Eli5 why subnet masking is used

1.11K views

Currently doing my Google certifications and struggling with the concept of subnet masking. I understand how it works in terms of identifying the network and host ids, what I don’t understand is why it is necessary.

If the octates that identify the network I’d need the ip to be interpreted, why is the the ip address not just used? They use the same number of bits, so how does it extend the range of available ip addresses?

In: Technology

9 Answers

Anonymous 0 Comments

[deleted]

Anonymous 0 Comments

> they use the same number of bits, so how does it extend the range of available ip addresses?

It doesn’t

The subnet defines the network.

For example are 125.124.12.1 and 125.124.11.55 on the same network? Trick question you CAN’T know the answer without knowing the subnet.

If the subnet is 255.255.0.0 then yes they are on the same network if it’s 255.255.255.0 then no they are not.

>why it is necessary.

Because not everyone want’s the exact same network configuration. A mom and pop shop with 2 computers has different network requirements than Amazon.

Anonymous 0 Comments

[removed]

Anonymous 0 Comments

Communicating with smaller numbers of computers is far simpler than communicating with a large number of computers. This is especially notable in terms of when you need to do things such as: communicate with all computers.

Imagine sending a message that has to go out to all the billions of devices on the internet.

To make this manageable, we need to distinguish between computers near you (on your local network) and everyone else.

We do this by saying that a certain number of bits of the IP address represents the network. Other computers you communicate with whose IP address shares those same bits are considered local to your computer.

The remaining bits represent the individual hosts on that network.

When we were first implementing this scheme we divided IP address into classes, but this was too rigid a structure so instead we moved to subnet masks.

A subnet mask is simply a string of 1’s followed by a string of 0’s for a total length of ~~16~~ 32 bits. The bits of the IP address that correspond to the 1’s in the subnet mask represent the network and the bits of the IP address that correspond to the 0’s in the subnet mask represent the host.

So let’s take [192.168.1.16](https://192.168.1.16) with a subnet mask of [255.255.255.0](https://255.255.255.000)

Putting that in binary would have the first three octets (192.168.1) being the network part and the last octet (16) being the host part. So your computer would consider every computer from [192.168.1.1](https://192.167.1.1) to [192.168.1.254](https://192.168.1.254) a local computer. And everything outside that range to be a remote computer, for a total of 254 hosts (.0 and .255 are special and can’t be used for hosts).

If the subnet mask was instead [255.255.0.0](https://255.255.0.0), then your computer would consider everything from [192.168.0.1](https://192.167.0.1) to [192.168.255.254](https://192.168.255.254) to be a local computer for 65,534 possible hosts.

Anonymous 0 Comments

Subnets are a way to “divide” a net(work), basically computers all attached to the same physical network, all wires going to ONE router, into multiple “separate” sub-networks. So the mask is the method by which computers are grouped. Groups of 2, groups of 4, groups of 8, etc. “The first 4 IP addresses are production, the next 4 IP addresses are HR” and so on.

The IP address IS used for directly talking to the computer in question, but if the server has to make a decision about security, for example, which computers should be able to “see” this file, then the mask becomes important.

Because we work with “groups” not with individual computers (or people). “Everyone in HR should be able to see this file” is easily implemented with a mask, and it’s more cumbersome to implement by keeping track of all the individual IP addresses that should receive that file.

Anonymous 0 Comments

To keep it simple and in a ELI5 format, the why is basically because that’s the way you establish some boundaries for the different domains. Without a subnet mask you wouldn’t be able to tell if two different IP addresses were in the same subnet or not, no matter how similar or “close” to each other they looked. You say you understand how it works, so you probably know there are things going on in a subnet that you do not want other subnets knowing about, this is why you need those limits.

I’ll try to give an analogy (maybe not the best but the best I can think of). Imagine two houses in the middle of nowhere. If there isn’t a fence or anything that indicates a boundary then you wouldn’t be able to easily tell where one ends and another begins. If the owners don’t know these limits then what’s stopping them from building something right in the middle of the properties?

The other explanations are not wrong but I’m not sure I’d understand them if I didn’t already have an understanding of the subject.

Anonymous 0 Comments

subnet masks allow you to easily determine if two addresses are in the same neighborhood, or if one is on the other side of a very busy highway. If they’re in the same neighborhood, Johnny Packet can walk to his friends house. If they are not, then Johnny needs to get in his mom’s Router-mobile and she can drive him to his friends house.

Anonymous 0 Comments

Subnet masking is how *much* of a network you want your host to see in the immediate – without routing – area.

Any packet that does not fit the mask is sent to the router, anything that does is sent to the switch.

Anonymous 0 Comments

Lets say you have a small business, and you have four general categories of stuff that need networking, but you don’t want stuff from one category to be able to talk to the other cagegories. For example, VOIP phones, Security cameras, the business’s own computers, and public facing wifi. Subnets let you do this. Instead of 255 addresses you can break it up into blocks of 64, and devices will ignore anything coming from outside their block of 64 addresses.