2

I just finished a Cisco CCNA video course, so I know just enough about networking to be dangerous. I have a pretty good idea of how IP's and subnets work, but one thing I haven't been able to find out is why, exactly, 255.255.255.0 is the default subnet mask in most of the routers I've seen (admittedly, nearly all consumer-grade and SOHO routers).

Granted, there's not all that much of a reason for a consumer-grade router to use anything else - unless you need more than 254 IP's, or want to do something complex like organizing your network (servers on 192.168.1.X, desktops on 192.168.2.x, etc.)

That got me thinking, are those the only reasons to use 255.255.255.0? What exactly would change for people if the default mask was 255.255.0.0 instead? Is there some downside to using the latter?

3
  • It just easier for people who can't, or won't, learn how to properly subnet.
    – Ron Maupin
    Jan 14, 2016 at 21:57
  • That's an interesting point - why exactly is it easier? For a home router that people aren't touching, and that uses DHCP for everything, is it actually easier? For a technical person, I'd just be changing it to whatever I want anyway. There may not be a "satisfying" answer here, I'm just a little confused about it - what exactly is easier?
    – Jake
    Jan 14, 2016 at 22:00
  • It's easier for home users to see what is on the network and to assign IP addresses if no extra subnetting is involved. All anyone has to look at is the last octet. nobody needs to worry that 192.168.1.65 is on a different subnet than 192.168.1.45 if a /26 network is used. All anyone needs to know is that the first three octets match.
    – Ron Maupin
    Jan 14, 2016 at 22:04

3 Answers 3

3

Well, sometimes you find some consumer hardware with that mask hard coded here and there. But that's relatively rare and not a deciding factor. Also you want to stick within the predefined private ip ranges, that's the bigger consideration.

Usually common practice for choosing defaults (in my neck of the woods at least) is to use the tightest mask possible and that one is an easy one for humans to deal with even if it isn't the absolute tightest.

You can use whatever you want though just be careful to not open up a range that starts to conflict with internet IPs. There's a list of reserved addresses at https://en.m.wikipedia.org/wiki/Reserved_IP_addresses. E.g. 192.x.x.x/255.0.0.0 is not acceptable for private LAN use.

I know this doesn't answer your question fully. Barring other answers I'll do some research on more concrete reasons why the default is /24 when I'm not on my phone. I strongly suspect it's either tradition, or the safest bet given that unwise users may choose nonprivate ranges.

4
  • Very interesting - can you explain the common practice of tightest mask possible? Why is that? I know for things like ports on firewalls or permissions for users, it's a security policy to give them the least privilege and whatnot. Is there any similar concern for a subnet? Or is it just from a management perspective?
    – Jake
    Jan 14, 2016 at 22:01
  • @jake Just from a management perspective. If you have only a few dozen devices on a subnet and you're configuring larger networks it is easier to subdivide everything tightly ahead of time instead of running into trouble later but, that's also imho. Maybe I should drop that statement before this becomes a debate. Mostly like I said you want to stay in reserved private ip ranges.
    – Jason C
    Jan 14, 2016 at 22:03
  • I'm not trying to debate, just honestly asking - for me, I set up my homelab network in the way similar to what I have in my question - DHCP on 192.168.1.x, and my servers and VMs on 192.168.2.x. This was pretty easy to set up, and lets me mess around with the static IP's on my servers without touching any of the other devices that are using DHCP (if it has the .2 in there, it won't ever conflict with DHCP). Is there another management setup that you're referring to, that might be easier?
    – Jake
    Jan 14, 2016 at 22:06
  • @jake Nope. 192.168.0.0/16 is acceptable, and since it makes your life easier for your home network, it is by definition better. Your goal is to make your setup convenient while not conflicting with internet IPs, and you've accomplished that. You're good. I was more speaking to why /24 is the more common default.
    – Jason C
    Jan 14, 2016 at 22:08
3

I guess the answer is easy: Clasful networking is not quite dead (Yes I know, I'm always writing the opposite).

When assigning an IP address many operating systems / tools (Windows, Linux ifconfig) suggest the default mask according to the class of network. As 192.168.x.y is Class-C 255.255.255.0 is suggested.

So if I do something like this on a Linux system:

# ifconfig eth1 10.0.0.1 
# ifconfig eth1:1 172.16.1.1 
# ifconfig eth1:2 192.168.99.1

I get

# ifconfig | grep "inet addr"
inet addr:10.0.0.1  Bcast:10.255.255.255  Mask:255.0.0.0
inet addr:172.16.1.1  Bcast:172.16.255.255  Mask:255.255.0.0
inet addr:192.168.99.1  Bcast:192.168.99.255  Mask:255.255.255.0

As many system behave this way using the default will less likely break things which limits the support costs for the vendors. Also: People are used to this and would complain that the device is to complicated.

1
  • Thank you for your answer, Jens! Unfortunately @Jason C answered sooner, but I do appreciate this information. It's a very interesting point - that changing things would incur support costs
    – Jake
    Jan 15, 2016 at 13:35
0

Before subnetting there was only Class-based addressing and the smallest networks were /24. So during the transition to subnetting, when the subnet masks were introduced to existing networks, most of them got 255.255.255.0 as being backward compatible. So that was the common thing and is also just a very easy mask to work with, being a round number (in binary) and preserving the Class C semantics of the last octet being the host number and the rest the network number. Using it avoids having to do decimal-to-binary conversion to determine if two addresses are on the same subnet or not.

Another reason I think it persisted besides familiarity and inertia is because there is a lot of broadcast traffic in IPv4 and by definition broadcast traffic goes to every device on the subnet. So in practice, by the time you are done routing and are allocating address to end nodes, you want to keep the number of devices generating broadcasts down to a reasonable number. The Class C subnet 255.255.255.0 is big enough that most organizations won't need more addresses than that and small enough to keep from being overwhelmed by broadcasts.

You do see smaller subnets, like 255.255.255.252, used when handing out publicly routable IPv4 addresses because those addresses are so precious. I did, however, once have an ISP give us 3 addresses with a /30 subnet only to have one of the addresses be on a different subnet than the other 2. That was annoying and probably a mistake on their part, but it was hard to spot because of the math.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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