[j-nsp] BMP and IPv6

Vincent Bernat bernat at luffy.cx
Wed Dec 6 02:35:09 EST 2017


Hey!

I am trying to collect route information using BMP:
 https://www.juniper.net/documentation/en_US/junos/topics/concept/bgp-bmp-understanding.html

No problem with IPv4. I receive new routes and withdrawn routes without
any issue. However, for IPv6, the MP_REACH_NLRI path attribute is
incorrectly encoded (both Wireshark and GoBGP agree on this):

Path Attribute - MP_REACH_NLRI
    Flags: 0x90, Optional, Extended-Length, Non-transitive, Complete
    Type Code: MP_REACH_NLRI (14)
    Length: 30
    Address family identifier (AFI): IPv6 (2)
    Subsequent address family identifier (SAFI): Unicast (1)
    Next hop network address (16 bytes)
    Number of Subnetwork points of attachment (SNPA): 0
    Network layer reachability information (9 bytes)
        MP Reach NLRI length 184 invalid
            [Expert Info (Error/Malformed): MP Reach NLRI length 184 invalid]

0000   90 0e 00 1e 00 02 01 10 20 01 0d b8 00 01 00 00  ........ .......
0010   00 00 00 00 00 00 00 01 00 40 20 01 0d b8 00 53  .........@ ....S
0020   00 00                                            ..

Moreover, when routes are withdrawn, the UPDATE message doesn't contain
withdrawn routes but come with a MP_UNREACH_NLRI which has the same
encoding problem.

Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 39
    Type: UPDATE Message (2)
    Withdrawn Routes Length: 0
    Total Path Attribute Length: 16
    Path attributes
        Path Attribute - MP_UNREACH_NLRI
            Flags: 0x90, Optional, Extended-Length, Non-transitive, Complete
            Type Code: MP_UNREACH_NLRI (15)
            Length: 12
            Address family identifier (AFI): IPv6 (2)
            Subsequent address family identifier (SAFI): Unicast (1)
            Withdrawn routes (9 bytes)
                MP Unreach NLRI length 184 invalid
                    [Expert Info (Error/Malformed): MP Unreach NLRI length 184 invalid]

0000   ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
0010   00 27 02 00 00 00 10 90 0f 00 0c 00 02 01 40 20  .'............@ 
0020   01 0d b8 00 07 00 00                             .......

Again, with IPv4 routes, no such issue:

Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 28
    Type: UPDATE Message (2)
    Withdrawn Routes Length: 5
    Withdrawn Routes
        192.0.2.7/32
            Withdrawn route prefix length: 32
            Withdrawn prefix: 192.0.2.7
    Total Path Attribute Length: 0

I have tried various versions (16.1, 17.1, 17.3) without any
change. Even if Juniper was implementing an earlier draft, encoding of
path attributes should still be correct. Has someone already get this
problem?
-- 
Don't just echo the code with comments - make every comment count.
            - The Elements of Programming Style (Kernighan & Plauger)


More information about the juniper-nsp mailing list