bgpsim - BGP4 routing environment simulator
Usage: bgpsim [-i router_id] [-p port] [-f file] [-v] [-o output]
BGPsim simulates complex BGP4 routing environments with possibly high
levels of routing instability/change.
BGPsim includes a perl program, BGPsim.pl, which is used to generate
ASCII descriptions of BGP traffic for use with route_btoa and sbgp.
(The BGPsim Perl code is still quite rough.)
BGPsim [-f configuration_file] [-l routing table] [-v] [-s] [-m]
Read the specified configuration file. By default, bgpsim
to read ./bgpsim.conf.
Turn on verbose logging to standard output. This is useful to
turn on logging before the debug commands are read in the
By default, BGPSim does not set mandatory BGP attributes,
including origin, nexthop and ASPath. If this flag is used,
BGPsim will add these attributes and prepend the local AS to
Use a new dump format.
By default, BGPsim looks for "./bgpsim.conf". The format of the
configuration file is described below. BGPsim also has an interactive
(Cisco Systems router-like) interface: telnet to port 5674 on the
machine running BGPsim.
BGPsim does not include mandatory attributes by default. You will need
to explicitly include a nexthop, origin, and apsath attribute in your
BGPsim configuration. Also note that BGPSim does not prepend its own AS
Sample Configuration File
A sample BGPsim configuration file is shown below.
network-list 1 range 10.0.0.0/8 220.127.116.11 stability 10 jitter 4 map 1 !
route-map 1 set nexthop 18.104.22.168 set aspath 185 123 23 23 12 set
origin igp !
network-list 2 range 22.214.171.124/24 126.96.36.199 stability 9 jitter 3
change 12 jitter 4 route-map 2 3 ! route-map 2 set next-hop
188.8.131.52 set as-path 185 123 23 23 12 set origin igp set
community 56:123 set dpa as 56 121 set local-preference 23 ! route-map
3 set as-path 185 100 10 102 set origin igp set community 100:345 set
dpa as 3 23 set local-preference 83 ! router bgp 185
neighbor 184.108.40.206 remote-as 65
neighbor 220.127.116.11 remote-as 165
This file describes two simulation processes, as defined by
network-list 1 and 2, which changes routes to two BGP peers (AS 65
The first simulation process, network-list 1, changes routes
(10.0.0.0/8 and 18.104.22.168/8) as defined in range every 10 seconds.
simulates an announcement of the routes first, and then a withdrawal
after 10 seconds. Ten seconds after the withdraw, the next
announcement is propagated. Thus the announcements and withdraws are
repeated every 10 seconds. These routes have attributes defined in
route-map 1: nexthop is 22.214.171.124 and aspath is a sequence of 123
23 23 12.
The second network list describes simulation of the range of routes
from 126.96.36.199/24 to 188.8.131.52/24 (i.e. 184.108.40.206/24,
220.127.116.11/24, etc.) All of these routes have an initial aspath of
(123 23 23 12), a next-hop of 18.104.22.168, and others as defined
route-map 2. These attributes change every 12 seconds among route-
2 and 3.
The peers (AS 65 and AS165) receive routing updates originated by
these two simulation processes.
For information about the uii, debug, and access-list configuration
commands, see Chapter 2, "Getting Started." In addition to the MRTd
configuration commands, the following are available in BGPsim to
simulate routing changes:
Defines a network-list with . This definition behaves like a routing
process which generates routing changes within a range defined
range subcommand by an interval defined by stability subcommand,
changing route attributes as specified by change and route-map
Defines a range to announce and withdraw, starting with up to
(inclusive). The range is along classful boundaries.
Defines an interval in second to change routes. Routes are
announced first and then withdrawn after the interval. Thus,
the interval, announce and withdraw repeat. Jitter
a random number of seconds between 0 and <jitter number> to the
Defines an interval in second to change attributes of routes
announced. route-map subcommand defines a sequence. Jitter
adds/subtracts a random <number> of seconds from the timer.
Defines a sequence of route-maps to be used. The next route-mapis
adopted after the interval defined in change subcommand. At the
end of list, the first route-map is adopted as a next. The first
route-map behaves as a default, that is, this is always adopted
before adopting other route-maps.
Loads routes from routing table dump file rather than using a range
BGPSim also adds several commands to bgp router commands:
Define stability for TCP peering session with this peer.
Interactive Interface Commands
The BGPsim interactive interface supports the following commands in
addition to MRTd interactive interface commands:
You can find more documentation in /usr/share/doc/mrt/html/