[Xorp-hackers] is this right?

Ratul Mahajan ratul@cs.washington.edu
Fri, 05 Aug 2005 20:58:45 -0700


hi -

i am experimenting with a new interdomain routing protocol, as part of 
which i need to do keep track of
   - the sums of the MEDs received from each ebgp peer.
   - the sums of the MEDs sent to each ebgp peer.
(its actually a custom attribute but pretty much like MEDs)

since i am not intimately familiar with xorp code, it'll be great if 
someone verified what i am doing is correct.

i do the following:
   1. add member variables sum_in and sum_out to PeerData which are 
updated through Rib[In,Out]->PeerHandler->Peer->PeerData
   2. update sum_in in RibIn
      2a. subtract in add_route() and delete_route() the MED of existing 
route, if any*
      2b. add the MED value of the new route in add_route()
   3. update sum_out in RibOut
      3a. subtract in delete_route(), using the MED attached to rtmsg, 
the route passed in the argument*
      3b. add in add_route() the current MED

* 2a and 3a are based on the following assumptions:
   - 2a: the routes stored in RibIn are never changed or deleted from 
what is originally received, no matter what the input filters do. (i 
realize that this might change in the future)
   - 3a: the rtmsg in delete_route() contains the correct old MED value, 
since the filtertable re-applies the filters to old route passed through 
the fanout table

are the following assumptions correct?
are there cases when the above procedure will break, e.g., peerings 
up/down or too many routes in the queue?

thanks!