[Live-devel] RTP-over-TCP error

Лисовой Андрей Витальевич A.Lisovoy at transtelematica.ru
Thu Nov 26 02:30:21 PST 2020


Hi!

I found bug (using live.2018.02.18, but in 2020.06.25 RTPInterface.cpp is the same).
It occures when proxyServer used with -t flag (RTP-over-TCP with backend server).
In some cases, like client disconnects or reconnects, backend socket deregistering RTP channels, and only RTCP channels have staying alive. But, before proxied server got PAUSE command, it continue send RTP packets. Proxy interpret packets channel ID as wrong: ("Saw nonexistent stream channel id") and continues search dollar from next byte. And, when found dollar (in RTP payload of not actual channel), it wrongly interpret next byte as channel Id. And when that wrong ID equals one of alive RTCP channels, next two bytes interprets as packet size. So, trying to get that wrongly detected amount of bytes leds to infinitely calling of RTCPInstance::incomingReportHandler1() with same fNumBytesAlreadyRead, that exceeding maxRTCPPacketSize.

Logs looks like:
SocketDescriptor(socket 5)::tcpReadHandler(): Saw nonexistent stream channel id: 0x60
SocketDescriptor(socket 5)::tcpReadHandler(): Saw '$'
SocketDescriptor(socket 5)::tcpReadHandler(): Saw nonexistent stream channel id: 0x19
SocketDescriptor(socket 5)::tcpReadHandler(): Saw '$'
SocketDescriptor(socket 5)::tcpReadHandler(): Saw nonexistent stream channel id: 0x00
SocketDescriptor(socket 5)::tcpReadHandler(): Saw '$'
SocketDescriptor(socket 5)::tcpReadHandler(): reading 46071 bytes on channel 3
SocketDescriptor(socket 5)::tcpReadHandler(): reading 44615 bytes on channel 3
RTCPInstance error: Hit limit when reading incoming packet over TCP. (fNumBytesAlreadyRead (1456) >= maxRTCPPacketSize (1456)).  The remote endpoint is using a buggy implementation of RTP/RTCP-over-TCP.  Please upgrade it!
SocketDescriptor(socket 5)::tcpReadHandler(): reading 44615 bytes on channel 3
RTCPInstance error: Hit limit when reading incoming packet over TCP. (fNumBytesAlreadyRead (1456) >= maxRTCPPacketSize (1456)).  The remote endpoint is using a buggy implementation of RTP/RTCP-over-TCP.  Please upgrade it!
SocketDescriptor(socket 5)::tcpReadHandler(): reading 44615 bytes on channel 3
RTCPInstance error: Hit limit when reading incoming packet over TCP. (fNumBytesAlreadyRead (1456) >= maxRTCPPacketSize (1456)).  The remote endpoint is using a buggy implementation of RTP/RTCP-over-TCP.  Please upgrade it!
and so on.

I think, after getting not actual channel ID, we needs drop full packaet, and only after that try get dollar of next one.

Best regards, Andrey L.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20201126/b3850fcc/attachment.htm>


More information about the live-devel mailing list