Some Thoughts on the Internet's IP Layer

Posted on Fri 04 October 2019 in study

Learning computer network recently, specifically on the IP layer.

The following 2 questions have been confusing me since long ago, but now I feel like I gained some insight.

To simplify the scenario and make it pure ipv4 related, NAT and ipv6 is not considered here.

IP vs MAC

When a machine transmits a packet, the IP address is translated to MAC. When a network adaptor joins the Internet, it is assigned with an IP according to its unique MAC.

Then, why do we need 2 systems of identifying "someone on the Internet", and even bother to translate back and forth?

It is because in the old days there were different kinds of LAN and each of them might speak different protocols (MAC included). One day some LANs wished to speak to a remote partner, but their languages were not mutually intelligible. So IP came up as a universal translator, on a higher level.

To solve the situation where LANs spoke assorted vernaculars, IP said, "You all now learn my language and translate what you wanna convey to my language. Then I will carry the info to your recipient."

OK, everyone complied. And IP the translator succeeded in being widely utilized. Had the story ended here, that'd be all of it. The reality was, however, MAC (Ethernet) turned out to be so popular that it dominated the market very soon, which means: now everyone started to speak the same MAC language and there was no more need of a translator.

But the structure/hierarchy stuff had already been set. So the status quo remained: a common language and a seemingly redundant translator for it.

The above is naive bullshit. MAC, though able to "unique" identify a device, does not contain "geo"-info that IP has. (If you have to use MAC-only inter-net, you need keep a large yellow page mapping MAC to address.) IP manifests where to go at crossroads. So IP is used for (distant) travelling/routing.

Subnetting

From the old-fashioned class A/B/C IP address through subnet mask tech to CIDR, they all try to divide the 32 bits into several groups (prefix-suffix, netid-hostid).

This division is actually of little significance to an end user. As long as I know the combination of the 32 0/1 binary bits, I can reach the one I want to visit, without any knowledge of my or the other's subnet details.

But subnetting is much more important to a router, like a rational odonym scheme matters a lot to a nation's postal system.

Dividing IP addresses is like demarcate boundaries and delegating street signs to certain nodes. One subnet is a basic administrative area. The length of the prefix determines how many of such areas exist, thus determines how many items a router should keep in its memory.

In real life, what does one same IP with different CIDR notations mean?

Actually, if subnet A (e.g. 10.0.0.0/8) includes subnet B (e.g. 10.1.2.0/24), a valid IP in subnet B (e.g. 10.1.2.3) should not be assigned to a machine in subnet A.