Example-BGP

Authors: José Luis Rubio (jrubio at dit.upm.es) David Fern&aacute;ndez (david at dit.upm.es) version 1.7, February 23rd, 2006

Scenario
This scenario provides an example of how VNUML can be used for testing routing daemons, and specifically bgpd, which is the BGP implementation included with Quagga Routing Suite.

The example includes six routers (named R1 to R6) running BGP, each one belonging to a different Autonomous System (AS 65001 to AS 65006). Each AS establishes BGP connections with some other AS's, which can represent either transit or peering relations between them. In Figure 1 the relations between all the AS's are shown.

Figure 1: Relations between AS's

Each AS is supposed to have a Class B prefix assigned, which is 161.0.0.0/16 for AS 65001, 162.0.0.0/16 for AS 65002 and so on. The BGP sessions are established over point-to-point links between the routers, which are assigned a /30 sub-prefix of one of the AS's Class B. For example for the connection between AS 65001 and AS 65004 (i.e. between routers R1 and R4) the prefix 161.0.0.8/30 is used in the point-to-point link. In Figure 2 you can see the actual addresses used for each interface.

Figure 2: Detail on Point-to-Point links addresses

In this simple scenario, only AS 65004, AS 65005 and AS 65006 announce their assigned prefixes to their transit providers, while AS 65001 is supposed to be a large ISP who announces a default route to all its transit clients. The main points about BGP filters configuration in all the routers are summarized in the following table:

Each row summarizes the filters that the corresponding router sets for OUTGOING and INCOMING prefixes in the peerings with other routers. These filters clearly reflect the kind of relation between the corresponding AS's. For example, in case of a transit relation, the client only announces its own prefixes and accepts everything. This can be seen on (R2,R1) cell on the table: as R2 is a client of R1, R2 annouces its prefixes to R1 ("MY-PREFIXES" in red), and accepts anything from R1 ("ANY" in blue").

Once the scenario is started (vnuml -t bgp.xml -vB) and the simulation is running (vnuml -s bgp.xml -v) the bgpd daemons can be accessed via telnet, with the password "bgp". A typical sequence of commands could be:

Host> vnuml -t bgp.xml -vB ... Host> vnuml -x start@bgp.xml -v ... Host> telnet R1 2605 Trying 192.168.3.2... Connected to R1. Escape character is '^]'. Hello, this is quagga (version 0.96.4). Copyright 1996-2002 Kunihiro Ishiguro. User Access Verification Password: bgp R1> show ip bgp BGP table version is 0, local router ID is 192.168.3.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network         Next Hop            Metric LocPrf Weight Path *> 0.0.0.0         0.0.0.0                  0         32768 i *  164.0.0.0        161.0.0.2                              0 65002 65004 i *>                  161.0.0.10               0             0 65004 i *> 165.0.0.0        161.0.0.2                              0 65002 65005 i *> 166.0.0.0        161.0.0.6                              0 65003 65006 i Total number of prefixes 4 R1> show ip bgp summary BGP router identifier 192.168.3.2, local AS number 65001 5 BGP AS-PATH entries 0 BGP community entries Neighbor       V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd 161.0.0.2      4 65002      15      18        0    0    0 00:12:11        2 161.0.0.6       4 65003      15      18        0    0    0 00:12:07        1 161.0.0.10      4 65004      15      18        0    0    0 00:12:07        1

VNUML Description
 <!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd" [ <!ENTITY VNUMLDIR "/usr/share/vnuml/"> <!ENTITY BASEDIR "/usr/share/vnuml/examples/bgp/"> <!ENTITY REDIR "&amp;lt;/dev/null &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;"> ]>

1.7      bgp_example ~/.ssh/identity.pub     &VNUMLDIR;filesystems/root_fs_tutorial &VNUMLDIR;kernels/linux &BASEDIR; xterm 

      <net name="AS3-AS6" mode="uml_switch"/>

<vm name="R1"> <if id="1" net="AS1-AS2"> <ipv4 mask="255.255.255.252">161.0.0.1 </if> <if id="2" net="AS1-AS3"> <ipv4 mask="255.255.255.252">161.0.0.5 </if> <if id="3" net="AS1-AS4"> <ipv4 mask="255.255.255.252">161.0.0.9 </if> <filetree when="start" root="/usr/local/etc">conf/R1 <exec seq="start" type="verbatim">hostname <exec seq="start" type="verbatim">rm -f /tmp/bgpd.debug <exec seq="start" type="verbatim">/usr/local/sbin/zebra -f /usr/local/etc/zebra.conf.sample -d -P 2604 <exec seq="start" type="verbatim">/usr/local/sbin/bgpd -f /usr/local/etc/bgpd.conf -d -P 2605 <exec seq="stop" type="verbatim">hostname <exec seq="stop" type="verbatim">killall zebra <exec seq="stop" type="verbatim">killall bgpd </vm>

