blob: 602768a78628ff9719c54e73983dc306fe457744 [file] [log] [blame]
paul76b89b42004-11-06 17:13:09 +00001@node Zebra Protocol
paul718e3742002-12-13 20:15:29 +00002@appendix Zebra Protocol
Paul Jakmaab2416a2006-04-03 21:24:27 +00003@appendixsection Overview of the Zebra Protocol
paul718e3742002-12-13 20:15:29 +00004
Paul Jakmaab2416a2006-04-03 21:24:27 +00005Zebra Protocol is used by protocol daemons to communicate with the
6zebra daemon.
paul718e3742002-12-13 20:15:29 +00007
Paul Jakmaab2416a2006-04-03 21:24:27 +00008Each protocol daemon may request and send information to and from the
9zebra daemon such as interface states, routing state,
10nexthop-validation, and so on. Protocol daemons may also install routes
11with zebra. The zebra daemon manages which route is installed into the
12forwarding table with the kernel.
paul718e3742002-12-13 20:15:29 +000013
Paul Jakmaab2416a2006-04-03 21:24:27 +000014Zebra Protocol is a streaming protocol, with a common header. Two
15versions of the header are in use. Version 0 is implicitely versioned.
16Version 1 has an explicit version field. Version 0 can be distinguished
17from all other versions by examining the 3rd byte of the header, which
18contains a marker value for all versions bar version 0. The marker byte
19corresponds to the command field in version 0, and the marker value is
20a reserved command in version 0.
21
22We do not anticipate there will be further versions of the header for
23the foreseeable future, as the command field in version 1 is wide
24enough to allow for future extensions to done compatibly through
25seperate commands.
26
27Version 0 is used by all versions of GNU Zebra as of this writing, and
28versions of Quagga up to and including Quagga 0.98. Version 1 will be
29used as of Quagga 1.0.
30
31@appendixsection Zebra Protocol Definition
32@appendixsubsec Zebra Protocol Header (version 0)
paul718e3742002-12-13 20:15:29 +000033@example
34@group
350 1 2 3
360 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
Paul Jakmaab2416a2006-04-03 21:24:27 +000037+-------------------------------+---------------+
paul718e3742002-12-13 20:15:29 +000038| Length (2) | Command (1) |
Paul Jakmaab2416a2006-04-03 21:24:27 +000039+-------------------------------+---------------+
paul718e3742002-12-13 20:15:29 +000040@end group
41@end example
42
Paul Jakmaab2416a2006-04-03 21:24:27 +000043@appendixsubsec Zebra Protocol Common Header (version 1)
paul718e3742002-12-13 20:15:29 +000044@example
45@group
460 1 2 3
470 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
Paul Jakmaab2416a2006-04-03 21:24:27 +000048+-------------------------------+---------------+-------------+
49| Length (2) | Marker (1) | Version (1) |
50+-------------------------------+---------------+-------------+
51| Command (2) |
52+-------------------------------+
paul718e3742002-12-13 20:15:29 +000053@end group
54@end example
Paul Jakmaab2416a2006-04-03 21:24:27 +000055
56@appendixsubsec Zebra Protocol Header Field Definitions
57@table @samp
58@item Length
59Total packet length including this header. The minimum length is 3
60bytes for version 0 messages and 6 bytes for version 1 messages.
61
62@item Marker
63Static marker with a value of 255 always. This is to allow version 0
64Zserv headers (which do not include version explicitely) to be
65distinguished from versioned headers. Not present in version 0
66messages.
67
68@item Version
69Version number of the Zserv message. Clients should not continue
70processing messages past the version field for versions they do not
71recognise. Not present in version 0 messages.
72
73@item Command
74The Zebra Protocol command.
75@end table
76
77@appendixsubsec Zebra Protocol Commands
78@multitable {ZEBRA_REDISTRIBUTE_DEFAULT_DELETE_WHATEVER} {99999}
79@headitem Command @tab Value
80@item ZEBRA_INTERFACE_ADD
81@tab 1
82@item ZEBRA_INTERFACE_DELETE
83@tab 2
84@item ZEBRA_INTERFACE_ADDRESS_ADD
85@tab 3
86@item ZEBRA_INTERFACE_ADDRESS_DELETE
87@tab 4
88@item ZEBRA_INTERFACE_UP
89@tab 5
90@item ZEBRA_INTERFACE_DOWN
91@tab 6
92@item ZEBRA_IPV4_ROUTE_ADD
93@tab 7
94@item ZEBRA_IPV4_ROUTE_DELETE
95@tab 8
96@item ZEBRA_IPV6_ROUTE_ADD
97@tab 9
98@item ZEBRA_IPV6_ROUTE_DELETE
99@tab 10
100@item ZEBRA_REDISTRIBUTE_ADD
101@tab 11
102@item ZEBRA_REDISTRIBUTE_DELETE
103@tab 12
104@item ZEBRA_REDISTRIBUTE_DEFAULT_ADD
105@tab 13
106@item ZEBRA_REDISTRIBUTE_DEFAULT_DELETE
107@tab 14
108@item ZEBRA_IPV4_NEXTHOP_LOOKUP
109@tab 15
110@item ZEBRA_IPV6_NEXTHOP_LOOKUP
111@tab 16
112@end multitable