To start things off, I would very highly recommend that you read RFC 3261. It is basically a tutorial for SIP and assumes no knowledge of what SIP is and what it can do. You can click here to read the RFC at your leisure. I know that the RFC is long, but it does provide some good insight as to how this protocol works, the definitions, and has a very good description of the headers.
In my opinion SIP in its basic form is an evolved H.323 protocol. The next level so to speak. SIP essentially takes all the craziness in H.323 and makes it much more legible and easier to deal with. Gone are the days of needing to decode the hex of H.323 and read through the TCS (Terminal Capabilities Set) if you migrate to a full SIP network. The only problem right now is that SIP is not everywhere just yet. Some ITSPs (Internet Telephony Service Provider) don't yet provide this service or are still new to the game. I have had the pleasure of working both H.323 over the years as well as SIP and MGCP. If SIP is available, why are you not using the technology?
If you are familiar with H.323 I am going to draw some comparisons to help generate a picture that helps in understanding the SIP concept. In H.323 you have your slow start and fast start. Basically, slow start deals with sending the H.245 separately after the H.225 call control and signalling setup. H.225 is basically your layer 2 while H.245 is your media negotiations. H.323 fast start takes the H.245 and embeds it within the H.225 call setup message. This allows the remote endpoint to choose fast start if it is capable and negotiate the media faster.
With SIP, the same concept exists. SIP has delayed-offer and early-offer. SIP also has something called early-media but we will get into that in another post. With SIP early offer, call setup proceeds like normal and the terminating end sends it's capabilities to us, the calling party. We then send a message back showing what we want to use and, in a perfect world, everything works out. Early-offer takes the capabilities of us, the caller and sends them in the initial call setup message. This allows the remote end to pick what it wants and send it back to us.
By now, if you know anything about SIP you are probably wondering why I haven't included any terminology. The reason behind this is that I want those with little to no experience in SIP to grasp the concept before I start throwing out tech jargon that they may or may not understand. SIP is a very easy protocol to grasp but a very difficult one to master.
When dealing with SIP messages, the best thing about them is that they are all in plain text and follow the HTTP protocol. You will see things like 404 Not Found when something bad happens as well as a myriad of other messages both good and evil. SIP has three main parts:
- The Start Line
- This includes the intial portion (i.e. INVITE, 200 OK, PRACK, etc.)
- The Header
- Things like Via, From, To, Contact, Max-Hops, Call-ID, etc.
- The SDP
- This is basically the media negotation portion. You will see codecs, DTMF, IP addresses, p-times, bit-rates, etc.
The start line with something like a INVITE is one of the first things you would see on a debug or call trace from RTMT. This start line indicates what is going on with a call leg or call at that point in time. Below are a list of common start lines:
- INVITE
- This is typically a request to setup a connection or call
- 200 OK
- This is an acknowledgement to a request such as the INVITE above
- Note that this can contain SDP (more on that later)
- PRACK
- This is a provision acknowledgement, hence PRACK
- This basically gurantees that a provisional message, like INVITE is acknowledged
- BYE
- Call teardown in its simplest form
- CANCEL
- Generally means a request was canceled mid-negotation/setup
- Note that this is different than a BYE as this was initiated to cancel a call/request
- Ringing
- Provisional response to let the requesting station know the phone is "ringing"
- Trying
- Provisional response to show the INVITE was sent and the distant end is "trying" to set up the call
- REFER
- This is essentially a gateway transferring the call elsewhere for one reason or another
- Via
- From
- To
- Contact
- Max-Hops
- Expires
- Cseq
- Call-ID
- Content-Length
Basically, with humor I described how SIP works with media negotiations. I just substituted codecs for languages since that analogy seems a bit easier to understand. One person says "I can speak these codecs" while the other says "I have this codec out of that list". Keeping it simple stupid, that is how it works. I will make another post and take things to another level on this later.
I hope that this very very VERY basic SIP introduction has been helpful. I try to break things down to a third grade level because it makes understanding things easier as well as more entertaining. Reading a Cisco book is great but can be (usually is), very dry and your head ends up on the keyboard or desk.
No comments:
Post a Comment