Subject: R: [Sip] Symmetric response routing -> Or where to return a response to?

From: "Giacomo Vacca" <[email-masked]>
Date: Wed, 19 May 2004 17:57:33 +0200

"RFC 3581 states that SIP, when used with UDP, returns responses to the IP
adress the request came from and to the port number contained in the topmost
Via header of that request. This behaviour introduces a "hybrid" way of
determining where to return the response to. 

I am somewhat surprised that the above behaviour is supposed to be SIP's
"default"
behaviour. The Via header will always contain a host name and may contain a
port number. Wouldn't it then be the logical thing to do to return the
response to the host address specified in the Via header? "

The problem is that a SIP UA may send a message from one port, and wait for
the answer to another port (i.e. send REGISTER from IP:4000, while listening
for incoming SIP messages in IP:5060). Furthermore, if a UA is behind a NAT,
IP and port in the Via header may be unreachable from outside the NAT and so
the need is to send the answer to IP and port from wich the request arrived
(i.e. Via: sip:[email-masked]:5060, but the request comes from 217.1.0.0:9000,
that is the "hole" in the NAT)

Bye
Giacomo

_______________________________________________
Sip mailing list  https://www1.ietf.org/mailman/listinfo/sip
This list is for NEW development of the core SIP Protocol Use
[email-masked] for questions on current sip Use
[email-masked] for new developments on the application of sip

__________ NOD32 1.767 (20040518) Information __________

This message was checked by NOD32 antivirus system.
http://www.nod32.com

_______________________________________________
Sip mailing list  https://www1.ietf.org/mailman/listinfo/sip
This list is for NEW development of the core SIP Protocol
Use [email-masked] for questions on current sip
Use [email-masked] for new developments on the application of sip

---

From: gautham <[email-masked]>
Date: Thu, 20 May 2004 10:23:28 +0530

Hi,

In SIP, responses are required to traverse the same set of entities 
traversed by the request in the reverse order.
This is so that these entities can give up any transaction state that 
they may have for purposes of retransmission etc.
It is to aid this that resposnses are sent to the IP address the request 
came from. The source port is not used since it
would typically be an ephemeral port and so that the client/server can 
listen on a single port for both requests and responses.

Section 18.2.2 of 3261 gives the procedures for selecting where to send 
responses. The 'maddr' parameter is used if it
is present. If not, the 'received' parameter is used. This is the second 
choice. The 'received' parameter which contains the source IP
address is added by the UAS if the 'via' in the request contains a host 
name or if it contains an IP address different from the source IP address.
If sending to either of these fails, or there is no 'received' 
parameter, the steps given in 3263 need to be followed.

Hope this helps.

Regards,
A. N. Gautham

[email-masked] wrote:

>RFC 3581 states that SIP, when used with UDP, returns responses to the IP 
>adress
>the request came from and to the port number contained in the topmost Via 
>header
>of that request. This behaviour introduces a "hybrid" way of determining 
>where
>to return the response to. 
>
>behaviour. The Via header will always contain a host name and may contain 
>a port
>number. Wouldn't it then be the logical thing to do to return the response 
>to the 
>host address specified in the Via header? 
>
>Furthermore, it may well be the case that the Via header does not contain 
>a port 
>number.What should the behaviour be in such a case? Should the response be 
>sent
>to the default port (5060 if SIP is used) or should it be sent to the 
>source port
>in the UDP header of the request?
>
>Cheers,
>
>Frank
>

---

From: Jonathan Rosenberg <[email-masked]>
Date: Thu, 20 May 2004 16:31:04 -0400

> host address specified in the Via header? 

The protocol was designed this way to allow listening for requests and 
responses on a single port, while at the same time using ephemeral ports 
for sending, so that ICMP errors could be collected. It was done before 
NATs, and specifically NAT-PT, were the plague that they are now.

> in the UDP header of the request?

5060.

Also note that TCP behavior is as expected, and that responses are sent 
over the connection the request came in on, and will thus traverse NAT fine.

-Jonathan R.

-- 
Jonathan D. Rosenberg, Ph.D.                600 Lanidex Plaza
Chief Technology Officer                    Parsippany, NJ 07054-2711
dynamicsoft
[email-masked]                     FAX:   (973) 952-5050
http://www.jdrosen.net                      PHONE: (973) 952-5000
http://www.dynamicsoft.com