Subject: Re: [Sip] What is the port number in "Invite" request-line? Thanks

From: "Attila Sipos" <[email-masked]>
Date: Wed, 4 Jun 2008 11:22:26 +0100

It is possible to have two instances of a UA (for example) on one unit.

So using the port is theoretically one way to differentiate between
instances.
 
It's not useless.  If you get a Contact header with a port then you have
to send to that port (discounting NAT traversal scenarios) otherwise
everything will break.
 
>>Or is the port number is which the UAS is listening to? How the UAC
knows it is 5555 if so? 
 
A UAC might not know but a proxy/registrar might - for example if a user
was registered with
the Contact as port 5555, then requests to that user will get forwarded
to port 5555.
Another user using, for example, port 5556 will register using a Contact
with 5556
and so will receive requests to that port.
 
Regards,

Attila

________________________________

From: [email-masked] [mailto:[email-masked]] On Behalf Of
Yuantao Zhang
Sent: 04 June 2008 11:10
To: [email-masked]; [email-masked]
Subject: [Sip] What is the port number in "Invite" request-line? Thanks

Dear all

INVITE sip:[email-masked] SIP/2.0:5555

INVITE sip:[email-masked] SIP/2.0

Above are 2 "Invite" request-line examples. In example one, it indicates
a port number, 5555. What does the port number mean? 

Is it the port number of SIP proxy? Why we include port number here? The
SIP proxy(biloxi.com) application layer who receives this "Invite"
should receive this via port 5555 from lowe layer(UDP). Therefore, The
SIP proxy(biloxi.com) application layer already know the port is 5555.
Actualy, the SIP proxy application layer keeps listening port 5555. 

The second "Invite" request-line example is from RFC3261 and does not
include port number. Can I say the port number is useless? So why
example one includes a useless part in "Invite" request-line URL? 

Or is the port number is which the UAS is listening to? How the UAC
knows it is 5555 if so? 

Any standard on this port number issue? Thanks. 

Best regards

Steven

_______________________________________________
Sip mailing list  https://www.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: Paul Kyzivat <[email-masked]>
Date: Wed, 04 Jun 2008 08:44:39 -0400

> and so will receive requests to that port.

Right. This illustrates a good point:

In general a UAC should not be expected to know "what port a UAS listens 
on". All A UAC should be doing is sending requests to URIs that it has 
been given. If the URI it is given contains a port number, then it 
should honor that.

This gets bent out of shape a bit by numeric dialing, where the UAC is 
only given a dial string and must derive a URI from it. The "standard" 
way to do this is via ENUM, where effectively the numeric address is 
looked up in a DB to obtain a URI. In that case again the UAC has been 
"given" the URI, which may have a port or not.

In the non-standard but common case where the UAC *constructs* a URI 
from a dial string, the UAC must still be *told* what to use for the 
remainder of the URI.

	Paul

---

From: "Yuantao Zhang" <[email-masked]>
Date: Fri, 6 Jun 2008 11:30:48 +0800

Dear all 

Thanks for your reply. Please let me ask my question in another way.

===============================================================
UDP:
Src port: 5060
Dst port: 5555        *<--------------
===============================================================
SIP:
INVITE sip:[email-masked]:5555 SIP/2.0  *<--------------
Via: SIP/2.0/UDP 192.168.100.3:5060;rport;branch=z9hG4bK27195
From: <sip:[email-masked]>;tag=27266
To: <sip:[email-masked]:5555>
Call-ID: [email-masked]
CSeq: 20 INVITE
Contact: <sip:[email-masked]:5060>
===============================================================

The above "Invite" message is over UDP. In the UDP part (Transport layer), the Destination port is 5555. In the SIP part (application layer), the port in the "Invite" request-line URL is 5555 too. Both of them are same. In which case the port in "Invite" request-line URL is different from the Destination port in lower layer UDP? Furthermore, if they are always same why we include redundant information (the port number) in "Invite" request-line URL? What happens if the port in "Invite" request-line URL is different from the Destination port in lower layer UDP? 

Thank you very much

Best Regards
Yuantao
-----Original Message-----
From: Paul Kyzivat [mailto:[email-masked]] 
Sent: 2008年6月4日 20:45
To: Attila Sipos
Cc: Yuantao Zhang; [email-masked]; [email-masked]
Subject: Re: [Sip] What is the port number in "Invite" request-line? Thanks

	Paul

