[SIPForum-discussion] Max forwards geting added by proxies

Gottfried, Hal F hal.gottfried at verizon.com
Thu Jan 24 21:41:44 UTC 2013


Vijay -

I think I understand your concern. You're thinking "I send a call out via my UAC which hits an outbound proxy, that outbound proxy then adds an entry for Max-Forwards with a value of 70. But what as it's routing through the network of devices to get to the UAC at the other end one of the other proxies adds a new Max-Forwards field starting at 70 to the packet".

You are basically concerned that the Max-Forwards field can be "lost" or "reset" somewhere along the way during the life of a packet. Okay, I can understand that, but that's not how it works.

Keep in mind how the Max-Forwards request-header field works.... It is used with the TRACE and OPTIONS requests type and when a server looks at the header containing a Max-Forwards field the server MUST check and update its value prior to forwarding the request. If the received value is zero (0) or missing the recipient MUST NOT forward the request; instead, it MUST respond as the final recipient.

Now with that in the back of our mind, let's think of what else we already know ... for example the Max-Forwards field is mandatory from a UAC and the proxies must check for it and update it if it exists. But then again those proxies are also a little smarter than the appear as they are also looking at what is expected in that header, not so much how high or low the Max-Forwards number is but does it exist if it is expected to exist.

That then raises the inquiry of how the proxy knows that if the field is supposed to exist or not.

Understanding the flow is of these messages is most important to understand how the header is validated. Let's consider a standard session that runs through a proxy server.


[cid:image006.jpg at 01CDFA49.4FE3D3E0]

During the INVITE or handshake is when the UA is going to attach the Max-Forwards field to the header.



Hal F. Gottfried
Sr Consultant, Contact Center Consulting & Services

From: Vijay Kumar [mailto:vj.tech776 at gmail.com]
Sent: Thursday, January 24, 2013 11:36 AM
To: Gottfried, Hal F
Cc: Vijay Badola; discussion at sipforum.org
Subject: Re: [SIPForum-discussion] Max forwards geting added by proxies

Gottfried, Hal F

If outbond proxy adds it no problem.
(What i mean here outbond is my first proxy to UAC when Messages are sent out)
 If intermediate proxies(after Outbond proxy for outgoing request)  start adding Max header feilds, then i feel it can be problem.
This is beacuse i feel , if Max header feild is lost at Nth proxy then this proxy may add it with recomended values .
I feel this may be cumulative  if proxies other than outbond proxies can add it.
Please correct be if iam ignorant.
Regards
Vijay
On Thu, Jan 24, 2013 at 10:27 PM, Gottfried, Hal F <hal.gottfried at verizon.com<mailto:hal.gottfried at verizon.com>> wrote:
Vijay -

The UAC shouldn't be adding much to the header as that really is just the final train station if you will. When the call moves through a proxy device the MAX-FORWARDS field is modified.  Your question regarding the intermediate proxies is unclear; it is common practice for people often refer to an intermediate SIP proxy (and registration) server as the SIP server, however if you read RFC 3263 (locating SIP servers) it specifically says "SIP end systems are called user agents, and intermediate elements are known as proxy servers" meaning technically that any device that passes SIP traffic on from a UAC would be a proxy server.  So then I would believe the answer to your question would be yes.

The only SIP Server (types) I am aware of are:


*         Proxy server-Receives SIP messages and forwards them to the next SIP server in the network. The proxy server is an intermediate device that receives SIP requests from a client and then forwards the requests on behalf of the client. Proxy servers can provide functions such as authentication, authorization, network access control, routing, reliable request retransmission, and security.



*         Redirect server-Provides the client with information about the next hop or hops that a message should take. The client then contacts the next hop server or UAS directly.



*         Registrar server-Processes requests from UACs for registration of their current location. Registrar servers are often located near a redirect or proxy server.

The registrar server does not handle routing of the call so the MAX-FORWARDS would not be adjusted there.

If a proxy server is used, the caller UA sends an INVITE request to the proxy server. The proxy server determines the path and then forwards the request to the callee.

[cid:image001.jpg at 01CDFA40.2C12C150]

The callee responds to the proxy server, which in turn forwards the response to the caller.

[cid:image002.jpg at 01CDFA40.2C12C150]

The proxy server forwards the acknowledgments of both parties. A session is then established between the caller and callee. Real-Time Transfer Protocol (RTP) is used for the communication between the caller and the callee.

[cid:image003.jpg at 01CDFA40.2C12C150]

If you mean a redirect server when you speak of proxies then no, it will not update as these servers too are not proxies and do not actually route, but simply provide message, in this scenario the caller UA sends an INVITE request to the redirect server. The redirect server contacts the location server to determine the path to the callee, and the redirect server sends that information back to the caller. The caller then acknowledges receipt of the information.

The caller then sends a request to the device indicated in the redirection information (which could be the callee or another server that will forward the request). If that request is sent to a server that is going to forward the request that is another proxy that will modify the MAX-FORWARDS field.

Once the request reaches the callee, it sends back a response (200 OK), and the caller acknowledges the response (ACK). RTP is used for the communication between the caller and the callee.

If you are talking about something different, something I've not mentioned please clarify for example a SIP trace route.

Back to MAX-FORWARDS, as I explained earlier the field is used to count the number of proxies' it has traversed.  You can also use the VIA header field to prevent looking by having the proxy validate if its address is still in the VIA header.  I believe you may have asked about this once before too.

