
Network packets

Upgrade for more content
True or false? User Datagram Protocol does not send the same packet twice.
The Internet consists of many cables and computers that send small information packets around the entire planet. How do all these packets get to the correct device? Packages sent in the post need an address to arrive at the correct location. A packet on the Internet also needs an address to be sent to. Therefore, all devices connected to the Internet need their own address.
On the Internet, the rule for how the address should look - the protocol - is called Internet Protocol, shortened to IP. A computer's address is called its IP-address. When one computer wants to contact another computer, it sends a packet. The packet contains the address of the computer it wants to contact. The computer that sent the packet wants an answer. ..therefore, the packet also contains the address of the computer that sent it.
The packet thus contains two addresses. An IP-address consists of four numbers, separated by dots. The first one, two, or three numbers tell you which country, city, company, or university uses the address. In this example, 130 and 238 show that the IP address belongs to Sweden, and that a university uses the address. The numbers 7 and 134 show which computer at this university has been assigned this address.
This way of writing IP addresses, version 4 or ipv4 - was agreed upon in the 1970s. It was designed for use by up to 4 billion devices connected together. That was believed to be more than enough to last forever. But it wasn’t. Today, there is a huge number, and an enormous variety of connected devices : mobile phones, cars, refrigerators, ...
Therefore, a new version of IP addresses, version 6 is coming in. All addresses will soon look like this: With IPv6, as many devices as there are grains of sand on earth can be connected. "That must be enough. Or is it?" Here is a computer that is about to send a picture to another computer. First, the picture is divided into multiple packets. Each packet gets the address of the receiving computer, and the address of the sending computer.
The packets are sent. But now they arrive in the wrong order. Will the picture look strange now? No, another protocol arranges that the packets are put together in the correct order. This is called Transmission Control Protocol, TCP.
TCP gives each packet an order number, a sequence number. Here comes the packet with sequence number 300 before the packet with sequence number 200. Meanwhile, the receiving computer is waiting to put all the packets together. But the packet with sequence number 200 doesn’t arrive! The receiving computer is programmed to wait for a set time, and if the packet hasn’t arrived, it sends a request to resend the missing packet.
The packet is sent again. When it arrives, the picture can be put together correctly. It's good that all packets get there. But sometimes that's not the most important thing. Lina is video-chatting with Leon.
The video chat is divided into small packets. What happens if the packets come in the wrong order? we the sentence Now understand! What? That didn’t make sense?
No. In a video chat, all packets must be in the correct order. Like this: NOW, we understand the sentence! But if some packets don’t arrive and need to be re-sent, the sound and picture won’t match. Therefore, there is another protocol: User Datagram Protocol, UDP.
UDP packets are sent faster than TCP packets because they are smaller. .. and UDP does not resend a packet that fails to arrive. So, with UDP packets, the picture on video chat can sometimes be .. .. really bad, when some packets are getting lost, .. but that's usually not as disturbing as when the sound and the picture are not synchronised.
So: Internet Protocol, IP, takes care of all the addresses on the Internet. Transmission Control Protocol, TCP, ensures that all packets that have been sent get there, puts them in the correct order, and is good when quality is important. User Datagram Protocol, UDP, also transports packets, is faster than TCP, always delivers the packets in the correct order, but lost packets can reduce the quality.