Search code examples
webrtcrfcstunturn

Binding Request inside Data attribute of Send Indication


When two peers are using WebRTC transmission with TURN as a relay server we've noticed that from time to time the data inside Send Indication or Channel Data is actually a valid STUN Binding Request message (type 0x0001). The other peer responds in the same way with a valid Binding Request Response (type 0x0101). It happens repeatedly during the whole conversation. Both peers are forced to use TURN server. What is the purpose of encapsulating typical STUN message inside data attribute of TURN transmission frame? Is it described in any document?

Here is an example of Channel Data frame:

[0x40,0x00,0x00,0x70,0x00,0x01,0x00,0x5c,0x21,0x12,0xa4,0x42,0x71,0x75,0x6d,0x6a,0x6f,0x66,0x69,0x6f...]

0x40,0x00 - channel number 0x00,0x70 - length of data 0x00,0x01,0x00,0x5c,0x21,0x12... - data, that can be parsed to a Binding Request


Solution

  • This is ICE (described in RFC 5245) connectivity checks running via TURN as well as consent checks described in RFC 7675.