SMPP Protocol – SMPP Client – SMPP server

SMPP or Short Message Peer to Peer protocol is an open standard protocol that uses TCP/IP protocol for transport of protocol messages. Earlier to SMPP, ss7 was the standard protocol for messaging over the GSM network.  USSD and SMS both can use SMPP. A messaging application can be developed using SMPP.

The app can be bulk SMS gateway, which connects to many mobile operators over SMPP on one side and another side can expose HTTP based bulk SMS APIs. 

For example, a voting app connects to mobile operators SMSCs and can receive all messages for a shortcode.

Benefits of SMPP:

1. SMPP is an open standard. Two peers can develop applications independently.

2. It is easy to get an SMPP connection than legacy ss7 protocol.

3. Uses TLV based encoding for parameters and messages, no need ASN.1 compilers for encoding and decoding. So reduces the cost of messaging or USSD application development.

4. Two mobile operators can exchange SMS if they don’t have an SS7 level roaming agreement. For example, if MNO1 wants to send SMS to the subscriber of MNO2. MNO1 sends the text to SMSC of MNO2 over SMPP.

5. Easy to develop an SMS gateway for bulk SMS providers. Earlier to SMPP, each mobile operator was exposing HTTP or another form of APIs to the bulk SMS providers. API format was depending on the SMSC vendor of an MNO. This was making difficult for, bulk SMS providers to connect many mobile operators. With SMPP, no change/development required for connecting a new mobile operator.

6. Uses TCP/IP protocol stack, which is available on each operating system now and a reliable protocol.

SMPP Startup sequence : 

This example shows the message sequence, used by sn ESME to connect to an SMSC for sending a receiving text message.

1. ESME connects to SMPP over TCP/IP. This involves TCP connection setup with a peer by the three-way handshake.
2. ESME binds with SMSC by sending bind transceiver SMPPprotocol message to the peer.
3. ESME Send Submit SM, message to send a text to a mobile device.
4. SMSC sends a deliver sm to the ESME for sending a text received from a mobile device.

Protocol Messages:

BIND Receiver /Bind Received Response : 

SMPP entity (e.g ESME), binds itself with peer entity, for receiving messages only. E.g a short code entity that is used for voting.

BIND Transmitter/Bind Transmitter Response : 

SMPP entity (e.g ESME), binds itself with peer entity, for receiving messages only. E.g a short code entity that is used for voting.

Bind Transmitter/ Bind Transmitter Response :

An entity uses this message if will send messages only.

Bind Transceiver/Bind Transceiver Response:

For send and received both.

Unbind/Unbind Response: 

An entity uses this message, to remove itself from sending or receiving or both messages from a peer node.

Submit Sm/Submit Sm Response:

When a text needs to send to SMSC, for sending SMS to the destination mobile. The text is sent in submit sm message.  If the receiving side accepts the message, then a Submit sm response will have success else an error code is returned to the sending entity.

Deliver Sm/Deliver Sm Response:

When a text needs to send from  SMSC to an ESME. The text is sent in deliver sm message.  If the receiving side accepts the message, then a Submit sm response will have success else an error code is returned to the SMSC.  E.g when a text is sent to a shortcode from a mobile device. On GSM network it reaches to SMSC as MO-SMS then, SMSC will send a text to the shortcode handling application.

Query Sm/Query Sm Response:

An ESME sends this message to SMSC, for an already submitted SMS. The short message state (unknown, en route, etc.) is returned to the ESME, by the SMSC in Query SM Response.

Cancel Sm /Cancel Sm Response:

ESME sends this message to cancel an already submitted message. This might be that the message is no longer valid and ESME doesn’t want to send this SMS anymore.

Enquire Link/ Enquire Link Response:

This is an optional message. Runs periodically in both directions from peer to peer. If an Enquire Link Response is not received by sending entity for a sent enquire link, Then SMPP connection marked inactive. SMPP layer disconnects the TCP connection. If the application is TCP client then tries to connect again with the peer.

SMPP Connection Parameters:

After two peers have been decided that they will talk to each other over SMPP. Both should set up a connection, before sending or receiving a text. For example, a bulk SMS provider wants to connect to a mobile operator’s SMSC.  SMSC will work in server mode and bulk SMS providers will act as ESME.  The mobile operator will create an SMPP account for the SMS provider and share the server details. 

SMPP account details are given to bulk SMS providers.

  1. Host: This is the IP  or URL of SMSC.
  2. SMPP Port, a TCP port can be default SMPP port 2775 or other.
  3. System_Id, a string value.
  4. Password, a string value.
  5. SystemType, string, and an optional value.

Message Format:

Each SMPP message has a fixed header and a variable message section.  The message section depends on the message type.

SMPP Header: 

The header has the following parameters:

  1. Command Length, a total length of the message, including the header.
  2. Command Id, every message type in SMPP have an integer value called the command id.
  3. Command Status, this field has significance in a response message of a command id.
  4. Sequence Number, this is a unique value assigned by the originator of an SMPP PDU.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top