
The Route of a Text Message - ericlott
https://scottbot.net/the-route-of-a-text-message/
======
snops
A really good article! The telecoms world is fascinating, it's a whole
separate parallel stack that doesn't get talked about anything like as much as
the web world.

One section caught my eye, and I wanted to add some detail:

>In order to efficiently send and receive signals, antennas should be no
smaller than half the size of the radio waves they’re dealing with. If cell
waves are 6 to 14 inches, their antennas need to be 3-7 inches. Now stop and
think about the average height of a mobile phone, and why they never seem to
get much smaller.

A common neat trick is to take advantage of the fact that this is only true in
air, and the wavelength depends on the material around the antenna. Some
modern antennas (especially common in GPS and Bluetooth) are built as a metal
foil around a ceramic element, which has a much shorter wavelength and allows
them to be shrunk[1].

You can also "fold" the antenna a bit, and hence get away with a quarter
wavelength in return for reduced performance in other areas. A common example
in phones is the Inverted F antenna [2].

Finally, a large "invisible" component of many antennas is the size of the
ground plane attached. Shrinking this can affect antenna performance a lot.
Generally, this is an internal copper layer of the PCB that is used by other
components too, but it's important to realise its an important part of the RF
performance. Therefore, you can't judge how good an antenna is from the
visible size of it alone, the form of the whole device matters.

