summaryrefslogtreecommitdiff
path: root/nest/route.h
AgeCommit message (Collapse)Author
2022-07-22Revert "Export table: Delay freeing of old stored route."Maria Matejka
This reverts commit cee0cd148c9b71bf47d007c850193b5fbf9486c1. This change is not needed in version 2 and the surrounding code has disappeared mostly in version 3.
2022-07-11Merge commit 'beb5f78a' into backportMaria Matejka
2022-07-10Merge version 2.0.10 into backportMaria Matejka
2022-06-27Preexport callback now takes the channel instead of protocol as argumentMaria Matejka
Passing protocol to preexport was in fact a historical relic from the old times when channels weren't a thing. Refactoring that to match current extensibility needs.
2022-06-04Nest: Improve GC strategy for rtablesOndrej Zajicek
Use timer (configurable as 'gc period') to schedule routing table GC/pruning to ensure that prune is done on time but not too often. Randomize GC timers to avoid concentration of GC events from different tables in one loop cycle. Fix a bug that caused minimum inter-GC interval be 5 us instead of 5 s. Make default 'gc period' adaptive based on number of routing tables, from 10 s for small setups to 600 s for large ones. In marge multi-table RS setup, the patch improved time of flushing a downed peer from 20-30 min to <2 min and removed 40s latencies.
2022-04-13RIP: fixed the EA_RIP_FROM attributeMaria Matejka
The interface pointer was improperly converted to u32 and back. Fixing this by explicitly allocating an adata structure for it. It's not so memory efficient, we'll optimize this later.
2022-04-06Unsetting route attributes without messing with type systemMaria Matejka
2022-04-06Eattr flags (originated and fresh) get their own struct fieldsMaria Matejka
2022-03-09Merge commit '60880b539b8886f76961125d89a265c6e1112b7a' into haugesundMaria Matejka
2022-03-09BGP Flowspec validation: Removed in-route optimization for multithreading ↵Maria Matejka
compatibility
2022-03-09Merge commit 'e42eedb9' into haugesundMaria Matejka
2022-03-09Merge commit '5cff1d5f' into haugesundMaria Matejka
Conflicts: proto/bgp/attrs.c proto/pipe/pipe.c
2022-03-09Merge commit 'd5a32563' into haugesundMaria Matejka
2022-02-06Nest: Implement locking of prefix tries during walksOndrej Zajicek (work)
The prune loop may may rebuild the prefix trie and therefore invalidate walk state for asynchronous walks (used in 'show route in' cmd). Fix it by adding locking that keeps the old trie in memory until current walks are done. In future this could be improved by rebuilding trie walk states (by lookup for last found prefix) after the prefix trie rebuild.
2022-02-06Nest: Implement prefix trie pruningOndrej Zajicek (work)
When rtable is pruned and network fib nodes are removed, we also need to prune prefix trie. Unfortunately, rebuilding prefix trie takes long time (got about 400 ms for 1M networks), so must not be atomic, we have to rebuild a new trie while current one is still active. That may require some considerable amount of temporary memory, so we do that only if we expect significant trie size reduction.
2022-02-06BGP: Implement flowspec validation procedureOndrej Zajicek (work)
Implement flowspec validation procedure as described in RFC 8955 sec. 6 and RFC 9117. The Validation procedure enforces that only routers in the forwarding path for a network can originate flowspec rules for that network. The patch adds new mechanism for tracking inter-table dependencies, which is necessary as the flowspec validation depends on IP routes, and flowspec rules must be revalidated when best IP routes change. The validation procedure is disabled by default and requires that relevant IP table uses trie, as it uses interval queries for subnets.
2022-02-06Nest: Add convenience functions to check rtable net typeOndrej Zajicek (work)
2022-02-06Nest: Add trie iteration code to 'show route'Ondrej Zajicek (work)
Add trie iteration code to rt_show_cont() CLI hook and use it to accelerate 'show route in <addr>' commands using interval queries.
2022-02-06Nest: Implement 'show route in <addr>' commandOndrej Zajicek (work)
Implement 'show route in <addr>' command, which shows all routes in networks that are subnets of given network. Currently limited to IP network types.
2022-02-06Nest: Attach prefix trie to rtable for faster LPM and interval queriesOndrej Zajicek (work)
Attach a prefix trie to IP/VPN/ROA tables. Use it for net_route() and net_roa_check(). This leads to 3-5x speedups for IPv4 and 5-10x speedup for IPv6 of these calls. TODO: - Rebuild the trie during rt_prune_table() - Better way to avoid trie_add_prefix() in net_get() for existing tables - Make it configurable (?)
2021-10-13Kernel: Convert the rte-local attributes to extended attributes and flags to ↵Maria Matejka
pflags
2021-10-13Route: moved rte_src pointer from rta to rteMaria Matejka
It is an auxiliary key in the routing table, not a route attribute.
2021-10-13RIP fixup + dropping the tmp_attrs mechanism as obsoleteMaria Matejka
2021-10-13Dropping the RTS_DUMMY temporary route storage.Maria Matejka
Kernel route sync is done by other ways now and this code is not used currently.
2021-10-13Preference moved to RTA and set explicitly in protocolsMaria Matejka
2021-10-13Export table: Delay freeing of old stored route.Maria Matejka
This is needed to provide the protocols the full old route after filters when export table is enabled.
2021-10-13BGP: Moved the suppressed and stale flags to pflagsMaria Matejka
2021-10-13Babel: Convert the rte-local attributes to extended attributesMaria Matejka
2021-10-13OSPF: Convert the rte-local attributes to extended attributesMaria Matejka
2021-10-13RIP: convert the rte-local attributes to extended attributesMaria Matejka
2021-10-13Extended route attributes may include also pointersMaria Matejka
2021-04-19Internal route tables have a reduced cleanup routineMaria Matejka
This fixes an internal table cleanup bug introduced in ff397df7edcbe7a8abca5b419729b9c64c063847.
2021-03-30Routing table is now a resource allocated from its own poolMaria Matejka
This also fixes memory leaks from import/export tables being never cleaned up and freed.
2021-02-10Nest: Automatic channel reloads based on RPKI changesOndrej Zajicek (work)
If there are roa_check() calls in channel filters, then the channel subscribes to ROA table notifications, which are sent when ROA tables are updated (subject to settle time) and trigger channel reload or refeed.
2020-05-01Nest: Added const to ea_show just to declare that this shouldn't really ↵Maria Matejka
change anything
2020-02-21RIP: Demand circuit support (RFC 2091)Ondrej Zajicek (work)
2020-02-04Added missing externMaria Matejka
Thanks to Robert Scheck <bird@robert-scheck.de> who reported it and Toke Høiland-Jørgensen <toke@toke.dk> who suggested this patch.
2020-01-07KRT: Improve syncer code to avoid using temporary data in rtableOndrej Zajicek (work)
The old code stored route verdicts and temporary routes directly in rtable. The new code do not store received routes (it immediately compares them with exported routes and resolves conflicts) and uses internal bitmap to keep track of which routes were received and which needs to be reinstalled. By not putting 'invalid' temporary routes to rtable, we keep rtable in consistent state, therefore scan no longer needs to be atomic operation and could be splitted to multiple events.
2019-12-19KRT: Remove KRF_SYNC_ERROR flagOndrej Zajicek (work)
This info is now stored in an internal bmap. Unfortunately, net.flags is still needed for temporary kernel data.
2019-12-16KRT: Remove KRF_INSTALLED flagOndrej Zajicek (work)
The same information is stored in export_map of kernel protocol.
2019-11-26Nest: Use bitmaps to keep track of exported routesOndrej Zajicek (work)
Use a hierarchical bitmap in a routing table to assign ids to routes, and then use bitmaps (indexed by route id) in channels to keep track whether routes were exported. This avoids unreliable and inefficient re-evaluation of filters for old routes in order to determine whether they were exported.
2019-10-09BGP: AIGP metric support (RFC 7311)Ondrej Zajicek (work)
2019-08-14BGP: implement Adj-RIB-OutOndrej Zajicek (work)
The patch implements optional internal export table to a channel and hooks it to BGP so it can be used as Adj-RIB-Out. When enabled, all exported (post-filtered) routes are stored there. An export table can be examined using e.g. 'show route export table bgp1.ipv4'.
2019-07-10Merge branch 'master' into mq-filter-stackMaria Matejka
2019-07-02Netlink: Handle alien routes with unsorted nexthopsOndrej Zajicek (work)
Nest requires that nexthops are sorted, the kernel protocol have to ensure that for alien routes.
2019-03-18Merge branch 'master' into HEADMaria Matejka
2019-03-14Nest: Update handling of temporary attributesOndrej Zajicek (work)
The temporary atttributes are no longer removed by ea_do_prune(), but they are undefined by store_tmp_attrs() protocol hooks. This fixes several bugs where temporary attributes were removed when they should not or not removed when they should be. The flag EAF_TEMP is no longer needed and was removed. Update all protocol make_tmp_attrs() / store_tmp_attrs() hooks to use helper functions and to handle unset attributes properly. Also fix some related bugs like improper handling of empty eattr list.
2019-03-06OSPF: Improved handling of tmpattrsOndrej Zajicek (work)
Keep track of whether OSPF tmpattrs are actually defined for given route (using flags in rte->pflags). That makes them behave more like real eattrs so a protocol can define just a subset of them or they can be undefined by filters. Do not set ospf_metric2 for other than type 2 external OSPF routes and do not set ospf_tag for non-external OSPF routes. That also fixes a bug where internal/inter-area route propagated from one OSPF instance to another is initiated with infinity ospf_metric2. Thanks to Yaroslav Dronskii for the bugreport.
2019-02-20Conf: Symbol implementation converted from void pointers to unionMaria Matejka
... and consted some declarations.
2019-02-20Filter refactoring: dropped the recursion from the interpreterMaria Matejka
This is a major change of how the filters are interpreted. If everything works how it should, it should not affect you unless you are hacking the filters themselves. Anyway, this change should make a huge improvement in the filter performance as previous benchmarks showed that our major problem lies in the recursion itself. There are also some changes in nest and protocols, related mostly to spreading const declarations throughout the whole BIRD and also to refactored dynamic attribute definitions. The need of these came up during the whole work and it is too difficult to split out these not-so-related changes.