Subnetting and Supernetting V Subnetting and Supernetting
Concepts Background The increasing number of host connected to the internet Restrictions on the network size
In subnetting, a network is divided into smaller subnetworks with each subnet having its own subnet address In supernetting, a organization can combine several class C to create a large range of addresses. In other word, several networks are combined to create a supernetwork
Subnetting IP address (32 bits) netid and hostid Means: there is a sense of hierarchy in IP addressing. To reach a host, we must first reach the network using netid, then using hostid to reach the host Generall: class A, B, C two levels of hierarchy Sometimes two levels is not enough For example, imagine an organization with a class B address. The organization has two levels hierarchical addressing, but it cannot have more than one physiscal network The host cannot be grouped, and all of the host has the same level Solution subnetting
Figure 5-1 Without subnetting
Figure 5-2 With subnetting
In the above example, The rest of the internet is not aware that the network is divided into three physical subnet.: three subnet still appear as a single network to the rest of internet A packet destined for host 141.14.2.21 still reaches router R1. The destination address of the IP datagram is still a class B where 141.14 defines the netid And 2.21 defines the host However, when the datagram arrives a router R1, the interpretation of the IP address changes. R1 knows the network 141.14 physically divided into three subnets. It knows that the last two octets define two things: subnettid and hostid ( 2.21 subnetid 2 and hostid 21) Router uses first twoo octets as netid, the third subnetid, and the fourth hostid
Three levels of hierachy Figure 5-3 Three levels of hierachy
Figure 5-4
Masking A process that extracts the address of the physical network from IP address Can be done whether we have subnet or not. Not have subnet: masking extract the network address from an IP address. Have subnet: masking extract the subnet address from IP address.
Figure 5-5
In masking: We perform math. operation on a 32-bits IP add. at the bit level using another 32-bit number called mask The bits in the mask are related to the corresponding IP add. Part of masking containing 1s defines netid or combination of netid and subnetid Part of making containing 0s defines hostid To get the network and subnet address, we must apply the bit-wise-and operation on IP address and the mask
Applying bit-wise-and operation to achieve masking Figure 5-6 Applying bit-wise-and operation to achieve masking
Special address in subnetting: Figure 5-7 Special address in subnetting: Reserved for Reserved for : Is not assigned to any host : Is not assigned to any host
Subnetting class A A class A address: Is made of a one-byte netid and a three-byte hostid Can have one single physical network with up to 16.777.214 (224-2) If we want more physical networks, we can divide this one range into several smaller ranges
Example : A organization with a class A needs a least 1000 subnetworks. Find the subnet mask and configuration of each network Solution: We need at least 1002 subnet to allow the all-1s and all-0s subnetids This means that the minimum number of bits to be allocated for subnetting should be 10 (29 < 1,002< 1010) Fourteen bits are left to define the hostid
Figure 5-8
Each subnet can have 16,384 hosts/computer Figure 5-9 Theres is 1024 subnets Each subnet can have 16,384 hosts/computer
Figure 5-10
Subnetting class B A class B: Is made A two byte netid and two-byte hostid Can have one single physical network and up to 65,534 hosts on the network. If we wan more physical network, we can divide this one big range into several smaller ranges.
Example An organization with a class B address needs at least 12 subnetwork. Find subnet mask and configuration of each subnetwork Solution: There is a need for at least 14 subnetworks, 12 as specified plus 2 reserve as special address. This means that the minimum number of bits should be 4 (23 < 14 < 24)
Figure 5-11 masking
Each subnet 4094 hosts/computers Figure 5-12 Each subnet 4094 hosts/computers
Figure 5-13
Subnetting class C A class C address: is made of a three byte netid and one-byte hostid Can have one single physical network and up to 254 (28 – 2) host on that network If we want more physical network, we can divide this one range into several smaller range.
Example: An organization with a class C needs at least five subnetworks. Find the subnet mask and configuration of each subnetwork Solution: There is a need for at least seven subnetworks, five specifief and two reserved a special address. This means that minimum number of bits should be 3 ( 22< 7 < 23)
Figure 5-14 Subnetting Class C
Each subnet can have 32 hosts Figure 5-15 There is 8 subnet Each subnet can have 32 hosts
Figure 5-16
Variable-length subnetting The internet allows a site to use variable-length subnetting. For an example of when this may be desirable, consider a site that is granted a class C address and needs to have five subnets with the following of host: 60,60,60,30,30 This site can not use a subnet mask with only two bits in the subnets section because this allows only four subnet with 62 hosts ( 256/4 - 2 = 62). Nor can the site use a subnet mask with three bits in the subnet section, because this allows 8 subnets with 30 hosts (256/8 -2 = 30) Solution for the problem: variable length subnetting. The router uses two different masks, one applied after the other First mask uses the mask with 26 1s (11111111 11111111 11111111 1100000 or 255.255.255.255.192) to divide the network into four subnets Then it applies the second mask with 27 1s (255.255.255.224) to one of the subnets to divide it into two smaller subnets
Variable length subnetting Figure 5-17 Variable length subnetting
Supernetting Depend on the need of an organization One or more classes c can be jointed to make one supernetwork Example: an organization that needs 1000 address can be granted four class c addresses. The organization can then use these address in one supernetwork, in four network, or in more then four networks.
Figure 5-18
Supernet Mask Can be assigned to a block of class C network address, if the number of net. Address is a power of two Default mask for a class C address 255.255.255.0 If some of the 1s are changed to 0s, we can have a mask for a group of class C Supernet mask is the reverseof the subnet mask
The beginning address can be X.Y.32.0, but it can not be X.Y.33.0 Figure 5-19 The beginning address can be X.Y.32.0, but it can not be X.Y.33.0
Example: With supernet 255.255.252.0, we can have four class C combined into one supernetwork If we choose the first address to be X.Y.32.0, the other three addres X.Y.33.0, X.Y.34.0 and X.Y.35.0 If the router recieves a packet, it applies the supernet mask to the destination address and compare the result to the lowest address. If the result and the lowest address are the same, the packet belong to the supernet Suppose a packet arrives with destination address X.Y.33.4. After applying the mask, the result is X.Y.32.0 (the lowest address), the packet belong to the supernet
Figure 5-20
Figure 5-21 Not belong to supernet Belong to
Figure 5-22 CIDR Classless Interdomain Routing