Closed Zahaib closed 4 years ago
For more context, the issue here is that the peering session for this BGP update message was over IPv6 (both peer and local addresses are IPv6)
Peer IP Address: 2001:7f8:54::1:204
Local IP Address: 2001:7f8:54::1:99
However, peering session doesn't necessarily mean that NLRI will follow the same AFI. In fact, NLRI at the end of BGP message should always be decoded as IPv4. RFC4760 for multiprotocol extensions also confirms this. Under 1. Introduction first paragraph, it states that:
The only three pieces of information carried by BGP-4 [BGP-4] that are IPv4 specific are (a) the NEXT_HOP attribute (expressed as an IPv4 address), (b) AGGREGATOR (contains an IPv4 address), and (c) NLRI (expressed as IPv4 address prefixes).
Hi,
Thank you very much for reporting this issue. I fixed it, so could you confirm that it works correctly? In my environment, the result is as follows:
--- updates.20200422.0125.out.before 2020-04-24 19:23:31.974871626 +0900
+++ updates.20200422.0125.out.after 2020-04-24 19:43:59.898189564 +0900
(...snip)
@@ -1160977,29 +1160977,29 @@
NEXT_HOP: 85.208.68.1
Path Attribute Flags/Type/Length: 0xc0/8/64
COMMUNITY: 0:8304 0:49981 16:1134 6762:1 6762:31 6762:40 6762:10150 24115:57463 25091:22414 25091:24115 64700:57463 64704:1300 65400:0 65400:65400 65444:102 65444:2000
- NLRI: 305::/20
- NLRI: 305::/24
- NLRI: 305:1000::/21
- NLRI: 305:1000::/24
- NLRI: 350::/12
- NLRI: 3e0::/12
- NLRI: 3d0::/12
- NLRI: 305:400::/24
- NLRI: 305:900::/24
- NLRI: 305:1100::/24
- NLRI: 305:1200::/24
- NLRI: 305:a00::/24
- NLRI: 305:b00::/24
- NLRI: 305:700::/24
- NLRI: 305:1300::/24
- NLRI: 305:200::/24
- NLRI: 305:600::/24
- NLRI: 305:300::/24
- NLRI: 305:1500::/24
- NLRI: 305:500::/24
- NLRI: 305:800::/24
- NLRI: 305:100::/24
- NLRI: 305:1400::/24
+ NLRI: 3.5.0.0/20
+ NLRI: 3.5.0.0/24
+ NLRI: 3.5.16.0/21
+ NLRI: 3.5.16.0/24
+ NLRI: 3.80.0.0/12
+ NLRI: 3.224.0.0/12
+ NLRI: 3.208.0.0/12
+ NLRI: 3.5.4.0/24
+ NLRI: 3.5.9.0/24
+ NLRI: 3.5.17.0/24
+ NLRI: 3.5.18.0/24
+ NLRI: 3.5.10.0/24
+ NLRI: 3.5.11.0/24
+ NLRI: 3.5.7.0/24
+ NLRI: 3.5.19.0/24
+ NLRI: 3.5.2.0/24
+ NLRI: 3.5.6.0/24
+ NLRI: 3.5.3.0/24
+ NLRI: 3.5.21.0/24
+ NLRI: 3.5.5.0/24
+ NLRI: 3.5.8.0/24
+ NLRI: 3.5.1.0/24
+ NLRI: 3.5.20.0/24
Thanks for the update, I took a look at your change and it looks good to me. I can also confirm that IPv4 are now getting decoded correctly.
Hi,
I used
print_all.py
to print the output of a MRT file from RIPE RouteCollector rrc21 (http://data.ris.ripe.net/rrc21/2020.04/updates.20200422.0125.gz). It seems that IPv4 prefixes at the end of BGP message are getting decoded as IPv6. For example, following is an example taken from the output ofprint_all.py
:MRT Header
It seems that the parser is using the AFI (IPv6) provided in the BGP4MP_MESSAGE header to decode the prefixes at the end of the BGP message whereas RFC 6396 under 4.4.2 states that: