Is a STUN server necessary, when peers are exchanging ICE messagens?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rodrigo,

1 - Is it necessary to use a STUN server, to the SIP 183 message carries 
the correct IP address and port, where 'A' should send its media?

No, you don't need a STUN server. The STUN binding request that ICE 
sends from B to A will reveal the "server reflexive address" of B's NAT, 
and this new candidate will be added to the list of ICE candidates. This 
is the address that will ultimately succeed for A to send to B. Using an 
external STUN server might determine this address, but also might not, 
depending on your NAT. For sending from B to A, A's "local address", 
which is a public address, will of course work.

2 - By doing a test of this scenario and using WireShark, we can see 
some ICE messages being exchanged between 'A' and 'B'. Why the peers 
send and receive ICE messages? Is it automatically and transparently  
controlled  by PJSIP?


Yes, this is ICE checking all the candidate address, by sending STUN 
binding requests.

3 - If the peers really exchange ICE messages, is it possible to trigger 
such protocol whenever our softphone needs?

Not sure. I'm only familiar with the ICE negotiation happening during 
the INVITE, as PJSIP has it implemented.

4 - I guess that for this specific scenario a STUN server/client will 
not be necessary, because I guess the peers using PJSIP are exchanging 
information about IP address, via ICE, what in some way is substituting 
a STUN work. Am I correct?


Yes, you have it. The ICE messages are STUN binding requests to the 
actual RTP ports that are intended for communication. So both endpoints 
act like STUN servers. When both endpoints are behind NATs it can be 
useful to have a STUN server, and a TURN relay may be necessary.


Regards,


Bill




On 11/20/2015 11:32 AM, Rodrigo Pimenta Carvalho wrote:
>
>
> Dear PJSIP-users,
>
> This is my first time posting to this list and I'm very beginner to 
> the subjects about STUN, ICE and PJSIP.
>
> Currently I'm working in a project with a SIP proxy and softphones. 
> When a softphone 'A' calls another softphone 'B',  'A' will provide 
> early media to 'B' as  depicted in the diagram below.
>
>
> The diagram below doesn't represent what we have implemented already. 
> It just represents what we think we can do with PJSIP, in a overview. 
> That is, this diagram is the representation of what could be our final 
> solution, if the answers for the following questions will be yes.
>
>
>
>               Softphone A (UAC) Softphone B (UAC)
>
>           |-------------------------------------- | 
> |---------------------------------|
>
>           | | |    - Is behind NAT         |
>           | | |    - Run PJSIP + ICE    |
>           | - Has public IP:port | 
> |                                         |
>           | - Run PJSIP in a softphone| |--------------------------------|
>           | - PJSIP + ICE | |
>           | | |
> |---------------------------------------| |
> |                                    |
>                        | ----------------------------------------ICE 
> message ------------------------------------>|
> |                                    |
> |                                    |
> |<----------------------------------------ICE message 
> -------------------------------------|
> |                                    |
> |                                    |
>                        | ----------------------------------------SIP 
> INVETE ------------------------------------->|
> |                                   |
> | |
> |<----------------------------------------SIP 183 
> --------------------------------------------|
> |                                             |
> | .                                              |
> | .                                              |
> | .                                              |
> | .                       |
> |-----------------------------------Early 
> media--------------------------------------------->|
> | |
>
>
> In our solution, one softphone will always has a public IP : PORT. 
> Such softphone 'A' will always be the provider of early media. The 
> softphone 'B' behind NAT will always be the consumer of the early 
> media. I this scenario I ask:
>
>
> 1 - Is it necessary to use a STUN server, to the SIP 183 message 
> carries the correct IP address and port, where 'A' should send its media?
>
>
>
> 2 - By doing a test of this scenario and using WireShark, we can see 
> some ICE messages being exchanged between 'A' and 'B'. Why the peers 
> send and receive ICE messages? Is it automatically and transparently 
> controlled  by PJSIP?
>
>      We run this test without a STUN server.
>
>
>
> 3 - If the peers really exchange ICE messages, is it possible to 
> trigger such protocol whenever our softphone needs?
>
>
>
> 4 - I guess that for this specific scenario a STUN server/client will 
> not be necessary, because I guess the peers using PJSIP are exchanging 
> information about IP address, via ICE, what in some way is 
> substituting a STUN work. Am I correct?
>
>
>
> Any hint will be very helpful!
>
>
> Best regards.
>
>
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Competence Center
> Software
> Ph: +55 35 3471 9200 RAMAL 979
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20151120/67815e09/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux