SUBNETTING | |
10000001 . 00001010 . yyyyyyyy . yyyyyyyy (IP address in binary form) [-----------16 bits----------] [-------16 bits--------] [-----------net ID-----------] [--------host ID-------] The first 16 bits form the network ID and the last 16 bits form the host ID. To form different host ID's, we can vary the bits in each of the last 16 bits. To subdivide this network, we keep the network ID the same. However, we will use some bits from the host ID to form a subnet ID as follows. [ ----------16 bits---------- ] [ 5 bits ] [ ------11 bits-----] [ ----------net ID----------- ] [subnet] [ ------host ID-----] We set the rule that if two hosts are on the same network segment, they must have the same network ID and the same subnet ID. That is, the two hosts must have identical bits in the network ID and subnet ID. If two hosts have identical network ID's but have different subnet ID's, they are on different subnet segments. Thus, if we can form many different subnet ID's, we have formed many segments in our network. Before subnetting: one network; different hosts formed from 16 bits. Now: subnet segments formed from 5 bits; different hosts formed from 11 bits. So the rule of thumb is: If we subdivide a network into more subnets, each subnet segment will have fewer potential hosts. How do we write the subnet mask for the above subnetted network? Recall that if two hosts are on the same segment, their network ID and subnet ID must be identical. In the above subnetted network, there are 16 bits in the network ID and 5 bits in the subnet ID. So we write a '1' for each of these bits in the subnet mask and a '0' for each bit in the host ID [ 11111111 11111111] [ 11111] [000 . 00000000] Subnet mask [ ----------16 bits---------- ] [ 5 bits ] [ -------11 bits ----] In decimal form, this subnet mask is 255.255.248.0 (because 11111000 = 248 ; 11111111 = 255) Given the above subnetted network 129.10.0.0 with subnet mask 255.255.248.0, here are two examples of IP addresses on the same subnet segment. 10000001 . 00001010 . 10010 011 . 00010000 (129.10.147.32) IP address 1 10000001 . 00001010 . 10010 100 . 01010101 (129.10.148.85)IP address 2 11111111 . 11111111 . 11111 000 . 00000000 (255.255.248.0) subnet mask Notice that each '1' in the subnet mask corresponds to a bit that both IP address must have identical. 10000001 . 00001010 . 10011 011 . 0010000 (129.10.163.32) is an IP address that does not have all bits identical in the bits where there is a '1' in the subnet mask. Therefore, this IP address is on a different subnet segment (remote). So given two IP addresses and a subnet mask, we can compare the binary bits corresponding to those with a '1' in the subnet mask. If those bits are identical, the two IP addresses belong to the same subnet segment. Otherwise, the two IP addresses belong to two different subnets.
|