SMPP bind using bind_transceiver

This page is about the SMPP bind procedure. SMPP bind is the connection setup request on the SMPP link. This guide explains how an SMPP client connects to an SMPP server by sending an SMPP bind request. It explains the differences between the possible connection modes (transmitter, receiver and transceiver) and it gives insights on connecting multiple clients using the same SMPP user account.

What is SMPP bind

SMPP bind is the first PDU sent after an SMPP link is established. SMPP software, such as Ozeki SMS gateway, send the SMPP bind pdu to login to an SMSC. An SMPP bind PDU, contains the username and password.

How is an SMPP connection created

When you setup an SMPP connection the following steps are performed:

  • The SMPP client initiates the connection
  • The TCP/IP link is connected
  • On SMPPS connections SSL handshake is done
  • The client sets the bind_transceiver PDU's sequence number to 0
  • The client puts the SMPP username into the bind_transceiver PDU
  • The client puts the SMPP password into the bind_transceiver PDU
  • The client sends the bind_transceiver PDU
  • The server checks the username (SMPP system ID) and password
  • If the authentication is Ok, the errorcode 0 is set.
  • The server return the bind_transceiver_resp PDU.
  • The SMPP client is ready to send SMS

SMPP connection setup explained

Figure 1 explains the SMPP connection setup. You can see that the SMPP client initiates the connection, and a single transaction is used for authentication. You can also see, that after successful login, SMS messages can be sent using the submit_sm pdu. And incoming delivery reports and incoming SMS messages can be received using the deliver_sm pdu.

Figure 1 - SMPP connection setup explained

Introduction to SMPP bind requests

SMPP bind requests are used to setup an SMPP connection. They are sent by the SMPP client to the SMPP server when the SMPP client tries to login. There are 3 types of bind requests: SMPP bind_transmitter, SMPP bind_receiver, SMPP bind_transceiver. The SMPP bind_transmitter can only be used for submitting SMS messages, the bind_receiver is only for receiving SMS messages, and the bind_transceiver can be used for both. SMPP bind_transceiver is the most common method. It is popular because it allows a single connection to send and receive SMS messages at the same time.

What is bind_transmitter

The SMPP bind_transmitter PDU is sent by the SMPP client connections to connect in a way that is dedicated for sending SMS messages. This connection cannot be used for receiving SMS messages. This bind method is rarely used. Most clients now connect using bind_transceiver.

What is bind_receiver

The SMPP bind_receiver PDU is sent by the SMPP client connections to connect in a way that is dedicated for receiving SMS messages. This connection cannot be used for sending SMS messages. This bind method is rarely used. Most clients now connect using bind_transceiver.

What is bind_transceiver

The SMPP bind_transceiver PDU is sent by the SMPP client connections to connect in a way that for both sending and receiving SMS messages. Most SMPP client connections are setup using this connection method.

Should I bind with transceiver, transmitter or bind_receiver?

Out of the three SMPP modes of operation. The SMPP client (often referred to as ESME), should choose the bind_transceiver mode. This allows the same connection to be used for both sending and receiving SMS messages. Using a single bind_transceiver connection is similar to having a transmitter and receiver connection over the same network link and allows submitting and receiving simultaneously.

SMPP connection setup video tutorial

The following video demonstrates how you can setup an SMPP client connection and how you can send an login to the SMPP server using the SMPP bind_transceiver PDU. The video shows with from the perspective of the SMPP client.

Video 1 - How to set up an SMPP client connection and send a login to the SMPP server (Video tutorial)

How does an SMPP client connect to the SMPP server?

When an SMPP client connects to your SMPP server, first it sets up a TCP/IP connection. If you use a secure SMPP server based on SMPPS, after the TCP/IP is established an SSL handshake takes place. The next step is happening at the application layer, which is the SMPP layer. In the SMPP protocol layer, the first PDU, that is sent by the client is an SMPP bind_transceiver. This PDU contains the username (which is often referred to as SMPP System ID) and the password. The server checks these login credentials and decides whether the client connection is accepted. If the login details are ok, the server returns an SMPP bind_transceiver_resp response when no error code. (Figure 2)

Figure 2 - How does the SMPP client send a bind request

SMPP bind_transceiver example

The following log snippet was taken from the Ozeki 10 SMPP client connection's log. You can see a standard SMPP connection setup. If you read the log, you will find that first the TCP/IP connection link is established and after that an SMPP bind_transceiver PDU is sent. The SMPP server responded with a bind_transceiver_resp answer. The Ozeki 10 SMS Gateway accepted this response and written "Successful login." into the log.

