7

My confusion is that, if we were to take, for example, a class C private IP range, it allows 254 hosts. Is this the theoretical amount or is it actually possible to have 254 hosts?

I'd assume having 254 hosts on a home network would surely slow down or stop the network from functioning correctly, or am I missing something?

15
  • 33
    Network classes are dead, killed in 1993 by RFCs 1517, 1519, and 1519, which defined CIDR (Classless Inter-Domain Routing). Modern networks do not use network classes. Please let them rest in peace.
    – Ron Maupin
    Jun 27, 2018 at 1:41
  • 6
    Relax, I got you the first time, that wasn't the point of the question Jun 27, 2018 at 1:43
  • 6
    @RonMaupin, there is no difference between a Class C and a VLSM of 255.255.255.0. Class-full addressing schemes are far from dead, they are just subsummed in a more flexible scheme. now if we were talking about routing, I might be with you, but... Jun 27, 2018 at 1:44
  • 7
    @FrankThomas, "there is no difference between a Class C and a VLSM of 255.255.255.0." That is patently false. The definition of a Class C network address is an address that started with the first three bits as 110. (Class A started with 0, Class B started with 10, Class C started with 110, Class D started with 1110, and Class E started with 1111). Each class A to C had a default mask, but 10.0.0.0 with mask 255.255.255.0 was still a Class A network.
    – Ron Maupin
    Jun 27, 2018 at 1:52
  • 13
    @RonMaupin - you might split hairs as much as you wish, but "C" in the sense of any address range x.x.x.0 - x.x.x.255 is widely used in common technical speech, at least here.
    – Edheldil
    Jun 27, 2018 at 8:55

2 Answers 2

44

To start with, classful addressing has not been used since the mid-90s. Everything uses CIDR now, which allows splitting an IPv4 address space into any size from a /32 (2^(32-32) = 1 address) to /0 (2^(32-0) addresses). The corresponding size for an (ancient) class C network would be a /24 subnet in CIDR.

From a theoretical point of view, you can have networks of any size (that is a power of two). Of course, as you've correctly guessed, you will run into practical issues at some point, so we have to put some design effort into our networks.


Now, routers generally don't care how many addresses are in a single subnet. They'll forward them to the correct destination all the same. Where you might run into problems at the routing level is if you have too many subnets - we've been splitting subnets smaller and smaller to deal with IPv4 exhaustion, so where a company might have been able to purchase a single contiguous /28 of 14 usable addresses in the past, they might need to purchase two separate /29s of 6 usable addresses each now.

What used to be a single /16 (originally assigned as a class B some 30 years ago) might now be split into 1000 /26s, which means 1000 more entries in routing tables. Do this a few (thousand) times and your tables are now full. This has caused major outages before, and will likely do so again.

This only really matters with publicly routable addresses on internet core routers, which have to know the route to every network. Your home "router" is just going to forward everything via its default route and let your ISP deal with it. This is also largely irrelevant for private addresses, which are by definition not publicly routable.


The other potential issue you mention applies below the routing level, within a single subnet. Where you might run into issues here is if your broadcast domain is too big. While a broadcast domain is not necessarily the same thing as a subnet, for most (especially consumer/home) purposes it is the same.

When your broadcast domain gets too big, you can run into issues: your OS's ARP tables might overflow (~256 by default in Windows, ~1024 by default in Linux, but tunable on both). This means your OS starts forgetting which MAC address an IP address corresponds to, and needs to discover it again by sending an ARP request ... which is broadcast to every host. With too many hosts, a good chunk of your network bandwidth is taken by ARP requests and responses.

Also, your network switches (often built into consumer routers as the 4 "LAN" ports) can get a bit unhappy with too many hosts because their fowarding tables (based on MAC addresses, not IP addresses) are only of a fixed size, and they can start "forgetting" which port to forward to.

Luckily (or by design?), these issues tend to appear somewhere north of 256 hosts, so 254 in a single subnet probably won't run into them. They are a reason you're generally supposed to route between /24s rather than using, say, a single /16.


One other advantage of assigning a whole /24 is so we have some spare room for DHCP-assigned addresses. Most home networks these days don't have a static address assigned to each host - they are instead chosen by a DHCP server and reserved for a period of time, so e.g. your phone doesn't get a new address every time it disconnects for a second. When your network is almost full, you force the DHCP server to start recycling addresses sooner.

Most DHCP servers on consumer routers default to an address pool of only 100 addresses, so you will never reach 254 without either adjusting the pool size or assigning static addresses.


At the end of the day, while we have issues with IPv4 exhaustion at the global level, there's absolutely no shortage of private addresses (which have three large ranges, a /8, a /12 and a /16, to play with -- that can contain over 65000 /24s). There's little reason to try conserving them, so no one bothers going smaller than a /24.

And, if you want to, you certainly can have 254 hosts active on a /24. Most consumer routers/switches and OSes will even handle it fine for the most part, though some tweaking (esp. DHCP) may be required.

16

They are real/concrete limits, not just theoretical. There's nothing about IP addressing schemes that "pushes the boundaries" of the technology, so it works exactly as advertised.

A Class-C uses 8 bits for host addressing, so 00000000 - 11111111 is the actual range (0-255 or 256 ordinal values). of those the top and bottom values are reserved for the broadcast and the route ID, leaving you with 254 available addresses.

IP addressing cares not a whit for your performance. That is entirely determined by the hardware and software you have running your network, and nothing to do with IP addressing schemes.

2
  • I like your answer the best. In my next breath I would emphasize that with 250 addresses you will quickly find out the limits of home equipment. All the broadcast and general junk flying around seems to overwhelm a lot of consumer grade equipment. The original question seems very relevant and in that situation you would want to proactively deal with it as opposed to allowing everyone on the same subnet. Even in an ipv6 scenario this seems to be the case with the home router I got at the dollar store in the bargain bin.
    – Sql Surfer
    Jun 27, 2018 at 22:00
  • 2
    The question already indicates understanding of the basic address structure. His question is more about practical capacity of the hardware.
    – Barmar
    Jun 27, 2018 at 22:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .