Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

LDP / RSVP-TE / BFD (P2)

Status: draft

Notes on LDP (RFC 5036), RSVP-TE (RFC 2205 / RFC 3209) and BFD (RFC 5880 / 5881 / 5883, Micro-BFD RFC 7130) (M7). The definitions live in crates/wpg-protocols/src/{ldp,rsvp,bfd}.rs, the samples in templates/protocols/mpls/ and templates/protocols/oam/.

Stacks and samples

ethernet2 / ipv4 / udp / ldp       # UDP 646: Hello (basic discovery to 224.0.0.2, extended to a unicast address)
ethernet2 / ipv4 / tcp / ldp       # TCP 646: the session (Initialization onwards)
ethernet2 / ipv4 / rsvp            # IPv4 protocol 46 (Auto)
ethernet2 / ipv6 / rsvp            # IPv6 next header 46 (Auto)
ethernet2 / ipv4 / udp / bfd       # UDP 3784 (single hop), 4784 (multihop), 6784 (Micro-BFD)

LDP over IPv6 (RFC 7552) is ipv6 / udp|tcp / ldp. UDP / TCP destination ports are not Auto: set 646, 3784, … (decoding also recognises the source port). The BFD echo port 3785 is not decoded: its contents only mean something to the sender.

SampleContents
ldp-helloLink Hello to 224.0.0.2 (GTSM bit, IPv4 transport address)
ldp-targeted-helloTargeted Hello for extended discovery (T / R bits, configuration sequence number)
ldp-initializationInitialization (Common Session Parameters) and KeepAlive in one PDU
ldp-label-mappingAddress and two Label Mappings (prefix FECs, generic labels including implicit null 3)
ldp-label-withdrawLabel Withdraw with the wildcard FEC and a Notification (Shutdown)
rsvp-te-pathPath with Router Alert (strict / loose ERO, SESSION_ATTRIBUTE, SENDER_TSPEC, RRO)
rsvp-te-resvResv with the SE style (FLOWSPEC, FILTER_SPEC, LABEL, RRO with a label)
rsvp-path-errPathErr with an ERROR_SPEC (Routing Problem)
rsvp-path-tearPathTear
rsvp-helloHello with a HELLO REQUEST
bfd-single-hopControl packets in state Up with 300 ms intervals (10 packets, 4 pps)
bfd-authPoll with meticulous keyed SHA1 authentication
bfd-multihop-ipv6Multihop over IPv6 (UDP 4784, state Init)
micro-bfdMicro-BFD on a LAG member link (UDP 6784, destination MAC 01:00:5e:90:00:01)

LDP: one layer is one PDU

The ldp layer is the PDU header (version, pdu_length, lsr_id, label_space) and every message of the PDU (messages). Messages end at the PDU length, so a further PDU in the same TCP segment becomes the next layer (raw).

Messages and TLVs are items of the same shape: a 16-bit type (the U bit, and for TLVs the F bit, are its top bits), a 16-bit length of the value only, and the value. Every message starts with message_id, followed by tlvs.

- protocol: ldp
  fields:
    lsr_id: 192.0.2.1
    messages:
      - label_mapping:
          message_id: 11
          tlvs:
            - fec:
                elements: [{ prefix_length: 24, prefix: "c6 33 64" }]
            - generic_label: { label: 299776 }
      - label_withdraw:
          message_id: 12
          tlvs:
            - fec_wildcard
TypeMessage (name)TypeTLV (name) and value fields
0x0001notification0x0100fec (elements: {element_type (2), address_family, prefix_length, prefix}), fec_wildcard (element type 1)
0x0100hello0x0101address_list (IPv4) / address_list_ipv6 (address_family, addresses)
0x0200initialization0x0103 / 0x0104hop_count, path_vector (lsr_ids)
0x0201keepalive0x0200generic_label (label: 20 bits)
0x0300 / 0x0301address / address_withdraw0x0300status (e, f, status_code, message_id, message_type)
0x0400label_mapping0x0400common_hello_parameters (hold_time, t, r, g (GTSM, RFC 6720))
0x0401label_request0x0401 / 0x0403ipv4_transport_address / ipv6_transport_address
0x0402label_withdraw0x0402configuration_sequence_number
0x0403label_release0x0500common_session_parameters (protocol_version, keepalive_time, a, d, pv_lim, max_pdu_length, receiver_lsr_id, receiver_label_space)
0x0404label_abort_request0x0600label_request_message_id

