Skip to content

Comments

controlplane: open source controller/agent#1

Merged
packethog merged 1 commit intomainfrom
feature/controller
Feb 20, 2025
Merged

controlplane: open source controller/agent#1
packethog merged 1 commit intomainfrom
feature/controller

Conversation

@packethog
Copy link
Contributor

No description provided.

@packethog packethog force-pushed the feature/controller branch 6 times, most recently from 26b0f96 to 3ecd967 Compare February 20, 2025 15:27
@packethog packethog self-assigned this Feb 20, 2025
@packethog packethog marked this pull request as ready for review February 20, 2025 15:29
@packethog packethog merged commit 841991a into main Feb 20, 2025
2 checks passed
@packethog packethog deleted the feature/controller branch February 20, 2025 17:45
packethog added a commit that referenced this pull request Jun 11, 2025
### Summary

When a client is subscribed to a multicast group and either shuts down
doublezerod or disconnects their tunnel, the upstream DoubleZero device
was continuing to replicate multicast traffic towards the user for up to
210s due to mroute state not being purged. This was because we were
setting the same holdtime on PIM join and prune messages which dictates
how long an upstream router should maintain join or prune state:

[RFC7761, section 4.9.5](https://datatracker.ietf.org/doc/rfc7761/):
```
   Holdtime
         The amount of time a receiver MUST keep the Join/Prune state
         alive, in seconds.  If the Holdtime is set to '0xffff', the
         receiver of this message SHOULD hold the state until canceled
         by the appropriate canceling Join/Prune message, or timed out
         according to local policy.  This may be used with dial-on-
         demand links, to avoid keeping the link up with periodic
         Join/Prune messages.
```

This PR lowers the holdtime for join messages to 120s and prune messages
to 5s.

### Testing

Create tunnel and verify PIM join is sent w/ 2m holdtime:
```
ubuntu@chi-dn-bm2:~$ doublezero connect multicast subscriber mg01 --device chi-dn-dzd1
DoubleZero Service Provisioning
🔗  Start Provisioning User...
Public IP: 137.174.145.145 (If you want to specify a particular address, use the argument --client-ip x.x.x.x)
🔍  Provisioning User for IP: 137.174.145.145
    Creating an account for the IP: 137.174.145.145
    The Device has been selected: chi-dn-dzd1
    User activated with dz_ip: 137.174.145.145
    User activated with dz_ip: 137.174.145.145
Provisioning: status: ok
/  Connected

ubuntu@chi-dn-bm2:~$ sudo tcpdump -i any -v pim
...
18:04:23.321277 doublezero1 Out IP (tos 0x0, ttl 1, id 12482, offset 0, flags [none], proto PIM (103), length 54)
    chi-dn-bm2 > pim-routers.mcast.net: PIMv2, length 34
        Join / Prune, cksum 0x82ef (correct), upstream-neighbor: 169.254.0.2
          1 group(s), holdtime: 2m
            group #1: 233.84.178.0, joined sources: 1, pruned sources: 0
              joined source #1: 10.0.0.0(SWR)
```

Verify mroute state is created on the dzd:
```
chi-dn-dzd1#show ip mroute
PIM Bidirectional Mode Multicast Routing Table
RPF route: U - From unicast routing table
           M - From multicast routing table
PIM Sparse Mode Multicast Routing Table
Flags: E - Entry forwarding on the RPT, J - Joining to the SPT
    R - RPT bit is set, S - SPT bit is set, L - Source is attached
    W - Wildcard entry, X - External component interest
    I - SG Include Join alert rcvd, P - Programmed in hardware
    H - Joining SPT due to policy, D - Joining SPT due to protocol
    Z - Entry marked for deletion, C - Learned from a DR via a register
    A - Learned via Anycast RP Router, M - Learned via MSDP
    N - May notify MSDP, K - Keepalive timer not running
    T - Switching Incoming Interface, B - Learned via Border Router
    V - Source is reachable via Evpn Tenant Domain
    F - Learned via MVPN
RPF route: U - From unicast routing table
           M - From multicast routing table
233.84.178.0
  0.0.0.0, 0:00:37, RP 10.0.0.0, flags: W
    Incoming interface: Register
    Outgoing interface list:
      Tunnel501
```

Disconnect from group and verify PIM prune is sent w/ 5s holdtime:
```
ubuntu@chi-dn-bm2:~$ doublezero disconnect multicast
DoubleZero Service Provisioning
🔍  Decommissioning User
Public IP: 137.174.145.145 (If you want to specify a particular address, use the argument --client-ip x.x.x.x)
|  deleting user account...                                                                                                                                                                                                                                                                                                                                                                                                                  🔍  Deleting User Account for: 9HKbT49idxD27K2KsH7f9zZHmTS78ANYPhAG6rLtBXnn
🔍  User Account deleted
/  🔍  Deprovisioning Complete

ubuntu@chi-dn-bm2:~$ sudo tcpdump -i any -v pim
...
18:04:39.134883 doublezero1 Out IP (tos 0x0, ttl 1, id 17108, offset 0, flags [none], proto PIM (103), length 54)
    chi-dn-bm2 > pim-routers.mcast.net: PIMv2, length 34
        Join / Prune, cksum 0x8362 (correct), upstream-neighbor: 169.254.0.2
          1 group(s), holdtime: 5s
            group #1: 233.84.178.0, joined sources: 0, pruned sources: 1
              pruned source #1: 10.0.0.0(SWR)

```

Verify mroute state is immediately purged:
```
chi-dn-dzd1#show ip mroute
PIM Bidirectional Mode Multicast Routing Table
RPF route: U - From unicast routing table
           M - From multicast routing table
PIM Sparse Mode Multicast Routing Table
Flags: E - Entry forwarding on the RPT, J - Joining to the SPT
    R - RPT bit is set, S - SPT bit is set, L - Source is attached
    W - Wildcard entry, X - External component interest
    I - SG Include Join alert rcvd, P - Programmed in hardware
    H - Joining SPT due to policy, D - Joining SPT due to protocol
    Z - Entry marked for deletion, C - Learned from a DR via a register
    A - Learned via Anycast RP Router, M - Learned via MSDP
    N - May notify MSDP, K - Keepalive timer not running
    T - Switching Incoming Interface, B - Learned via Border Router
    V - Source is reachable via Evpn Tenant Domain
    F - Learned via MVPN
RPF route: U - From unicast routing table
           M - From multicast routing table
chi-dn-dzd1#
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants