Deleting a single route in BGP

Johannes Ludwig johannes.ludwig2 at mailbox.tu-dresden.de
Tue Oct 5 11:24:07 CEST 2021


Hello everyone!


Currently I'm writing my bachelor thesis that also contains an implementation of an extension in BIRD and BGP. One building block is deleting a single route in BGP without triggering an Update message (with route withdraws) and the route must be deleted programmatically, so without receiving an Update message. The problem is, that I see no support for that. I can't call rte_update2 with new == NULL, because this would delete all routes that lead to the specified network. But I want to delete only one specific route! The problem description and what I have done so far:


Delete a specific route without triggering a BGP Update Message:

Since BGP has no use case where only a specific route should be deleted, this problem is difficult (at least for me). Normally we receive a Route Withdraw Message and can call rte_update2() with the not reachable network and when rte * new == NULL all routes that lead to the target network are deleted. But in my use case I only want to remove one specific route. At the moment I add specific pflags to the rte I want to delete and in rte_update2 I check if new->pflags has the specific value. If so, I jump to drop in rte_update2, where the route is deleted. The route is deleted but no recalculation is done, therefore I set new to the best route of the reachable network (net->routes) and jump to recalc in rte_update2(). I add my specific pflags and when bgp_rt_notify in attrs.c is called I return. Unbelievable but this works -- almost! My problem is that the route is deleted in the BIRD BGP Routingtable, so when I call birdc show route all it shows me all routes without the deleted one (so far so good), BUT the kernel routing table is not changed. And this is the point where I have to change my approach.


To summarize my problem in one sentence: How can I delete a single route in BIRD without declaring a network as unreachable and calling rte_update2() with new == NULL, because this approach would lead to the deletion of all routes that lead to a network.

I hope someone can help me and maybe explain where I can look, what functions could be useful and what things I have to consider.

Many thanks in advance!


Johannes Ludwig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20211005/78fd11a1/attachment.htm>


More information about the Bird-users mailing list