[quagga-dev 8615] Re: [PATCH] BGP minttl more complete support

Stephen Hemminger shemminger at vyatta.com
Fri Mar 25 16:30:44 GMT 2011


On Fri, 25 Mar 2011 10:49:55 +0000 (GMT)
paul at jakma.org wrote:

> On Thu, 24 Mar 2011, Stephen Hemminger wrote:
> 
> >>> -	  if (peer->fd >= 0 && peer->gtsm_hops != 0)
> >>> -            sockopt_minttl (peer->su.sa.sa_family, peer->fd, MAXTTL + 1 - peer->gtsm_hops);
> >>> +	  /* Change setting of existing peer
> >>> +	   *   established then change value (may break connectivity)
> >>> +	   *   not established yet (teardown session and restart)
> >>> +	   *   no session then do nothing (will get handled by next connection)
> >>> +	   */
> >>> +	  if (peer->status == Established)
> >>> +	    {
> >>> +	      if (peer->fd >= 0 && peer->gtsm_hops != 0)
> >>> +		sockopt_minttl (peer->su.sa.sa_family, peer->fd,
> >>> +				MAXTTL + 1 - peer->gtsm_hops);
> >>> +	    }
> >>> +	  else if (peer->status < Established)
> >>> +	    {
> >>> +	      if (BGP_DEBUG (events, EVENTS))
> >>> +		zlog_debug ("%s Min-ttl changed", peer->host);
> >>> +	      BGP_EVENT_ADD (peer, BGP_Stop);
> >>> +	    }
> >>
> >> Why special case the different states? Why can't you just set min-ttl
> >> on Active/Open sessions like for Established? Is it possible to have
> >> a state where peer->fd is < 0, but where it won't get the minttl
> >> applied as its state progresses toward Established?
> 
> > Because if you change minttl on an established socket, it may no
> > longer accept new packets from that peer (if the ttl is was increased
> > and peer still has old value). That means
> > the TCP socket would have to time out which takes much longer than forcing
> > a reconnect.
> 
> Ah, not good that. But the mintttl is being changed on Established 
> though??
> 
> regards,

In established state the BGP keepalives force TCP to drop connection
(too many retransmits) if the TTL change breaks connectivity. But in earlier
states, no keepalives are sent. We could stop established connections
but then it needs to handle the case old vs. new ttl values and only
stop if needed.

Anyway the old code would cause connections to hang, the new code works
for the subset of changes we check during regression tests. Open to
a better solution.



More information about the Quagga-dev mailing list