0

If you have the subnet mask 255.255.255.0 and a class A IP address, the first octet specifies the network, the last is the individual host. So do the middle 2 octets specify the subnet? And this is useful because a router would know how to route it based on those two octets?

For example 121.123.124.101/24. Would this mean 123.124 is used by router to find the correct subnet? If this isn't correct, how exactly do subnet masks accomplishing subnetting? The actual point of subnetting is to reduce congestion and so that router tables don't have to be huge, right?

1

You have a bit of a misconception of which bits are used for identifying network and hosts.

All of the bits are used in one way or another.

In your specific example, a full octet for /24 would look like:

nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh where n bits are network bits, and h are host bits.

With the IP address information given, 121.124.124.101/24, your network address would be 121.124.124.0, because you get 254 usable hosts with a /24.

The point of subnetting isn't just to reduce congestion, but to minimize the waste of IP address blocks. In fact, the routing tables that are closer to the backbone of the internet have huge routing tables.

You can check out how big some of these routing tables are by visiting CIDR report

If you're having trouble finding an BGP table to look at on the site, here is one from Amazon-02, US

Here is a picture that helps visualize network and hosts bits from /17 to /30.

enter image description here

  • That clears things up! Though I don't get "The point of subnetting [is]...to minimize the waste of IP address blocks". I don't see how it does this since regardless of subnetting, an organization is still assigned the same block of IP addresses? – northerner Nov 24 '20 at 1:23
  • In a sense, isn't it correct to say subnetting reduces network congestion. Because it is what divides up big networks into smaller ones. – northerner Nov 24 '20 at 1:24
  • @northerner the concept of subnetting is used in the public address space, but you can maybe see more value in it with an internal network.There is only a handful of companies who have a /8 public block assigned to them. Just to show they do assign them in an appropriate manner, my ISP is assigned a /12 pubic block. – DrZoo Nov 24 '20 at 1:30
  • @northerner yes it does reduce congestion. Sorry I missed the word "just" in my answer. I updated it. For example, having subnets can help reduce congestion like broadcast traffic, keeping that traffic within it's domain, instead of flooding across the entire network. – DrZoo Nov 24 '20 at 1:36
  • Ok thanks. In the table shown I notice the smallest subnet mask is /17 but you mentioned your ISP has /12. So in the table these IP addresses are Class C and your ISP is Class B (or Class C). Can I infer like that? In otherwords it wouldn't make sense to have a subnet mask less than /17 on a network that isn't Class C? – northerner Nov 24 '20 at 1:53
1

If you have the subnet mask 255.255.255.0 and a class A IP address, the first octet specifies the network, the last is the individual host. So do the middle 2 octets specify the subnet?

Yes, this was correct 30 years ago, when "class A" addresses were still part of the spec. However, they aren't anymore – the address is now fully described by its subnet mask.

That is, if you have the subnet mask 255.255.255.0, then the first 3 octets specify the network and the last octet specifies the host. That's it. The router doesn't care about which octets are "net" and which ones are "subnet".

For example 121.123.124.101/24. Would this mean 123.124 is used by router to find the correct subnet?

No; the whole 121.123.124._ is used by the router to find the correct route. Routers don't think in terms of "subnet IDs" – they take the whole IP address and check it against a route with its netmask.

The actual point of subnetting is to reduce congestion and so that router tables don't have to be huge, right?

That indeed was the original point. When only classful networks existed before subnetting, organizations had to make a choice: if they got a class-B address assignment, they would need to connect everything to a single flat layer-2 network (possibly spanning several buildings or even several cities – linked together through layer-2 bridges); and if they wanted to do internal layer-3 routing, they would need to obtain many class-C's instead, and those class-C's would use up the very limited space in the core routers. Subnetting of course allowed the organization to internally have multiple networks while still publishing just one large route.

(Note that this is different from CIDR and classless allocation of addresses. Subnetting didn't solve the issue of needing to allocate a whole "class B" when an organization only needs maybe 2000 hosts. That's what CIDR deals with – it removes the concept of address classes entirely.)

  • Here is my confusion. What is the point of CIDR if Classful networking already had subnet masks? Is that the difference between CIDR and Classful networking, what subnets masks are allowed? – northerner Nov 24 '20 at 12:00
  • In other words, why did they use Classes in the first place? – northerner Nov 24 '20 at 15:00
  • Classful networking didn't have subnet masks at first; they were added 3 years later. (Actually, as far I gathered from the "tcp-ip-digest" archive, even classes themselves didn't exist in the very beginning, as all networks were the same size, class-A or /8. But they soon started running out of networks, I assume, and decided on some way to have different-sized networks, so classes were introduced. Later they added subnetting to allow for layer-3 routing within a classful network. Finally they introduced CIDR to allow for supernetting or route aggregation.) – user1686 Nov 24 '20 at 16:36
  • I don't exactly remember the entire history (having not actually lived through it), so I would recommend reading 1) the tcp-ip-digest archives up to year 1985, 2) RFCs 791, 917, 925, 932, 950, 1338 ... to get a better story. – user1686 Nov 24 '20 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.