Skip to content

Use originated time from MRT peer table RIB entries #251

@ties

Description

@ties

The RIB entries in the MRT table dump message contain the originated time. I noticed that some applications process this time, and use it to give a more precise timestamp for when a prefix was originally announced.

rfc6396 section 4.3.4:

[4.3.4](https://datatracker.ietf.org/doc/html/rfc6396#section-4.3.4).  RIB Entries

   The RIB Entries are repeated Entry Count times.  These entries share
   a common format as shown below.  They include a Peer Index from the
   PEER_INDEX_TABLE MRT record, an originated time for the RIB Entry,
   and the BGP path attribute length and attributes.  All AS numbers in
   the AS_PATH attribute MUST be encoded as 4-byte AS numbers.

        0                   1                   2                   3
        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
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |         Peer Index            |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                         Originated Time                       |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |      Attribute Length         |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                    BGP Attributes... (variable)
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Figure 10: RIB Entries

I also validated that a project that uses bgpdump actually uses this orginated time. As a user I would like to use this value when using a parser naïevely on a RIB, e.g.

let parser = BgpkitParser::from_reader(reader);

        for elem in parser {
          # As a user the originated time is more relevant than the time in the MRT header

https://github.com/RIPE-NCC/bgpdump/blob/010381c6a7897a88040f3a1729e7631466e0c00d/bgpdump_lib.c#L663

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions