summaryrefslogtreecommitdiff
path: root/pimd/pim_msdp_packet.c
AgeCommit message (Collapse)Author
2024-12-12pimd: support originator id configurationRafael Zalamena
Allow user to specify the RP field for the SA messages. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-06pimd: Move ACL handling to pim_util.cCorey Siltala
Move the extended access-list handling from pim_msdp_packet.c to pim_util.c to allow use elsewhere in the daemon. Signed-off-by: Corey Siltala <csiltala@atcorp.com>
2024-11-21pimd,yang: log MSDP SA eventsRafael Zalamena
Add new command to log all SA events. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-07-27pimd: MSDP SA filteringRafael Zalamena
Implement MSDP peer incoming/outgoing SA filter. Note ---- Cisco extended access list has a special meaning: the first address is the source address to filter. Example: ! The rules below filter some LAN prefix to be leaked out access-list filter-lan-source deny ip 192.168.0.0 0.0.255.255 224.0.0.0 0.255.255.255 access-list filter-lan-source permit any router pim msdp peer 192.168.0.1 sa-filter filter-lan-source out ! The rules below filter some special management group from being ! learned access-list filter-management-group deny 230.0.0.0 0.255.255.255 access-list filter-management-group permit any router pim msdp peer 192.168.0.1 sa-filter filter-management-group in Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2023-10-04pimd: Indicating the rp in the msdp sa messageAdriano Marto Reis
Indicating the configured PIM Rendezvous Point (RP) in the MSDP SA message The RFC-3618, section 12.2.1, describes the fields included in the MSDP SA message. The "RP address" field is "the address of the RP in the domain the source has become active in". In the most common case, we will establish an MSDP connection from RP to RP. However, there are cases where we want to establish a MSDP connection from an interface/address that is not the RP. Section 3 of RFC-3618 describes that scenario as "intermediate MSDP peer". Moreover, the RP could be another router in the PIM domain - not the one establishing the MSDP connection. The current implementation could be problematic even with a single router per PIM domain. Consider the following scenario: * There are two PIM domains, each one with a single router. * The two routers are connected via two independent networks. Let's say that is to provide redundancy. * The routers are configured to establish two MSDP connections, one on each network (redundancy again). * A multicast source becomes active on the router 1. It will be communicated to router 2 via two independent MSDP SA messages, one per MSDP connection. * Without these changes, each MSDP SA message will indicate a different RP. * Both RP addresses will pass the RPF check, and both MSDP sources will be accepted. * If the router has clients interested in that multicast group, it will send PIM Join messages to both RPs and start receiving the multicast traffic from both. With the changes included in this commit, the multicast source available in router 1 would still be communicated to router 2 twice. But both MSDP SA messages would indicate the same RP, and one of them would be discarded due to failure in the RPF-check failure. Also, the changes allow us to define the RP that will be included in the MSDP SA message, and it could be one of the interfaces used to establish the MSDP connection, some other interface on the router, a loopback interface, or another router in the PIM domain. These changes should not create compatibility issues. As I mentioned, we usually establish MSDP connections from RP to RP. In this case, the result will be the same. We would still indicate the address used to establish the MSDP connection if the RP is not set - I wonder if that should even be a valid configuration. Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-31pimd: Add missing enums to switch statementDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-12-07pimd: fix MSDP packet debug crashesRafael Zalamena
Add some safe guards to avoid crashes and alert us about programming errors in packet build. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2022-12-07pimd: fix MSDP crash on unexpected TLV sizesRafael Zalamena
Increase the MSDP peer stream buffer size to handle the whole TLV (maximum is 65KiB due to 16bit field). If the stream is not resized there will be a crash in the read function attempting to put more than 9192 (`PIM_MSDP_SA_TLV_MAX_SIZE`) bytes. According to the RFC 3618 Section 12 we should accept the TLV and we should not reset the peer connection. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2022-05-06pimd: un-dependency-hell `pim_instance.h`David Lamparter
This is causing build issues on BSD by including (transitively) `linux/mroute6.h` - try to address by disentangling the headers a bunch. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12bgpd, lib, pimd: Remove sockopt_corkDonald Sharp
sockopt_cork is a no-op function that was cleaned up in 2017. Since then it's still not being used. At this point in time there is little point in keeping a dead function that will not be used because of vagaries between platforms Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-17pimd: remove pim_str_sg_dump()David Lamparter
... and replace with `%pSG` printfrr specifier. This actually used a static buffer in the formatting function, so subsequent formatting would overwrite earlier uses. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-12pimd: `prefix_sg` => `pim_sgaddr`David Lamparter
Mostly just 2 sed calls: - `sed -e 's%struct prefix_sg%pim_sgaddr%g'` - `sed -e 's%memset(&sg, 0, sizeof(pim_sgaddr));%memset(\&sg, 0, sizeof(sg));%g'` Plus a bunch of fixing whatever that broke. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-07-01*: Convert numeric 32 into IPV4_MAX_BITLEN for prefixlenDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-06-25pimd: allow MSDP group name 'default'Rafael Zalamena
Don't assign a default group name for non meshed group peers, instead use a flag. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-25pimd: rework MSDP northbound integrationRafael Zalamena
Simplify the MSDP handling functions and allow source changes. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-10-06pimd: MSDP SA forwardingAdriano Marto Reis
* If the MSDP peer receives the SA from a non-RPF peer towards the originating RP, it will drop the message. * SA messages are forwarded away from the RP address only. * SA messages are not forwarded within the mesh group. * Preventing the MSDP connection from being dropped due to RPF check failure (RFC3618, section 13 "MSDP Error Handling") Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com> Signed-off-by: Adriano Reis <areis@barrukka.local>
2018-09-13*: style for EC replacementsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13*: LIB_[ERR|WARN] -> EC_LIBQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13pimd: PIM_[ERR|WARN] -> EC_PIMQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14*: rename ferr_zlog -> flog_err_sysQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14*: rename zlog_fer -> flog_errQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14pimd: Add pim_errors and define some pim specific errorsDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14pimd: Convert over to use LIB_ERR_XXX for zlog_errDonald Sharp
Convert, where appropriate, the zlog_err functions to zlog_ferr for the LIB_ERR_XXX enums Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-01*: don't use deprecated stream.h macrosQuentin Young
Some of the deprecated stream.h macros see such little use that we may as well just remove them and use the non-deprecated macros. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-24pimd: Push 'struct pim_instance *' a bit furtherDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Fix intentional pass of NULLDonald Sharp
pim_msdp_pkt_sa_gen is intentionally passed mp as NULL in some cases, so we need to pass through the pim instance Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Make msdp `struct pim_instance *` awareDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24pimd: Make pim MSDP pim instance aware to some extentDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-21pimd: increase the maximum msdp TLV burst to 100 from 12anuradhak
12 is too slow of a slow-start in scale setup (say with 6000 SAs) when sources are being learnt one at a time (but in a rapid fire fashion). Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21pimd: Add debug logs to help find problems with stream_readanuradhak
Logs only. No functional change Ticket: CM-13852 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21pimd: restart the ka timer after the sa adv timeranuradhak
To avoid unnecessary ka activity in the network. When the SA advertisment timer fires we build SA TLVs and send them to peers. As a part of this tx we were also restarting the ka timer to avoid unnecessary ka generation in the next 60 seconds. However because the adv timer was restarted after tx (i.e. after ka restart) ka timer would always endup firing just before the adv timer.
2016-12-21pimd: Fix the number of SAs pushed into one MSDP SA-TLVanuradhak
The entry_cnt in a SA TLV is one byte. I was trying to push 765 SAs into each TLV resulting in strange problems in a scale setup. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21pim-msdp: CLI and debug cleanupanuradhak
No functional change. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21pim-msdp: part-3: use SA cache for setting up SPTsanuradhak
1. Added a new MSDP source reference flag for creating (S,G) entries based on the SA-cache. The RFC recommends treating as SA like rxing a (S, G) join (which is a bit different then treating like a traffic stream). 2. SA-SPT is only setup if we are RP for the group and a corresponding (*,G) exists with a non-empty OIL. 3. When an SA is moved we need to let the SPT live if it is active (this change will come in a subsequent CL). Testing done: 1. SA first; SPT setup whenever (*, G) comes around. 2. (*, G) first. As soon as SA is added SPT is setup. 3. (*, G) del with valid SA entries around. Ticket: CM-13306 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pim-msdp: part-2: SA cache supportanuradhak
This commit includes - 1. Maintaining SA cache with local and remote entries. 2. Local SA entries - there are two cases where we pick up these - - We are RP and got a source-register from the FHR. - We are RP and FHR and learnt a new directly connected source on a DR interface. 3. Local entries are pushed to peers immediately on addition and periodically. An immediate push is also done when peer session is established. 4. Remote SA entries - from other peers in the mesh group and passed peer-RPF checks. 5. Remote entries are aged out. No other way to del them currently. In the future we may add a knob to flush entries on peer-down. Testing done - Misc topologies with CL routers plus basic interop with another vendor ( we can process their SA updates and they ours). Sample output - root@rp:~# vtysh -c "show ip msdp sa" Source Group RP Uptime 33.1.1.1 239.1.1.2 local 00:02:34 33.1.1.1 239.1.1.3 local 00:02:19 44.1.1.1 239.1.1.4 100.1.3.1 00:01:12 44.1.1.1 239.1.1.5 100.1.3.1 00:00:55 root@rp:~# Ticket: CM-13306 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pim-msdp: part-1 - initial protocol infra.anuradhak
This commit includes the following changes - 1. Support for MSDP peer DB (hash and sorted list). 2. Support for the following timers - keepalive, connect-retry, hold. 3. TCP session management (lower-ip is active, higher-ip is passive). 4. MSDP KA packet rx/tx. 5. Limited temporary config (will be replaced with the more automation friendly RP-set). Testing done - Peer bringup/deletion (including interop with another vendor) Sample out - root@dell-s6000-04:~# sudo vtysh -c "show ip msdp peer" Peer Local Mesh-group State Uptime 100.1.1.1 100.1.2.1 default established 00:07:27 100.1.3.1 100.1.2.1 default established 00:31:50 root@dell-s6000-04:~# Coming soon - 1. part-2: SA cache management. 2. part-3: SPT setup using source in SA cache. 3. part-4: CLI cleanup. Ticket: CM-13306 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>