SSF.OS.BGP4 Example: Route Distribution between Peers

Disclaimer
This implementation of BGP-4 is constantly improving and evolving, and examples are not always immediately updated to reflect the most current version. It is usually (though not always) safe to assume that an example still runs properly, but the DML files and the output files may look different than the way there are described in some of the accompanying documentation.

Compatibility
This example is up-to-date with SSF.OS.BGP4 version 1.1.0.

Conventions
For an explanation of the debugging output used in this example, refer to BGP Debugging Output Conventions.

Overview
This example shows the process of a router receiving routing information from its peer regarding how to get to that peer.

Files
primary source:  route-distrib.dml
library source:  dictionary.dml
schema source:   net.dml
raw output:      route-distrib.out

Running
To run this example, SSFNet must be installed and the three source files, as listed in the previous subsection, must be accessible. As an example, if the three source files were together in the same directory, the following command could be used to run the simulation:

    java SSF.Net.Net 1 route-distrib.dml dictionary.dml net.dml

Network Graph

Discussion
Once a BGP speaker receives routing information, it's important that the information finds its way into the forwarding table at that router. This simulation shows a very basic example of routing information, received in an Update message, finding its way into the forwarding table.

The configuration file used for this example, route-distrib.dml, configures a simple topology of two connected routers in separate ASes. Here is an abridged version of the debugging output, followed by an explanation:

001> 0.0       bgp@0:0     AS 2   id 0.0.0.9/32     prefix 0.0.0.8/29
002> 0.0       bgp@0:0     adding 0.0.0.18/32 to local fwd table, nxt=1:0(0)
003> 0.0       bgp@0:0     Local Forwarding Table:
004>   0.0.0.8/30 {nxt=0.0.0.0 :cost=1 :if=[NIC#1@0.0.0.9/30]}
005>   0.0.0.16/30 {nxt=0.0.0.0 :cost=1 :if=[NIC#0@0.0.0.17/30]}
006>   0.0.0.18/32 {nxt=0.0.0.18 :cost=-1 :if=[NIC#0@0.0.0.17/30]}
007> 0.0       bgp@1:0     AS 1   id 0.0.0.1/32     prefix 0.0.0.0/29
008> 0.0       bgp@1:0     adding 0.0.0.17/32 to local fwd table, nxt=0:0(0)
009> 0.0       bgp@1:0     Local Forwarding Table:
010>   0.0.0.0/30 {nxt=0.0.0.0 :cost=1 :if=[NIC#1@0.0.0.1/30]}
011>   0.0.0.16/30 {nxt=0.0.0.0 :cost=1 :if=[NIC#0@0.0.0.18/30]}
012>   0.0.0.17/32 {nxt=0.0.0.17 :cost=-1 :if=[NIC#0@0.0.0.18/30]}
013> 5.52E-4   bgp@0:0     snd update advertising my AS to bgp@1:0 rte=0.0.0.8/29
014> 5.52E-4   bgp@1:0     snd update advertising my AS to bgp@0:0 rte=0.0.0.0/29
015> 6.83E-4   bgp@0:0     rcv update frm bgp@1:0  rte=0.0.0.0/29
016> 6.83E-4   bgp@0:0     adding 0.0.0.0/29 to local fwd table, nxt=1:0(0)
017> 6.83E-4   bgp@0:0     Local Forwarding Table:
018>   0.0.0.0/29 {nxt=0.0.0.18 :cost=-1 :if=[NIC#0@0.0.0.17/30]}
019>   0.0.0.8/30 {nxt=0.0.0.0 :cost=1 :if=[NIC#1@0.0.0.9/30]}
020>   0.0.0.16/30 {nxt=0.0.0.0 :cost=1 :if=[NIC#0@0.0.0.17/30]}
021>   0.0.0.18/32 {nxt=0.0.0.18 :cost=-1 :if=[NIC#0@0.0.0.17/30]}
022> 6.83E-4   bgp@1:0     rcv update frm bgp@0:0  rte=0.0.0.8/29
023> 6.83E-4   bgp@1:0     adding 0.0.0.8/29 to local fwd table, nxt=0:0(0)
024> 6.83E-4   bgp@1:0     Local Forwarding Table:
025>   0.0.0.0/30 {nxt=0.0.0.0 :cost=1 :if=[NIC#1@0.0.0.1/30]}
026>   0.0.0.8/29 {nxt=0.0.0.17 :cost=-1 :if=[NIC#0@0.0.0.18/30]}
027>   0.0.0.16/30 {nxt=0.0.0.0 :cost=1 :if=[NIC#0@0.0.0.18/30]}
028>   0.0.0.17/32 {nxt=0.0.0.17 :cost=-1 :if=[NIC#0@0.0.0.18/30]}

Lines 1 and 7 indicate the IP prefixes representing the two routers' associated ASes. At time 5.52E-4, each BGP speaker sent the routing information for its AS to its peer (lines 13 and 14). At time 6.83E-4, the routing information was received (lines 15 and 22). The content of the forwarding tables for each router was then dumped (lines 17-21 and 24-28), and each one did in fact contain the routing information which was just received from a peer (lines 18 and 26). The earlier additions to the forwarding table (lines 2 and 8) represent each peer adding the address of the other (on the immediate point-to-point link between them) so that the initial TCP connections could be established. The remaining entries in the tables, which are unaccounted for in the output messages, were added by means other than BGP.