39
1 V Subnetting and Supernetting

IP Sub Sup Netting F5[1]Tarun

Embed Size (px)

Citation preview

Page 1: IP Sub Sup Netting F5[1]Tarun

1

V

Subnettingand

Supernetting

Page 2: IP Sub Sup Netting F5[1]Tarun

2

Concepts Background

• The increasing number of host connected to the internet

• Restrictions on the network size

Page 3: IP Sub Sup Netting F5[1]Tarun

3

• 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

Page 4: IP Sub Sup Netting F5[1]Tarun

4

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

Page 5: IP Sub Sup Netting F5[1]Tarun

5

Figure 5-1

Without subnetting

Page 6: IP Sub Sup Netting F5[1]Tarun

6

Figure 5-2

With subnetting

Page 7: IP Sub Sup Netting F5[1]Tarun

7

• 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

Page 8: IP Sub Sup Netting F5[1]Tarun

8

Figure 5-3

Three levels of hierachy

Page 9: IP Sub Sup Netting F5[1]Tarun

9

Figure 5-4

Page 10: IP Sub Sup Netting F5[1]Tarun

10

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.

Page 11: IP Sub Sup Netting F5[1]Tarun

11

Figure 5-5

Page 12: IP Sub Sup Netting F5[1]Tarun

12

• 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

Page 13: IP Sub Sup Netting F5[1]Tarun

13

Figure 5-6Applying bit-wise-and operation to achieve masking

Page 14: IP Sub Sup Netting F5[1]Tarun

14

Figure 5-7

Special address in subnetting:

: Is not assigned to any host

: Is not assigned to any host

Reserved for

Reserved for

Page 15: IP Sub Sup Netting F5[1]Tarun

15

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

Page 16: IP Sub Sup Netting F5[1]Tarun

16

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

Page 17: IP Sub Sup Netting F5[1]Tarun

17

Figure 5-8

Page 18: IP Sub Sup Netting F5[1]Tarun

18

Figure 5-9

Theres is 1024 subnetsEach subnet can have 16,384 hosts/computer

Page 19: IP Sub Sup Netting F5[1]Tarun

19

Figure 5-10

Page 20: IP Sub Sup Netting F5[1]Tarun

20

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.

Page 21: IP Sub Sup Netting F5[1]Tarun

21

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)

Page 22: IP Sub Sup Netting F5[1]Tarun

22

Figure 5-11

masking

Page 23: IP Sub Sup Netting F5[1]Tarun

23

Figure 5-12

Each subnet 4094 hosts/computers

Page 24: IP Sub Sup Netting F5[1]Tarun

24

Figure 5-13

Page 25: IP Sub Sup Netting F5[1]Tarun

25

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.

Page 26: IP Sub Sup Netting F5[1]Tarun

26

• 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)

Page 27: IP Sub Sup Netting F5[1]Tarun

27

Figure 5-14 SubnettingClass C

Page 28: IP Sub Sup Netting F5[1]Tarun

28

Figure 5-15

There is 8 subnetEach subnet can have 32 hosts

Page 29: IP Sub Sup Netting F5[1]Tarun

29

Figure 5-16

Page 30: IP Sub Sup Netting F5[1]Tarun

30

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

Page 31: IP Sub Sup Netting F5[1]Tarun

31

Figure 5-17

Variable length subnetting

Page 32: IP Sub Sup Netting F5[1]Tarun

32

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.

Page 33: IP Sub Sup Netting F5[1]Tarun

33

Figure 5-18

Page 34: IP Sub Sup Netting F5[1]Tarun

34

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

Page 35: IP Sub Sup Netting F5[1]Tarun

35

Figure 5-19

The beginning address can beX.Y.32.0, but itcan not be X.Y.33.0

Page 36: IP Sub Sup Netting F5[1]Tarun

36

• 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

Page 37: IP Sub Sup Netting F5[1]Tarun

37

Figure 5-20

Page 38: IP Sub Sup Netting F5[1]Tarun

38

Figure 5-21

Belong to Not belong to supernet

Page 39: IP Sub Sup Netting F5[1]Tarun

39

Figure 5-22

CIDRClasslessInterdomainRouting