In very short, everything is translated to binary bits consisting of 1s and 0s, and then the network address you have you run through a filter of another string of 1s and 0s where on each position the 1 lets the value through and 0 cancels it: putting 10101 through 11000 will give you 10000, and putting it through 00111 would have given you 00101. You can select some bits in your address this way to label the subnetwork, so for example 11000 filter would show you the network address, and 11*1*00 would show you the subnetwork. Kind of like adding to the address: first two 1s would filter value like Main Street 2, and the third 1: building B. That leaves you the two last digits for the apartment numbers in specific building.
Example:
You have an address made of 3 digits. You can filter it like this: 1.0.0 – so the only information you receive is the value of X, and you disregard the rest: x.0.0
The 1 will give you the street name, and it leaves you plenty of range in those two positions marked by 0s to full with apartment numbers. It suggests there’s only one, self-explanatory building assigned to this street address (your network).
But you can filter it like this: 1.1.0
Then the first 1 from the left still gives you the street name, but the second one you can use as building number, leaving the 0 as the range for apartment numbers. You can have two apartments labelled “1”, if the building number is different, the address remains unique, so you aren’t actually limiting your range like it may seem.
Whether you have apartment 1 and apartment 2 in one self-explanatory building under Main Street address, or you have apartment 1 in Main Street, building A, and apartment 1 in Main Street, building B, you still have 2 apartments. They’re just in different buildings (subnetworks).
You can filter it like this 0.0.1 to achieve only values of specific apartment numbers, without the context of the street name or building number, without knowing if there’s a building number that suggests there’s more than 1 building or not. The building is your subnet.
In IPv4 the addressing is done within 4 bytes, and each has 8 bits, that is slots for a 1 or a 0, so it looks like this:
10000000.00000000.00000000.00000000
The filtering allows you to extract specific information for such longs strings of 1s and 0s and is called masking.
Latest Answers