Bugzilla – Bug 2129
DCE-Linux simulations with heterogeneous nodes crash (some DCE-Linux and some ns3)
Last modified: 2015-06-01 19:44:23 EDT
Created attachment 2051 [details] Patch for simulations that mix DCE-Linux nodes and plain NS3 nodes The code for populating the routing tables in linux-stack-helper.cc assumes that all nodes have Ipv4Linux objects attached. In other words, the code assumes that all nodes are running DCE Linux. I have tried to simulate a case where there is a mix of node types -- some running plain NS3 network stack, and some running DCE Linux. I have called this a heterogeneous node type network. Specifically, around line 112 in linux-stack-helper.cc there is code that searches for the Ipv4Linux object associated with a node, and then populates the routing tables for it. If the node in question is a plain NS3 node, the return value in "ipv4" will be NULL, and dereferencing the "ipv4" pointer causes the simulation to crash: So I propose the following patch: Ptr<Node> node = *i; Ptr<Ipv4Linux> ipv4 = node->GetObject<Ipv4Linux> (); ipv4->PopulateRoutingTable (); Change to the following: Ptr<Node> node = *i; Ptr<Ipv4Linux> ipv4 = node->GetObject<Ipv4Linux> (); if(ipv4) { ipv4->PopulateRoutingTable (); } A test case and patch are attached.
Created attachment 2052 [details] This is a test case for a DCE-Linux simulation that has a heterogeneous network of DCE-Linux nodes and plain NS3 nodes.
Thanks Chip. The patch is definitely correct and will apply to ns-3-dce asap. btw, do you mind if I include the attached example script into ns-3-dce release ?
Yes, it is fine to include this example!
http://code.nsnam.org/ns-3-dce/rev/06b23f4d262c the commit should fix this issue.
(In reply to Hajime Tazaki from comment #4) > http://code.nsnam.org/ns-3-dce/rev/06b23f4d262c > > the commit should fix this issue. follow-up fix for the issue in static-optimized build (missing dependencies). http://code.nsnam.org/ns-3-dce/rev/10182d62e5ae