# How does the Internet work?

There were a lot of network disconnections during my last English lesson through a video call and I joked, “The Internet waves are broken today”. The teacher answered, “I know nothing about the Internet — I use it every day and it’s magic for me.” So, I decided to write an article for her and other people, who use the Internet and think that it’s magic given to us from above. The goal of this article is to explain complex things in a very simple way, so many details will be skipped for this purpose.

I will try to explain the Internet as for a child. When I was a child I had a lot of questions about the essence of things. I want to elaborate on some physical aspects of networks and show that it’s not magic, it’s nature and human technologies with defined rules.

And the first question is “How is data transmitted through wire?”. For Internet connections through wire, cables are used with electrical signals, and optical fiber cables with light signals. They differ in noise immunity, signal transmission distance, and in complexity of the industrial production. And after the explanation of wireless connections, I will speak about how we can transmit information using these signals.

How is data transmitted «through air»?” Photos, music, videos, texts and other information are transmitted as electromagnetic waves in a wireless connection. Electromagnetic waves are used by people in a lot of areas. You can see some waves from a visible spectrum which are light. Yes, light is a electromagnetic wave too, and other electromagnetic waves travel at the speed of light. You can see on the image below the entire range and scope of frequencies and lengths of electromagnetic waves, and how people can use them in different domains. Without deep physical details, you can think about an electromagnetic wave as a water wave, but it can propagate without anything in a vacuum.

“How can we present all different information such as images, texts and videos in understandable signals for computers?” Information in computers is presented as a set of bits, a bit is the unit which has two possible values; 0 or 1. That’s all, you can express any information in a set of 0s and 1s. You can see in the images below how we can present numbers in bits, and how to present alphabet letters in bits, and the last is an example of how we can present an image in bits:

Of course, it’s not only one way for encoding images and letters in bits, a lot of image file formats exist with different rules such as GIF, PNG, JPEG, SVG, etc. And many character encodings such as UTF-8, UTF-16, ASCII, and so on.

How can we read and write bits using signals?” As you can see on an image below, we can change different parameters of an electromagnetic wave such as amplitude, or frequency, or phase of a wave for describing sets of 0s and 1s. And in the same way, we can change different params of electric signals such as voltage or amperage. And the last, in an optical fiber cable we can send light signals of varying intensity.

What’s next? We know how to send and receive bits as signals. “How can we understand what kind of data we receive?” As you can understand, a full-color photo seems as a lot of bits, and if you send them all at once, and several bits will be lost, you need to retransmit them all over again. For this reasons, and not only, data is divided into packets. A packet is the basic unit of information in a network transmission, and if some packets are lost, you can only retransmit them. A network packet contains not only data, but also a header with source and destination addresses, and other important fields. And a packet is a set of bits too, but every device know where each field of a packet’s header and data are.

“How can packets know where other computers are?” As we now know when we send data, we wrap it in packets, and these packets have source and destination addresses. What are these? They are IP addresses. As you can see on an image below, from your computer(client) you make a request to, for example google.com, and your request is wrapped in packets that travel to the Google server, and after that, the Google server sends an answer to your source IP address.

This cloud in the center of image is the Internet. Your connection to the Google server isn’t direct — there are intermediate computers or routers in between. How does a router make this decision? It does so through something called a forwarding table. A forwarding table consists of a set of IP address patterns and the link to send across for each pattern. Routers then check with the table and send a packet to the best matched direction.

As you can see now, the Internet is signals which are propagated through air and wire between computers and other devices. And, of course, it’s a much more complex system of hardware, software, protocols, algorithms, technologies, science and experts. And I want to underline a very important thing — the Internet Standards. Common standards for hardware, software, transmission, encoding/decoding, file formats, applications and so on. Standards are very important in the Internet technologies, because the Internet connects multiple devices with a multitude of data types, and it’s the glue of the Internet — that’s why we can understand signals from each other.