Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
466 views
in Technique[技术] by (71.8m points)

sip - Registration message over TCP

I have implemented SIP calls over TCP. Now I intend to extrapolate it to REGISTRATION over TCP.

I have a reference PCAP with the following flow:

Logic for Sequence number and Acknowledgement number for initial registration:

A------------------------------------B Seq - Ack - Size

           REGISTER

----------------------------------→ 1 - 1 - 709

        100 Giving a Try

<---------------------------------- 1 - 710 - 358

        401 Unauthorized

<---------------------------------- 359 - 710 - 459

          REGISTER

----------------------------------→ 710 - 818 - 931

        100 Giving a Try

<---------------------------------- 818 - 1641 - 358

       200OK

<---------------------------------- 1176 - 1641 - 450

sequence number of current leg= (sequence number of previous leg in same direction+window size of previous leg in same direction.)

Ack number of current leg =(Ack number of previous leg) {if current leg is in same direction as previous one}

=(sequence number of previous leg)+(window size of previous leg ) {else}

I am trying to understand the following:

  1. Should the refresh instance be part of the same TCP stream? Which means should the Src and dest IP addresses and Src and Dest Port addresses of the refresh instance be the same as the initial registration?
  2. What logic should be applied to the Seq and Ack numbers? Should they be in continuation to the previous messages (initial registration attempt) or should these values be as if a new instance is being generated between the given devices?

PS: I am working on a tool that generates calls among devices, so src and dest message code is within my realm.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

SIP registrations are independent of the used transport protocol. If you want to update an existing SIP registration that was established over a TCP connection you can send the registration update request over the same TCP connection, another TCP connection or even via UDP. As long as the request is sent to the same registrar the update request will be treated as such.

More information on the use of seq numbers and SIP registration (update) in the Registration section of RFC 3261. More information SIP registration paths and the use of (different) transport protocols in RFC 5626.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...