protocol.texi 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. @node Zebra Protocol
  2. @appendix Zebra Protocol
  3. @appendixsection Overview of the Zebra Protocol
  4. Zebra Protocol is used by protocol daemons to communicate with the
  5. zebra daemon.
  6. Each protocol daemon may request and send information to and from the
  7. zebra daemon such as interface states, routing state,
  8. nexthop-validation, and so on. Protocol daemons may also install routes
  9. with zebra. The zebra daemon manages which route is installed into the
  10. forwarding table with the kernel.
  11. Zebra Protocol is a streaming protocol, with a common header. The protocol
  12. is versioned to allow for incompatible changes. Version 0 is implicitely
  13. versioned. Version 1 onwards has an explicit version field. Version 0 can
  14. be distinguished from all other versions by examining the 3rd byte of the
  15. header, which contains a marker value of 255 for all versions bar version 0.
  16. The marker byte corresponds to the command field in version 0, and the
  17. marker value is a reserved command in version 0.
  18. Version 0 is used by all versions of GNU Zebra as of this writing, and
  19. versions of Quagga up to and including Quagga 0.98. The version 1 header
  20. was introduced with Quagga 0.99.3. The version 3 header was introduced with
  21. Quagga 1.0.20160309.
  22. @appendixsection Zebra Protocol Definition
  23. @appendixsubsec Zebra Protocol Header (version 0)
  24. @example
  25. @group
  26. 0 1 2 3
  27. 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
  28. +-------------------------------+---------------+
  29. | Length (2) | Command (1) |
  30. +-------------------------------+---------------+
  31. @end group
  32. @end example
  33. @appendixsubsec Zebra Protocol Common Header (version 1 and 2)
  34. @example
  35. @group
  36. 0 1 2 3
  37. 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
  38. +-------------------------------+---------------+-------------+
  39. | Length (2) | Marker (1) | Version (1) |
  40. +-------------------------------+---------------+-------------+
  41. | Command (2) |
  42. +-------------------------------+
  43. @end group
  44. @end example
  45. @appendixsubsec Zebra Protocol Common Header (version 3)
  46. @example
  47. @group
  48. 0 1 2 3
  49. 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
  50. +-------------------------------+---------------+-------------+
  51. | Length (2) | Marker (1) | Version (1) |
  52. +-------------------------------+---------------+-------------+
  53. | VRF ID (2) | Command (2) |
  54. +-------------------------------+-----------------------------+
  55. @end group
  56. @end example
  57. @appendixsubsec Zebra Protocol Header Field Definitions
  58. @table @samp
  59. @item Length
  60. Total packet length including this header. The minimum length is 3
  61. bytes for version 0 messages, 6 bytes for version 1 and 2 messages, and
  62. 8 bytes for version 3.
  63. @item Marker
  64. Static marker with a value of 255 always. This is to allow version 0
  65. Zserv headers (which do not include version explicitely) to be
  66. distinguished from versioned headers. Not present in version 0
  67. messages.
  68. @item Version
  69. Version number of the Zserv message. Clients should not continue
  70. processing messages past the version field for versions they do not
  71. recognise. Not present in version 0 messages.
  72. @item VRF ID
  73. Virtual Routing/Forwarding context ID, to which the message applies. Only
  74. present from version 3 onwards.
  75. @item Command
  76. The Zebra Protocol command.
  77. @end table
  78. @appendixsubsec Zebra Protocol Commands
  79. @multitable {ZEBRA_REDISTRIBUTE_DEFAULT_DELETE_WHATEVER} {99999}
  80. @headitem Command @tab Value
  81. @item ZEBRA_INTERFACE_ADD
  82. @tab 1
  83. @item ZEBRA_INTERFACE_DELETE
  84. @tab 2
  85. @item ZEBRA_INTERFACE_ADDRESS_ADD
  86. @tab 3
  87. @item ZEBRA_INTERFACE_ADDRESS_DELETE
  88. @tab 4
  89. @item ZEBRA_INTERFACE_UP
  90. @tab 5
  91. @item ZEBRA_INTERFACE_DOWN
  92. @tab 6
  93. @item ZEBRA_IPV4_ROUTE_ADD
  94. @tab 7
  95. @item ZEBRA_IPV4_ROUTE_DELETE
  96. @tab 8
  97. @item ZEBRA_IPV6_ROUTE_ADD
  98. @tab 9
  99. @item ZEBRA_IPV6_ROUTE_DELETE
  100. @tab 10
  101. @item ZEBRA_REDISTRIBUTE_ADD
  102. @tab 11
  103. @item ZEBRA_REDISTRIBUTE_DELETE
  104. @tab 12
  105. @item ZEBRA_REDISTRIBUTE_DEFAULT_ADD
  106. @tab 13
  107. @item ZEBRA_REDISTRIBUTE_DEFAULT_DELETE
  108. @tab 14
  109. @item ZEBRA_IPV4_NEXTHOP_LOOKUP
  110. @tab 15
  111. @item ZEBRA_IPV6_NEXTHOP_LOOKUP
  112. @tab 16
  113. @end multitable