I hate being late. Just ask my wife. She has grown used to the fact that I like being in our seats at least 20 minutes prior to the start of a movie, but she never fails to point out that we are the only ones in the theater at that time. Thankfully, she has learned to bring a book or her knitting and make the best of it.
She, on other hand, has no problem with being late. In fact, she will start getting dressed to go out sometime around the time I want to leave. This has led to me naming a departure time that’s even too early for me.
It’s an endless cycle, yet somehow we continue to stay married.
The creators of SIP must have been thinking about people like my wife and me when they developed the protocol. They realized that some folks absolutely need to be early and others are better suited to being late. Thus, they came up with early offer and late offer.
Note: Some people refer to late offer as delayed offer, but I prefer the former.
If you are a regular reader of this blog, you already know that SIP is a signaling protocol and Session Description Protocol (SDP) describes a session’s media. That separation allows SIP to create sessions for any number of media types. It’s not just voice, video, or instant message. It’s any real-time data you wish to use.
For a deeper understanding of SDP, please refer to Understanding Session Description Protocol (SDP).
You should also be very familiar with the idea of putting SDP in the message body of an INVITE request. The headers of the INVITE describe the kind of session you want to establish and the SDP describes the media you are willing to send and receive. For instance, an Avaya telephone will typically send SDP that contains entries for G.711, G.729, G.723, and G.722 codec types.
The recipient of that INVITE will parse the SDP, decide which codec it will use, and send its own SDP back in the 200 Ok response. Note that the called party gets to see the caller’s SDP before showing his. In other words, the caller lays his cards out on the table and allows the called party to decide which hand to play.
This is called early offer. Early offer means SDP in the INVITE. Early offer gives the power of choosing the ultimate media for a session over to the recipient.
However, what if you didn’t want the called party to have all that power? What if you wanted the caller to hold his cards close to the vest and wait until the called party shows his?
This is where late offer comes in.
With late offer, there is no SDP in the INVITE request. The messages exchanged between the caller (user agent client) and the called party (user agent server) are identical, but responsibility for choosing the media shifts from one to the other.
In late offer, the called party receives an INVITE with no message body. He does all the usual stuff to process the INVITE (e.g. send a 180 Ringing), but is unaware of what codec might be involved in the session. When the call is answered, a 200 Ok with SDP is sent and the caller responds back with an ACK. However, the ACK will now contain the SDP that would have been sent in the INVITE. With this change in SDP placement, the caller gets to decide which codec will be used for this session.
Early offer = SDP in INVITE
Late offer = SDP in ACK
When I first started working with SIP, early offer was the norm. Of course, back then we were working with either basic SIP proxies or point-to-point SIP clients. A lot has changed since then and we now have very sophisticated session management and call processing. These smarter network components want to implement call admission control and bandwidth management. To do so, they need to seize control from the endpoints and make centralized decisions for the greater good of all. So, even though a client may want to use G.722, it may not be the best choice at the time. Late offer allows the core communications system to play the traffic cop and make the codec decisions.
I hope this makes sense. If it helps, you can think of me as early offer and my wife as late offer. I am all gung-ho about getting to the theater early, but she has the final say. For better or worse, isn’t that the case with most aspects of married life?
In a future article I will tackle early media vs. late media. Stay tuned for more fun and games!