From: [email-masked] [mailto:[email-masked]] On Behalf Of Yuantao Zhang
Sent: 04 June 2008 11:10
To: [email-masked]; [email-masked]
Subject: [Sip] What is the port number in "Invite" request-line? Thanks
Dear all
INVITE sip:[email-masked] SIP/2.0:5555
INVITE sip:[email-masked] SIP/2.0
Above are 2 “Invite” request-line examples. In example one, it indicates a port number, 5555. What does the port number mean? 
Is it the port number of SIP proxy? Why we include port number here? The SIP proxy(biloxi.com) application layer who receives this "Invite" should receive this via port 5555 from lowe layer(UDP). Therefore, The SIP proxy(biloxi.com) application layer already know the port is 5555. Actualy, the SIP proxy application layer keeps listening port 5555. 
The second “Invite” request-line example is from RFC3261 and does not include port number. Can I say the port number is useless? So why example one includes a useless part in “Invite” request-line URL? 
Or is the port number is which the UAS is listening to? How the UAC knows it is 5555 if so? 
Any standard on this port number issue? Thanks. 
Best regards
Steven

---

From: Paul Kyzivat <[email-masked]>
Date: Fri, 06 Jun 2008 07:55:02 -0400

The URI typically exists before the message is constructed. Then a
message is constructed and the URI included in it. The URI specifies
where the message is *intended* to go. And it might not go there
immediately. Instead it may first go to a proxy. When it gets there the
proxy needs to consult the R-URI to know where the message is intended
to go.

When the last hop to the final destination is made it is true that the
port number, and the ip address, may be redundant. But we don't expect
the intermediate nodes to remove the information. The recipient may do
as it wishes if it receives a request with addressing that is
inconsistent with where it is received.

	Paul

Yuantao Zhang wrote:
> Dst port: 5555        *ß------------
> 
> INVITE sip:[email-masked]:5555 SIP/2.0  *ß------------
> 
> The above "Invite" message is over UDP. In the UDP part (Transport 
> layer), the Destination port is 5555. In the SIP part (application 
> layer), the port in the "Invite" request-line URL is 5555 too. Both of 
> them are same. In which case the port in "Invite" request-line URL is 
> different from the Destination port in lower layer UDP? Furthermore, if 
> they are always same why we include redundant information (the port 
> number) in "Invite" request-line URL? What happens if the port in 
> "Invite" request-line URL is different from the Destination port in 
> lower layer UDP?
> 
> Thank you very much
> 
> Best Regards
> 
> Yuantao
> 
> ***From:* [email-masked] [mailto:[email-masked]]*** On 
> Behalf Of* Yuantao Zhang
> ***Sent:* 04 June 2008 11:10
> ***To:* [email-masked]; [email-masked]
> ***Subject:* [Sip] What is the port number in "Invite" request-line? Thanks
> 
> Dear all
> 
> Above are 2 “Invite” request-line examples. In example one, it indicates 
> The second “Invite” request-line example is from RFC3261 and does not 
> example one includes a useless part in “Invite” request-line URL?
>

---

From: "Yuantao Zhang" <[email-masked]>
Date: Mon, 9 Jun 2008 10:34:46 +0800

------------------     -------------------         -------------------
|UA1		  |	|SIP proxy	    |	      |UA2		  |
|IP:192.168.100.1|-----|IP: 192.168.100.2 |--------|IP: 192.168.100.3 |
|Port: 1111	  |	|Port: 2222        |	      |Port: 3333        |
------------------	--------------------         -------------------

If UA1 makes call to UA2, UA1 should send the following message to the SIP proxy:

===============================================================
IP: 
Src: 192.168.100.1
Dst: 192.168.100.2
===============================================================
UDP:
Src port: 1111
Dst port: 2222        						   !
===============================================================
SIP:
INVITE sip:[email-masked]:2222 SIP/2.0  			   !
Via: SIP/2.0/UDP 192.168.100.1:1111;
===============================================================

Then SIP proxy sends the following message to UA2:

===============================================================
IP: 
Src: 192.168.100.2
Dst: 192.168.100.3
===============================================================
UDP:
Src port: 2222
Dst port: 3333        						   !
===============================================================
SIP:
INVITE sip:[email-masked]:3333 SIP/2.0  			   !
Via: SIP/2.0/UDP 192.168.100.2:2222;
Via: SIP/2.0/UDP 192.168.100.1:1111;
===============================================================

UAC(UA1) does not know the port of UAS(UA2). All the UAC needs to know is the proxy's port. And the proxy knows all the ports of UAs under it (UAs tell proxy when register). Therefore, the proxy does not care the port number in the received "Invite" request-linen (because the port number is proxy itself)

Therefore, the port number in the "Invite" request-line is always same with the port number in the lower layer UDP. Why we insert redundant information? How about we drop this redundant and confusing port number in the URL? Please correct me if I am wrong. Thanks.

Best regards
Yuantao Zhang

-----Original Message-----
From: Paul Kyzivat [mailto:[email-masked]] 
Sent: 2008年6月6日 19:55
To: Yuantao Zhang
Cc: Attila Sipos; [email-masked]; [email-masked]
Subject: Re: [Sip] What is the port number in "Invite" request-line? Thanks

	Paul

---

From: Paul Kyzivat <[email-masked]>
Date: Mon, 09 Jun 2008 07:52:43 -0400

OK, if you are talking about a case with a proxy/registrar, then when
the proxy does the translation, it does so by by takking the URI that
was provided in REGISTER and placing it into the R-URI. Then it routes
based on the revised message.

The whole system of routing sip messages is based on URIs. The URI *may*
contain a port, or the port may be discovered using DNS.

I guess you are proposing some entirely different system for managing
the routing of sip messages. But you are 8 or 9 years too late for that.

	Thanks,
	Paul

Yuantao Zhang wrote:
> UAC(UA1) does not know the port of UAS(UA2). All the UAC needs to know 
> is the proxy's port. And the proxy knows all the ports of UAs under it 
> (UAs tell proxy when register). Therefore, the proxy does not care the 
> port number in the received "Invite" request-linen (because the port 
> number is proxy itself)
> 
> Therefore, the port number in the "Invite" request-line is always same 
> with the port number in the lower layer UDP. Why we insert redundant 
> information? How about we drop this redundant and confusing port number 
> in the URL? Please correct me if I am wrong. Thanks.
> 
> Best regards
> 
> Yuantao Zhang
>

---

From: "Yuantao Zhang" <[email-masked]>
Date: Tue, 10 Jun 2008 10:19:47 +0800

Dear Paul 

Thanks for keeping answering my question. And it is happy to discuss with you. Could you give me a scenario that the port number in R-line and the lower layer UDP destination port are different? They are always same, aren't they? Thanks

Best regards
Yuantao

-----Original Message-----
From: Paul Kyzivat [mailto:[email-masked]] 
Sent: 2008年6月9日 19:53
To: Yuantao Zhang
Cc: [email-masked]; [email-masked]
Subject: Re: [Sip] What is the port number in "Invite" request-line? Thanks

	Thanks,
	Paul

---

From: "Michael Procter" <[email-masked]>
Date: Tue, 10 Jun 2008 09:13:16 +0100 (BST)

On Tue, June 10, 2008 3:19 am, Yuantao Zhang wrote:
> Dear Paul
>
> Thanks for keeping answering my question. And it is happy to discuss with
> you. Could you give me a scenario that the port number in R-line and the
> lower layer UDP destination port are different? They are always same,
> aren't they? Thanks

No.  Look up 'Loose Routing' in RFC3261 (section 12.2.1.1 may help you). 
A request may be sent to destination other than the one indicated by the
Request-URI.  This may or may not involve different port numbers.

Regards,

Michael

---

From: Paul Kyzivat <[email-masked]>
Date: Tue, 10 Jun 2008 08:51:01 -0400

> Thanks for keeping answering my question. And it is happy to discuss with you. Could you give me a scenario that the port number in R-line and the lower layer UDP destination port are different? Th…

Yes of course I can give an example. If the message contains a Route
header, then it will be sent to the address (and port if present) in the
top Route header. Meanwhile the address (and port) in the R-URI remain,
and will *eventually* be used to route the message when the Route header
has been exhausted.

	Paul

---

From: "Theo Zourzouvillys" <[email-masked]>
Date: Tue, 10 Jun 2008 21:59:04 +0100

> Thanks for keeping answering my question. And it is happy to discuss with you. Could you give me a scenario that the port number in R-line and the lower layer UDP destination port are different? Th…

as well as others examples, there are also these times when a UAC
sends a request and the destination is resolved via SRV - the R-URI
may be sip:example.com, but the port could be anything at all.  Note
however that if a port is explicitly provided in the URI, then this
would not be the case.

 ~ Theo