As said that SIP can locate the user IP with the user's SIP address, then why we need STUN or TURN?

  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Commented Aug 9, 2017 at 15:34

2 Answers 2


STUN or TURN can be used when your SIP device is behind NAT and the device doing the NAT doesn't have an ALG (Application Layer Gateway) that translates your internal IP to your external IP in the SIP messages.

The problem is as follows, let's say by example:

  • phone1: IP (a private network)
  • router1: LAN:, WAN:
  • sipserver1:

Keep in mind that SIP messages are carried by layer 4 protocol UDP.

The SIP registration packet passes through router1, which will translate the source address of the UDP packet from to Thus, sipserver1 will see as source IP. However, the SIP registration message contains the IP address of phone1 in its headers and sipserver1 will use that information, and not the layer 4 (UDP) source address. So the information in the SIP header has precedence. In other words, the registration database of sipserver1 will list as the address of phone1, which is unreachable from sipserver1.

A router equipped with a SIP ALG, will recognize that a SIP message is being carried in a UDP packet, and will also translate the information inside the SIP headers, thus alleviating the need for STUN or TURN. phone1 will then correctly register as Any traffic coming back from sipserver1 destined for phone1 will again be translated by router1 (this is how NAT works).

  • 1
    I appreciate your including information about layers.
    – Thufir
    Commented Feb 17, 2015 at 11:07

I've made a short memo on how SIP and NAT interacts, where I've tried to define problens with SIP over NAT and possibe solutions such as TURN and STUN. https://profcollab.wordpress.com/2015/08/27/nat-and-firewall-traversal-for-sip-and-h-323/ Also you can refer to a book Voice and Video Conferencing Fundamentals (http://www.ciscopress.com/store/voice-and-video-conferencing-fundamentals-9781587052682) which provides a thorough explanation of this question

Not the answer you're looking for? Browse other questions tagged or ask your own question.