Why are tweets limited to 280 characters?
"Oh no, Adi is in why mode!", Groaned Pratham and our family mentally started preparing for the onslaught of the word why for the next 10-15 minutes. Life is different with 10-year-olds around, they can keep asking why until you start saying "I don't know".
I got into Adi's why mode today and asked the same question for the 280 character limit I keep running into for my tweets. I knew answers to a couple of whys from previous experience but I had to go look for source material to answer the deeper level of whys. Here we go down the why rabbit hole:
Why can't send a tweet that's longer than 280 characters?
Tweets started out as 140 characters long. Expressing ideas in 140 characters became an art. But many people still wanted a larger limit. Twitter relented and increased the limit to 280 characters recently. Of course, you can use Twitter threads if you still have more to say.
Why did tweets start as 140 characters long?
Twitter's early versions were based on SMS and SMS technology has a 140 character limit per SMS. Any longer SMS you see are concatenated using a special binary format.
Why can't SMS be longer than 140 characters?
Many English speakers would be tempted to correct me and say that SMS can indeed be 160 characters and they would be partially right.
SMS body can be 140 bytes. 140 bytes aren't a whole lot and even in the early SMS versions, telecom engineers devised a great strategy (called 7-bit encoding or GSM-7) to fit 160 ASCII characters in 140 bytes.
Think of it this way, printable characters (a-z, A-Z, 0-9, and some punctuation marks) can fit in 7 bits instead of 8 bits. If we choose to limit the characters in the SMS body to 128 ASCII characters; we can use fit 8 * 140 / 7 = 160 characters in 140 bytes.
Fun fact 1: The character { (curly brace start) is NOT included in the GSM-7 alphabet by default)
Fun fact 2: Only 70 characters can fit in an SMS for Chinese and Japanese.
Why can't SMS be longer than 140 bytes?
It comes down to protocols.
SMS is transferred using IP protocols in modern times. HTTP is of course most popular. But earlier forms used binary IP protocols like SMPP and CIMD. These limited the SMS body to 140 bytes.
The 140 bytes limit didn't come from IP protocols. The original limit came from a telecom protocol called SS7 (introduced in the 1980s). SS7 is a network protocol stack much like TCP/IP. SS7 uses the OSI layers called MTP 2,3, SCCP, TCAP, and MAP (only 6 layers that act like 7).
The overall packet size for SS7 messages is 279 bytes. Out of which some are reserved, some are used for network addressing, transaction management, SMS sender, receiver, and 140 bytes are available for actual SMS payload.
Why are SS7 messages only 279 bytes long?
That's where my prior knowledge ends and we go into SS7 history. SS7 messages are of three types. The message used for SMS is called MSU (Message Signal Unit) and has 272 bytes of the payload called SIF (Signalling Information Field).
The standards talk about message length changing from 62 octets (bytes) to 279 bytes. I also see 279 to 300 provisional values in standards.
The earlier version SS6 seems to only use 28 bits for signaling so I can understand why they would increase it to 62 bytes in SS7. These 62 bytes were enough for carrying calls (using a standard called ISUP) but when other applications emerged, they increased the size.
But why 279 bytes?
This has got to do a lot with acceptable error rates, retransmissions, processing, delays, and throughput. Using 64 kbits/second (a standard at that time) it was calculated that the transmission delay would be 120 milliseconds (ms) over a wire length of 25,000 kilometers (kms).
Outgoing link delay crosses 1000 milliseconds when average of 279 bytes of messages are sent. A mean message length of 140 bytes looks like a sweet spot for all the metrics.
Processing time (those processors were slow) was also crossing the desired limits at 279 bytes message length.
I still don't understand fully why it's 279 and not 280 or 300. If the readers can find the actual source of this information. I will be eternally grateful.
To conclude, Twitter has a 280 character limit because the technical standard used for carrying SMS is based on a standard that was designed for routing calls and used only 28 bits and was later upgraded to use 279 bytes because error probability was going beyond acceptable limits for longer messages.