[1]
[https://electronics.stackexchange.com/a/245245](https://electronics.stackexchange.com/a/245245)

[2] [http://www.antenna-
theory.com/antennas/aperture/ifa.php](http://www.antenna-
theory.com/antennas/aperture/ifa.php)

~~~
DonHopkins
So will we ever have tiny cell phones like Zoolander?

~~~
lultimouomo
We already have, and they're apparently very popular in prisons:
[https://www.vice.com/en_uk/article/zngpz4/prison-phones-
that...](https://www.vice.com/en_uk/article/zngpz4/prison-phones-that-go-up-
your-bum)

------
3chelon
Interesting, but so much left out. This quote:-

>Through some digital gymnastics that would take entirely too long to explain,
suddenly my wife’s phone shoots a 279-byte information packet containing “I
love you” at the speed of light in every direction, eventually fizzling into
nothing after about 30 miles.

is the biggest understatement in the whole article. It omits the _entire_
baseband!

Within the baseband, even the channel coding process itself is insanely
complex, involving convolutional codes, CRCs, weird interleaving schemes...
and then there's the modulation, and all the L1 signalling to support it
all... I could go on.

~~~
scottbot
If you do go on, I'll happily link to it in the article. There's no way I
could have done everything, but I could have done a better job nodding to
what's missing.

~~~
vvanders
Yeah, things like CDMA and some of the other multiplexing signal techniques
are incredibly cool. When I discovered that CDMA is just more or less a giant
XOR with a mask in signal space it blew my mind. Being able to simultaneously
share a frequency at the same time is a pretty nifty thing.

------
jpatokal
Great post. I used to work with SMS for a living, and still remember the first
time I visited a customer's data center and watched one of their engineers
send an SMS... by telnetting directly into the SMSC and punching out a command
in raw EMI:

[https://en.wikipedia.org/wiki/EMI_(protocol)](https://en.wikipedia.org/wiki/EMI_\(protocol\))

And an old blog post of mine on why MMS failed but still managed to delay
actual mobile internet by 10 years:

[https://gyrovague.com/2014/06/27/how-sms-set-back-the-
mobile...](https://gyrovague.com/2014/06/27/how-sms-set-back-the-mobile-
internet-by-ten-years/)

~~~
voltagex_
I wonder if there's a good technical writeup on MMS. It seems to be "just
another" IP based thing, but I've never really investigated it.

~~~
jpatokal
Wikipedia goes into this in some detail, but it really is pretty much the
canonical example of a protocol designed by committee.

[https://en.wikipedia.org/wiki/Multimedia_Messaging_Service](https://en.wikipedia.org/wiki/Multimedia_Messaging_Service)

Here's the technical spec, which manages to combine the single bit level
detail of old school telco with the enterprisey goodness of SOAP.

[http://www.qtc.jp/3GPP/Specs/23140-6g0.pdf](http://www.qtc.jp/3GPP/Specs/23140-6g0.pdf)

For example, this is how you say "OK" in MM7:

    
    
        HTTP/1.1 200 OK
        Content-Type: text/xml; charset="utf-8"
        Content-Length: nnnn
        <?xml version="1.0" ?>
        <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
        <env:Header>
          <mm7:TransactionID xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-3" env:mustUnderstand="1"> vas00001-sub</mm7:TransactionID>
        </env:Header>
        <env:Body>
        <SubmitRsp xmlns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-3">
          <MM7Version>5.6.0</MM7Version><Status> 
          <StatusCode>1000</StatusCode> 
          <StatusText>Success</StatusText></Status> 
          <MessageID>041502073667</MessageID>
        </SubmitRsp> 
        </env:Body></env:Envelope>

~~~
maaarghk
jesus christ. No wonder I could never send the things!

Your blog post above was also a good read. Thanks.

------
Supermancho
Although this wa a little wordy at times and not given proper sectional
headers (easily fitting in a hyperlink toc), this us the type of quality
content I _wish_ for every time I open HN

~~~
scottbot
I'm an academic historian, you're lucky this wasn't book-length.

~~~
marai2
Yes! Now make it into a book and take my money!

Or as is frequently mentioned on HN, sell the product before there is a
product - to see how many people would become customers.

------
molodec
I am a developer in a big company that acts as SMSC. We work with hundreds of
operators around the world. The explanation in the article is way better that
all internal documentation combined we have in the company.

I wrote algorithms to convert 8bit to 7bit and back as some our customers
require that.

One thing that strikes me about SMS is that most people think SMS is secure
and offer great privacy. It is not. The messages are not encrypted, and from
the technical perspective there is no way to prevent SMSC from reading your
messages.

------
VBprogrammer
Has anyone encountered the interview question similar to "Tell me what happens
when you type www.google.com into a browser."

This article reads like the most immense answer to that question might.

~~~
macintux
As far as I can remember, I independently created that question about 20 years
ago. I’m sure I wasn’t the first, and of course it’s entirely possible I heard
about it somewhere before using it myself.

~~~
VBprogrammer
Its one of my favourite questions. I imagine it would take a lot of detective
work to figure out who first started using it.

------
dgritsko
This was really well-written and fascinating. For something that I have used
all the time and think of as relatively simple, there is a tremendous amount
of complexity going on behind the scenes. I suppose that's true for nearly any
technology one interacts with these days, but it's fun to see the curtain
pulled back.

------
amaccuish
Does anyone know if it's possible for the BTS or BTC to notice that the two
numbers are on the same tower/BTC and send the message along without notifying
the SMSC?

~~~
pilsetnieks
The SMS contains only the human facing phone number (also known as MSISDN) but
the BTS deals (usually, I don't know, maybe they are smarter now) with IMSI
numbers which are unique identifiers of SIM cards.

The base station doesn't know or care about phone numbers. (Kinda like L2 and
L3 in networking - MAC vs IP addresses.)

~~~
dfox
Another issue apart from addressing is that all the SMS related logic resides
in the SMSC and rest of the network sees the traffic as opaque payload.

The article glosses over how the resulting message structure is actually sent
over the radio interface and the SS7 network. In all it involves establishing
(somewhat TCP-like) connection between your phone and SMSC across the
signalling paths. The fact that this process is somewhat involved and consumes
significant amount of radio resources is probably at least partially the
reason why SMSes aren't particularly cheap.

On the other hand on native LTE sending or receiving SMS could in theory
consist of two UDP packets, but I'm not sure how widely is this deployed.

~~~
bestham
An SMS is sent in the GSM SACCH (Slow Associated Control Channel), that
channel is normally used for timing information (how far away the handset is
from the cell tower and the power control of the handset). Since SMS is not a
real time application, they are virtually free. The phone will wait until it
is possible to send. This and congestion on the SMSC is why SMSes sent on New
Years eve often are delayed.

------
toomanybeersies
I find it pretty amazing that I can take my phone overseas, and someone in a
third country could send me an SMS and it will find my phone in a matter of
seconds.

~~~
macintux
I remember being astonished I could email someone in Sweden from the U.S. in
1991 and it arrived instantly. So much magic we now usually take for granted.

------
eoinclancy1
Incredible article! Brings me back to my EEE days. I have become very
interested in Telnyx recently as they move towards being a next generation
carrier replacing the old-school PSTN with API oriented connectivity. Would
highly recommend checking them out here -
[https://telnyx.com/products/programmable-
sms?utm_source=refe...](https://telnyx.com/products/programmable-
sms?utm_source=referral&utm_medium=hackernews_referral&utm_campaign=sms-
routing-january-2019)

~~~
mandrill
Yeah interesting to see how much complexity is introduced by the PSTN--
impacting deliver-ability and making things like broadcasting a challenge.
Also found the SMS from SIM to Cell Tower in the article eye-opening. Will
check out your link...

------
gadders
About 20 years ago, before texting really became popular, you used to be able
to change your SMSC to one from a specific company and get free texts. I think
in the UK I used one from Finland.

------
samat
I wish you'd have dived into software part of rendering text. Fonts, scaling
etc.

Great article, thank you very much!

------
adamson
Are most of the images failing to load for anyone else? It's a delightful
post, but so much of it refers to the images that I feel like I'm missing a
lot

~~~
scottbot
Hey, not the OP but the original author here! I was wondering why my server
was going crazy; should've known it was HN. If you have issues, the page is
already scraped into the Internet Archive:
[http://web.archive.org/web/20190116163255/http://scottbot.ne...](http://web.archive.org/web/20190116163255/http://scottbot.net/the-
route-of-a-text-message/)

------
colinprince
This is delightful!

And this phrase kills me (in a good way):

"The process isn’t entirely frictionless, which is why my phone vibrates
lightly upon delivery"

------
nerdile
It's a fun read, intentionally glossy on the details (is this "pop tech"?) but
I was fascinated.

Except the value judgments about endianness in encoding. All of the decisions
in this system were made in a broader context. When you see something weird,
it's tempting to say, that is inane, but it is enlightening to ask, what am I
missing?

------
saagarjha
> If cell waves are 6 to 14 inches, their antennas need to be 3-7 inches. Now
> stop and think about the average height of a mobile phone, and why they
> never seem to get much smaller.

Is this actually true? I thought this was mostly because this was a convenient
size for phones to be, and that antennas were often internally folded anyways.

> You know that every point of light, like the Christian God or Musketeers
> (minus d’Artagnan), is always a three-for-one sort of deal. Red, green, and
> blue combine to form white light in a single pixel.

Doesn't Samsung use PenTile displays, which has the normal number of green
subpixels and but with fewer red and blue ones?

~~~
scottbot
To your first point, look to the other comments, which clarify this beyond
what I was aware of. To your second point, yes you are correct; I didn't feel
like getting into that was necessary, but it's apparent in the image I put on
the blog post.

~~~
saagarjha
Unfortunately, the images didn't load when I was reading your article, so I
didn't see them :(. Glad to hear you're already aware of these, though.

------
buchanae
One of the best articles I've read in awhile.

I'd love to know more about this line: "There’s also a little flag in the DCS
byte that tells the phone whether to self-destruct the message after sending
it"

And also, how do towers deconvolute all those signals?

------
danyork
What a fun - and educational - post about the full and complete journey from
the moment someone starts typing “I love you” on a phone to when it gets read
on the other end. That was great!

------
zoggjones
Brilliant. That was so much more interesting than I expected it to be. Thanks
for posting.

------
holmberd
Still common to call it BTS (GSM era) contra RBS in the states?

------
leetbulb
I love this writing style. Thank you. Would like to see more!

------
f055
Delightful article! Thank you!

------
flareback
I think he left out the part where the NSA gets the data sent to them.

