SIP_REGISTER.png

A valid SIP request must contain the following header fields: To, From, CSeq, Call-ID, Max-Forwards, and Via. So today, I will use SIP_REGISTER message to be an example to introduce these headers.

 

1. Request-URI (SIP Message):

- It is composed of three parts: command name (like... REGISTER, NOTIFY, INVITE...), request URI and protocol version.

- URI: Uniform Resource Identifier. It's an identifier to distinguish device/user in a live network. (URI ex., Terry@Verizon.com)

- Generally, the content of request URI should be same as To header. But, SIP_REGISTER is an exception. According to the chapter 10.2 of RFC 3261, the “user info” and “@” components of the SIP URI must not be present in SIP_REGISTER. So you can see the headers between Request-URI and To are different in this example.

 

2. From & To:

- The purpose of these two headers is to tell network which user requests for registration. (e.g., Terry@Verizon.com)

- However, we don't set username as "Terry" directly in a live network. Because there could be thousands of users called "Terry" in Version network. The value of “user” is MCC + MNC + Public User Identity (PUI). The PUI is saved in SIM card and different from a phone number. “001” is operator’s MCC/MNC. (e.g., Verizon: MNC == 012, MCC == 310)

- During the process of VoLTE registration (Register/Subscribe/Notify), the From and To header have same contents. Both of them are filled with user's information.

- When a User Agent Client (UAC) sends a SIP_REGISTER to a User Agent Server (UAS), it adds a “tag” behind the From header. UAS also adds a “tag” behind the To header when it replies to the UAC. These tag values in From and To header are different. They identify the peer of a dialog. (If you don’t know what is dialog, maybe you can refer my  article “RFC 3261 – Difference between session, dialog, and transaction in SIP”)

 

3. SIP Call-ID:

- Use of cryptographically random identifiers (RFC – 1750) is the generation of Call-IDs is recommended. It is a globally unique identifier over space and time.

- Request and response SIP message (request + response = a transaction) have same SIP Call-ID. If a UAC re-sends a request to a UAS, it also sets the same SIP Call-ID in the new request message.

- “1.2.3.4” is the IP address of the phone. It is assigned by network once the phone activates EPS bearer with a network.

 

4. CSeq:

- The header is used to identify the order of SIP request (Request and response message have the same value). It increases progressively and the maximum is 2^31.

- Imagine a scenario as follows: a UAC sends SIP_REGISTER_1 to a UAS. But the UAS doesn’t reply it. So the UAC re-sends SIP_REGISTER_2 and SIP_REGISTER_3 to the UAS. Finally, the UAC receives a response from the UAS. How can we know the response is for SIP_REGISTER 1/2/3? (ANS: Use CSeq header to identify!)

 

5. Via:

- This header is used to inform a UAS that where the response message is to be sent.

- It includes SIP version and transmission protocol (TCP/UDP).

- “1.2.3.4” is the IP address of the phone. It was assigned by network once the phone activates EPS bearer with a network.

-  For VoWiFi registration, “1.2.3.4” is also the IP address of the phone. It was assigned by the network after the phone establishes IKEv2 tunnel with the network.

- We can see “branch” as a transaction ID. It must begin with the characters “z9hG4bK”. (If you don’t know what is a transaction, maybe you can refer my  article “RFC 3261 – Difference between session, dialog, and transaction in SIP”)

- The branch parameter value must be unique across space and time for all request sent by the UAC (Request and response message have the same value). The exceptions to this rule are CANCEL and ACK for non-2xx responses.

 

6. Contact:

- This header is similar to Via header,It is composed of a username and Fully Qualified Domain Name (FQDN). FQDN is usually replaced by the IP address of the phone.

- The Via header tells the other elements where to send a response, the Contact header tells other elements where to send future requests.

- UAS sometimes fills contact header in 200 OK to let UAC knows that where to send subsequent requests.

arrow
arrow

    Fone RD 發表在 痞客邦 留言(0) 人氣()