A Network Control-Plane Simulator
This is a simulator for BGP and OSPF routing protocols.
It does not model OSI Layers 1 to 4.
Thus, routers and interfaces do not have an IP address but use an identifier (RouterId).
Further, the simulator exchanges control-plane messages using a global event queue without directly modeling time.
The messages do not (necessarily) reflect how control-plane messages are serialized and deseialized.
The implementation of both BGP and OSPF does not directly correspond to the specifications from IETF.
Instead, the protocols are simplified (e.g., routers don't exchange OSPF hello and BGP keepalive packets).
Features
- Supported protocols:
- BGP
- Arbitrary route-maps
- Route reflection
- Confederations
- Additional-paths
- Inter-domain topologies
- OSPF
- Multiple areas
- ECMP
- Virtual links
- Static Routes,
- MPLS / Source Routing
- BGP
- Swappable event queue:
- We provide a FIFO queue and a basic timing model out of the box.
- You can implement your queue by implementing the
EventQueuetrait.
- Choice of the prefix type:
- You can run BGP in the
Ipv4Prefixmode (with hierarchical prefixes). But you can also opt out of hierarchy and assume no prefixes overlap or only have a single prefix in BGP. - This choice is encoded in the type system.
- The compiler can apply optimizations based on the prefix type (using
prefix-triefor hierarchical prefixes, aHashMapfor non-overlapping prefixes, and a simpleOptionfor a single prefix).
- You can run BGP in the
- Simulate OSPF by passing a direct message or by using a global oracle.
- Extract the forwarding state and check properties based on it.
- Includes topologies from TopologyZoo.
- Export the network configuration to Cisco and FRR configuration.
Example
The following example generates a network with two border routers (B0 and B1), two route reflectors (R0 and R1) and two external routers (E0 and E1).
Both routers advertise the prefix Prefix::from(0), and all links have the same weight 1.0.
use *;
// Define the type of the network.
type Prefix = SimplePrefix; // Use non-overlapping prefixes.
type Queue = ; // Use a basic FIFO event queue
type Ospf = GlobalOspf; // Use global OSPF without message passing
type Net = ;
You can create the same network using the net! macro:
use *;
This library contains networks from TopologyZoo and convenient builder functions to quickly generate random configurations.
Notice, that this requires the features topology_zoo and rand.
use *;
use *;
type Prefix = SimplePrefix; // Use non-overlapping prefixes.
type Queue = ; // Use a basic FIFO event queue
type Ospf = GlobalOspf; // Use global OSPF without message passing
type Net = ;
Disclaimer
This library is a research project. It was originally written for the SGICOMM'21 paper: "Snowcap: Synthesizing Network-Wide Configuration Updates". If you are using this project, please cite us: