The Back-to-Back User Agent (B2BUA)

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.

13 comments

  1. […] device.  It was designed to keep the bad guys out and let the good guys in.  An SBC is a Back-to-Back User Agent that does a deep packet inspection of every SIP packet that enters or leaves an enterprise’s […]

  2. […] device.  It was designed to keep the bad guys out and let the good guys in.  An SBC is a Back-to-Back User Agent that does a deep packet inspection of every SIP packet that enters or leaves an enterprise’s […]

  3. Saurabh · · Reply

    A short and easy to understand article, with the technical covered too ..well done Andrew !!

  4. vishwajeet · · Reply

    Very nice

  5. TechSavvy · · Reply

    “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.”

    To my understanding it should be UAC who receives messages, and UAS who sends them.

    1. Nope. clients send messages and servers receive them.

  6. Akash Gupta · · Reply

    I think both client and sever send and receive messages. The messages sent by client are called “Request” , while those sent by server are called “Response” .

    1. Yes, that is true, but in SIP we divide them into two classes. A User Agent Client sends requests and a User Agent Server sends response. It is not uncommon for a single device to be both a UAS and a UAC — such as a SIP telephone.

  7. Hi;
    I have a doubt
    SBC is used as a B2BUA in order to hide the topology but what is requirement of using Application Servers as B2BUA in IMS.

    1. Application building. It can be useful if you want an application to act as both client and server.

      1. Can you please explain in bit detail.Can we assign the AS task to SCSCF?

        Thanks

      2. My comment was directed towards the Avaya IMS environment. It does not apply to AS tasks.

      3. Thanks Andrew..

        Can you give some examples when AS needs to trigger services as UAC as B2B.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: