cloudflare / cloudflare/udpgrm

feature: Support ICE(Interactive Connectivity Establishment) protocol

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
155
Forks
9
PR merge metrics
No merged PRs in 30d

Description

This is a nitche use-case to be honest, but it is a good example of extending BESPOKE and combining it with FLOW dissector imo.

We are currently operating a lot of webrtc clients that uses ICE in shared UDP single port mode. They acting kind of like QUIC server, for every 4-tuple UDP connection, an `ufrag` (like dcid) will exist in the STUN header, but only for the initial and heartbeat packets. Subsequent data packets is pure UDP and does not have STUN attributes in them.

Thus, the flow becomes:
``` mermaid
flowchart TD
BESPOKE_Ufrag -->|Yes| Lookup[Lookup ufrag in
ufrag_cookie_map]
BESPOKE_Ufrag -->|No - Not STUN| ComputeHash

Lookup -->|Found| Cookie[Return socket cookie
IERR_OK]
Lookup -->|Not found| ComputeHash[Compute IP flow hash
goto have_hash]

Cookie --> FlowAssure[Flow assure with hash]
```

Essentialy, BESPOKE_ICE parse the potential STUN header and look for ufrag in it, on success, assure the flow in hash; if failed, fallback to FLOW dissector.

I have a working implementation that works with forked [pion/ice](https://github.com/kuroa-me/ice/blob/master/udp_mux_ebpf.go). Cloudflare contribution.md requires feature request issue before PR. So if this interests you, I am happy to provide more details and make a draft PR.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.