SIP is nothing more than a protocol. It has request and response messages. These messages contain headers and headers contain parameters. Both request and response messages optionally carry a message body. The message body is typically Session Description Protocol (SDP), but it can be anything you want it to be. I once helped write a chess program based on SIP and the message body contained chess moves.
All of this is well and good, but unless you are as geeky as I am, it’s pretty boring. You need SIP-aware components to make the real magic work. Today I would like to write about my favorite component, the Back-to-Back User Agent (B2BUA).
The B2BUA is special combination of two other SIP components – the User Agent Client (UAC) and the User Agent Server (UAS). The UAC is a SIP entity that sends SIP messages and receives SIP responses and the UAS is a SIP entity that receives SIP messages and sends SIP responses. You often see applications that implement both UAC and UAS functionality. You may hear this referred to as a SIP User Agent Client Server (UACS) A SIP phone is such a beast. It sends a SIP INVITE when it wants to make a call and it receives a SIP INVITE when being called.
To learn more about User Agent Clients and Servers, please refer to my blog SIP Servers and Services.
A B2BUA is also the combination of a UAC and UAS, but unlike a SIP phone which can be thought of as a destination for SIP traffic, a B2BUA is part of the path from sender to receiver. For instance, a B2BUA might sit between two SIP phones in order to add value to the communications process.
I said that a B2BUA is both a UAC and a UAS. What makes it different from a UACS is that when the UAS half receives a SIP message it regenerates that message and passes it to its UAC side which sends the new message to the next hop. This message regeneration is very important because it allows the B2BUA to perform a number of important tasks.
- Service Creation. The regenerated packet won’t be exactly the same as the received packet. The B2BUA can potentially change every header along with the SIP URI and message body. For example, to implement a caller-ID masking service, the B2BUA could alter caller’s name in the From header to “Anonymous.” To implement a Call Admission Control (CAC) service, the B2BUA could eliminate a caller’s request for a high bandwidth codec and force it to use a lower bandwidth counterpart. The number of services that can be created this way is limitless.
- Deep Packet Inspection. Providing a safe and secure environment for SIP communications should be paramount for every enterprise. A B2BUA can assist in that by looking at every byte within a SIP message to ensure that nothing improper is going on.
- Policy Enforcement. A B2BUA can require that SIP traffic be of certain nature. For example, an enterprise may require that all its remote SIP traffic comes in on a secure, TLS connection. A B2BUA that sits between the Internet and a local LAN can force this to occur.
- Topology Hiding. A B2BUA can hide the real identities of the users and services that live behind it. For instance, the IP address of an enterprise’s Session Manager could be removed from all outgoing SIP messages and replaced with that of a Session Border Controller.
- Private IP Address Support. Very few (if any) organizations will give a public IP address to all its users and servers. Instead, they will be assigned private IP addresses that only make sense within the confines of an enterprise’s network. Since IP addresses are embedded inside SIP messages, a mechanism is required to change those internal, private IP addresses to public IP addresses that can be shared with the outside world. As SIP packets are being regenerated, a B2BUA can perform that replacement and translation.
So, what are some examples of B2BUAs? One of the most obvious is the Session Border Controller (SBC). The SBC acts as a B2BUA on the border of an enterprise’s network to keep the bad guys out and allow the good guys to freely pass SIP traffic. Additionally, through Avaya’s Agile Communications Environment (ACE), an enterprise can write their own B2BUA applications and sequence them into call flows.
I hope that you find this useful as you make your journey to SIP. You may never have the opportunity to write your own B2BUA, but I guarantee you that you will purchase one or many for your communications network.