2021-04-06 12:06:09.082 INFO SMPP_client_1: [TCP client] Connecting to 192.168.93.113:9550.
2021-04-06 12:06:09.082 INFO SMPP_client_1: Connected from 192.168.93.6:33444 to 192.168.93.113:9550.
2021-04-06 12:06:09.082 INFO SMPP_client_1: <- 00000030000000090000000000000001736D703100717765313233004F5A454B493130003401012B3030303030303000
2021-04-06 12:06:09.082 INFO SMPP_client_1: -> 0000001C8000000900000000000000014F5A454B4953595354454D00
2021-04-06 12:06:09.082 INFO SMPP_client_1: Successful login.
2021-04-06 12:06:09.082 INFO SMPP_client_1: Connection online.

Accepting SMPP clients on the SMPP server

When you operate your own SMPP server, you will create SMPP usernames and passwords, in order to accept incoming SMPP client connections. Your customers will enter their usernames and passwords along with the ip address and SMPP port of your SMPP server into the configuration of their SMPP client software. After this their software will connect to your system.

Some SMPP servers will only allow a single connection with the same username and password. Ozeki 10 SMPP server allows your customers to connect from multiple computers simultaneously. Alternatively, they can create multiple TCP links from the same computer and connect with the same username and password. This is called multiple SMPP binding.

How to use SMPP bind to connect multiple SMPP clients

Figure 3 shows how a single customer called Customer "A" can connect to the same SMPP server with a single username and password using multiple SMPP bind requests. In this setup the customer can send a bind_transceiver PDU on all his links.

Figure 3 - Multiple clients connecting to the SMPP server

Video tutorial on how to accept multiple client connections

The following video shows how you can configure Ozeki 10 SMS gateway with a single SMPP user account to accept multiple client connections. In short no special configuration is needed. As soon as you assign the username and password to the connection multiple clients can connect. In this case we recommend that you enable SMPP low level logging (as demonstrated in the video) to make sure you know where each of your SMPP messages will end up. The SMPP low level log will show you which SMPP client sent a particular SMPP PDU and you will see the corresponding response from the SMPPP server.

Video 2 - How to accept multiple client connections (Video tutorial)

Debugging incoming bind_transceiver requests

If you examine the SMPP communication log carefully you will notice that the incoming SMPP bind requests are not present in the log of a particular SMPP user's logfile. This is because, when this PDU comes in no user is assigned to the connection yet. To see the SMPP bind requests, you need to open the configuration form of the SMPP server. This can be done by clicking on the Advanced button in the toolbar, then selecting the Details page of the SMPP server (Figure 4).

Figure 4 - Opening the SMPP server details page

On the SMPP details page you will immediately see the incoming SMPP bind PDU-s. It is worth mentioning that the response PDUs are not listed here. To be more precise, they are only listed here for failed login attempts. Once an SMPP user was successfully identified with a username and password. The logs from the corresponding SMPP client connections are written to that user's log. (Figure 5)

Figure 5 - SMPP bind PDU log

Who is connected to my SMPP server?

If you open the details page of an SMPP user, you can see the currently connected clients in the Connected clients section of the left hand panel. Here you will see the remote TCP/IP endpoints for each client. These endpoints are used to identify the log entries for a given client in the low level SMPP communication log, which you can find in the left-hand panel (Figure 6).

Figure 6 - SMPP connected client list

How are incoming messages handled?

If any of the SMPP client sends in an SMS using the SMPP submit_sm request, its corresponding SMPP submit report (called submit_sm_resp) will be returned on the same connection. This allows SMPP clients to process SMS submissions reports properly even if they run on different computers.

For incoming SMS messages and delivery report Ozeki 10 SMS gateway performs load balancing between the connected clients. This means that as capacity becomes available on an incoming SMPP client connection, incoming SMS messages and delivery reports will be pushed to that client. If no clients are connected or if the client connections are busy sending or receiving SMS messages, incoming SMS messages will be stored in the inbox folder.

Note that incoming delivery reports will not be matched to sending clients. This is because when a delivery report comes in it might be possible that the submitting client is not connected or connected from a different address. Remember that delivery reports can come in at a much later time. This means that it is possible for a delivery report to be returned on a different link, then the link where the SMS was sent on. This only happens if multiple clients are connected using the same SMPP username and password. To avoid this situation, you can create multiple SMPP user accounts for your customer, and tell them, that they should bind with one link to each user account.

More information