Hacker News new | comments | ask | show | jobs | submit login
The Route of a Text Message (scottbot.net)
627 points by ericlott 34 days ago | hide | past | web | favorite | 63 comments



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

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


That's fascinating. I'm the author of the piece, and the material trick and its ramifications is new to me, thank you! This entire subject is not my area of expertise - I'm an historian of 17th century astronomy - but it's been fun dipping my toes into this world.


If you want to dive into the deep pool of antennas the experimentation side of ham radio is dedicated to this, among other interesting technical topics.

Personally I find it a fascinating hobby and never run out of fun things to research/build/test.


What are some of your favorite topics from 17th century astronomy, you would recommend to anyone interested in learning more about it. Sounds fascinating thanks!



> 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.

over the last few years, phones have gotten a lot larger on average... maybe we'll get to one wavelength soon...


On the other hand, LTE bands are moving down the spectrum (longer wavelength). T-mobile for example are rolling out 600 mhz service right now, meanwhile while I sit here in Downtown Seattle I'm connected to 1900 mhz, so less than 1/3 of the length.


I wouldn't say that. TMobile is the outlier. Most 5G deployments will have mich, much shorter wavelengths.


And a lot heavier, too.


I spent a couple of days playing with antennas and an RTL-SDR dongle. It's quite an interesting subject which I'd love to learn more about one day. I mostly used it for listening in on ATC. It was cool to make an Antenna (in this case a half wave dipole) which could hear aircraft out over the English channel from my livingroom in London.


So will we ever have tiny cell phones like Zoolander?


We already have, and they're apparently very popular in prisons: https://www.vice.com/en_uk/article/zngpz4/prison-phones-that...


Although I did have one of these in the early 2000s:

https://www.mobilegazette.com/siemens-sl55-08x10x26.htm


Yes - search "mini phone" on AliExpress or similar.


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.


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.


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.


How about making collaborative article (github?), so that everyone can write his own two cents from his field he knows?


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)

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...


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.


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

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

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>


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

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


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


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


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.


Book length would be great.


TAOCP-style, every 10-20 years another volume.


let me know if you need a proofreader for the book...


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.


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.


It's amazing how much detail is required to fully answer that question... and it comes right down to the hardware that browser is on.

I think most of the time when people ask this question, they're really only looking for a protocol level answer, they're not looking at you getting into the nitty gritty of comms signals and the 7 layer OSI model and BGP and frame relay protocols. Some layers are more fascinating than others...and depending on who you're talking to, the level of focus you give each layer can vary. But you could quite easily drown someone with information.

The tragedy of this is that you kind of need to understand the big picture before any of the details become clear. In much the same way you learn the detail of math without ever understanding the big picture and consequently a lot of people fail to feel good at math because they just don't get it. It's not until you have sufficient vocabulary until the grammar becomes clear.

It's easier to learn the web than math from the top down because all the pieces are reasonably easy to interact with and there are easy to obtain tools to allow you to pick apart just about everything to help you understand what is going on under the covers... except for the BaseBand radio on your cell phone, that's a virtual black box that the phone manufacturers don't want you picking apart. Tools for this are beginning to become available as hackers manage to find ways to reverse engineer them too.


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.


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


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.


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?


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.)


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.


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.


SMS over LTE is RCS [1], isn't it? I'd be happy to use it but my carrier/phone manufacturer have decided to limit the RCS apps I can use.

1: https://en.wikipedia.org/wiki/Rich_Communication_Services


I thought SMS was built on top of the existing GSM signalling protocols, and so is effectively free to carriers. The bandwidth costs of a few hundred byte message are nothing compared to streaming a video or a phone call. The only reason why carriers charge for SMS is because they can.


I'm pretty sure that BTC work with MSINs, primarily.


Yes, that's quite possible, I'm not that familiar of that side of things and might be thinking of the wrong number. Anyway, the point is that they don't use the same numbers you and I have in our phonebooks.


No. BTS is quite dumb and BTC is not tasked with routing.


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.


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.


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...


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...


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.


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

Great article, thank you very much!


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


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...


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"


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?


> 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?


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.


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.


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?


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!


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


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


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


Delightful article! Thank you!


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




Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: