# RTP SSRC collision detected: terminating stream

- **ID:** `communication/rtp-ssrc-collision-detected`
- **Domain:** communication
- **Category:** protocol_error
- **Verification:** ai_generated
- **Fix Rate:** 76%

## Root Cause

Two or more RTP participants in the same session are using the same Synchronization Source (SSRC) identifier, causing the RTP stack to terminate one stream to resolve the collision as per RFC 3550 section 8.1.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| FFmpeg 6.1 | active | — | — |
| GStreamer 1.22.0 | active | — | — |
| WebRTC (libwebrtc M120) | active | — | — |
| Janus 1.2.0 | active | — | — |
| MediaSoup 3.10.0 | active | — | — |

## Workarounds

1. **Ensure each RTP participant generates a random SSRC using a cryptographically secure random number generator: in C with GStreamer, set 'gst_rtp_buffer_set_ssrc(buffer, g_random_int())'.** (85% success)
   ```
   Ensure each RTP participant generates a random SSRC using a cryptographically secure random number generator: in C with GStreamer, set 'gst_rtp_buffer_set_ssrc(buffer, g_random_int())'.
   ```
2. **Use RTCP to detect and resolve collisions automatically: enable RTCP support in both sender and receiver, and implement the collision resolution logic from RFC 3550 section 8.2 (send BYE and re-randomize SSRC).** (80% success)
   ```
   Use RTCP to detect and resolve collisions automatically: enable RTCP support in both sender and receiver, and implement the collision resolution logic from RFC 3550 section 8.2 (send BYE and re-randomize SSRC).
   ```

## Dead Ends

- **Manually assign a fixed SSRC value in the RTP sender configuration** — Static SSRC assignment guarantees collisions if multiple senders use the same value; RFC requires SSRC to be randomly chosen to minimize collision probability. (95% fail)
- **Disable SSRC collision detection in the RTP stack** — Disabling collision detection violates RFC 3550 and can cause undetected stream corruption, packet loss, and audio/video desynchronization. (90% fail)
- **Increase the RTP buffer size to absorb the collision** — Buffer size does not affect SSRC collisions; it only affects jitter handling and packet reordering. (85% fail)
