What is SMS?| Full form and SMS protocol tutorial.


Know all about the Text.

SMS is an abbreviation for Short Message Service. It is a basic service provided by all GSM mobile operators. The service enables subscribers to send and receive text messages using an active SIM card on a mobile phone. The sender/receiver of the message could be a mobile subscriber or a third-party application. In the bulk SMS tutorial, we discussed SMS flows between a mobile device and a software application.

What is SMS protocol?

GSM 03.40 specifies the 3GPP standard for short message service implementation. The protocol specification contains information about message components and the encoding/decoding of parameters.

SMS is an abbreviation for short message service, which means it adheres to a protocol-based message format and call flow. The following section will discuss service subscriptions and call flows in a GSM network.

How does the text service gets provisioned?

When a subscriber purchases a new SIM card. The mobile operator configures the subscription for the sim card in HLR. The sim card subscription includes configuration for teleservices and other services.

For SMS, teleservices MO-SMS (code 33), and MT-SMS (code 34) must be provisioned and active on HLR to use text functionality.

How does SMS service gets activated while roaming?

During the initial registration of a sim card on a mobile network. The HLR transfers the teleservice list to the roaming VLR/MSC through an insert subscriber data map protocol message.

When sending Mobile Originated text, VLR checks with the subscriber to see if the MO-SMS service is active. If it is, the text is sent from VLR to the SMSC otherwise, the subscriber receives an error message.

For a mobile terminated text (MT-SMS), sender SMSC, do a lookup with the receiver HLR, using MSISDN or phone number. If HLR, doesn’t have MT-SMS teleservice configured and active, for destination mobile number, mobile terminated SMS fails. Else HLR returns roaming information and IMSI in the response.  Tutorial of map protocol mentions gsm network flows for Mobile Originated and mobile terminated texts.

SMS protocol has the following components: 

Validity Time:

Text lifetime in the network is the validity time. When a mobile subscriber sends a text to any other subscriber.  After pressing the send button, the MO-SMS  protocol message originates from MSC and reaches the SMSC.

If all is good, SMSC keeps the text and tries to deliver it to the destination phone number. To deliver, SMSC does a location lookup (uses SRI-SM MAP message over SS7/Sigtran) from destination HLR. If the response is a user error (e.g subscriber not reachable ), SMSC stores and tries after an interval. If the total time exceeds the validity time, the message is dropped.

Message Waiting Data:

After HLR lookup, SMSC gets the visiting MSC and IMSI of the mobile subscriber.  Using location and IMSI, SMSC sends the text to visiting MSC. If visiting MSC fails to deliver the message to a mobile device, SMSC may send Message Waiting Data on HLR. So that once the error is recovered, HLR sens and Alert Service Center message to the SMSC. Now if validity time is not over, SMSC will again try to deliver the message to the mobile subscriber.

More Messages to Send:

According to the gsm standard, a text message on the wire can be a maximum of 160 bytes long. But a mobile subscriber may send a long (more than 160 bytes) message. This requires segmentation and reassembly of a long message on SMSC and device.

For MO-SMS, VLR segments the long message into 160 bytes smaller messages. Each small message has a segmentation number and indication to the receiving side that there are more segments that are yet to come. SMSC does reassembly and stores the full message.  Once SMS is successfully submitted, SMSC starts the MT-SMS procedure.

For MT-SMS, SMSC does segmentation and VLR does the reassembly. SMS protocol has two parameters, named more-message  and segment number. If no more message to send is set, the receiver side assembles all received segments.

Service Center Time Stamp:

The timestamp an SMSC sends to the mobile device in an MT SMS is the arrival time of the SMS at the service center. This should be unique in all messages delivered to the same subscriber number. If two or more messages arrive within a second, a unique timestamp is generated. The difference is kept at a minimum in-between time stamps.

Priority: 

SMSC uses this field, to attempt to deliver a message, which was failed earlier. The failure was temporary (e.g no more capacity in mobile).  SMSC, don’t wait for HLR to send an alert service center.

Protocol Identifier: 

This is a one-byte parameter. Define how the message will be handled by the mobile device. The OTA message uses a different PID than normal text messages.

SMS protocol PDU Types:

SMS-Deliver: Sent from SMSC to the mobile device. When a Mobile terminated SMS from the roaming SMSC, the MT-ForwardsSM or Forwards-SM goes from SMSC to MSC. In version 2 of the gsm map protocol, the MSC decides if SMS is mobile originated or mobile terminated on the basis of the SMS PDU type.

SMSC-Submit: Sent from mobile to SMSC. The gsm map operation is Mo-forwards sm in version 3 and in version 2 it is Forward-SM. Again on PDU type, SMSC decides if it’s a MO or MT SMS request.