summaryrefslogtreecommitdiff
path: root/proto
AgeCommit message (Collapse)Author
2023-06-26RAdv: Use new syntax for custom optionsAlexander Zubkov
And use WALK_LIST macro
2023-06-23RAdv: Add custom optionsAlexander Zubkov
Currently one can use only a predefined set of advertised options in RAdv protocol, which are supported by BIRD configuration. It would be convenient to be able to specify other possible options at least manually as a blob so one should not wait until it is supported in the code, released, etc. This idea is inspired by presentation by Ondřej Caletka at CSNOG, in which he noticed the lack of either PREF64 option or possibility to add custom options in various software. The patch makes it possible to define such options with the syntax: other type <num> <bytestring>
2023-06-02Babel: Minor changes to RTT formattingOndrej Zajicek
Use existing %t printf code and move 'ms' in CLI output to table header.
2023-06-02Babel: Add support for the RTT extensionToke Høiland-Jørgensen
This adds support to the Babel protocol for the RTT extension specified in draft-ietf-babel-rtt-extension. While this extension is not yet at the RFC stage, it is one of the more useful extensions to Babel[0], so it seems worth having in Bird as well. The extension adds timestamps to Hello and IHU TLVs and uses these to compute an RTT to each neighbour. An extra per-neighbour cost is then computed from the RTT based on a minimum and maximum interval and cost value specified in the configuration. The primary use case for this is improving routing in a geographically distributed tunnel-based overlay network. The implementation follows the babeld implementation when picking constants and default configuration values. It also uses the same RTT smoothing algorithm as babeld, and follows it in adding a new 'tunnel' interface type which enables RTT by default. [0] https://alioth-lists.debian.net/pipermail/babel-users/2022-April/003932.html
2023-05-19BGP: Fix role check when no capability option is presentOndrej Zajicek
When an OPEN message without capability options was parsed, the remote role field was not initialized with the proper (non-zero) default value, so it was interpreted as if 'provider' was announced. Thanks to Mikhail Grishin for the bugreport.
2023-04-27Conf: Improve handling of keywordsOndrej Zajicek
For whatever reason, parser allocated a symbol for every parsed keyword in each scope. That wasted time and memory. The effect is worsened with recent changes allowing local scopes, so keywords often promote soft scopes (with no symbols) to real scopes. Do not allocate a symbol for a keyword. Take care of keywords that could be promoted to symbols (kw_sym) and do it explicitly.
2023-04-20BMP: Silence some log messagesOndrej Zajicek
Hooks called from BGP to BMP should not log warning when BMP is not connected, that is not an error (and we do not want to flood logs with a ton of messages). Blocked sk_send() should not log warning, that is expected situation. Error during sk_send() is handled in error hook anyway.
2023-04-20BMP: Fix connection managementOndrej Zajicek
Replace broken TCP connection management with a simple state machine. Handle failed attempts properly with a timeout, detect and handle TCP connection close and try to reconnect after that. Remove useless 'station_connected' flag. Keep open messages saved even after the BMP session establishment, so they can be used after BMP session flaps. Use proper log messages for session events.
2023-04-18BMP: Fix reconfigurationOndrej Zajicek
It is not supported, but at least it must update internal config pointer to not keep old one.
2023-04-18BMP: Allow build without BMP and disable BMP build by defaultOndrej Zajicek
It has still several important issues to be enabled by default.
2023-04-18BMP: Move initialization to bmp_start()Ondrej Zajicek
That fixes BMP socket allocation from an invalid pool.
2023-04-18BMP: Fix missing templateOndrej Zajicek
It is mandatory for protocol.
2023-04-16BMP: Add some missing bmp_buffer_free() callsOndrej Zajicek (work)
They were inadvertently removed during recent code refactoring. Thanks to Dawid Macek for the bugreport and patch.
2023-04-16BMP: Remove duplicate functions for update encodingOndrej Zajicek (work)
Use existing BGP functions also for BMP update encoding.
2023-04-16BMP: Integrate bmp_conn to bmp_protoOndrej Zajicek (work)
There is only one socket per BMP instance, no need to have separate struct (like in BGP).
2023-04-16BMP: Minor cleanupsOndrej Zajicek (work)
Remove redundant 'disable' option, simplify IP address serialization, and remove useless macros.
2023-04-16BMP: Do not use global instance ptr internallyOndrej Zajicek (work)
Use local variable to refence relevant instance instead of using global instance ptr. Also, use 'p' variable instead of 'bmp' so we can use common macros like TRACE().
2023-04-16BMP: Remove superfluous error handlingOndrej Zajicek (work)
Most error handling code was was for cases that cannot happen, or they would be code bugs (and should use ASSERT()). Keep error handling for just for I/O errors, like in rest of BIRD.
2023-04-16BMP protocol supportPawel Maslanka
Initial implementation of a basic subset of the BMP (BGP Monitoring Protocol, RFC 7854) from Akamai team. Submitted for further review and improvement.
2023-04-14BGP: Add 'allow bgp_med' option for EBGP sessionsTrisha Biswas
This option allows to treat bgp_med as regular transitive attribute on EBGP sessions (without hacks in filters). Minor changes from committer.
2023-04-04BGP: Fix bgp_med handlingOndrej Zajicek
Missing translation from BGP attribute ID to eattr ID in bgp_unset_attr() broke automatic removal of bgp_med during export to EBGP peers. Thanks to Edward Sun for the bugreport.
2023-03-16BGP: Free bind applies also to outbound connectionsMaria Matejka
Even though the free bind option is primarily meant to alleviate problems with addresses assigned too late, it's also possible to use BIRD with AnyIP configuration, assigning whole ranges to the machine. Therefore free bind allows also to create an outbound connection from specific address even though such address is not assigned.
2023-02-19BGP: Update RFC referencesOndrej Zajicek
2023-02-19Babel: Update RFC referencesOndrej Zajicek
2023-02-14Babel: Keep separate auth PC counters for unicast and multicastToke Høiland-Jørgensen
The babel protocol normally sends all its messages as multicast packets, but the protocol specification allows most messages to be sent as either unicast or multicast, and the two can be mixed freely. In particular, the babeld implementation can be configured to unicast updates to all peers instead of sending them as unicast. Daniel discovered that this can cause problems with the packet counter checks in the MAC extension due to packet reordering. This happens on WiFi networks where clients have power save enabled (which is quite common in infrastructure networks): in this case, the access point will buffer all multicast traffic and only send it out along with its beacons, leading to a maximum buffering in default Linux-based access point configuration of up to 200 ms. This means that a Babel sender that mixes unicast and multicast messages can have the unicast messages overtake the multicast messages because of this buffering; when authentication is enabled, this causes the receiver to discard the multicast message when it does arrive because it now has a packet counter value less than the unicast message that arrived before it. Daniel observed that this happens frequently enough that Babel ceases to work entirely when runner over a WiFi network. The issue has been described in draft-ietf-babel-mac-relaxed, which is currently pending RFC publication. That also describes two mitigation mechanisms: Keeping separate PC counters for unicast and multicast, and using a reorder window for PC values. This patch implements the former as that is the simplest, and resolves the particular issue seen on WiFi. Thanks to Daniel Gröber for the bugreport. Minor changes from committer.
2023-02-14Babel: Implement IPv4 via IPv6 extension (RFC 9229)Andreas Rammhold
The patch implements an IPv4 via IPv6 extension (RFC 9229) to the Babel routing protocol (RFC 8966) that allows annoncing routes to an IPv4 prefix with an IPv6 next hop, which makes it possible for IPv4 traffic to flow through interfaces that have not been assigned an IPv4 address. The implementation is compatible with the current Babeld version. Thanks to Toke Høiland-Jørgensen for early review on this work. Minor changes from committer.
2023-01-31Babel: Initialise source seqno from incoming messageToke Høiland-Jørgensen
When creating a new babel_source object we initialise the seqno to 0. The caller will update the source object with the right metric and seqno value, for both newly created and old source objects. However if we initialise the source object seqno to 0 that may actually turn out to be a valid (higher) seqno than the one in the routing table, because of seqno wrapping. In this case the source metric will not be set properly, which breaks feasibility tracking for subsequent updates. To fix this, add a new initial_seqno argument to babel_get_source() which is used when allocating a new object, and set that to the seqno value of the update we're sending. Thanks to Juliusz Chroboczek for the bugreport.
2023-01-30Babel: Improve clarity of unfeasible update handling.Ondrej Zajicek
Add a comment and (unnecessary) check to make correctness obvious.
2023-01-30Babel: Fix missing modulo comparison of seqnosToke Høiland-Jørgensen
Juliusz noticed there were a couple of places we were doing straight inequality comparisons of seqnos in Babel. This is wrong because seqnos can wrap: so we need to use the modulo-64k comparison function for these cases as well. Introduce a strict-inequality version of the modulo-comparison for this purpose.
2023-01-22BFD: Improve incoming packet matchingOndrej Zajicek
For active sessions, ignore received packets with zero local id and mismatched remote id. That forces a session timeout instead of an immediate session restart. It makes BFD sessions more resilient to packet spoofing. Thanks to André Grüneberg for the suggestion.
2023-01-22VRF: Fix issues with reconfigurationOndrej Zajicek
Protocols receive if_notify() announcements that are filtered according to their VRF setting, but during reconfiguration, they access iface_list directly and forgot to check VRF setting here, which leads to all interfaces be addedd. Fix this issue for Babel, OSPF, RAdv and RIP protocols. Thanks to Marcel Menzel for the bugreport.
2023-01-20BGP: Add received role value to role mismatch log messageOndrej Zajicek
2023-01-13Minor cleanupsOndrej Zajicek
2023-01-03BGP: Allow role specific keywords to be used as symbolsOndrej Zajicek
Some of these new BGP role keywords use generic names that collides with user-defined symbols. Allow them to be redefined. Also remove duplicit keyword definition for 'prefer'.
2023-01-03Nest: Fix leaking internal attributes in RIP and BabelOndrej Zajicek
During backporting attribute changes from 3.0-branch, some internal attributes (RIP iface and Babel seqno) leaked to 'show route all' output. Allow protocols to hide specific attributes with GA_HIDDEN value. Thanks to Nigel Kukard for the bugreport.
2023-01-01Nest: Fix several issues with pflagsOndrej Zajicek
There were some confusion about validity and usage of pflags, which caused incorrect usage after some flags from (now removed) protocol- specific area were moved to pflags. We state that pflags: - Are secondary data used by protocol-specific hooks - Can be changed on an existing route (in contrast to copy-on-write for primary data) - Are irrelevant for propagation (not propagated when changed) - Are specific to a routing table (not propagated by pipe) The patch did these fixes: - Do not compare pflags in rte_same(), as they may keep cached values like BGP_REF_STALE, causing spurious propagation. - Initialize pflags to zero in rte_get_temp(), avoid initialization in protocol code, fixing at least two forgotten initializations (krt and one case in babel). - Improve documentation about pflags
2022-12-24Babel: Rework seqno request handlingToke Høiland-Jørgensen
The seqno request retransmission handling was tracking the destination that a forwarded request was being sent to and always retransmitting to that same destination. This is unnecessary because we only need to retransmit requests we originate ourselves, not those we forward on behalf of others; in fact retransmitting on behalf of others can lead to exponential multiplication of requests, which would be bad. So rework the seqno request tracking so that instead of storing the destination of a request, we just track whether it was a request that we forwarded on behalf of another node, or if it was a request we originated ourselves. Forwarded requests are not retransmitted, they are only used for duplicate suppression, and for triggering an update when satisfied. If we end up originating a request that we previously forwarded, we "upgrade" the old request and restart the retransmit counter. One complication with this is that requests sent in response to unfeasible updates (section 3.8.2.2 of the RFC) have to be sent as unicast to a particular peer. However, we don't really need to retransmit those as there's no starvation when sending such a request; so we just change such requests to be one-off unicast requests that are not subject to retransmission or duplicate suppression. This is the same behaviour as babeld has for such requests. Minor changes from committer.
2022-12-10BGP: Log unacceptable hold time as decimal numberOndrej Zajicek
Thanks Johannes Moos for the suggestion.
2022-12-09BGP: Improve handling of hold and keepalive timersOndrej Zajicek
The effective keepalive time now scales relative to the negotiated hold time, to maintain proportion between the keepalive time and the hold time. This avoids issues when both keepalive and hold times were configured, the hold time was negotiated to a smaller value, but the keepalive time stayed the same. Add new options 'min hold time' and 'min keepalive time', which reject session attempts with too small hold time. Improve validation of config options an their documentation. Thanks to Alexander Zubkov and Sergei Goriunov for suggestions.
2022-10-10BGP: Add option 'next hop prefer global'Ondrej Zajicek
Add BGP channel option 'next hop prefer global' that modifies BGP recursive next hop resolution to use global next hop IPv6 address instead of link-local next hop IPv6 address for immediate next hop of received routes.
2022-10-03BGP: Some fixes related to VRF and MPLS interactionsOndrej Zajicek
- When next hop is reset to local IP, we should remove BGP label stack, as it is related to original next hop - BGP next hop or immediate next hop from one VRF should not be passed to another VRF, as they are different IP namespaces
2022-10-03BGP: Do not assume that all channels are struct bgp_channelOndrej Zajicek
In principle, the channel list is a list of parent struct proto and can contain general structures of type struct channel, That is useful e.g. for adding MPLS channels to BGP.
2022-10-03RPKI: wait for retry_time if we get error immediately after connectedMaria Matejka
2022-08-18Simplified the protocol hookup code in MakefilesMaria Matejka
2022-08-03Merge commit '082905a8' into HEADMaria Matejka
2022-08-03rip_rte_better() uses the IGP_METRIC_UNKNOWN instead of protocol-specific ↵Maria Matejka
infinity
2022-07-24Merge branch 'master' into backportOndrej Zajicek
2022-07-22Fixed a rarely used part of Babel: comparing two routes in table by their metricMaria Matejka
2022-07-12BGP: Minor improvements to BGP rolesOndrej Zajicek
Add support for bgp_otc in filters and warning for configuration inside confederations.
2022-07-11BGP: Implement BGP rolesEugene Bogomazov
Implement BGP roles as described in RFC 9234. It is a mechanism for route leak prevention and automatic route filtering based on common BGP topology relationships. It defines role capability (controlled by 'local role' option) and OTC route attribute, which is used for automatic route filtering and leak detection. Minor changes done by commiter.