<vm name="R2"> <if id="1" net="AS1-AS2"> <ipv4 mask="255.255.255.252">161.0.0.2 </if> <if id="2" net="AS2-AS3"> <ipv4 mask="255.255.255.252">162.0.0.1 </if> <if id="3" net="AS2-AS4"> <ipv4 mask="255.255.255.252">162.0.0.5 </if> <if id="4" net="AS2-AS5"> <ipv4 mask="255.255.255.252">162.0.0.9 </if> <filetree when="start" root="/usr/local/etc">conf/R2 <exec seq="start" type="verbatim">hostname <exec seq="start" type="verbatim">rm -f /tmp/bgpd.debug <exec seq="start" type="verbatim">/usr/local/sbin/zebra -f /usr/local/etc/zebra.conf.sample -d -P 2604 <exec seq="start" type="verbatim">/usr/local/sbin/bgpd -f /usr/local/etc/bgpd.conf -d -P 2605 <exec seq="stop" type="verbatim">hostname <exec seq="stop" type="verbatim">killall zebra <exec seq="stop" type="verbatim">killall bgpd </vm>

<vm name="R3"> <if id="1" net="AS1-AS3"> <ipv4 mask="255.255.255.252">161.0.0.6 </if> <if id="2" net="AS2-AS3"> <ipv4 mask="255.255.255.252">162.0.0.2 </if> <if id="3" net="AS3-AS6"> <ipv4 mask="255.255.255.252">163.0.0.1 </if> <filetree when="start" root="/usr/local/etc">conf/R3 <exec seq="start" type="verbatim">hostname <exec seq="start" type="verbatim">rm -f /tmp/bgpd.debug <exec seq="start" type="verbatim">/usr/local/sbin/zebra -f /usr/local/etc/zebra.conf.sample -d -P 2604 <exec seq="start" type="verbatim">/usr/local/sbin/bgpd -f /usr/local/etc/bgpd.conf -d -P 2605 <exec seq="stop" type="verbatim">hostname <exec seq="stop" type="verbatim">killall zebra <exec seq="stop" type="verbatim">killall bgpd </vm>

<vm name="R4"> <if id="1" net="AS1-AS4"> <ipv4 mask="255.255.255.252">161.0.0.10 </if> <if id="2" net="AS2-AS4"> <ipv4 mask="255.255.255.252">162.0.0.6 </if> <filetree when="start" root="/usr/local/etc">conf/R4 <exec seq="start" type="verbatim">hostname <exec seq="start" type="verbatim">rm -f /tmp/bgpd.debug <exec seq="start" type="verbatim">/usr/local/sbin/zebra -f /usr/local/etc/zebra.conf.sample -d -P 2604 <exec seq="start" type="verbatim">/usr/local/sbin/bgpd -f /usr/local/etc/bgpd.conf -d -P 2605 <exec seq="stop" type="verbatim">hostname <exec seq="stop" type="verbatim">killall zebra <exec seq="stop" type="verbatim">killall bgpd </vm>

<vm name="R5"> <if id="1" net="AS2-AS5"> <ipv4 mask="255.255.255.252">162.0.0.10 </if> <filetree when="start" root="/usr/local/etc">conf/R5 <exec seq="start" type="verbatim">hostname <exec seq="start" type="verbatim">rm -f /tmp/bgpd.debug <exec seq="start" type="verbatim">/usr/local/sbin/zebra -f /usr/local/etc/zebra.conf.sample -d -P 2604 <exec seq="start" type="verbatim">/usr/local/sbin/bgpd -f /usr/local/etc/bgpd.conf -d -P 2605 <exec seq="stop" type="verbatim">hostname <exec seq="stop" type="verbatim">killall zebra <exec seq="stop" type="verbatim">killall bgpd </vm>

<vm name="R6"> <if id="1" net="AS3-AS6"> <ipv4 mask="255.255.255.252">163.0.0.2 </if> <filetree when="start" root="/usr/local/etc">conf/R6 <exec seq="start" type="verbatim">hostname <exec seq="start" type="verbatim">rm -f /tmp/bgpd.debug <exec seq="start" type="verbatim">/usr/local/sbin/zebra -f /usr/local/etc/zebra.conf.sample -d -P 2604 <exec seq="start" type="verbatim">/usr/local/sbin/bgpd -f /usr/local/etc/bgpd.conf -d -P 2605 <exec seq="stop" type="verbatim">hostname <exec seq="stop" type="verbatim">killall zebra <exec seq="stop" type="verbatim">killall bgpd </vm>

Download

 * VNUML specification files: bgp.xml
 * Configuration files: bgp.tar

Old Releases

 * 1.7.1
 * 1.6
 * 1.3