]>
Commit | Line | Data |
---|---|---|
42fc5d26 QY |
1 | .. _Zebra_Protocol |
2 | ||
3 | ************** | |
4 | Zebra Protocol | |
5 | ************** | |
6 | ||
7 | Overview of the Zebra Protocol | |
8 | ============================== | |
718e3744 | 9 | |
ab2416a0 PJ |
10 | Zebra Protocol is used by protocol daemons to communicate with the |
11 | zebra daemon. | |
718e3744 | 12 | |
ab2416a0 PJ |
13 | Each protocol daemon may request and send information to and from the |
14 | zebra daemon such as interface states, routing state, | |
15 | nexthop-validation, and so on. Protocol daemons may also install routes | |
16 | with zebra. The zebra daemon manages which route is installed into the | |
17 | forwarding table with the kernel. | |
718e3744 | 18 | |
ab2416a0 PJ |
19 | Zebra Protocol is a streaming protocol, with a common header. Two |
20 | versions of the header are in use. Version 0 is implicitely versioned. | |
21 | Version 1 has an explicit version field. Version 0 can be distinguished | |
22 | from all other versions by examining the 3rd byte of the header, which | |
23 | contains a marker value for all versions bar version 0. The marker byte | |
24 | corresponds to the command field in version 0, and the marker value is | |
25 | a reserved command in version 0. | |
26 | ||
27 | We do not anticipate there will be further versions of the header for | |
28 | the foreseeable future, as the command field in version 1 is wide | |
29 | enough to allow for future extensions to done compatibly through | |
30 | seperate commands. | |
31 | ||
32 | Version 0 is used by all versions of GNU Zebra as of this writing, and | |
80e71dcd DS |
33 | versions of Quagga up to and including Quagga 0.98. Version 2 was created |
34 | for 0.99.21 of Quagga. Version 3 designates VRF compatibility and was | |
35 | released in 1.0. Version 4 will be used as of Frr 2.0 to indicate that | |
36 | we are a different Routing Suite now and to hopefully prevent accidental | |
37 | Quagga <-> FRR issues. | |
ab2416a0 | 38 | |
42fc5d26 QY |
39 | Zebra Protocol Definition |
40 | ========================= | |
41 | ||
42 | Zebra Protocol Header (version 0) | |
43 | ---------------------------------- | |
44 | ||
45 | :: | |
46 | ||
47 | 0 1 2 3 | |
48 | 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 | |
49 | +-------------------------------+---------------+ | |
50 | | Length (2) | Command (1) | | |
51 | +-------------------------------+---------------+ | |
52 | ||
53 | ||
54 | Zebra Protocol Common Header (version 1) | |
55 | ---------------------------------------- | |
56 | ||
57 | :: | |
58 | ||
59 | 0 1 2 3 | |
60 | 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 | |
61 | +-------------------------------+---------------+-------------+ | |
62 | | Length (2) | Marker (1) | Version (1) | | |
63 | +-------------------------------+---------------+-------------+ | |
64 | | Command (2) | | |
65 | +-------------------------------+ | |
66 | ||
67 | ||
68 | Zebra Protocol Header Field Definitions | |
69 | --------------------------------------- | |
70 | ||
ab2416a0 PJ |
71 | @table @samp |
72 | @item Length | |
73 | Total packet length including this header. The minimum length is 3 | |
74 | bytes for version 0 messages and 6 bytes for version 1 messages. | |
75 | ||
76 | @item Marker | |
77 | Static marker with a value of 255 always. This is to allow version 0 | |
78 | Zserv headers (which do not include version explicitely) to be | |
79 | distinguished from versioned headers. Not present in version 0 | |
80 | messages. | |
81 | ||
82 | @item Version | |
83 | Version number of the Zserv message. Clients should not continue | |
84 | processing messages past the version field for versions they do not | |
85 | recognise. Not present in version 0 messages. | |
86 | ||
87 | @item Command | |
88 | The Zebra Protocol command. | |
89 | @end table | |
90 | ||
42fc5d26 QY |
91 | Zebra Protocol Commands |
92 | ----------------------- | |
93 | ||
ab2416a0 PJ |
94 | @multitable {ZEBRA_REDISTRIBUTE_DEFAULT_DELETE_WHATEVER} {99999} |
95 | @headitem Command @tab Value | |
96 | @item ZEBRA_INTERFACE_ADD | |
97 | @tab 1 | |
98 | @item ZEBRA_INTERFACE_DELETE | |
99 | @tab 2 | |
100 | @item ZEBRA_INTERFACE_ADDRESS_ADD | |
101 | @tab 3 | |
102 | @item ZEBRA_INTERFACE_ADDRESS_DELETE | |
103 | @tab 4 | |
104 | @item ZEBRA_INTERFACE_UP | |
105 | @tab 5 | |
106 | @item ZEBRA_INTERFACE_DOWN | |
107 | @tab 6 | |
108 | @item ZEBRA_IPV4_ROUTE_ADD | |
109 | @tab 7 | |
110 | @item ZEBRA_IPV4_ROUTE_DELETE | |
111 | @tab 8 | |
112 | @item ZEBRA_IPV6_ROUTE_ADD | |
113 | @tab 9 | |
114 | @item ZEBRA_IPV6_ROUTE_DELETE | |
115 | @tab 10 | |
116 | @item ZEBRA_REDISTRIBUTE_ADD | |
117 | @tab 11 | |
118 | @item ZEBRA_REDISTRIBUTE_DELETE | |
119 | @tab 12 | |
120 | @item ZEBRA_REDISTRIBUTE_DEFAULT_ADD | |
121 | @tab 13 | |
122 | @item ZEBRA_REDISTRIBUTE_DEFAULT_DELETE | |
123 | @tab 14 | |
124 | @item ZEBRA_IPV4_NEXTHOP_LOOKUP | |
125 | @tab 15 | |
126 | @item ZEBRA_IPV6_NEXTHOP_LOOKUP | |
127 | @tab 16 | |
128 | @end multitable |