In networking, a protocol is a standardized way of doing certain actions and formatting data so that two or more devices are able to communicate with and understand each other.
To understand why protocols are necessary, consider the process of mailing a letter. On the envelope, addresses are written in the following order: name, street address, city, state, and zip code.
If an envelope is dropped into a mailbox with the zip code written first, followed by the street address, followed by the state, and so on, the post office won't deliver it. There is an agreed-upon protocol for writing addresses in order for the postal system to work. In the same way, all IP data packets must present certain information in a certain order, and all IP addresses follow a standardized format.
Transmission Control Protocol (TCP) ensures packets are reassembled correctly by first establishing a connection with the recipient computer. Once the transmission begins, TCP guarantees that all packets arrive in the correct order. Packet headers contain information, similar to numbering pages in a letter, that allows the receiving device to put the packets back in the right sequence
Computers send the first packet to the nearest router.
A router is a type of computing device used in computer networks that helps move the packets along.
Arrow goes from laptop to router, with message "TO: 91.198.174.192" and "FROM: 216.3.192.1".
When the router receives a packet, it looks at its IP header. The most important field is the destination IP address, which tells the router where the packet wants to end up.
The router has multiple paths it could send a packet along, and its goal is to send the packet to a router that's closer to its final destination.
If a packet is lost or corrupted, TCP handles the situation through an acknowledgment system. The receiving computer sends an acknowledgment for each packet it receives. If the sender does not get an acknowledgment for a specific packet, it assumes the packet was lost and sends it again. This process ensures reliability over speed
The router has a forwarding table that helps it pick the next path based on the destination IP address.
That table does not have a row for every possible IP address; there are 2^32 possible IP addresses (IPv4), and that's far too much to store. Instead, the table has rows for IP address prefixes.
When two IP addresses start with the same prefix, that often means they're on the same large network.
Router forwarding tables take advantage of that fact so that they can store far less information.
Once the router locates the most specific row in the table for the destination IP address, it sends the packet along that path.
IP addresses are critical because they are unique identifiers for every device connected to the internet, much like a mailing address for a house. They are essential for routing and addressing data packets so they can travel across networks and arrive at the correct destination. Every packet includes the destination IP address, which routers use to forward the packet closer to its final recipient. Without IP addresses, devices wouldn't know where to send or receive information.
If all goes well, the packet should eventually arrive at a router that knows exactly where to send it.
The router can now send the message to the destination IP address, which may be a personal computer or a server.
A packet is similar to a letter in several ways:
Standardized Formatting: Just as the postal service requires addresses to be written in a specific order (name, street, city), network protocols require packet information to be formatted in a standardized way so devices can understand it.
Addressing: An IP packet contains a destination and source address, much like a piece of mail includes the recipient's address and a return address.
Segmentation: Sending a large message is like writing a long letter on a series of small, numbered index cards to fit through a small mail slot; the internet breaks large files into smaller packets that are numbered and reassembled at the destination.
A key difference is that the internet uses packet switching, meaning packets from the same message can take different network paths to get to the same destination. A physical letter, by contrast, typically follows a single path from sender to recipient.
When a large file like a video is transmitted, it doesn't travel in one piece. Instead, it is broken down into many small packets of data. Each packet contains a header with the source and destination IP addresses and a payload, which is a small piece of the video file. These packets travel across the internet, forwarded by routers, and are reassembled into the original file by the receiving computer.
If there was no TCP protocol, a less reliable protocol like UDP (User Datagram Protocol) might be used. UDP does not guarantee that all packets are delivered or that they arrive in the correct order, and it does not re-send lost packets. For a video file, this would likely result in a corrupted or unplayable file with missing or scrambled pieces