Zebra on the MSR 9152021 1 What is
Zebra on the MSR 9/15/2021 1
What is Zebra? • Free routing software distributed under GNU • Modular design – process for each routing protocol, – zebra daemon for accessing kernel routing table • Supports various protocols: – BGP 4 – RIPv 1, RIPv 2, RIPng – OSPFv 2, OSPFv 3 • IPv 6 and SNMP support • Platforms – – GNU/Linux 2. 4. X Free. BSD 2. 2. 8, 3. 1, 4. X, Net. BSD 1. 4. X, Open. BSD 2. 4 Solaris 7 9/15/2021 2
Zebra on Linux/Net. BSD INTERFACE_UP INTERFACE_DOWN IPV 4_ROUTE_ADD IPV 4_ROUTE_DELETE REDISTRIBUTE_ADD REDISTRIBUTE_DELETE IPV 4_NEXTHOP_LOOKUP Interface type, addresses, status, MTU Routing Protocols BGP IFlist RIP OSPF Zebra RIB Kernel Interface Table Routing Table Initial kernel/static routes and zebra updates through route socket, ioctl, netlink or /proc Zebra generates a common routing information base (RIB) from various routing protocols, distributes routes between protocols and updates the kernel routing table with the routes it learnt. It also keeps track of the interface state and if an interface goes up/down, zebra notifies each routing protocol. 9/15/2021 3
Zebra on MSR Routing Protocols Resource Manager User Space CP Kernel CP Config Signaling Routing Table Agent … BGP IFlist RIP OSPF Zebra RIB Routing Table CP Kernel Virtual Interfaces Install route in FIPL Processing Elements SPC 0 SPC 1 SPC 2 SPC 3 SPC 4 … SPC 7 On the MSR, Zebra should communicate with the Routing Table Agent (which is part of the CP) instead of directly with the kernel routing table. The Routing Table Agent then installs these routes in FIPL’s table on the SPC. 9/15/2021 4
API used to communicate with Route Table • Need to implement following functions: – Add/delete route: e. g. , “ 128. 132/16” nexthop interface kernel_add_ipv 4(struct prefix *, struct rib *); kernel_delete_ipv 4(struct prefix *, struct rib *); kernel_add_route(struct prefix_ipv 4 *, struct in_addr *); – Add/delete interface address: kernel_address_add_ipv 4(struct interface *, struct connected *); kernel_address_delete_ipv 4(struct interface *, struct connected *); The add/delete interface address functionality might not be needed for the MSR since addresses can be configured at MSR startup. 9/15/2021 5
Zebra Route Table Agent Protocol Routing Protocols Resource Manager User Space CP Config Signaling … Routing Table Agent BGP IFlist struct routemsg { u_char msgtype; /* Add or delete route */ u_char prefixlen; struct in_addr prefix; struct in_addr nexthop; /* interface addr */ }; nexthop can be either an interface index or interface address. 9/15/2021 RIP OSPF Zebra RIB Zebra also needs to know static routes (such as default routes). At startup, the resource manager sends zebra all configured static routes. Then zebra is ready and can learn other routes from various routing protocols. 6
- Slides: 6