The VIA header will still be required, as one proxy sends message to another proxy on application layer, by creating a new packet (transport and IP layer), and thus sets the TTL to the initial high value instead of decrementing from received IP packet. Detecting loops using the VIA header may be very CPU Intensive, hence Max-Forwards allows you to have a fallback loop prevention.

I hope this helps.


Hal F. Gottfried
Sr Consultant, Contact Center Consulting & Services

From: Vijay Kumar [mailto:vj.tech776 at gmail.com<mailto:vj.tech776 at gmail.com>]
Sent: Thursday, January 24, 2013 10:14 AM
To: Vijay Badola
Cc: Gottfried, Hal F; discussion at sipforum.org<mailto:discussion at sipforum.org>

Subject: Re: [SIPForum-discussion] Max forwards geting added by proxies

Vijay

There may be some ambiguty in RFC OK .
My second question is as below iam pasting from original mail in this mail chain


2. As per 3261 if Max forward Is not added by UAC then SIP outbond proxy Must add Maxforward header feild.
    Can Max-forwarded be added by intermediate proxies as wel l???

(If yes i feel the  purpose of Max forwards header feild  does not serve the purpose.)

Regards
Vijay
On Thu, Jan 24, 2013 at 7:39 PM, Vijay Badola <Vijay.Badola at onmobile.com<mailto:Vijay.Badola at onmobile.com>> wrote:
There are many places in RFCs that show the contradictory meaning. And this also looks as a part of that contradiction.

Regards,
Vijay Badola

From: discussion-bounces at sipforum.org<mailto:discussion-bounces at sipforum.org> [mailto:discussion-bounces at sipforum.org<mailto:discussion-bounces at sipforum.org>] On Behalf Of Vijay Kumar
Sent: Wednesday, January 23, 2013 7:37 AM
To: Gottfried, Hal F
Cc: discussion at sipforum.org<mailto:discussion at sipforum.org>
Subject: Re: [SIPForum-discussion] Max forwards geting added by proxies

Hal F. Gottfried
Agreed, but my question is that why Proxy should add it.
If an outbound proxy gets a request from a UAC then it may add it  no problem.
Can intermediate proxy do this?
Regards
Vijay

On Wed, Jan 23, 2013 at 4:59 AM, Gottfried, Hal F <hal.gottfried at verizon.com<mailto:hal.gottfried at verizon.com>> wrote:
Vijay -
I believe the wordings of the RFC are slightly ambiguous when it comes to the use of the Max-Forwards field.  There was a time when this field was optional although now it has become mandatory. Max-Forwards limits the number of hops a request can make on the way to its destination. It consists of an integer, normally 70 that is decremented by one at each hop. If the Max-Forwards value reaches 0 before the request reaches its destination, it is rejected with a 483 (Too Many Hops) error response.

The real use behind the Max-Forwards mechanism is in that it allows the preventing of a message from entering into an endless loop between a set of proxies.

I hope this helps.

Hal F. Gottfried
Sr Consultant, Contact Center Consulting & Services

From: discussion-bounces at sipforum.org<mailto:discussion-bounces at sipforum.org> [mailto:discussion-bounces at sipforum.org<mailto:discussion-bounces at sipforum.org>] On Behalf Of Vijay Kumar
Sent: Tuesday, January 22, 2013 3:25 AM
To: discussion at sipforum.org<mailto:discussion at sipforum.org>
Subject: [SIPForum-discussion] Max forwards geting added by proxies

Agreed as per RFC 3261 Sec 8.1.1.6   " Max forward is Mandatory header feild in SIP Requests
UAC MUST insert it."

But as per 16.6

"If the copy does not contain a Max-Forwards header field, the proxy MUST add
one with a field value, which SHOULD be 70."

My questions
1.If MAx forwards is a Mandatory parameter then why should proxy add it.( If UAs are not able to add it).

2. As per 3261 if Max forward Is not added by UAC then SIP outbond proxy Must add Maxforward header feild.
    Can Max-forwarded be added by intermediate proxies as wel l???

(If yes i feel the  purpouse of Max forwards header feild  does not serve the purpose.)

Enlighten me please
Thanks in Advance
Vijay



________________________________

DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Further, this e-mail may contain viruses and all reasonable precaution to minimize the risk arising there from is taken by OnMobile. OnMobile is not liable for any damage sustained by you as a result of any virus in this e-mail. All applicable virus checks should be carried out by you before opening this e-mail or any attachment thereto.
Thank you - OnMobile Global Limited.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sipforum.org/pipermail/discussion/attachments/20130124/bf05f4a6/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 9560 bytes
Desc: image001.jpg
URL: <http://sipforum.org/pipermail/discussion/attachments/20130124/bf05f4a6/attachment-0008.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 10707 bytes
Desc: image002.jpg
URL: <http://sipforum.org/pipermail/discussion/attachments/20130124/bf05f4a6/attachment-0009.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 9394 bytes
Desc: image003.jpg
URL: <http://sipforum.org/pipermail/discussion/attachments/20130124/bf05f4a6/attachment-0010.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.jpg
Type: image/jpeg
Size: 18697 bytes
Desc: image006.jpg
URL: <http://sipforum.org/pipermail/discussion/attachments/20130124/bf05f4a6/attachment-0011.jpg>


More information about the discussion mailing list