[asterisk-users] Why Nat=yes Nat=no Option?

Alex Balashov abalashov at evaristesys.com
Thu Nov 13 09:19:22 CST 2008


Alex Balashov wrote:
> Klaus Darilion wrote:
> 
>> Actually I would nat=yes always, even if clients are not behind NAT os 
>> otherwise the clietn can put some garbage into the contact header (e.g. 
>> IP address of an upstream provider) and influence routing.
> 
> No.  There is a specific reason RFC 3261 says:
> 
>     "Registration creates bindings in a location service for a particular
>     domain that associates an address-of-record URI with one or more
>     contact addresses.  Thus, when a proxy for that domain receives a
>     request whose Request-URI matches the address-of-record, the proxy
>     will forward the request to the contact addresses registered to that
>     address-of-record."
> 
> This gives the UAC the necessary level of control to determine how it is 
> to be contacted.
> 
> Imagine, for a example, a scenario in which incoming registrations are 
> proxied further upstream for whatever reason - load balancer/distributor 
> perhaps? - by an intermediate element.  Do you really want to use that 
> proximate hop's received IP address in place of the ultimate sending 
> UAC's domain?

In other words, there is a very specific reason why UACs are given the 
power to determine where and how to be contacted by the locator, 
depending on the application.

If the UAS wishes to restrict the ability of registrants to specify a 
contact URI domain that does not match their received IP, or to 
overwrite it with something else, it can do that.  Those are 
configuration options that can be created with Asterisk.  But to enable 
standards-breaking behaviour by default (let alone always) is absurd; 
there very point of specifying a contact binding in registrations is to 
provide the very control and flexibility you are suggesting should be 
taken away.

-- 
Alex Balashov
Evariste Systems
Web    : http://www.evaristesys.com/
Tel    : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599



More information about the asterisk-users mailing list