difference between network id and subnet id

1

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.

JohnMerlino

Posted 2014-04-14T00:53:54.893

Reputation: 257

Based on: > 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. 16581375 networks?

Those numbers are not right. – DaveM – 2014-04-14T05:20:31.837

Answers

1

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.

Paul

Posted 2014-04-14T00:53:54.893

Reputation: 52 173

When you say "The notion of "classful" vs "classless" subnetting doesn't really come up any more. ", does that suggest that the classful concept is history? – JohnMerlino – 2014-04-14T04:34:12.443

@JohnMerlino Classful routing was used on the internet until 1993, afterwhich classless routing was introduced. Prior to that you wouldn't even set a subnet mask, it was derived from the address (the leading bits would define the class). Once you define a subnet mask, then the notion of classes can be ignored as you can carve up the address space any way you want. – Paul – 2014-04-14T04:40:27.373

traditionally subnetting and supernetting relate more to how addresses are allocated to organizations and subdivided by them, and how internet engineers route traffic at very long distances. now-a-days, the subnet mask is sufficient for both these purposes, and ICANN doesn't have enough addresses left to hand out whole blocks anyway. – Frank Thomas – 2014-04-14T04:43:49.690

@JohnMerlino I have updated the answer a bit to hopefully make it clearer. – Paul – 2014-04-14T04:45:05.290