TCP — IP packet flow

Anirudh Rajmohan
4 min readMay 18, 2020

--

And a quick gist of how data flows through the internet.

Note: This article is Part II of a three part series explaining how data flows as packets of information on the internet.

Suggested reading if you haven’t already: DNS

Brief history of the internet:

The internet as a means of communication was preceded by telephone lines. Yes, the landline telephones which were wired up to underground cables.
Telephone lines were duplex in nature — it allowed for simultaneous transmission and receiving of information.

Telephones worked by being centrally connected to local hubs called telephone exchanges. This meant that all telephone connections belonging to a particular city were gathered at a central location which was the telephone exchange for that city. Then, corresponding connections were exchanged with the telephone exchange in the next city and this cycle continued until the information was sent to the telephone exchange of the destination city.

Once the intended message reached the destination city’s telephone exchange, it was then routed to the individual telephone number(connection) it was meant for.

Then, World War II stuck!

Military experts realized that a scenario such as the nuclear bombing of cities like Hiroshima, Nagasaki meant that entire cities could be destroyed in minutes. Destroying the telephone exchanges within them. And the forwarding information through telephone exchanges meant that every city became a single point of failure.

If a single city(say Phoenix) went off-grid due to any natural disaster such as a storm, earthquake etc. while sending a message from Dallas to Portland, it not only meant that messages for that city were lost but also the messages that were meant for other cities that were being routed through that particular telephone exchange.

Hence, the hunt was on for a self-healing communication network. Enter the internet!

The telephone network with a message being sent from Dallas to Portland. A failure at a single exchange(in this case, Phoenix) could jeopardize all messages being sent.

How the internet works as opposed to the telephone network:

The modern internet works in a mesh structure. And it does so by sharing messages as packets of information. Every message being sent across in the internet, be it an email or a movie streamed via Netflix is sent across as packets of information.

Every router and device connected to the internet(even your own) becomes a node on the internet. These routers (nodes) are configured to constantly receive and send packets of information as long as they are switched on(meaning even when you are not actively using the internet off your wi-fi at your home). Thus every router in the world is a forwarding device.

Now, let’s have a brief gist of the packet flow in the internet.

Packet flow in modern internet:

To reiterate once again, every form of communication on the internet takes place in the form of packet flow.

Think of each packet as an envelope with a letter inside it. The letter contains the actual information that needs to be conveyed and in networking terminology, it is the payload.

The envelope here is technically called the packet header. Just as an envelope would have a from address and to address mentioned on it to indicate the sender and the receiver, the packet header will contain the IP addresses of the sender and the receiver. This packet header will thus specify the sender of the packet and the destination server it needs to be sent to.

In a real word scenario, if you were to trying to access a website, your PC’s IP address would be the sender’s address and the server hosting the website you are trying to access would be the receiver’s IP address.

Merging what you just learnt about routers and packet flow:

As mentioned, routers along the world act as forwarding devices and they forward the packets generated by users all over the world.

Thus, you get a convoluted mesh of routers and devices, where each router passes along the packets it receives to the next router in the mesh until the packet reaches from source IP address to destination IP address.

A representation of a typical computer network

Where is the advantage over telephone network?

Let’s go back to the example of a message being sent between Dallas and Portland. In the previous example, we considered a case where the intermediary exchange in Phoenix went down.

Similarly, if a single router(or maybe all routers) were to go down in Phoenix due to a power grid failure for example, the message that is being sent from Dallas would choose an alternate route from the next nearest available router and the message would re-route until it reaches its intended destination — Portland.

A message being redirected in case of failure of an intermediary node during internet transmission.

The internet is not only designed to be self-healing as mentioned above, but is also designed to be fast, reliable and effective. The routing decisions for the packets of data to flow through are made almost instantaneously, so much that you, as an end user would not even know that so much is going on behind the scenes. As an end user, all you do is hit up a website, and the webpage loads up for you.

Combined with DNS and port numbers, TCP packet flow constitutes an inherent design that forms the backbone of internet communication.

Suggested reading: Port numbers

--

--