Question about BGP NLRI structure

johnjdunbar at disroot.org johnjdunbar at disroot.org
Fri Jun 10 21:32:04 UTC 2022


I'm trying to implement https://datatracker.ietf.org/doc/draft-ietf-idr-sdwan-edge-discovery/ into frr/bgpd. Looking through the code I have some questions for which I hope someone can help me

RFC 4760 defines the mp_reach_nlri attributes as this
+---------------------------------------------------------+
| Address Family Identifier (2 octets)                    |
+---------------------------------------------------------+
| Subsequent Address Family Identifier (1 octet)          |
+---------------------------------------------------------+
| Length of Next Hop Network Address (1 octet)            |
+---------------------------------------------------------+
| Network Address of Next Hop (variable)                  |
+---------------------------------------------------------+
| Reserved (1 octet)                                      |
+---------------------------------------------------------+
| Network Layer Reachability Information (variable)       |
+---------------------------------------------------------+

Is the following structure in /bgpd/bgpd.h representing the table above?
struct bgp_nlri {
	/* AFI.  */
	uint16_t afi; /* iana_afi_t */

	/* SAFI.  */
	uint8_t safi; /* iana_safi_t */

	/* Pointer to NLRI byte stream.  */
	uint8_t *nlri;

	/* Length of whole NLRI.  */
	bgp_size_t length;
};

If yes, 
does uint8_t *nlri map to [Network Layer Reachability Information (variable)]?
does bgp_size_t length map to [Length of Next Hop Network Address (1 octet)]?

If not, can someone please tell me what this structure maps to?

I appreciate anyone who has insights to help me out.

Thank you,
John



More information about the dev mailing list