[quagga-dev 232] bgpd: routeadv timer (fwd)

Patrick Verkaik patrick at caida.org
Tue Sep 9 03:15:29 BST 2003



Hi there,

I took a look at the quagga-0.96.2 source code and I think this hasn't
been fixed. Are there any plans to do so? If not, I might take a look at
it myself.

	Cheers,

	Patrick

---------- Forwarded message ----------
Date: Wed, 19 Feb 2003 18:20:13 -0800 (PST)
From: Patrick Verkaik <patrick at caida.org>
Reply-To: zebra at zebra.org
To: zebra at zebra.org
Cc: Patrick Verkaik <patrick at caida.org>
Subject: [zebra 17963] bgpd: routeadv timer


Hello,

I have a question about how BGP's routeadv timer is implemented by zebra.

If I'm correct, it works like this.  For each peer there is a queue of
outstanding updates (adverts and withdrawals) still to be sent to that
peer.  Each peer's routeadv timer expires every 30 seconds. At that point
any updates on that queue get flushed (sent to the peer and removed from
the queue).

The queue is also examined for flushing when updates (whether adverts or
withdrawals) are placed in the queue. To prevent adverts from being
flushed at this time (before the routeadv timer expires), each advert
carries an uptime.  Whenever the queue of outstanding updates is examined
for flushing, only adverts with an uptime older than the peer's latest
routeadv expiry time ('synctime') as well as any withdrawals are flushed.
Correct?

As far as I can gather from the code, the uptime used in the above is
actually the uptime of the best *received* advert for the prefix. (It is
taken from the struct bgp_info corresponding to the best received advert.)
So consider this sequence of events:

  t1
  rcv advert a1 for prefix p from peer1
  set a1.uptime to current time
  place advert for p in peer3.queue
  no advert is sent to peer3 since a1.uptime > peer3.synctime

  t2
  rcv advert a2 for p from peer2 (preferred route)
  set a2.uptime to current time
  replace advert for p in peer3.queue
  no advert is sent to peer3 since a2.uptime > peer3.synctime

  t3
  peer3 routeadv expires
  set peer3.synctime to current time
  send queued advert for p to peer3, since a2.uptime < peer3.synctime
  (and remove advert from queue)

  t4
  rcv withdrawal for p from peer2 (now a1 is best)
  place advert for p in peer3.queue
  send advert for p to peer3, since a1.uptime < peer3.synctime

The last event occurs before peer3's routeadv timer expires! Is this a bug
or am I mistaken?


	Thanks,

	Patrick






More information about the Quagga-dev mailing list