I'm doing a Java implementation of RFC 3550 (RTP) and I've ran into a little problem:
In chapter 11, paragraph 2, it states that:
(...) A participant MUST NOT assume that the source port of the incoming RTP or RTCP packet can be used as the destination port for outgoing RTP or RTCP packets. When RTP data packets are being sent in both directions, each participant's RTCP SR packets MUST be sent to the port that the other participant has specified for reception of RTCP. (...)
RTP does not have any mechanism to inform of these addresses and ports (that's up to SDP or some other setup protocol), which would lead me to understand this paragraph as "if you're receiving data from an unknown source, just discard it".
But in section 6.3.3 it basically says that when an RTP or non-BYE RTCP packet is received with an unknown SSRC, a new participant should be added to the table.
So to sum up:
- You should add a new participant when an unknown SSRC is received;
- You can't use the packet's source IP/port as the destination of packets for that participant;
- SDP doesn't define the SSRC that will be used by each of the RTP participants;
- You can manually add RTP participants (discovered in other ways) BUT you have no idea what the SSRC's will be.
So the million dollar question is: just how is one supposed to handle unexpected SSRC's?