From: Martin Quinson Date: Fri, 2 Jun 2017 09:32:39 +0000 (+0200) Subject: ns3 routes are always symmetrical, don't dupplicate them X-Git-Tag: v3.16~155 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5e9f3b14a72f7a2e3868cfec1e0d210261109937?hp=47ea517bbdbd085a1e639a264d2deb201552e543 ns3 routes are always symmetrical, don't dupplicate them --- diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index cafc27b1f4..2cf77d2ed5 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -69,6 +69,7 @@ static void clusterCreation_cb(sg_platf_cluster_cbarg_t cluster) NetPointNs3* host_src = sg_host_by_name(host_id)->pimpl_netpoint->extension(); xbt_assert(host_src, "Cannot find a NS3 host of name %s", host_id); + // Any NS3 route is symmetrical ns3_add_link(host_src, host_dst, bw, lat); delete host_dst; @@ -108,9 +109,8 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin xbt_assert(host_src != nullptr, "Network element %s does not seem to be NS3-ready", src->cname()); xbt_assert(host_dst != nullptr, "Network element %s does not seem to be NS3-ready", dst->cname()); + // Any NS3 route is symmetrical ns3_add_link(host_src, host_dst, link_bdw, link_lat); - if (symmetrical) - ns3_add_link(host_dst, host_src, link_bdw, link_lat); xbt_free(link_bdw); xbt_free(link_lat); @@ -466,7 +466,6 @@ void ns3_add_link(NetPointNs3* src, NetPointNs3* dst, char* bw, char* lat) { ns3::PointToPointHelper pointToPoint; - ns3::NetDeviceContainer netA; ns3::Ipv4AddressHelper address; int srcNum = src->node_num; @@ -479,6 +478,7 @@ void ns3_add_link(NetPointNs3* src, NetPointNs3* dst, char* bw, char* lat) pointToPoint.SetDeviceAttribute ("DataRate", ns3::StringValue (bw)); pointToPoint.SetChannelAttribute ("Delay", ns3::StringValue (lat)); + ns3::NetDeviceContainer netA; netA.Add(pointToPoint.Install (a, b)); char * adr = bprintf("%d.%d.0.0",number_of_networks,number_of_links);