Thursday, February 5, 2009

IP Subnetting

IP Subnetting
Due to the explosive growth of the Internet, the principle of assigned IP addresses became too inflexible to allow easy changes to local network configurations. Those changes might occur when:
• A new type of physical network is installed at a location.
• Growth of the number of hosts requires splitting the local network into two or more separate networks.
• Growing distances require splitting a network into smaller networks, with gateways between them.
To avoid having to request additional IP network addresses, the concept of IP subnetting was introduced. The assignment of subnets is done locally.
The entire network still appears as one IP network to the outside world. The host number part of the IP address is subdivided into a second network number and a host number.
This second network is mentioned as subnetwork or subnet. The main network now consists of a number of subnets. The IP address is interpreted as:

<><>
The combination of subnet number and host number is often termed the local address or the local portion of the IP address.
Subnetting is implemented in a way that is transparent to remote networks. A host within a network that has subnets is aware of the subnetting structure.
A host in a different network is not. This remote host still regards the local part of the IP address as a host number.
The division of the local part of the IP address into a subnet number and host number is chosen by the local administrator.
Any bits in the local portion can be used to form the subnet. The division is done using a 32-bit subnet mask. Bits with a value of zero bits in the subnet mask indicate positions of the host number.
For example, subnetting a Class B network could use one of the following schemes:
• The first octet is the subnet number; the second octet is the host number. This gives 28-2 (254) possible subnets, each having up to 28-2 (254) hosts.
Recall that we subtract two from the possibilities to account for the all ones and all zeros cases. The subnet mask is 255.255.255.0.
• The first 12 bits are used for the subnet number and the last four for the host number.
This gives 212-2 (4094) possible subnets but only 24-2 (14) hosts per subnet. The subnet mask is 255.255.255.240.
In this example, there are several other possibilities for assigning the subnet and host portions of the address.
The number of subnets and hosts and any future requirements should be considered before defining this structure.
In the last example, the subnetted Class B network has 16 bits to be divided between the subnet number and the host number fields.
The network administrator defines either a larger number of subnets each with a small number of hosts, or a smaller number of subnets each with many hosts.
Types of subnetting
There are two types of subnetting: static and variable length. Variable length subnetting is more flexible than static.
Static subnetting
Static subnetting implies that all subnets obtained from the same network use the same subnet mask. While this is simple to implement and easy to maintain, it may waste address space in small networks.
Consider a network of four hosts using a subnet mask of 255.255.255.0. This allocation wastes 250 IP addresses. All hosts and routers are required to support static subnetting.
Variable length subnetting
When variable length subnetting is used, allocated subnets within the same network can use different subnet masks. A small subnet with only a few hosts can use a mask that accommodates this need.
A subnet with many hosts requires a different subnet mask. The ability to assign subnet masks according to the needs of the individual subnets helps conserve network addresses.
Variable length subnetting divides the network so that each subnet contains sufficient addresses to support the required number of hosts.
An existing subnet can be split into two parts by adding another bit to the subnet portion of the subnet mask. Other subnets in the network are unaffected by the change.
Mixing static and variable length subnetting
Not every IP device includes support for variable length subnetting.
Initially, it would appear that the presence of a host that only supports static subnetting prevents the use of variable length subnetting.
This is not the case. Routers interconnecting the subnets are used to hide the different masks from hosts.
Hosts continue to use basic IP routing. This offloads subnetting complexities to dedicated routers.

No comments: