On Thu, Jun 17, 2021 at 12:24:16PM +0200, Claudio Jeker wrote:
> On Mon, Jun 14, 2021 at 05:10:07PM +0200, Claudio Jeker wrote:
> > On Thu, May 27, 2021 at 06:24:06PM +0200, Claudio Jeker wrote:
> > > Implement RFC 7313 enhanced route refresh.
> > > 
> > > While there also change when graceful restart EoR markers are sent.
> > > In short the graceful restart marker should only be sent initally. After
> > > that the End of Route Refresh message should be sent instead.
> > > Because of this track if an EoR marker was received or should be sent in
> > > the peer config.
> > > 
> > > For now this setting is off by default but that may be changed at a later
> > > state.
> > > 
> > > Please try this out and tell me if it works for you. The message and
> > > prefix/rrefresh counters in bgpctl show nei output help a lot to see what
> > > is going on.
> 
> Minor cleanup, instead of this comment use CTASSERT to make sure that the
> recv_eor and send_eor fields are large enough to work as a bitfield for
> AID_MAX
> 
> > -#define    AID_MAX         5
> > +#define    AID_MAX         5       /* check rde_peer.recv_eor when max 
> > reaches 7 */
> 
> Enhanced route refresh is currently off by default. So unless somebody
> is against this I will commit this soon. At least then it gets tested :)

Under what circumstances will bgpd(8) send an enhanced route refresh?

If I issue 'bgpctl neighbor xxx refresh' on a session where Enhanced
Refresh is negotiated

  Negotiated capabilities:
    Multiprotocol extensions: IPv4 unicast
    4-byte AS numbers
    Route Refresh
    Enhanced Route Refresh
    Graceful Restart

I see in tshark:

   Border Gateway Protocol - ROUTE-REFRESH Message
       Marker: ffffffffffffffffffffffffffffffff
       Length: 23
       Type: ROUTE-REFRESH Message (5)
       Address family identifier (AFI): IPv4 (1)
       Subtype: Normal route refresh request [RFC2918] with/without ORF 
[RFC5291] (0)
       Subsequent address family identifier (SAFI): Unicast (1)

Attached below a tcpdump diff that perhaps can help improve visibility
:-)

Kind regards,

Job

Index: print-bgp.c
===================================================================
RCS file: /cvs/src/usr.sbin/tcpdump/print-bgp.c,v
retrieving revision 1.29
diff -u -p -r1.29 print-bgp.c
--- print-bgp.c 3 Jul 2019 03:24:03 -0000       1.29
+++ print-bgp.c 17 Jun 2021 13:24:33 -0000
@@ -97,7 +97,7 @@ struct bgp_route_refresh {
        u_int16_t len;
        u_int8_t type;
        u_int8_t afi[2]; /* unaligned; should be u_int16_t */
-       u_int8_t res;
+       u_int8_t subtype;
        u_int8_t safi;
 };
 #define BGP_ROUTE_REFRESH_SIZE          23
@@ -189,6 +189,7 @@ static const char *bgp_capcode[] = {
        /* 67: [Chen] */ "DYNAMIC_CAPABILITY",
        /* 68: [Appanna] */ "MULTISESSION",
        /* 69: [draft-ietf-idr-add-paths] */ "ADD-PATH",
+       /* 70: RFC7313 */ "ENHANCED_ROUTE_REFRESH"
 };
 
 #define bgp_capcode(x) \
@@ -199,7 +200,7 @@ static const char *bgpnotify_major[] = {
        NULL, "Message Header Error",
        "OPEN Message Error", "UPDATE Message Error",
        "Hold Timer Expired", "Finite State Machine Error",
-       "Cease", "Capability Message Error",
+       "Cease", "ROUTE_REFRESH Message Error",
 };
 #define bgp_notify_major(x) \
        num_or_str(bgpnotify_major, \
@@ -323,6 +324,11 @@ static const char *afnumber[] = AFNUM_NA
                num_or_str(afnumber, \
                        sizeof(afnumber)/sizeof(afnumber[0]), (x)))
 
+static const char *refreshtype[] = {
+       "Normal", "BoRR", "EoRR"
+};
+#define refresh_subtype(x) \
+       num_or_str(refreshtype, sizeof(refreshtype)/sizeof(refreshtype[0]), (x))
 
 static const char *
 num_or_str(const char **table, size_t siz, int value)
@@ -1069,7 +1075,8 @@ bgp_route_refresh_print(const u_char *da
 
        bgp_route_refresh_header = (const struct bgp_route_refresh *)dat;
 
-       printf(" (%s %s)",
+       printf(" %s (%s %s)",
+           refresh_subtype(bgp_route_refresh_header->subtype),
            af_name(EXTRACT_16BITS(&bgp_route_refresh_header->afi)),
            bgp_attr_nlri_safi(bgp_route_refresh_header->safi));
 

Reply via email to