Networking – difference between network id and subnet id

ipnetworking

Typically a classful ip address will be split into a network id and a host id, like in the following example:

$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.2.0     *               255.255.255.0   U     1      0        0 eth0

The subnet mask is 255.255.255.0 and the network id section is the 3 most significant bytes and the host id section is the least significant byte. That means using this subnet mask, we can have 16581375 networks and 255 host computers in each of those networks.

Now we can convert that classful subnet to a classless subnet:

http://s11.postimg.org/6vaa5q9df/classless_subnet.png

We just partitioned the class C subnet to 255.255.255.224, where the least significant byte now is binary 11100000. Well I just created a subnet id, with 8 new networks independent of each other. Ok, but isn't this accomplishing the same thing as the network id? I do not see any difference between network id and subnet id.

Best Answer

This is really a matter of convention rather than a technical consideration these days, as classful addresses were phased out in 1993.

So the notion of "classful" vs "classless" subnetting doesn't really come up any more, except as a convienience. People will generally only use "class b" as easy way to convey a 16bit network address. No one thinks of classes when planning network address space.

Trying to maintain the notion of classful addressing, and introducing a subnet id to distinguish between the classful and non-classful parts of the address is backward, and as you have discovered, confusing.

There aren't really three parts to the address, there are only two. The subnet id is not configured anywhere. There are two parts to an IP address, the network and the host.

Your example shows a 27bit network address with a 5bit host address.

Related Question