WebRTC Beginner Question about STUN Ping

2,385 views
Skip to first unread message

askin chokkatravo

unread,
Apr 26, 2017, 8:59:18 AM4/26/17
to discuss-webrtc
Hi all,

I am just the beginner of the WebRTC stack. In the process of learning I read about the ICE, and got few questions and would like to get wisdom on it from you. 

Question is all about the STUN server ping request.  Below is my understanding. correct me if i am wrong.

My Understanding:
--------------------------


1) STUN SERVER is used to find IP/PORT binding allocated by the NAT.

2) Two different interesting stun requests are available. 
        1) Shared Secret Request,
        2) Binding Request. 

3) The credentials shared by Shared Secret Requests are used in Binding Request as one of the attribute. 

Question:
-------------

4) Is there anything called "STUN Ping"  for which the related log i am seeing very frequently?,  My first guess about STUN ping is to check if the connection exists or not?. is this right?

(port.cc:607): Jingle:Port[0x2cf3dc0:sdparta_0:1:0:local:Net[eth0:192.168.0.0/24:Unknown]]: Sent STUN ping response, to=XX.XXX.XXX.XXX:12345, c

5) What are the possible scenarios STUN Ping is invoked?. is it all the time or whenever there is a failure when sending data over network ?


Kindly provide insight. 


Taylor Brandstetter

unread,
Apr 26, 2017, 8:09:04 PM4/26/17
to discuss-webrtc
4) Is there anything called "STUN Ping"  for which the related log i am seeing very frequently?,  My first guess about STUN ping is to check if the connection exists or not?. is this right?

Yes, that's basically it. Our code uses the term "STUN ping" to refer to ICE connectivity checks. They're used when ICE starts, to find an initial candidate pair (connection), and are still sent at a lower rate afterwards to keep the connection state up to date, and to ensure the other peer still consents to receiving media.

5) What are the possible scenarios STUN Ping is invoked?. is it all the time or whenever there is a failure when sending data over network ?
 
As mentioned above, they will be sent all the time. Though the rate depends on the current state; more pings will be sent if the connection is broken, to try to recover quickly. Note that this isn't a standard ICE thing; RFC5245 specifies a fixed connectivity check interval ("Ta"), and doesn't talk about sending connectivity checks after ICE completes.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/bb232a32-d73c-4941-a19c-758bd609aad9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

shakeeb nazmus

unread,
Apr 28, 2017, 12:26:27 AM4/28/17
to discuss-webrtc
The answer provided by Taylor is perfect. I like to add few more things 

>>My first guess about STUN ping is to check if the connection exists or not?. is this right?

Yes. I think one more thing is associated with STUN ping. When one client is behind NAT, It must send receive something within certain interval otherwise, NAT will close the mapping. So STUN ping also helps to keep firewall's mapping open when there is no data to send receive.

>>5) What are the possible scenarios STUN Ping is invoked?    

Chrome's existing implementation will send STUN Ping all the times. But there is no necessity of sending STUN Ping when the client is actively receiving data. 
Maybe this feature will be implemented in the chrome in the future.    
Reply all
Reply to author
Forward
0 new messages