ECMP routing from a node with multiple interfaces with the same IP

105 views
Skip to first unread message

Ofri Rips

unread,
May 28, 2018, 12:25:09 PM5/28/18
to ns-3-users
Hey,

I'm trying to simulate the following network topology:

   +---------+.1             +----------+           .17+---------+
   |            +-------------+.2      .18 -------------+             |
   |  End    |                 |             |                  |   End    |
   |  Node  +-------------+.3      .19 -------------+   Node |
   |            |.1              |             |             .17|              |
   +---------+                +----------+                +---------+

                 subnet A                   subnet B
                   P2P                        P2P

There are 3 node, the left node is node 0, the right in is node 1, and node 2 in the middle.
Between nodes 0,2 and 1,2 there are 2 P2P connections, and on the end nodes both devices have the same IP.
I gave an example - there are 2 subnets in my case, and each of the end nodes receives the same ip (X.1 for node 0, X.17 for node 2).
The middle node is used as a router.
All of node's devices are connected to the same remote router (in the above example all links connected to node 0 will be connected on the other side to node 2).

Routing configuration:
Config::SetDefault ("ns3::Ipv4GlobalRouting::FlowEcmpRouting",BooleanValue(true));
Config::SetDefault ("ns3::Ipv4GlobalRouting::RespondToInterfaceEvents", BooleanValue (true));

When I'm sending a packet from node 0 to node 1, it looks like it knows it has 2 routes, and it uses 5-tuple hash to choose
one of the routes, but it seems that both routes have the same source device id (meaning the packet is sent on the same network device).
I'll add that when I have a single P2P connection on each subnet my simulation runs as expected, I'm now tweaking the code a bit to try and make it work with multiple P2P connections.
I'm trying to get ECMP routing, where packets from node0 and node2 can be sent from either one of the devices (depending on the udp source port).

My questions are - 
1. Is this the right way to simulate multiple network devices with the same ip on a single node?
2. How can I tell if node 0 is actually sending packets on both interfaces, and not only on one of the interfaces? I'm sending multiple packets with different udp source port.

Please let me know if there are any technical details missing in my questions.

Thank you for your help,
Ofri
Message has been deleted

Ofri Rips

unread,
Jun 6, 2018, 4:57:15 AM6/6/18
to ns-3-users

11:55 (less than a minute ago)
OK, so I digged a bit more in the routing code and I found 2 problems:
1- When it builds the global routing tables, it uses ip to get a node's matching device id (which is a problem in my case). I changed it so now it uses the mac address, and I do get 2 different routes.
2- 5-tuple hash - Ipv4GlobalRouting::LookupGlobal calls GetTupleValue with the ip payload  and the header before it adds the udp ports to the udp header (happens only later in Send), so I don't get
    hash value consistent with my actual packet and udp ports.
I had to add few more minor changes, but these are the major ones.

If somehow I got this wrong, please let me know.

Thanks,
Ofri
Auto Generated Inline Image 1
Reply all
Reply to author
Forward
0 new messages