Subnetting and Supernetting Oleh Abdul Kholiq S Kom
Subnetting and Supernetting Oleh: Abdul Kholiq, S. Kom www. abdkejora. wordpress. com 1
Concepts Background • The increasing number of host connected to the internet • Restrictions on the network size 2
• 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 3
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 4
Figure 5 -1 Without subnetting 5
Figure 5 -2 With subnetting 6
• 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 R 1. 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 R 1, the interpretation of the IP address changes. • R 1 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 7
Figure 5 -3 Three levels of hierachy 8
Figure 5 -4 9
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. 10
Figure 5 -5 11
• 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 1 s defines netid or combination of netid and subnetid – Part of making containing 0 s defines hostid – To get the network and subnet address, we must apply the bit-wise-and operation on IP address and the mask 12
Figure 5 -6 Applying bit-wise-and operation to achieve masking 13
Figure 5 -7 Special address in subnetting: Reserved for : Is not assigned to any host 14
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 15
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-1 s and all 0 s 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 16
Figure 5 -8 17
Figure 5 -9 Theres is 1024 subnets Each subnet can have 16, 384 hosts/computer 18
Figure 5 -10 19
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. 20
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) 21
Figure 5 -11 masking 22
Figure 5 -12 Each subnet 4094 hosts/computers 23
Figure 5 -13 24
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. 25
• 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) 26
Figure 5 -14 Subnetting Class C 27
Figure 5 -15 There is 8 subnet Each subnet can have 32 hosts 28
Figure 5 -16 29
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, 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 1 s (11111111 1100000 or 255. 192) to divide the network into four subnets • Then it applies the second mask with 27 1 s (255. 224) to one of the subnets to divide it into two smaller subnets 30
Figure 5 -17 Variable length subnetting 31
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. 32
Figure 5 -18 33
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. 0 • If some of the 1 s are changed to 0 s, we can have a mask for a group of class C • Supernet mask is the reverseof the subnet mask 34
Figure 5 -19 The beginning address can be X. Y. 32. 0, but it can not be X. Y. 33. 0 35
• Example: – With supernet 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 36
Figure 5 -20 37
Figure 5 -21 Belong to Not belong to supernet 38
Figure 5 -22 CIDR Classless Interdomain Routing 39
- Slides: 39