12/9/2015 1 Zebra on the MSR 12/9/2015. 2 What is Zebra? Free routing software distributed under GNU...

6
08/16/22 1 Zebra on the MSR 08/16/22

Transcript of 12/9/2015 1 Zebra on the MSR 12/9/2015. 2 What is Zebra? Free routing software distributed under GNU...

Page 1: 12/9/2015 1 Zebra on the MSR 12/9/2015. 2 What is Zebra? Free routing software distributed under GNU Modular design –process for each routing protocol,

04/21/23 1

Zebra on the MSR

04/21/23

Page 2: 12/9/2015 1 Zebra on the MSR 12/9/2015. 2 What is Zebra? Free routing software distributed under GNU Modular design –process for each routing protocol,

04/21/23 2

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:– BGP4– RIPv1, RIPv2, RIPng – OSPFv2, OSPFv3

• IPv6 and SNMP support• Platforms

– GNU/Linux 2.4.X– FreeBSD 2.2.8, 3.1, 4.X,– NetBSD 1.4.X, OpenBSD 2.4– Solaris 7

Page 3: 12/9/2015 1 Zebra on the MSR 12/9/2015. 2 What is Zebra? Free routing software distributed under GNU Modular design –process for each routing protocol,

04/21/23 3

Zebra on Linux/NetBSD

Zebra

BGP RIP OSPF

Interface Table Routing Table

Kernel

Routing Protocols

RIB

Initial kernel/static routes and

zebra updates through route socket, ioctl,

netlink or /proc

Interface type, addresses, status,

MTU

IFlist

INTERFACE_UPINTERFACE_DOWNIPV4_ROUTE_ADD

IPV4_ROUTE_DELETEREDISTRIBUTE_ADD

REDISTRIBUTE_DELETEIPV4_NEXTHOP_LOOKUP

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.

Page 4: 12/9/2015 1 Zebra on the MSR 12/9/2015. 2 What is Zebra? Free routing software distributed under GNU Modular design –process for each routing protocol,

04/21/23 4

Zebra on MSR

Zebra

BGP RIP OSPF

Routing Table CP Kernel

Routing Protocols

RIBIFlist

Resource Manager

Config SignalingRoutingTableAgent

Virtual Interfaces

SPC0 SPC1 SPC2 SPC3 SPC4 SPC7…

User SpaceCP

KernelCP

Processing Elements

Install route in FIPL

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.

Page 5: 12/9/2015 1 Zebra on the MSR 12/9/2015. 2 What is Zebra? Free routing software distributed under GNU Modular design –process for each routing protocol,

04/21/23 5

API used to communicate with Route Table

• Need to implement following functions:– Add/delete route:

kernel_add_ipv4(struct prefix *, struct rib *);kernel_delete_ipv4(struct prefix *, struct rib *);kernel_add_route(struct prefix_ipv4 *, struct in_addr *);

– Add/delete interface address:

kernel_address_add_ipv4(struct interface *, struct connected *);kernel_address_delete_ipv4(struct interface *, struct connected *);

e.g., “128.132/16” nexthop interface

The add/delete interface address functionality might not be needed for the MSR since addresses can be configured at MSR startup.

Page 6: 12/9/2015 1 Zebra on the MSR 12/9/2015. 2 What is Zebra? Free routing software distributed under GNU Modular design –process for each routing protocol,

04/21/23 6

Zebra Route Table Agent Protocol

Zebra

BGP RIP OSPF

Routing Protocols

RIBIFlist

Resource Manager

Config SignalingRoutingTableAgent

User SpaceCP …

struct routemsg { u_char msgtype; /* Add or delete route */ u_char prefixlen; struct in_addr prefix; struct in_addr nexthop; /* interface addr */};

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.

nexthop can be either an interface index or interface address.