2 @appendix Zebra Protocol
3 @appendixsection Overview of the Zebra Protocol
5 Zebra Protocol is used by protocol daemons to communicate with the
8 Each protocol daemon may request and send information to and from the
9 zebra daemon such as interface states, routing state,
10 nexthop-validation, and so on. Protocol daemons may also install routes
11 with zebra. The zebra daemon manages which route is installed into the
12 forwarding table with the kernel.
14 Zebra Protocol is a streaming protocol, with a common header. The protocol
15 is versioned to allow for incompatible changes. Version 0 is implicitely
16 versioned. Version 1 onwards has an explicit version field. Version 0 can
17 be distinguished from all other versions by examining the 3rd byte of the
18 header, which contains a marker value of 255 for all versions bar version 0.
19 The marker byte corresponds to the command field in version 0, and the
20 marker value is a reserved command in version 0.
22 Version 0 is used by all versions of GNU Zebra as of this writing, and
23 versions of Quagga up to and including Quagga 0.98. The version 1 header
24 was introduced with Quagga 0.99.3. The version 3 header was introduced with
27 @appendixsection Zebra Protocol Definition
28 @appendixsubsec Zebra Protocol Header (version 0)
32 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
33 +-------------------------------+---------------+
34 | Length (2) | Command (1) |
35 +-------------------------------+---------------+
39 @appendixsubsec Zebra Protocol Common Header (version 1 and 2)
43 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
44 +-------------------------------+---------------+-------------+
45 | Length (2) | Marker (1) | Version (1) |
46 +-------------------------------+---------------+-------------+
48 +-------------------------------+
52 @appendixsubsec Zebra Protocol Common Header (version 3)
56 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
57 +-------------------------------+---------------+-------------+
58 | Length (2) | Marker (1) | Version (1) |
59 +-------------------------------+---------------+-------------+
60 | VRF ID (2) | Command (2) |
61 +-------------------------------+-----------------------------+
66 @appendixsubsec Zebra Protocol Header Field Definitions
69 Total packet length including this header. The minimum length is 3
70 bytes for version 0 messages, 6 bytes for version 1 and 2 messages, and
71 8 bytes for version 3.
74 Static marker with a value of 255 always. This is to allow version 0
75 Zserv headers (which do not include version explicitely) to be
76 distinguished from versioned headers. Not present in version 0
80 Version number of the Zserv message. Clients should not continue
81 processing messages past the version field for versions they do not
82 recognise. Not present in version 0 messages.
85 Virtual Routing/Forwarding context ID, to which the message applies. Only
86 present from version 3 onwards.
89 The Zebra Protocol command.
92 @appendixsubsec Zebra Protocol Commands
93 @multitable {ZEBRA_REDISTRIBUTE_DEFAULT_DELETE_WHATEVER} {99999}
94 @headitem Command @tab Value
95 @item ZEBRA_INTERFACE_ADD
97 @item ZEBRA_INTERFACE_DELETE
99 @item ZEBRA_INTERFACE_ADDRESS_ADD
101 @item ZEBRA_INTERFACE_ADDRESS_DELETE
103 @item ZEBRA_INTERFACE_UP
105 @item ZEBRA_INTERFACE_DOWN
107 @item ZEBRA_IPV4_ROUTE_ADD
109 @item ZEBRA_IPV4_ROUTE_DELETE
111 @item ZEBRA_IPV6_ROUTE_ADD
113 @item ZEBRA_IPV6_ROUTE_DELETE
115 @item ZEBRA_REDISTRIBUTE_ADD
117 @item ZEBRA_REDISTRIBUTE_DELETE
119 @item ZEBRA_REDISTRIBUTE_DEFAULT_ADD
121 @item ZEBRA_REDISTRIBUTE_DEFAULT_DELETE
123 @item ZEBRA_IPV4_NEXTHOP_LOOKUP
125 @item ZEBRA_IPV6_NEXTHOP_LOOKUP