The second part to understanding VLSM is knowing exactly what a subnet does and how they are made.
A subnet mask is another binary 32 bit value with 4 octets that can split a network into several sub-networks, hence the name. There are three important values that we have to keep in mind when working with subnets; the network address, the broadcast address, and the range of usable host addresses.
The network address is the address that like it sounds, determines what network any given IP address is on. It is also the value that will be used to base routing decisions on. In order to determine a network address from an IP address, you take the binary values of both the IP address and the subnet masks and do a binary AND comparison. Lets use an example we are familiar with from my last post, so let's use an IP address of 192.168.0.128 with a subnet mask of 255.255.255.0.
When we do a binary AND comparison, there are 3 possible combinations:
1 AND 1 = 1, 1 AND 0 = 0, 0 AND 1 = 0.
This means that all we are concerned about at the moment is where both values are 1.
IP Address:     11000000.10101000.00000000.10000000
Subnet Mask:    11111111.11111111.11111111.00000000
Network Address:11000000.10101000.00000000.00000000
Translate that back into our standard format, and we see that the network address is 192.168.0.0!
Now, let's move onto the broadcast address, which is the address used in order to send a packet to every single address on a given network. In order to figure out the broadcast address, we take the subnet mask and invert all of the host bits and tally them up. Let's use the example above.
We are using the 24 bit subnet mask of 255.255.255.0, so the first 24 bits are being used for subnetting.
Subnet Mask:          11111111.11111111.11111111.00000000
Inverted Host Bits:   11111111.11111111.11111111.11111111
That works out to be 255 when converted back to standard form. All we have to do is append that onto the network portion of the address, and we get 192.168.0.255!
Once you know those two values, finding the usable host addresses is easy. All you do is take the range between the network address and the broadcast address, and that's it!
So in our example, the network address is 192.168.0.0, the broadcast address is 192.168.0.255. The usable ip range is then 192.168.0.1 - 192.168.0.254.
We're getting to VLSM soon, I promise!
Wednesday, December 5, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment