-
-
-
----------------------- 2237 - CELL PHONE - to send a txt message
-
- How do cell phones dial your number? How do they send the message? Cell phones are radios not traditional phones per say. Phones used wires, cell phones use radios that transmit through the air.. They talk to radio towers that relay messages around the country until the message gets to your phone.
-
- This review tracks the message from how it is typed, stored, sent, received, and displayed. From the sender’s phone to the receiver’s phone. We will send this simple message, “ I love you” . Simple right?
-
- I dare you to read through this process, only an electrical engineer can love. Thus the message being sent. Give it a try if only a scan the highlights.
- We begin by my thumb tapping a translucent screen, one letter at a time, and end as light strikes on the receiving person’s retinas.
-
- With each tap of the finger, a small electrical current passes from the screen into your hand. Because electricity flows easily through human bodies, sensors on the phone register a change in voltage wherever your thumb presses against the screen. Your body is a sink for flowing electrons. No worries that happens all the time.
-
- But the world is messy, and the phone senses random fluctuations in voltage across the rest of the screen, too, so an algorithm determines the biggest, finger-looking voltage fluctuations and assumes that is where you intended to press. The phone tries to compensate for sloppy fingers too. The software sorts it all out.
-
- So you start tap-tap-tapping on the keyboard, one letter at a time.
-
-------------------------- I-spacebar-l-o-v-e-spacebar-y-o-u.
-
- The phone reliably records the (x,y) coordinates of each thumbprint and aligns it with the coordinates of each key on the screen. It’s harder than you think; sometimes your thumb slips, yet somehow the phone realizes you’re not trying to swipe, that it was just a messy press. The phone tries to compensate for sloppy swipes as well.
-
- An algorithm tests whether each thumb-shaped voltage disruption moves more that a certain number of pixels. If the movement is sufficiently small, the phone registers a key press rather than a swipe.
-
- The allotment of 160 characters is a carefully chosen number for the complete txt message.
-
- SMS is a system of cell phone protocols. SS7 is Signaling System number 7, which is a set of protocols used by cell phones to stay in constant contact with their local tower. Cell phones need this continuous connection to know when to ring, to get basic location tracking, to check for voicemail, and communicate other non-internet relevant messages. Since the protocol’s creation in 1980, it had a hard limit of 279 bytes of information.
-
- Normally, 279 bytes equals 279 characters. A byte is eight bits. Each bit is a 0 or 1.
and alphabet single letter is equivalent to eight 0s and 1s in a row.
-
‘A’ is 0100 0001
‘B’ is 0100 0010
‘C’ is 0100 0011
and so on.
-
- Unfortunately, getting messages across the SS7 protocol is not a simple matter of sending 2,232 (0’s or 1’s) , that’s 279 bytes at 8 bits each, through radio signals from one phone to another phone..
-
- Part of that 279-byte signal needs to contain the receiver’s phone number, and part of it needs to contain the senders phone number. Part of it needs to let the cell tower know, this is a message, not a call, don’t ring the phone!.
-
- After cramming all the necessary text bits into the 279-byte signal, they were left with only enough space for 140 characters at 1 byte (8 bits) a piece, or 1,120 bits.
-
- But what if they could encode a character in only 7 bits? At 7 bits per character, they could squeeze 160 (1,140 / 7 = 160) characters into each SMS message, but those extra twenty characters demanded a sacrifice of fewer possible letters.
-
- An 8-bit encoding allows 256 possible characters: lowercase ‘a’ takes up one possible space, uppercase ‘A’ another space, a period takes up a third space, an ‘@’ symbol takes up a fourth space, a line break takes up a fifth space, and so on up to 256.
-
- To squeeze an alphabet down to 7 bits, you need to remove some possible characters: the 1/2 symbol (½), the degree symbol (°), the pi symbol (pi), and so on. But assuming people will never use those symbols in text messages , this allows stuffing 160 characters into a 140-byte space, which in turn fits neatly into a 279-byte SS7 signal.
-
- Typing “I love you” into a text message the phone converts those letters into this 7-bit encoding scheme, called GSM-7.
-
- “I” (notice it’s at the intersection of 4x and x9 above) =49
-
- Spacebar (notice it’s at the intersection of 2x and x0 above) =20
-
- “l” =6C
-
- “o” =6F
-
- and so on down the line. In all the message becomes:
-
------------------------------ 49 20 6C 6F 76 65 20 79 6F 75
-
- (10 bytes combined). Each two-character code, called a hex code, is one 8-bit chunk, and together it spells “I love you”.
-
- But this is not how the message is stored on your phone. It has to convert the 8-bit text to 7-bit hex codes, which it does by essentially borrowing the remaining bit at the end of every byte. The resulting message appears as;
-
--------------------------------- 49 10 FB 6D 2F 83 F2 EF 3A
-
- (9 bytes in all) in the phone.
-
- When the phone senses voltage fluctuations over the ‘send’ button, it sends the encoded message to the SIM card (that tiny card your cell provider puts in your phone so it knows what your phone number is), and in the process it wraps it in all sorts of useful contextual data. By the time it reaches the receiver’s SIM, it goes from a 140-byte message (just the text) to a 176-byte message (text + context).
-
- The extra 36 bytes are used to encode all sorts of information:
-
- The Bytes are called octets (8 bits). Counting all possible bytes yields 174 (10+1+1+12+1+1+7+1+140). The other two bytes are reserved for some SIM card bookkeeping. The first ten bytes are reserved for the telephone number (service center address, or SCA) of the SMS service center (SMSC), tasked with receiving, storing, forwarding, and delivering text messages. It’s essentially a switchboard for all the mnemonics.
-
- The transmitter’s phone sends out a signal to the local cell tower and gives it the number of the SMSC, which forwards the text message from the tower to the SMSC. The SMSC, operated by AT&T, routes the text to the mobile station nearest to the receiver’s phone.
-
- The next byte , called a PDU-type, encodes some basic housekeeping on how the phone should interpret the message, including whether it was sent successfully, whether the carrier requests a status report, and whether this is a single text or part of a string of connected messages.
-
- The byte after the PDU-Type is the message reference (MR). It’s a number between 1 and 255, and is essentially used as a short-term ID number to let the phone and the carrier know which text message it’s dealing with.
-
- The next twelve bytes or so are reserved for the recipient’s phone number, called the destination address (DA). With the exception of the 7-bit letter character encoding that helps stuff 160 letters into a 140-character space.
-
- The phone number encoding is the most confusing bits you’ll encounter in this SMS. It’s called reverse nibble notation, and it reverses every other digit in a large number.
-
- A phone number which is usually in this form 1-352-537-8376, is logged in to the receiver’s phone as:
-
---------------------------- 3125358773f6
-
---------------------------- The 1-3 is represented by 31
-
---------------------------- The 52 is represented by 25
-
---------------------------- The 53 is represented by 35
-
-----------------------------The 7-8 is represented by 87
-
---------------------------- The 37 is represented by 73
-
---------------------------- And the 6 is represented by…f6
-
- Where the ‘f’ means it’s the end of the phone number, it’s one character before the final digit.
-
- The Protocol Identifier (PID) byte is mostly wasted space. It takes about 40 possible values, and it tells the service provider how to route the message. A value of 22 means the sender is sending “I love you” to a fax machine; a value of 24 means he is sending it to a voice line. Since he is sending it as an SMS to the receiver‘s phone that receives texts, the PID is set to 0
-
- The next byte is the Data Coding Scheme which tells the carrier and the receiving phone which character encoding scheme was used. The sender used GSM-7, the 7-bit alphabet mentioned above that allows stuffing 160 letters into a 140-character space, but you can easily imagine someone wanting to text in Chinese, or someone texting a complex math equation. It gets complicated, but let’s keep it simple.
-
- For the sender’s text, the DCS byte was set to 0, meaning he used a 7-bit alphabet, but he may have changed that value to use an 8- or 16-bit alphabet, which would allow it to have many more possible letters, but a much smaller space to fit them. Incidentally, this is why when you text emoji to your friend, you have fewer characters to work with.
-
- There is also a little flag in the DCS byte that tells the phone whether to self-destruct the message after sending it. The validity period (VP) space can take up to seven bytes, and sends us into another aspect of how text messages actually work.
-
- When the sender hits ‘send’, the text gets sent to the SMS Service Center (SMSC), which then routes the message to the receiver. What the phone receiver were turned off? The phone needs to accept a message when it’s not receiving any power, so the SMSC has to do something with the text.
-
- If the SMSC can’t find the phone, the message will just bounce around in its system until the moment my phone reconnects, at which point it sends the text out immediately.
-
- The validity period (VP) bytes tell the carrier how long the message will wait before it finds a new home. It is either a timestamp for a duration, which basically says “if you don’t see the recipient phone pop online in the next however-many days, just don’t bother sending it.”
-
- The default validity period for a text is 10,080 minutes, which means if it takes more than seven days to turn my phone back on, I’ll never receive the text.
-
- There is often a lot of empty space in an SMS, a few bits here or there are dedicated to letting the phone and carrier know exactly which bytes are unused. If the sender’s SIM card expects a 176-byte SMS, but because he wrote an exceptionally short message it only receives a 45-byte SMS, it may get confused and assume something broke along the way. The user data length (UDL) byte solves this problem: it relays exactly how many bytes the text in the text message actually takes up.
-
- In the case of “I love you”, the UDL claims the subsequent message is 9 bytes. You’d expect it to be 10 bytes, one for each of the 10 characters in
-
------------------------------- I-spacebar-l-o-v-e-spacebar-y-o-u
-
- But, because each character is 7 bits rather than 8 bits (a full byte), we are able to shave an extra byte off in the translation. That is because 7 bits * 10 characters = 70 bits, divided by 8 (the number of bits in a byte) = 8.75 bytes, rounded up to 9 bytes.
-
- Which brings us to the end of every SMS: the message itself, or the UD (User Data). The message can take up to 140 bytes.
-
------------------------------ I love you
-
------------------------------ 49 10 FB 6D 2F 83 F2 EF 3A.
-
- Somehow, the SMS must get from the SIM card to the nearest base station. To do that, the sender’s phone must convert a string of 176 bytes to the 279 bytes readable by the SS7 protocol, convert those digital bytes to an analog radio signal, and then send those signals out at a frequency of somewhere between 800 and 2000 megahertz. That frequency has each wave at between 6 and 14 inches from one peak to the next.
-
- 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. A half wavelength. If cell phone waves are 6 to 14 inches, their half-wavelength antennas need to be 3-7 inches. Now stop and think about the average height of a mobile phone.
-
- Through some digital wizardly the sender’s phone sends a 279-byte information packet containing “I love you” at the speed of light in every direction, eventually landing into no antennas after about 30 miles.
-
- But this signal strikes an antenna at the AT&T HSPA Base Station ID199694204 LAC21767. This base transceiver station (BTS) is about 5 blocks away.
-
- It is a wonder the signal ever reaches the base transceiver station at all, given everything else going on. Not only is this person texting “I love you” in the 1,000 megahertz band of the electromagnetic spectrum; tens of thousands of other people are likely talking on the phone or texting within this same 30 mile radius.
-
- On top of that, a slew of radio and TV signals are jostling for attention in our immediate airspace, alongside visible light bouncing this way and that, to name a few of the many electromagnetic waves that seem like they ought to be getting in the way.
-
- Due to the complexity of competing signals, each base transceiver station generally can’t handle more than 200 active users at the same time.
-
- The message is massaged into the 279-byte SS7 channel, and sent along to the local base transceiver station (BTS). From there, it gets routed to the base station controller (BSC), which is the brain of not just our antenna, but several other local antennas besides.
-
- The BSC flings the text to AT&T’s mobile switching center (MSC), which relies on the text message’s SCA (remember the service center address embedded within every SMS? That’s where this comes in) to get it to the appropriate short message service center (SMSC).
-
- But if our phones are connected to the same tower, so after step 3 the 279-byte packet of love just does an about-face and returns through the same mobile service center, through the same base station, and now to my phone. A trip of a few dozen miles in the blink of an eye.
-
- Buzzzzz. My pocket vibrates. A notification lets me know an SMS has arrived through my nano-SIM card, a circuit board about the size of my pinky nail.
-
- The SCA (phone number of the short message service center), the PDU (some mechanical housekeeping), the PID (phone-to-phone rather than, say, phone-to-fax), the DCS (character encoding scheme), the UDL (length of message), and the UD (the message itself) are all mostly the same, but the VP (the text’s expiration date), the MR (the text’s ID number), and the DA (my phone number) are missing.
-
- Instead, on my phone, there are two new pieces of information: the OA (originating address, or the sender’s phone number), and the SCTS (service center time stamp, or when the sender sent the message).
-
- The sender’s phone number is stored in the same annoying reverse nibble notation that my phone number was stored in on the sender’s phone, and the timestamp is stored in the same format as the expiration date was stored in on the sender’s phone.
-
- These two information inversions make perfect contextual sense. The sender’s phone needed to reach me by a certain time at a certain address, and I now need to know who sent the message and when. Without the home address we would not know whether the “I love you” came from which would change the interpretation of the message fairly significantly.
-
- In much the same way that any computer translates a stream of bytes into a series of (x,y) coordinates with specific color assignments, our phone’s screen gets the signal to render
-
---------------------------------- 49 10 FB 6D 2F 83 F2 EF 3A
-
on the screen as “I love you” in backlit black-and-white. It’s an interesting process on how those instructions become points of light.
-
- There are about 330,000 tiny sources of light, or pixels, crammed inside each of the phone screen’s 13 square inches. For that many pixels, each needs to be about 45 micrometers wide: thinner than a human hair. There’s 4 million of them all packed into the palm of your hand.
-
- But you already know how screens work. You know that every point of light is always a three-for-one. Red, green, and blue combine to form white light in a single pixel. Fiddle with the luminosity of each channel, and you get every color in the rainbow. And since 4 x 3 = 12, that’s 12 million tiny sources of light sitting there on our screen
-
- Each pixel, as the acronym suggests, is an organic light-emitting diode. The layers are a cathode plate (negatively charged), below a layer of organic molecules that are just some atoms strung together with carbon), below an anode plate (positively charged).
-
- When the phone wants the screen on, it sends electrons from the cathode plate to the anode plate. The sandwiched molecules intercept the energy, and in response they start emitting visible light, photons, up through the transparent anode, up through the screen, and your eyes.
-
- Since each pixel is three points of light (red, green, and blue), there’s actually three of these sandwiches per pixel. They’re all essentially the same, except the organic molecule is switched out: poly(p-phenylene) for blue light, polythiophene for red light, and poly(p-phenylene vinylene) for green light. Because each is slightly different, they shine different colors when electrified.
-
- All 4 million pixels are laid out on an indexed matrix. An index works in a computer much the same way it works in a book: when the phone wants a specific pixel to light a certain color, it looks that pixel up in the index, and then sends a signal to the address it finds.
-
- The phone’s operating system interprets sender’s text message, figures out the shape of each letter, and maps those shapes to the indexed matrix. It sends just the right electric pulses through the Super AMOLED screen to render those three little words.
-
- Your eyes never see “I love you” in bright OLED lights. Rather it appears on the screen black-on-white. The phone creates the illusion of text through negative space, washing the screen white by setting every red, green, & blue to maximum brightness, then turning off the bits where letters should be. Its complexity is an electrical engineer’ dream.
-
- The message received is not just a technical wonder. The text would not have reached me had I not paid the phone bill on time That requires a small army of workers handling financial systems behind the scenes. Technicians keep the phone towers in working order, which they reach via a network of roads partially subsidized by federal taxes collected from hundreds of millions of Americans across 50 states.
-
- Because so many transactions still occur via mail, if the U.S. postal system collapsed tomorrow, our service would falter. Factory workers assembling parts in both our phones, and exhausted programmers renting expensive Silicon Valley closets are as-you-read-this pushing out code ensuring our phones communicate without interruption.
-
- All of this underneath a 10-character text. A text which, let’s be honest, means much more than it says.
-
- (More reviews on this subject are available if requested)
-
- January 18, 2019
----------------------------------------------------------------------------------------
--- Some reviews are at: -------------- http://jdetrick.blogspot.com -----
-- email feedback, corrections, request for copies or Index of all reviews
- to: ------- jamesdetrick@comcast.net ------ “Jim Detrick” -----------
- https://plus.google.com/u/0/ -- www.facebook.com -- www.twitter.com
-------------------------- Friday, January 18, 2019 --------------------------
------------------------------------------------------------------------------------------
No comments:
Post a Comment