Possible Bug in NetDevice Container or Ipv4InterfaceContainer ? (ns 3.19)

24 views
Skip to first unread message

ns-3-user

unread,
Sep 3, 2014, 2:51:01 AM9/3/14
to ns-3-...@googlegroups.com
Hi all,

I was trying to simulate the following topology:

Node1-----<p2p link>-------Node2-------<p2p link>-------Node3

I wanted to send data from Node 1 to Node 2 for starters and stumbled across the following
1)For the following case:
NetDeviceContainer devices1,devices2;
devices1 = pointToPoint.Install (nodes1.Get(0),nodes1.Get(1));
devices2 = pointToPoint.Install (nodes1.Get(1),nodes1.Get(2));
Ipv4AddressHelper address;
 

InternetStackHelper stack;
  stack.Install (nodes1);
  address.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer interfaces1 = address.Assign (devices1);
Ipv4InterfaceContainer interfaces2 = address.Assign (devices2);

My trace file showed the following:
reading from file p2p-0-0.pcap, link-type PPP (PPP)
05:30:01.000000 IP 10.1.1.1.49153 > 10.1.1.2.5000: Flags [S], seq 0, win 65535, length 0
05:30:04.000000 IP 10.1.1.1.49153 > 10.1.1.2.5000: Flags [S], seq 0, win 65535, length 0
 and I obviously ended up with Zero throughput.

2)For this set of code:

  NetDeviceContainer devices1,devices2;
  devices1 = pointToPoint.Install (nodes1.Get(0),nodes1.Get(1));
  devices1.Add(pointToPoint.Install (nodes1.Get(1),nodes1.Get(2)));   
  InternetStackHelper stack;
  stack.Install (nodes1);
 
  Ipv4AddressHelper address;
 
  address.SetBase ("10.1.1.0", "255.255.255.0");
  Ipv4InterfaceContainer interfaces1 = address.Assign (devices1);

 I again ended up with above result - No data was sent

3)but when i modified the address assigning part and explicitly added devices1.Get(1) to address, the packets were being sent. I have pasted the code below

NetDeviceContainer devices1,devices2;
  devices1 = pointToPoint.Install (nodes1.Get(0),nodes1.Get(1));
  devices1.Add(pointToPoint.Install (nodes1.Get(1),nodes1.Get(2)));   
/************************************************/
  InternetStackHelper stack;
  stack.Install (nodes1);
 
  Ipv4AddressHelper address;
 
  address.SetBase ("10.1.1.0", "255.255.255.0");
  Ipv4InterfaceContainer interfaces1 = address.Assign (devices1);
  interfaces1.Add(address.Assign(devices1.Get(1)));
 
For just a simple Node1-------Node2 topology , everything works fine (I simple avoided assigning a netdevice/IP address to the Node2---Node3 link in the same code),so i suspect a bug with ipv4interfacecontainer or the netdevicecontainer.  If this is a bug , how does one exactly spot the wrong function call or anomaly etc?


[I have attached the complete code of my simulation also (I use ns-3.19).]


Thanks!

tcp_test_p2p.cc

Tommaso Pecorella

unread,
Sep 3, 2014, 3:13:27 AM9/3/14
to ns-3-...@googlegroups.com
Hi,

there's no bug or anomaly in what you described. There's only a bad understanding of how IP works on P2P channels.

In this topology:
Node1-----<p2p link 1>-------Node2-------<p2p link 2>-------Node3

Node2 must be a router, and p2p link 1 / p2p link 2 must have different network addresses.

This is not an ns-3 problem, this is how IP works.
In your example you have some packet flowing simply thanks to a casual accident. I could explain in detail why it happens, but it would be too long. Let's just say that it an accident, it works only in one way (not the other) and it depends on the order of interface/address creation.

Anyway, please consider to refresh your ideas on routing.

Cheers,

T.
Reply all
Reply to author
Forward
0 new messages