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:
PS: I am working on a tool that generates calls among devices, so src and dest message code is within my realm.
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.