Packet Binary Dump Format


Zebra can dump routing protocol packet into file with binary format (see also Dump BGP packet and table).

It seems to be better that we share the MRT's header format for backward compatibility of the MRT's dump logs. We should also define the binary format excluding the header, because we must support both of IP v4/v6 addresses as socket addresses and / or routing entries.

In the last meeting, we discussed to have a version field in the header. But, Masaki told us that we can define new type value rather than having a version field, and it seems to be better because we don't need to change header format.

Here is the common header format. This is same as that of MRT.

0 1 2 3
012345 678901 234567 890123 456789 01
Time
Type Subtype

If type is PROTOCOL_BGP4MP, subtype is BGP4MP_STATE_CHANGE, and Address Family == IP (version 4)

0 1 2 3
012345 678901 234567 890123 456789 01
Source AS number Destination AS number
Interface Index Address Family
Source IP address
Destination IP address
Old State New State

Where State is the value defined in RFC1771.

If type is PROTOCOL_BGP4MP, subtype is BGP4MP_STATE_CHANGE, and Address Family == IP version 6

0 1 2 3
012345 678901 234567 890123 456789 01
Source AS number Destination AS number
Interface Index Address Family
Source IP address
Source IP address (Cont'd)
Source IP address (Cont'd)
Source IP address (Cont'd)
Destination IP address
Destination IP address (Cont'd)
Destination IP address (Cont'd)
Destination IP address (Cont'd)
Old State New State

If type is PROTOCOL_BGP4MP, subtype is BGP4MP_MESSAGE, and Address Family == IP (version 4)

0 1 2 3
012345 678901 234567 890123 456789 01
Source AS number Destination AS number
Interface Index Address Family
Source IP address
Destination IP address
BGP Message Packet
 

Where BGP Message Packet is the whole contents of the BGP4 message including header portion.

If type is PROTOCOL_BGP4MP, subtype is BGP4MP_MESSAGE, and Address Family == IP version 6

0 1 2 3
012345 678901 234567 890123 456789 01
Source AS number Destination AS number
Interface Index Address Family
Source IP address
Source IP address (Cont'd)
Source IP address (Cont'd)
Source IP address (Cont'd)
Destination IP address
Destination IP address (Cont'd)
Destination IP address (Cont'd)
Destination IP address (Cont'd)
BGP Message Packet
 

If type is PROTOCOL_BGP4MP, subtype is BGP4MP_ENTRY, and Address Family == IP (version 4)

0 1 2 3
012345 678901 234567 890123 456789 01
View # Status
Time Last Change
Address Family SAFI Next-Hop-Len
Next Hop Address
Prefix Length Address Prefix [variable]
Attribute length  
BGP Attribute [variable length]

If type is PROTOCOL_BGP4MP, subtype is BGP4MP_ENTRY, and Address Family == IP version 6

0 1 2 3
012345 678901 234567 890123 456789 01
View # Status
Time Last Change
Address Family SAFI Next-Hop-Len
Next Hop Address
Next Hop Address (Cont'd)
Next Hop Address (Cont'd)
Next Hop Address (Cont'd)
Prefix Length Address Prefix [variable]
Address Prefix (cont'd) [variable]  
Attribute length  
BGP Attribute [variable length]

BGP4 Attribute must not contains MP_UNREACH_NLRI. If BGP Attribute has MP_REACH_NLRI field, it must has zero length NLRI, e.g., MP_REACH_NLRI has only Address Family, SAFI and next-hop values.

If type is PROTOCOL_BGP4MP and subtype is BGP4MP_SNAPSHOT,

0 1 2 3
012345 678901 234567 890123 456789 01
View # File Name [variable]

The file specified in "File Name" contains all routing entries, which are in the format of "subtype == BGP4MP_ENTRY".

Constants:

       /* type value */
       #define MSG_PROTOCOL_BGP4MP 16
       /* subtype value */
       #define BGP4MP_STATE_CHANGE 0
       #define BGP4MP_MESSAGE 1
       #define BGP4MP_ENTRY 2
       #define BGP4MP_SNAPSHOT 3

This file documents the GNU Zebra software which manages common TCP/IP routing protocols.

This is Edition 0.1, last updated 5 July 2000 of `The GNU Zebra Manual', for Zebra Version 0.88.

Copyright (C) 1999, 2000 Kunihiro Ishiguro

Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Kunihiro Ishiguro.