The bngsync Protocol

 


The bngsync Protocol #

The bngsync UDP protocol may use either IPv4 or IPv6 as transport protocol and uses the registered UDP port 10439 (bngsync) per default.

The general bngsync UDP protocol message format is as follows:

Byte
Offset    Description                 Value

 0        bngsync protocol tag        0xFF
 1        bngsync protocol version 1  0x01
 2        virtual router ID (VRID)    variable
 3        virtual router priority     variable
 4        message type                variable
 5        message subtype             variable
 6        data length high byte       variable
 7        data length low byte        variable
 8        data start
 .
 .
 N        last data byte

Type 0 Subtype 4: Session Table Sync Advertisement #

With this message type the current VRRP master notifies the backup node that a certain session table entry has just been created or that this session table entry is still valid and in use.

The session table entry key is an always zero terminated and readable ASCII string. The last byte of this message is the terminating 0x00, the data length at byte offsets 6 and 7 is therefore 2 + 2 + 4 + strlen(key) + 1.

Byte
Offset    Description                 Value

 0        bngsync protocol tag        0xFF
 1        bngsync protocol version 1  0x01
 2        virtual router ID (VRID)    variable
 3        virtual router priority     variable
 4        message type                0x00
 5        message subtype             0x04
 6        data length high byte       variable
 7        data length low byte        variable
 8-9      server number
          uint16_t network byte order 
10-11     target number
          uint16_t network byte order 
12-15     session timeout
          uint32_t network byte order 
16        ASCII readable session key 
 .
 .
 N        last data byte              0x00

Type 0 Subtype 5: GNAT State Sync Advertisement #

This message type is no longer needed and no longer in use since the ephemeral port selection with IPFlowPortHash() does not need to be synchronized.

Type 0 Subtype 6: Session Table Sync ACK #

A backup node acknowledges with this message the receipt of a specific session table sync advertisement (type 0 subtype 4). The packet has exactly the same contents as the matching advertisement, except that the message subtype is 6.

This message type is only sent by the current VRRP backup node if session table synchronization acknowledgement is activated by setting the parameter sessionsyncack to 1 (active).

Byte
Offset    Description                 Value

 0        bngsync protocol tag        0xFF
 1        bngsync protocol version 1  0x01
 2        virtual router ID (VRID)    variable
 3        virtual router priority     variable
 4        message type                0x00
 5        message subtype             0x06
 6        data length high byte       variable
 7        data length low byte        variable
 8-9      server number
          uint16_t network byte order 
10-11     target number
          uint16_t network byte order 
12-15     session timeout
          uint32_t network byte order 
16        ASCII readable session key 
 .
 .
 N        last data byte              0x00

Type 0 Subtype 7: Session Table Resync Request #

With this message type a backup node requests the resynchronization of the complete session table after he has been restarted and remained in BACKUP state for 10 seconds. The data length is 0 (byte offsets 6 and 7).

The parameters sessionsync and sessionautoresync need both to be activated (set to 1). The BACKUP retries sessionarrtimeout seconds (default 60) until it receives a Session Table Resync Request ACK from the master.

Byte
Offset    Description                 Value

 0        bngsync protocol tag        0xFF
 1        bngsync protocol version 1  0x01
 2        virtual router ID (VRID)    variable
 3        virtual router priority     variable
 4        message type                0x00
 5        message subtype             0x07
 6        data length high byte       0 
 7        data length low byte        0 

Type 0 Subtype 8: Session Table Resync Request ACK #

This message type is the reply of the VRRP MASTER node in response to a Session Table Resync Request. The data length is also 0 (byte offsets 6 and 7).

The parameters sessionsync and sessionautoresync also need both to be activated (set to 1).

Byte
Offset    Description                 Value

 0        bngsync protocol tag        0xFF
 1        bngsync protocol version 1  0x01
 2        virtual router ID (VRID)    variable
 3        virtual router priority     variable
 4        message type                0x00
 5        message subtype             0x08
 6        data length high byte       0 
 7        data length low byte        0