SIP rport Mechanism

Source: Internet
Author: User
3 Rport 3.1 solution description

The obtained IP address is carried with the received parameter in the via header. In order to obtain port information, we also refer to this method, that is, to specify port information with the rport attribute in the via header.

When Nat is used between the client and the server, the request may create (or refresh) a binding in Nat. In order for the client to receive the response information, this binding must exist during transaction processing. Most Nat bindings have a timeout of more than 1 minute, which exceeds the duration of the non-invite transaction, therefore, the response to the non-invite transaction request only exists when the binding exists. This problem does not exist in invite transactions.

To maintain this binding, the client should resend the invite request every 20 s. This re-sending mechanism must occur after receiving a temporary response.

Of course, the time-out period of about one minute just mentioned is not definite. Sometimes it will be longer than this. At this time, the re-sending mechanism can be slower; otherwise, it can be faster. For more information about these problems, see rfc3489.

If it is a server that supports the rport mechanism, it needs to check whether the via header contains an rport parameter with no value in the received request. If yes, it needs to include the rport value in the response, which is similar to the processing of received.

To traverse symmetric Nat, the response must be sent to the same IP address and port. When a server listens for a request from multiple ports or interfaces, it must remember where the request was sent. For a stable proxy, there is no problem remembering these things during a transmission duration. However, for an unstable proxy, it does not store the status information in the request and response. To meet the requirements of this specification, it needs to encrypt the address and port information to the via header field, when the Response Information arrives, it can extract the encrypted information and put it in the response.

The rport mechanism requires the terminal to support this mechanism, so the application is limited. However, in the Application Scenario (Call Center) of the author, the main problem to be solved is that the agent can traverse in the NAT environment and send information to the server. Because the SIP Soft Phone used by the agent is developed by our company, it can be ensured that rport and received are supported.

3.2 instance

The following is an instance that sends the register information. The request's via header contains the rport parameter with no value, as shown below:

Register SIP: 124.40.120.188: 5060 Sip/2.0
Via: SIP/2.0/udp 124.42.4.203: 15500; branch = z9hG4bK-d8754z-1049ed261d2e643d-1 --- d8754z-; rport
Max-forwards: 70
Contact: <SIP: 19988888888@192.168.2.65: 12344; rinstance = 7cd1c532e92fdb0e>; expires = 0
To: "19988888888" <SIP: 19988888888@124.40.120.188: 5060>
From: "19988888888" <SIP: 19988888888@124.40.120.188: 5060>; tag = 203ba359
Call-ID: yzc4n2iwmzy5owu4mtdkmzy0nwy4owu3njmznmjim2u.
CSeq: 1 register
Allow: Invite, ack, cancel, options, bye, refer, y, message, subscribe, Info
User-Agent: eyeberelease 1105a stamp 56793
Content-Length: 0

The server that is sent supports the rport mechanism. After seeing the rport in the request, the NAT public IP address (124.42.4.203) and port information (15500) obtained by analyzing the UDP packet information) these attributes are sent to the client as sorted Ed and rport respectively:

Sip/2.0 200 OK
Via: SIP/2.0/udp 124.42.4.203: 15500; branch = z9hG4bK-d8754z-1049ed261d2e643d-1 --- d8754z-; rport = 15500; received = 124.42.4.203
From: "19988888888" <SIP: 19988888888@124.40.120.188: 5060>; tag = 203ba359
To: "19988888888" <to 19988888888@124.40.120.188: 5060>; tag =: 0005-0to
Call-ID: yzc4n2iwmzy5owu4mtdkmzy0nwy4owu3njmznmjim2u.
CSeq: 4 register
Allow: Invite, ack, options, bye, cancel, register, info, update, prack, refer, subscribe, publish y, message
Contact: <SIP: 124.40.120.188: 5060>
Content-Length: 0

After the client obtains the response information, it knows the Internet address and port used. In the register information that is sent again regularly, the contact is changed to 124.42.4.203: 15500. For example, the new register information is changed:

Register SIP: 124.40.120.188: 5060 Sip/2.0
Via: SIP/2.0/udp 124.42.4.203: 15500; branch = z9hG4bK-d8754z-1049ed261d2e643d-1 --- d8754z-; rport
Max-forwards: 70
Contact: <SIP: 19988888888@124.42.4.203: 15500; rinstance = 7cd1c532e92fdb0e>; expires = 0
To: "19988888888" <SIP: 19988888888@124.40.120.188: 5060>
From: "19988888888" <SIP: 19988888888@124.40.120.188: 5060>; tag = 203ba359
Call-ID: yzc4n2iwmzy5owu4mtdkmzy0nwy4owu3njmznmjim2u.
CSeq: 2 register
Allow: Invite, ack, cancel, options, bye, refer, y, message, subscribe, Info
User-Agent: eyebeam release 1105a stamp 56793
Content-Length: 0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.