SMS is so familiar that many people don’t think about how message transmission works in voice-oriented networks and don’t remember why we are limited to such a small message length. Let us recall where the short messages came from and what they are.

SMS development as a service
This year, the "short messages" will be 25 years old. It is believed that the first SMS was sent to the UK in 1992, and the commercial SMS service appeared in Finland in 1993.
It should be noted that before the advent of the GSM standard, SMS analogues did not exist, but to the current moment, i.e. After nearly 25 years, the service has gained immense popularity, despite the fact that operators charge for outgoing and sometimes incoming messages.
')
Of course, the path to popularity for this service turned out to be rather thorny. For the first time the idea of a service transmitting short messages between telephone sets appeared in 1984. The German engineer Friedhelm Hillebrand, who in 1985 headed the “non-voice” GSM committee, already showed that 160 Latin characters (equivalent to 140 bytes) are enough to transmit most of the household messages. The basis of his statement was not very scientific experiments (handwritten random household questions and answers, as well as the observation that the cards and analyzed messages on the telex for business users almost always contain less than 150 characters), but they determined the nature of the service in dozens years old.
Is 160 characters really enough? Of course, “Tolstoyan” sentences cannot fit in them, but until the on-screen keyboards appeared (on touchscreen devices) or at least T9, the users themselves did not want to send longer text either. Moreover, at the start, although SMS was laid down in the GSM standard, it was not uncommon that there was no support for typing and sending short messages in some devices.
From a technical point of view, SMS has not undergone almost any changes (with the transition to GSM 03.40-
https ://en.wikipedia.org/wiki/GSM_03.40 - the set of supported characters in the message body has changed significantly, perhaps). The commercial service developed in the networks of various operators approximately equally adjusted for launch time, marketing and the approach to monetization.
Today, in addition to users, a huge number of service messages from operators (for example, delivery receipt), as well as service SMS from third-party service providers such as banks, providers, and Internet services are transmitted in the network. Moreover, they can be not only informational (to report on the account balance, warn about regular payments under the contract, notify about the delivery of parcels), but also serve as one of the tools in two-factor authentication. In addition, short messages can be used to manage a number of services, for example, to post to Twitter.
Message format
An SMS message consists of text up to 140 bytes in length and a service information block:
- message type - 2 bits (SMS-DELIVER - message delivery to a mobile phone, SMS-DELIVER-REPORT - delivery confirmation, SMS-SUBMIT - sending a message from a mobile device, SMS-SUBMIT-REPORT - sending confirmation, SMS-COMMAND - changing parameters or delete a message stored in the SMS center, SMS-STATUS-REPORT - notification of the sender about the fate of his message).
Depending on the type of message, subsequent fields may be present or absent, and also swapped. A detailed description of all the fields can be found in
the GSM 03.40 specification , but here we will give only the most interesting ones from the point of view of parsing the message forwarding process:
- destination address - 2-12 bytes ;
- date and time of sending (SMS center mark) - 7 bytes ;
- protocol identifier - 1 byte ;
- encoding scheme - 1 byte : encoding, message class (affects the way the device processes the message: displayed without saving, saved in the device’s SIM or memory), request for automatic deletion after reading, status of flags corresponding to unread fax or voice message, information message content compression language (for broadcast SMS);
- user data area length - 1 byte ;
- message text - up to 140 bytes . The length of the message "in letters" varies, depending on the encoding used. These are 160 characters for 7-bit encoding (Latin + basic characters - according to GSM 03.38 specification), 140 characters for 8-bit (Latin + accented characters) and 70 characters for UCS-2 (Russian operators work with this encoding, so for Cyrillic characters, the length of the message is no more than 70 characters).
Initially (in the GSM Phase 2 document) each SMS message was a self-contained object, but according to subsequent revisions (GSM Phase 2+), a message transmitted in this way may include several messages — in this case, each of them contains a sequence number (because of what the length of the "body" of each message is reduced).
SMS transmission
Between individual users of the mobile network, the message is transmitted via an SMS center (SMSC or SMS-SC - Short Message Service - Service Center).
Along with the text of the message, additional information is transmitted from the mobile phone to the base station, including the address of the message center (in the early 2000s, this number had to be driven in by itself upon initial setup of the purchased device). If a message travels between networks, the SMS center of the sender’s network is primarily responsible for its delivery.
SMSC not only delivers and forwards messages if necessary, but also stores them. If the recipient’s phone is turned off when the message is sent, it remains in the SMSC until the device appears on the network. Usually, operators set the maximum storage time for such messages (technically, this setting may be available to users of the mobile network). SMSC also sends reports on the delivery of messages, if it is written in the user settings.
In the process of sending a message from one user to another, not only SMSC is involved. In short, the process is as follows:

- The request to send a message goes to the mobile switching center (MSC - mobile switching center),
- The MSC checks if the sender can work with messages on the GSM subscriber database (HLR / VLR — Home / Visitors Location Register — the common base and base of the individual switch) and forwards the message along with the sender and recipient addresses in the SMSC;
- The SMSC sends an acknowledgment of receipt, assigns the status “not delivered” to the message,
- And attempts to deliver the text to the addressee.

- Before delivering the SMSC, the sender requests from the HLR a unique recipient identifier (IMSI - International Mobile Subscriber Identity), which is necessary for carrying out any operations with the subscriber within the network, and also checks that there are no restrictions on working with SMS. At the same time, the MSC address of the subscriber is requested;
- After that, the location (LAI - Location Area Identity) and the temporary mobile subscriber identity (TMSI) of the subscriber are requested from the MSC and the connection with the device is initiated to send the message directly;
- Upon completion of the transfer, the mobile phone sends a delivery confirmation (accordingly, the status of the message in the SMSC changes to “delivered”). And if the delivery is unsuccessful, the status “not delivered” is preserved, while the reason is recorded in the HLR - the lack of memory or the subscriber in the network. Re-delivery is initiated by the actions of the addressee himself (appearance on the network or clearing the memory of the device).
Getting on the recipient's phone, messages are displayed on the screen or stored on the SIM card / memory of the device, depending on user settings and properties of the message itself.
Gateways, gateways ...
For historical reasons, telephony, including GSM, operates on the basis of ACS-7 protocols (Common Signaling Channel - 7). In the terminology of this standard, SMS is transmitted via a signaling channel, and not through a traffic channel with voice data. It was conceived so that SMS could run freely in parallel with the transmission of voice traffic (during a call). In addition, the signaling channel “idle” most of the time, so sending short messages through it is quite an economical solution.
However, SMSC does not support ACS-7, therefore, it is necessary to use additional gateways to communicate the SMS center with other operator systems (HLR / VLR and MSC). For delivery of messages to subscribers of other operators, special gateways are also used. The first gateway appeared in the world only in 1999, but we did not have full-fledged communication between operators and in the early 2000s (the gateways appeared a little
later ).
With the emergence of the need to connect a communication network (fixed or mobile) to
IP-networks - at the turn of the new century - was created the SIGTRAN specification, which allows to transmit ACS-7 flows over IP-networks. This is how the Internet-based SMS gateways appeared. These gateways can not only “allow” content from the Internet to SMS, but also allow data to be sent back, for example, sending SMS messages from a phone to an email address (although the peak of the development of such services has already passed - with the advent of Internet access on phones , built-in mail clients and OS applications for smartphones, it has become much easier to send e-mails directly).
SMS gateways can belong to an operator or exist independently, including as an addition to commercial corporate software for SMS distribution. Poor security of such gateways, as well as a very real opportunity to build a fraudulent gateway and lead to the spread of spam, hacking and other troubles associated with SMS. However, as far as they can and, to be sure, under the pressure of the regulator, mobile operators are trying to deal with these problems.
Interesting facts about SMS
Like any popular technology, during its existence, SMS has acquired a whole bunch of legends and myths. Here are some interesting stories that managed to find confirmation:
- In 2003, Malaysia recognized the legitimate SMS divorce between spouses;
- In 2007, the number of SMS messages sent by an average American exceeded the number of calls made by them;
- In 2008, SMS helped conduct a complex surgical operation to a patient from Congo: a volunteer surgeon received instructions from colleagues through text messages;
- Text abbreviations within the framework of SMS communication are becoming a new direction in the development of the language: in 2011, the popular in English LOL and OMG were entered into the Oxford Dictionary;
- The German engineer F. Hillebrand, who proposed the idea of SMS, eventually received only world renown - the developers did not provide any royalties or patenting.
Instead of the conclusion, I would like to note that although SMS has not been technologically developed for a long time, the peak of popularity in the world was just recently - in 2012-2014. Considering that the large-scale take-off of technology occurred in the early 2000s, it lasted on a pedestal for a surprisingly long time (from the point of view of the world, so fond of new items). What is waiting for SMS-messages tomorrow - the fall in popularity or a stable future? Time will tell.