The FEC TLV is decoded as fec_wildcard or fec from the first value octet (the element type), the Address List as IPv4 or IPv6 from the first two (the address family). Other types (ATM / Frame Relay labels and session parameters, vendor TLVs, …) are kept as { type: N, data: "..." }.

RSVP-TE: objects are “length, then type”

The rsvp layer is the common header (version, flags, msg_type, checksum, send_ttl, length) and every object of the message (objects). An object is a 16-bit length (counting the 4-octet header) followed by the Class-Num and C-Type, read together as one 16-bit type (class_num << 8 | c_type; wpg-core TlvDef::len_first). Item names combine the class and the C-Type.

TypeName (name)TypeName (name)
0x0101 / 0x0102session_ipv4 / session_ipv60x0b01sender_template_ipv4
0x0107 / 0x0108session_lsp_tunnel_ipv4 / _ipv60x0b07 / 0x0b08sender_template_lsp_tunnel_ipv4 / _ipv6
0x0301 / 0x0302rsvp_hop_ipv4 / rsvp_hop_ipv60x0c02sender_tspec (IntServ)
0x0501time_values0x0f01resv_confirm_ipv4
0x0601 / 0x0602error_spec_ipv4 / error_spec_ipv60x1001label
0x0701scope_ipv40x1301label_request (l3pid)
0x0801style (sharing, sender_selection; default SE)0x1401 / 0x1501explicit_route / record_route (subobjects)
0x0902flowspec (IntServ, controlled load)0x1601 / 0x1602hello_request / hello_ack
0x0a01filter_spec_ipv40x1701 / 0x1801 / 0x1802message_id / message_id_ack / message_id_nack (RFC 2961)
0x0a07 / 0x0a08filter_spec_lsp_tunnel_ipv4 / _ipv60xcf07 / 0xcf01session_attribute / session_attribute_ra (with resource affinities)

EXPLICIT_ROUTE subobjects are ipv4_prefix, ipv6_prefix, unnumbered_interface and as_number; the names ending in _loose have the L bit (loose hop). RECORD_ROUTE subobjects are ipv4_address, ipv6_address, label and unnumbered_interface (each with flags). ADSPEC, POLICY_DATA, INTEGRITY and other objects keep their value octets.

The token bucket of SENDER_TSPEC / FLOWSPEC (token_bucket_rate, token_bucket_size, peak_data_rate) is given as IEEE 754 single-precision bit patterns in 32-bit integers (1,000,000 octets/s = 0x49742400, infinity = 0x7f800000). The default is 125,000 octets/s (1 Mbit/s).

Path, PathTear and ResvConf are normally sent with the IP Router Alert option (ipv4 options: [router_alert: 0]).

BFD

The bfd layer is the mandatory section and the optional authentication section (authentication). The flags are the 1-bit fields p, f, c, a, d and m. Authentication types are simple password (simple_password: key_id, password), keyed_md5 / meticulous_keyed_md5 (key_id, sequence_number, a 16-octet digest) and keyed_sha1 / meticulous_keyed_sha1 (a 20-octet hash).

- protocol: bfd
  fields:
    state: up
    my_discriminator: 0x101
    your_discriminator: 0x201
    desired_min_tx_interval: 300000 # microseconds
    required_min_rx_interval: 300000
    authentication:
      - simple_password: { key_id: 1, password: '"secret"' }

Auto fields

FieldRule
ldp.pdu_lengthPDU length after the version and PDU length fields
LDP message / TLV lengthsValue length (without the type and length)
rsvp.checksumInternet checksum of the whole message with the field zeroed
rsvp.length, object / subobject lengthsLength including the header
SESSION_ATTRIBUTE name_length and paddingOctets of the name, zero padding to 4 octets (counted in the length)
bfd.lengthControl packet length including the authentication section
bfd.a1 when there is an authentication section

Limitations

  • No state: no LDP session setup, RSVP refresh, or BFD state machine and timers. Values are sent as given; use generators to vary them.
  • BFD MD5 digests / SHA1 hashes and the RSVP INTEGRITY object are Manual (nothing is computed from a key).
  • One LDP layer is one PDU; further PDUs in the same segment decode as raw.
  • RSVP does not type the GMPLS objects (RFC 3473), ADSPEC or POLICY_DATA; RSVP over UDP (RFC 2205 appendix C) is out of scope.
  • Only the first IntServ parameter (the token bucket) is typed; later ones (the guaranteed service rate / slack term, …) are parameters octets.

Generated reference

Field reference of the protocols on this page (generated from the definitions):

ipv4 · ldp · rsvp · bfd · raw