A miracle for the lazy

This is a translation from the original post in Spanish.

The vocal cords start vibrating from the mouth, which generate waves of movement in the air, bouncing around the room until reaching the microphone. It analyzes the wave against an stored in a chip specifically designed for it consumir power to finally decide that the pattern is sufficiently similar to then wake up the main processor.

The main core wakes up from hibernation, accessing the program in RAM memory composed of binary information cells. The operating system begins executing the 350 assembler instructions, each of them moving information from the memory in the form of electrical impulses through an integrated circuit of 14 nanometers long to the main registers.

The instructions end up turning on the main microphone in 12 millisecons receiving the airwaves still in circulation, which are digitalized with a software occupying 50Kb in RAM memory; around 410,000 logical records. Another 700 instructions on the CPU are executed to compress the audio digital file, using 4 trillon operations that finally leave in memory — always moving bit by bit internally — about 5Kb of data.

The program instructions continue to execute thousands of processes, which in this case end up opening a network session within the operating system. The operating system sent instructions through electrical pulses and standard communication protocols to the WiFi card, which emits radio frequency signals. These thousands of signals spread throughout the environment, collide against walls and are repeated until they are received by an antenna connected by a metallic connection with a plate, which is located inside a device known as a WiFi router, alias “the one we restart when nothing works.“

The router receives the signals thanks to other software stored in a ROM memory and executed by its own CPU. After digitalizing the received wave signals, it processes them and sends them to other program in the same memory which start to read bit by bit to understand what to do. There it realizes that accessing the external output is required before sending data packets through it. This output is connected through a coaxial cable, so signales must be converted to electrical impulses that add up to thousands of them being transported by that cable, including 350 television channels, 60 of them in HD.

The boundle of bits travel 97 yards, or 89 meters, to a central box in the same building, whose hardware receives the signal, detects that they are meant for upload data and sends them trough an optic fiber cable that travel by bouncing on the inner edges of a filament inside a cable with hundreds of them. How much do they travel? They pass through hundreds of cables connected by routers, and after about 16 miles or 26 kilometers of travel (in 127 microseconds) arrives at a provider’s central building.

When it arrives the provider’s central building, one device receives it but while processing the data the device stops working for a hardware failure and that’s why the original router must resend the data packages again, and this time other device takes control and receives the data. That device realizes, after processing thousands of instructions, that is required to open a TCP connection to an IP address (the computer does not know this but that IP address is localted on a different continent).

At that moment, the central device generates new packets sent by two output connections, an optic fiber connection connected to other company and other cable that after 15 devices the data ends up being sent by radio signal to a geostationary satellite. The optical fiber carrying one of the copies of the transmission ends up connecting after about 12 intermediate devices (each of which checked what was transmitted by consuming energy and transporting bits from one place to another) to a channel under the ocean to the other continent. The satellite on its side receives the radio signal among tens of thousands of trillions of other signals, which it interprets and re-sends to another country. In both trips the information continues to be transported and diversified. About 15% of the time, the signals had to be resent because they have been lost or corrupted on the journey.

After a while the packet arrives a device who knows that IP address and it has a coaxil cable connected to that device. The packet finally arrives to a network card that interprets the data as effectively for that device, so it decodifies and sent in electrical impulses to the CPU while the programmed instructions are requesting it. After thousands of operations between the CPU, registers, RAM memory and network card, the program recognizes that some device from the other side of the world wants to send a message. That software accepts the request and send back an acknowledgement response. And a new message is agan reconverted into signales going through the jorney back. All of it, complete. Again.

The response arrives back to the original device, which decides to send those 5Kb of compress data in the RAM memory (do you remember?) in a data package that goes through the same journey but faster because now the network knows the best path, but that does not free the system of processing around 41,000 bits, which are encoded and recoded in electrical impulses, luminous signals and electromagnetic waves, not even counting that in the middle some equipment decided to separate the message in 3 smaller packages, one of which is lost and must be requested again.

Al llegar nuevamente al equipo original, éste decide entonces comenzar a enviar esos 5Kb de datos (¿te acuerdas?) en un paquete de información que comienza a enviarse otra vez por el camino que ahora al tener memoria sabe más rápido por qué vía llegar al destino pero eso no quita que alrededor de 41.000 bits son codificados y recodificados en impulsos eléctricos, señales luminosas y ondas electromagnéticas hasta llegar a destino, sin contar que en el medio algún equipo decidió separar el mensaje en 3 paquetes más pequeños, uno de los cuales se pierde y debe ser solicitado nuevamente.

Hey reader, are you still there? Cool! Let’s continue

The software at the provider’s central receives the 5Kb of compressed audio and sends it through an internal network (again, electrical impulses, cables and so on) to other device which start executing trillions of instructions comparing the encoded audio waves with words and letters stored in some memory cells. After 3 milliseconds executing trillions of operations consuming energy in a farm of 2 million servers of 4,000 US dollars each, the software decided that it has already decoded the audio file and it generates a 15 bytes message using the ASCII standard, which is sent back to the central server in that provider which, fortunately, it’s on the same country.

This central server makes a communication via TCP with a database server, which queries a couple of hard drives with cuatrillions of bits stored magnetically. The database server finds what the original audio requested and it sends the information back to the central server through cables, bits, protocols and other possible issues.

The central server took the final decision based on the information received. And that specifies that a communication to other server must be made (let’s call it the destination server) that it’s located in a third continent -there are 5 of them, so it could happen. A new communication following a similar path starts and the message is sent. To keep a good reader’s mental health, we will not repeat the process here.

The destination server receives the request, searches on its own database server (again, magnetic data, electrical impulses, network packages, error forwarding, RAM memory access, CPU and so on) and decides that it have to send a very simple message to one IP address.

And everything starts again. But this time, the IP address is pointing to the same router that the audio device used and where the trigger happened. Bits travelles again through continents, air, water, light, electricity until they reach the router where everything started.

Several devices connected to that router that are currently using energy -15 to be accurate- receive the data but after decoding it, they rejected the message because it wasn’t for them.

Until finally it arrived at a device that was actually the recipient. This device reads the message and sends an electrical signal to an internal circuit that disconnects a logical bridge of two electricity cables, cutting the electric current coming from the electric power and the cable going to the ceiling of that room.

Audio waves, electromagnetic waves, electric pulses, light beams, radio signals to the thermosphere, magnetic cells, memory cells, a trip of 200 megameters, 1500 copies of the data transmitted in 213 equipment working in orchestra thanks to the use of 47 protocols. For what?

Sitting very comfortably on the couch, a human being realizes that the light switch is really far away so she says “Alexa, turn off the light”. 1 second and 321 thousandths later, the light goes out.