"the practice of arbitrary imprisonments have been, in all ages, the favorite and most formidable instruments of tyranny." --Alexander Hamilton, Federalist #84
Because although your ip class might allow tens of thousands of possible hosts, a standard ethernet segment can only cope with about 1000.
It's cool
Theory:
Ok, so assuming you know how internal ip addressing works (e.g classes, host octets and network octets) then we can skip wading through all of that crap. If you don't know that stuff, look at suggested reading.
Ok then, so we know that computers don't see ips as decimal numbers like we do (e.g 172.16.80.0), nope it sees that in binary! So for the computer to tell the network octets and the host octets apart, it uses something called a subnet mask .
Each ip class has a default subnet mask, so a class B ip (e.g 172.16.80.0) will have a default subnet mask of 255.255.0.0. This is because the subnet mask uses the first 16 bits to identify the network.
In binary this would look like:
CODE :
11111111 11111111 00000000 00000000
This kind of address can also be noted as /16, so 16 bits identifies the network portion of this ip address.
Right so that's default subnet masks sorted right? Well sometimes we have to go beyond defaults and start customizing them!
Why?
Well if you have a regular Class B address you'll have 65,534 addresses available to you, that's great right? Won't need any more than that?
Wrong!
Unfortunately a standard network segment can only support roughly 1,000 network hosts. That's not very efficient!
So with a class B network for instance, I don't want to waste addresses but I want to stay a Class B network!
What do I do? I subnet!! Yes that's right, I use the following:
I have one physical network but am using several logical sub-networks (subnets).
I have now borrowed bits from my host portion. So when I create a subnet mask I'm going to tell the computer which bits to pay attention to, so it can identify the network.
In this case I borrowed 8 bits, an octet, to identify the network.
So since I've done this, I'm going to have to change the subnet mask, so the poor computer can understand what's going on.
This is how they're created:
It's all a case of how many bits I borrow, borrow 1 bit and then my subnet mask becomes 255.255.128.0.
Confused? I hope not! Here's a table to figure it out:
So 172.16.80.0/20 means there are 16 bits (Class B ip) and 4 subnet bits, therefore the subnet mask would be: 255.255.240.0
Cast your vote on this article 10 - Highest, 1 - Lowest
Comments: Published: 16 comments.
HackThisSite is the collective work of the HackThisSite staff, licensed under a CC BY-NC license.
We ask that you inform us upon sharing or distributing.