t2mune / mrtparse

MRT format data parser
Apache License 2.0
136 stars 39 forks source link

Extended NLRI Encodings #8

Closed Dazul closed 9 years ago

Dazul commented 9 years ago

Bird already supports Extended NLRI Encodings in order to offer Advertisement of Multiple Paths in BGP. When bird is configured with the multiple paths, the nlris are extended encoded on the mrt path.

Is it possible to add the support of extended nlri encodings?

https://tools.ietf.org/html/draft-ietf-idr-add-paths-10

t2mune commented 9 years ago

Hello Dazul,

Thank you for your request :smile: I added a suuport for ADD-PATH Capability. Coud you try again? It seems to work fine in my environment. My output is as below:

---------------------------------------------------------------
MRT Header
    Timestamp: 1442693220(2015-09-20 05:07:00)
    Type: 16(BGP4MP)
    Subtype: 4(BGP4MP_MESSAGE_AS4)
    Length: 96
BGP4MP_MESSAGE_AS4
    Peer AS Number: 65000
    Local AS Number: 65000
    Interface Index: 0
    Address Family: 1(IPv4)
    Peer IP Address: 192.168.1.10
    Local IP Address: 192.168.1.100
BGP Message
    Marker: -- ignored --
    Length: 76
    Type: 2(UPDATE)
    Withdrawn Routes Length: 0
    Total Path Attribute Length: 28
    Path Attribute Flags/Type/Length: 0x40/1/1
        ORIGIN: 2(INCOMPLETE)
    Path Attribute Flags/Type/Length: 0x40/2/0
        AS_PATH
    Path Attribute Flags/Type/Length: 0x40/3/4
        NEXT_HOP: 192.168.1.10
    Path Attribute Flags/Type/Length: 0x80/4/4
        MULTI_EXIT_DISC: 0
    Path Attribute Flags/Type/Length: 0x40/5/4
        LOCAL_PREF: 100 
    Path Identifier: 1
    NLRI: 192.168.6.0/24
    Path Identifier: 1
    NLRI: 192.168.3.0/24
    Path Identifier: 1
    NLRI: 192.168.0.10/32
...
---------------------------------------------------------------
MRT Header
    Timestamp: 1442693773(2015-09-20 05:16:13)
    Type: 16(BGP4MP)
    Subtype: 4(BGP4MP_MESSAGE_AS4)
    Length: 126
BGP4MP_MESSAGE_AS4
    Peer AS Number: 65000
    Local AS Number: 65000
    Interface Index: 0
    Address Family: 2(IPv6)
    Peer IP Address: 2001:db8::10
    Local IP Address: 2001:db8::100
BGP Message
    Marker: -- ignored --
    Length: 82
    Type: 2(UPDATE)
    Withdrawn Routes Length: 0
    Total Path Attribute Length: 59
    Path Attribute Flags/Type/Length: 0x90/14/34
        MP_REACH_NLRI
            AFI: 2(IPv6)
            SAFI: 1(UNICAST)
            Length: 16
            Next-Hop: 2001:db8::10
            Path Identifier: 1
            NLRI: 2001:db8::/64
    Path Attribute Flags/Type/Length: 0x40/1/1
        ORIGIN: 2(INCOMPLETE)
    Path Attribute Flags/Type/Length: 0x40/2/0
        AS_PATH
    Path Attribute Flags/Type/Length: 0x80/4/4
        MULTI_EXIT_DISC: 0
    Path Attribute Flags/Type/Length: 0x40/5/4
        LOCAL_PREF: 100
t2mune commented 9 years ago

Slightly changed :laughing:

---------------------------------------------------------------
MRT Header
    Timestamp: 1442882012(2015-09-22 09:33:32)
    Type: 16(BGP4MP)
    Subtype: 4(BGP4MP_MESSAGE_AS4)
    Length: 96
BGP4MP_MESSAGE_AS4
    Peer AS Number: 65000
    Local AS Number: 65000
    Interface Index: 0
    Address Family: 1(IPv4)
    Peer IP Address: 192.168.1.10
    Local IP Address: 192.168.1.100
BGP Message
    Marker: -- ignored --
    Length: 76
    Type: 2(UPDATE)
    Withdrawn Routes Length: 0
    Total Path Attribute Length: 28
    Path Attribute Flags/Type/Length: 0x40/1/1
        ORIGIN: 2(INCOMPLETE)
    Path Attribute Flags/Type/Length: 0x40/2/0
        AS_PATH
    Path Attribute Flags/Type/Length: 0x40/3/4
        NEXT_HOP: 192.168.1.10
    Path Attribute Flags/Type/Length: 0x80/4/4
        MULTI_EXIT_DISC: 0
    Path Attribute Flags/Type/Length: 0x40/5/4
        LOCAL_PREF: 100
    NLRI
        Path Identifier: 1
        Prefix: 192.168.6.0/24
    NLRI
        Path Identifier: 1
        Prefix: 192.168.3.0/24
    NLRI
        Path Identifier: 1
        Prefix: 192.168.0.10/32
...
---------------------------------------------------------------
MRT Header
    Timestamp: 1442882014(2015-09-22 09:33:34)
    Type: 16(BGP4MP)
    Subtype: 4(BGP4MP_MESSAGE_AS4)
    Length: 126
BGP4MP_MESSAGE_AS4
    Peer AS Number: 65000
    Local AS Number: 65000
    Interface Index: 0
    Address Family: 2(IPv6)
    Peer IP Address: 2001:db8::10
    Local IP Address: 2001:db8::100
BGP Message
    Marker: -- ignored --
    Length: 82
    Type: 2(UPDATE)
    Withdrawn Routes Length: 0
    Total Path Attribute Length: 59
    Path Attribute Flags/Type/Length: 0x90/14/34
        MP_REACH_NLRI
            AFI: 2(IPv6)
            SAFI: 1(UNICAST)
            Length: 16
            Next-Hop: 2001:db8::10
            NLRI
                Path Identifier: 1
                Prefix: 2001:db8::/64
    Path Attribute Flags/Type/Length: 0x40/1/1
        ORIGIN: 2(INCOMPLETE)
    Path Attribute Flags/Type/Length: 0x40/2/0
        AS_PATH
    Path Attribute Flags/Type/Length: 0x80/4/4
        MULTI_EXIT_DISC: 0
    Path Attribute Flags/Type/Length: 0x40/5/4
        LOCAL_PREF: 100
Dazul commented 9 years ago

Hi,

Thanks for the add on. The support for the "add path" works great on my environment. :)

t2mune commented 9 years ago

Please let me know if you have any problems :smile: Thank you.