Bug 2102

Summary: GlobalRouting is confused by bridged interfaces
Product: ns-3 Reporter: Tommaso Pecorella <tommaso.pecorella>
Component: global-routingAssignee: Tom Henderson <tomh>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs, ns3
Priority: P5    
Version: pre-release   
Hardware: All   
OS: All   
Attachments: test script
network diagram
erroneous Routing Table
patch proposed by Chip Webb
Simulation Script to test proposed patch
Revised Simulation Script to test proposed patch
test case program for new issue

Description Tommaso Pecorella 2015-04-19 15:18:36 UTC
Created attachment 2019 [details]
test script

The bug has been reported here:
https://groups.google.com/forum/#!topic/ns-3-users/n5cRslXYjEg

As shown in the attachments (script, RT and diagram), the nodes routing table is not populated correctly.
Comment 1 Tommaso Pecorella 2015-04-19 15:19:13 UTC
Created attachment 2020 [details]
network diagram
Comment 2 Tommaso Pecorella 2015-04-19 15:19:44 UTC
Created attachment 2021 [details]
erroneous Routing Table
Comment 3 Tom Henderson 2015-11-08 15:12:36 UTC
Seems to have also been reported again here:
http://mailman.isi.edu/pipermail/ns-developers/2015-November/013247.html

I will post Chip Webb's patch here and work on finalizing that and the test case that Tommaso provided (turn into a test).
Comment 4 Tom Henderson 2015-11-08 15:16:12 UTC
Created attachment 2175 [details]
patch proposed by Chip Webb
Comment 5 Chip Webb 2015-11-13 10:18:49 UTC
Created attachment 2185 [details]
Simulation Script to test proposed patch

This simulation script contains a network topology with a mixture of switches and routers connecting two pairs of endpoints.

The first pair of endpoints (t2 and b2) have UDP echo client and server applications, and are connected to two different subnetworks via multiple bridges (switches). Without the patch to this bug, this pair of endpoints will not get the correct routing table (all_the.routes). With the patch, the correct routes will be populated.

In a similar manner, the second pair of endpoints also have UDP echo client and server applications, and are also connected to two different subnetworks (the same ones as the first pair). However, there is only one switch between these nodes and their respective routers. This path will work regardless of whether the patch for this bug is applied.

This simulation script uses a new proposed object called SwitchHelper, which has been requested in a related bugzilla #2216

       https://www.nsnam.org/bugzilla/﷒0
Comment 6 Chip Webb 2016-03-05 14:13:19 UTC
Created attachment 2329 [details]
Revised Simulation Script to test proposed patch

This revised test script avoids dependency on my proposed SwitchHelper object. The patch does not need to change.  It shows two L2 LANs connected by a WAN link and illustrates  a network that has multiple L2 switches between L3 routers.            
                                                                       
It serves as a test case to verify a patch to global-router-interface  
that fixes bug #2102.                                                  
                                                                       
The LANs are "top" [192.168.1/24] and "bottom" [192.168.2/24].         
Each LAN network is interconnected by several L2 switches, and each    
LAN has its own router to act as a gateway with the WAN. Each LAN      
has two endpoints upon which is installed a UDP echo client or server  
that are used to test connectivity over the LANs & WAN.                
                                                                       
One pair of UDP endpoints (t3 and b3) have LAN connections with only   
one switch between them and their local routers. This path works with  
unpatched ns3 code (3.24 & earlier) as well as with the patch applied. 
                                                                       
Another pair of endpoints (t2 and b2) have LAN connections with        
a chain of multiple switches between them and their local router.      
This path will only work after applying the associated patch.          
                                                                       
The LAN links are modeled by half-duplex Ethernet CSMA links which     
have command-line-configurable data rate and latency.                  
                                                                       
There are two types of CSMA links: 100Mbit and 10Mbit. The 100Mbit     
links are called csmaX, are denoted by [X] in the diagram and can      
be controlled with the --csmaXRate and --csmaXDelay command line args. 
The 10Mbit links are called csmaY, are denoted by [Y] in the diagram   
and can be controlled with the --csmaYRate and --csmaYDelay command    
line arguments. Both the top and bottom LAN have a mixture of          
100Mbit/s and 10Mbit/s links.                                          
                                                                       
The WAN is modeled by a point-to-point link which has configurable     
data rate and latency. Unlike many typical home/work networks,         
the routers do not perform NAT.                                        
                                                                       
The WAN link is denoted by [P] in the diagram, and the                 
speed and latency can be set from the command line with the            
--p2pRate and --p2pDelay options. The default for this link is 5Mbit/s 
and 50ms delay                                                         

---------------------------------------------------------------------- 
                             Network Diagram
---------------------------------------------------------------------- 
                                                                       
  192.168.  192.168.                                                   
   .1.2      .1.3                                                      
 ---------  ---------                                                  
 |  t2   |  |  t3   |                                                  
 |  UDP  |  |  UDP  |                                                  
 |  echo |  |  echo |    Node t2 is a UDP echo client (multi-switch)   
 | client|  | server|    Node t3 is a UDP echo server (single-switch)  
 ---------  ---------                                                  
  CSMA(t2)   CSMA(t3)                                                  
    [X]        [X]                                                     
    [X]        [X]                                                     
   CSMA        [X]                                                     
 ---------     [X]                                                     
 |  ts4  |     [X]        Nodes ts1, ts2, ts3 and ts4 are L2 switches  
 |  (sw) |     [X]        The top LAN is subnet 192.168.1.*            
 ---------     [X]                                                     
   CSMA        [X]        The long chain of switches is designed       
    [Y]        [X]        to test whether global-router-interface      
    [Y]        [X]        can fully enumerate an IP subnet that has    
   CSMA        [X]        multiple interconnected L2 switches.         
 ---------     [X]        The problem is documented in Bug #2102.      
 |  ts3  |     [X]                                                     
 |  (sw) |     [X]                                                     
 ---------     [X]                                                     
   CSMA        [X]                                                     
    [X]        [X]                                                     
    [X]        [X]                                                     
   CSMA        [X]                                                     
 ---------     [X]                                                     
 |  ts2  |     [X]                                                     
 |  (sw) |     [X]                                                     
 ---------     [X]                                                     
   CSMA        [X]                                                     
    [Y]        [X]                                                     
    [Y]        [X]                                                     
   CSMA       CSMA                                                     
  ------------------                                                   
  |  ts1 (switch)  |                                                   
  ------------------                                                   
         CSMA                                                          
          [Y]                                                          
          [Y]                                                          
         CSMA(trlan)    192.168.1.1                                    
  ------------------                                                   
  |  tr (router)   |    Node tr is an L3 router                        
  ------------------      (between 192.168.1.* & 76.1.1.*)             
          P2P(trwan)    76.1.1.1                                       
          [P]                                                          
          [P]                                                          
          [P]                                                          
          [P]                                                          
          [P]           The WAN is 76.1.1.*                            
          [P]                                                          
          [P]                                                          
          [P]                                                          
          P2P(brwan)    76.1.1.2                                       
  ------------------                                                   
  |  br (router)   |    Node br is an L3 router                        
  ------------------      (between 192.168.2.* & 76.1.1.*)             
         CSMA(brlan)    192.168.2.1                                    
          [X]                                                          
          [X]                                                          
         CSMA                                                          
  ------------------     Nodes bs1 to bs5 are L2 switches              
  |  bs1 (switch)  |     The bottom LAN is subnet 192.168.2.*          
  ------------------                                                   
   CSMA       CSMA                                                     
    [Y]        [Y]                                                     
    [Y]        [Y]                                                     
   CSMA        [Y]                                                     
 ---------     [Y]                                                     
 | bs2   |     [Y]                                                     
 | (sw)  |     [Y]                                                     
 ---------     [Y]                                                     
   CSMA        [Y]                                                     
    [X]        [Y]                                                     
    [X]        [Y]                                                     
   CSMA        [Y]                                                     
 ---------     [Y]                                                     
 | bs3   |     [Y]                                                     
 | (sw)  |     [Y]                                                     
 ---------     [Y]                                                     
   CSMA        [Y]                                                     
    [Y]        [Y]                                                     
    [Y]        [Y]                                                     
   CSMA        [Y]                                                     
 ---------     [Y]                                                     
 | bs4   |     [Y]                                                     
 | (sw)  |     [Y]                                                     
 ---------     [Y]                                                     
   CSMA        [Y]                                                     
    [X]        [Y]                                                     
    [X]        [Y]                                                     
   CSMA        [Y]                                                     
 ---------     [Y]                                                     
 | bs5   |     [Y]                                                     
 | (sw)  |     [Y]                                                     
 ---------     [Y]                                                     
   CSMA        [Y]                                                     
    [Y]        [Y]                                                     
    [Y]        [Y]                                                     
   CSMA(b2)   CSMA(b3)                                                 
 ---------  ---------                                                  
 |  b2   |  |  b3   |                                                  
 |  UDP  |  |  UDP  |                                                  
 |  echo |  |  echo |    Node b2 is a UDP echo server (multi-switch)   
 | server|  | client|    Node b3 is a UDP echo client (single-switch)  
 ---------  ---------                                                  
  192.168.  192.168.                                                   
   .2.2      .2.3                                                      
                                                                       
Note: Names in parenthesis after NetDevices are pcap tap locations.    
----------------------------------------------------------------------
Comment 7 Tom Henderson 2016-03-10 19:15:07 UTC
Pushed in http://code.nsnam.org/ns-3-dev/rev/8495f6496ae2 and http://code.nsnam.org/ns-3-dev/rev/1fd617b55ca1

I made a few small changes:
- simplified the API in FindDesignatedRouterForLink() and AnotherRouterOnLink()
- added some Doxygen
- placed the example program (test case) into examples/routing/global-routing-multi-switch-plus-router.cc
- some other minor edits
Comment 8 Tom Henderson 2016-03-26 21:25:36 UTC
reopened to address this problem (new test case attached):

http://mailman.isi.edu/pipermail/ns-developers/2016-March/013500.html

The problem lies in the creation of NetworkLSAs, which are not populated correctly on bridged LANs.
Comment 9 Tom Henderson 2016-03-26 21:26:07 UTC
Created attachment 2356 [details]
test case program for new issue
Comment 10 Tom Henderson 2016-09-20 02:18:06 UTC
fix pushed in changeset 12328:5ffb3df065c1