computer eng

Moh-993
Week1_CLASS.pdf

Subnetting Practice, Routing Process and Supernetting

Dr. Louai SAKER

Outlines

• Exercise 1: Subnetting Class C Address

• Exercise 2: Subnetting Class B Address

• IP Routing Process

• Supernetting

Outlines

• Exercise 1: Subnetting Class C Address

• Exercise 2: Subnetting Class B Address

• IP Routing Process

• Supernetting

Exercise 1: Subnetting Class C Address.

Answer the following questions regarding the IP address 192.168.10.0 along with 255.255.255.224 subnet mask.

1. How many subnets does the subnet mask produce?

2. How many valid hosts per subnet?

3. What are the valid subnets?

4. What are the valid hosts in each subnet?

5. What is the broadcast address of each subnet?

In this example, you will subnet the network address 192.168.10.0 and subnet mask 255.255.255.224.

192.168.10.0=Network address

255.255.255.224=Subnet mask

• How many subnets?

224 is 11100000, so our equation would be 23–2=6

• How many hosts?

25–2=30.

5

Exercise 1: Subnetting Class C Address.

What are the valid subnets?

256–224=32. (00100000)

32+32=64. (01000000)

64+32=96. (01100000)

96+32=128. (10000000)

128+32=160. (10100000)

160+32=192. (11000000)

192+64=224 (11100000) which is invalid because it is our subnet mask (all subnet bits on).

Our subnets are 32, 64, 96, 128, 160, and 192.

6

Exercise 1: Subnetting Class C Address.

• What are the valid hosts?

• What is the broadcast address for each subnet?

7

Exercise 1: Subnetting Class C Address.

CLASS C : 192.168.10.0 and subnet mask 255.255.255.224.

Outlines

• Exercise 1: Subnetting Class C Address

• Exercise 2: Subnetting Class B Address

• IP Routing Process

• Supernetting

Exercise 2: Subnetting Class B Address

An organization is granted the block 130.56.0.0/16. The administrator wants to create 1000 subnets.

a. Find the subnet mask.

b. Find the number of addresses in each subnet.

c. Find the first and last IP valid addresses in subnet 1.

d. Find the first and last IP valid addresses in subnet 32.

Exercise 2: Subnetting Class B Address

An organization is granted the block 130.56.0.0/16. The administrator wants to create 1000 subnets.

a. Find the subnet mask.

2^n = 1024 => 1024 >1000 Therefore, n = 10.

The address given here is a Class B address, therefore the default mask is /16.

10 bits are required for subnets and hence the required subnet mask is /(16+10) = /26.

In dotted decimal format, it shall be 192 and therefore, the subnet mask will be 255.255.255.192

Exercise 2: Subnetting Class B Address

An organization is granted the block 130.56.0.0/16. The administrator wants to create 1000 subnets.

a. Find the subnet mask.

b. Find the number of addresses in each subnet.

The remaining bits must be used for the address in each subnet i.e. there will be 32 - 26 = 6 bits available for the address component. Therefore, there will be a total of 2^6=64 bits available.

=> each subnet mask will be able to maintain 62 valid addresses

Exercise 2: Subnetting Class B Address c. Find the first and last IP valid addresses in subnet 1.

First address in subnet 1 = 130.56.0.1

Last address is subnet 1 = 130.56.0.62

The first address for the block can be calculated by ANDing the address 130.56.0.0 with the subnet mask /26 like below: 10000010 00111000 00000000 00000000 (130.56.0.0)

This address can not be allocated, so we will consider the next address: 10000010 00111000 00000000 00000001 (130.56.0.1)

In the similar manner, the last address that can be allocated before the broadcast address will be 130.56.0.62.

Exercise 2: Subnetting Class B Address c. Find the first and last IP valid addresses in subnet 1.

Format : nnnnnnnn.nnnnnnnn.ssssssss.sshhhhhh

Subnet 0: nnnnnnnn.nnnnnnnn.00000000.00hhhhhh (Since the subnet bits can’t be both off or on at the same time, we exclude the subnet 0)

Subnet 1: nnnnnnnn.nnnnnnnn.00000000.01hhhhhh

Subnet 2: nnnnnnnn.nnnnnnnn.00000000.10hhhhhh

Subnet 3: nnnnnnnn.nnnnnnnn.00000000.11hhhhhh

Subnet 4: nnnnnnnn.nnnnnnnn.00000001.00hhhhhh

Subnet 32: nnnnnnnn.nnnnnnnn.00001000.00hhhhhh

Exercise 2: Subnetting Class B Address c. Find the first and last IP valid addresses in subnet 1.

Network Address = nnnnnnnn.nnnnnnnn.00000000. 01000000

=130.56.0.64

First Host in subnet 1 = nnnnnnnn.nnnnnnnn.00000000. 01000001

= 130.56.0.65

Last Host in subnet 1 = nnnnnnnn.nnnnnnnn.00000000. 01111110

= 130.56.0.126

Broadcast address = nnnnnnnn.nnnnnnnn.00000000. 01111111

= 130.56.0.127

Exercise 2: Subnetting Class B Address d. Find the first and last IP valid addresses in subnet 32.

Subnet 32: nnnnnnnn.nnnnnnnn.00001000.00hhhhhh

Subnet 32 is the first subnet we obtain :

Network Address = nnnnnnnn.nnnnnnnn.00001000.00000000

=130.56.8.0

First Host in subnet 32 = nnnnnnnn.nnnnnnnn.00001000. 00000001

= 130.56.8.1

Last Host in subnet 32 = nnnnnnnn.nnnnnnnn.00001000. 00111110

= 130.56.8.62

Broadcast address = nnnnnnnn.nnnnnnnn.00001000. 00111111

= 130.56.8.63

Outlines

• Exercise 1: Subnetting Class C Address

• Exercise 2: Subnetting Class B Address

• IP Routing Process

• Supernetting

IP Routing example using two hosts and one router

In our example, a user on Host A pings Host B’s IP address. It will not get simpler than this. Let’s work through the steps.

IP Routing Process

1. From a command prompt, the user types ping 172.16.20.2.

A packet is generated on the Host A machine using the IP and ICMP Network layer protocols.

18

IP Routing Process

2. IP works with the Address Resolution Protocol (ARP) protocol to determine what network this packet is destined for by looking at the IP address and the subnet mask of Host A. Since this is a request for a remote host, which means it is not destined to be sent to a host on the local network, the packet must be sent to the router (the gateway for Network A) so that it will be routed to the correct remote network (which is Network B).

19

IP Routing Process:

3. For Host A to send the packet to the router, it must know the hardware address of the router’s interface located on the local network (Network A). Remember that the Network layer will hand the packet and the destination hardware address to the Data Link layer for framing and transmitting on a local host. To get the hardware address, the host looks in a location in memory called the ARP cache (a memory location where these MAC addresses are stored for a few seconds).

20

IP Routing Process

4. If the IP address has not already been resolved to a hardware address and is not in the ARP cache, the host sends an ARP broadcast looking, for the hardware address of IP address 172.16.10.1.

21

IP Routing Process

5. The router responds with the hardware address of the Ethernet interface connected to the local network. The host now has everything it needs to transmit the packet out on the local network to the router. The Network layer hands down the packet it generated with the ICMP echo request (Ping) to the Data Link layer, along with the hardware address of where the host wants to send the packet. The packet includes the IP source address and the destination IP address, as well as the ICMP specified in the Network layer protocol field.

22

IP Routing Process

6. The Data Link layer creates a frame, which encapsulates the packet with the control information needed to transmit on the local network. This includes the source and destination hardware addresses and the type field specifying the Network layer protocol.

The following Figure shows the frame that will be generated by the Data Link layer and sent out on the local media.

23

IP Routing Process

24

IP Routing Process

7. The Data Link layer of Host A hands the frame to the Physical layer, which encodes the 1s and 0s into a digital signal and transmits this out on the local physical network.

25

IP Routing Process

8. The signal is picked up by the router’s Ethernet 0 interface, and the interface synchronizes on the digital signal preamble and extracts the frame. The router’s interface, after building the frame, runs a CRC and, at the end of the frame, checks the FCS (frame check sequence) field to make sure that the CRC matches and no fragmentation or collisions occurred.

26

IP Routing Process

9. The destination hardware address is checked. Since this will be a match, the type field in the frame will be checked to see what the router should do with the data packet. IP is, of course, in the type field, and the router hands the packet to the IP protocol running on the router. The frame is discarded, and the original packet that was generated by Host A now sits in the router's buffer.

27

IP Routing Process

10. IP looks at the packet's destination IP address to determine if the packet is for the router. Since the destination IP address is 172.16.20.2, the router determines from the routing table that 172.16.20.0 is a directly connected network on interface Ethernet 1

28

IP Routing Process

11. The router places the packet in the buffer of interface Ethernet 1. The router needs to create a frame to send the packet to the destination host. First, the router looks in the ARP cache to determine whether the hardware address has already been resolved from a prior communication. If it is not in the ARP cache, the router sends an ARP broadcast out Ethernet 1 to find the hardware address of 172.16.20.2.

29

IP Routing Process

30

IP Routing Process

12. Host B responds with the hardware address of its network interface card with an ARP reply. The router’s Ethernet 1 interface now has everything it needs to send the packet to the final destination. The previous figure shows the frame that was generated and sent out on the physical network.

31

IP Routing Process

13. The frame generated from the router’s Ethernet 1 interface has the source hardware address of the Ethernet 1 interface and the hardware destination address of Host B’s network interface card. However, the most important thing here is that even though the frame’s source and destination hardware address changed at every interface of the router it was sent to and from, the IP source and destination addresses never changed. The packet was never modified at all; only the frame changed

32

IP Routing Process

14. Host B receives the frame and runs a CRC. If that checks out, it discards the frame and hands the packet to IP. IP will then check the destination IP address. Since the IP destination address matches the IP configuration of Host B, it looks in the protocol field of the packet to determine what the purpose of the packet is.

33

IP Routing Process

15. Since the packet is an ICMP echo request, Host B generates a new ICMP echo-reply packet with a source IP address of Host B and a destination IP address of Host A. The process starts all over again, except that it goes in the opposite direction. However, the hardware address of each device along the path is already known, so each device only needs to look in its ARP cache to determine the hardware address of each interface.

34

Outlines

• Exercise 1: Subnetting Class C Address

• Exercise 2: Subnetting Class B Address

• IP Routing Process

• Supernetting

Supernetting

• Introduction

• Classless Interdomain Routing

• Subnetting vs. Supernetting

• Why supernetting?

• Supernetting rules

• Exercises

Outlines

• Introduction

• Classless Interdomain Routing

• Subnetting vs. Supernetting

• Why supernetting?

• Supernetting rules

• Exercises

38

Introduction

• An IPv4 is a 32-bit address.

• The address space of IPv4 is ? There are two prevalent notations to show an IPv4 address:

binary notation and decimal notation.

• IPv4 addresses uses the concept of classes. This architecture is called classful addressing The address space is divided into five classes: A, B, C, D, and E.

An IP address is divided into netid and hostid

Introduction

39

IPv4 addresses uses the concept of classes. This architecture is called Classful addressing

40

Introduction

Default mask is a 32-bit number made of contiguous 1s followed by 0s.

Classless Interdomain Routing (CIDR):

The last column shows the mask in the form /n where n can be 8, 16, or 24 (for default mask). this notation is also called slash notation or Classless Interdomain Routing (CIDR).

Supernetting

• Introduction

• Classless Interdomain Routing

• Subnetting vs. Supernetting

• Why supernetting?

• Supernetting rules

• Exercises

Classless Interdomain Routing (CIDR)

• No more network classes with CIDR

• CIDR uses variable length subnet masks (VLSM) for subnetting

• Network ID no longer has to be on an octet boundary

CIDR • subnet portion of address of arbitrary length

• address format: a.b.c.d/x, where x is # bits in subnet portion of address

11001000 00010111 00010000 00000000

Subnet part Host part

200.23.16.0/23 OR 200.23.16.0 255.255.254.0 42

Supernetting

• Introduction

• Classless Interdomain Routing

• Subnetting vs. Supernetting

• Why supernetting?

• Supernetting rules

• Exercises

44

Subnetting vs. Supernetting

• Subnetting: For any class A, B, C or D, it could be divided into several contiguous

groups and assign each group to smaller networks called subnets.

Subnetting is done by increasing the number of 1s in the default mask.

• Supernetting: Is the combination of several set of classes (networks) of C (or A, B, D) to

create one supernet (network).

Supernetting is done by decreasing the number of 1s in the default mask

Subnetting vs. Supernetting

46

Subnetting : With this new subnet mask, the network has been transformed from one Class C network with up to 254 hosts to four separate subnetworks, each with 64 (26 = 64) hosts. However, because the IP with all host bits set to 0 and the IP address with all bits set to 1 are both reserved, there is actually a limit of 62 valid hosts for each subnetwork.

Subnetting vs. Supernetting

Supernetting: To create 4 separate subnetworks from one Class C network, we would simply add two bits (22 = 4) to the default subnet mask. In the following figure, we create a new supernetwork by combining four separate subnetworks.

Supernetwork can now accommodate 210, or 1024 hosts. If the first Netid is 192.168.64.0, the next three Netids will be 192.168.65.0, 192.168.66.0, and 192.168.67.0.

47

Subnetting vs. Supernetting

Subnetting vs. Supernetting

Supernetting

• Introduction

• Classless Interdomain Routing

• Subnetting vs. Supernetting

• Why supernetting?

• Supernetting rules

• Exercises

Supernetting

• Supernetting is the process of summarizing a bunch of contiguous networks back in a single large network. Supernetting is also known as route summarization and route aggregation. Supernetting is mainly done for optimizing the routing tables.

Supernetting

Advantages of Supernetting:

• Control and reduce network traffic

• Helpful to solve the problem of lacking IP addresses

• Minimizes the routing table

Supernetting

52

With supernetting you can combine small networks into one larger network. Figure shows IP addresses within the following Class C subnetworks: • 192.168.64.0 • 192.168.65.0 • 192.168.66.0 • 192.168.67.0 These four smaller networks have been combined to create the 192.168.64.0 supernetwork. Class C supernetworks will usually assume the address of the subnetwork with the lowest IP address, in this case, 192.168.64.0.

Supernetting

53

Default routing table of the router (without Supernetting)

Supernetting

54

Default routing table of the router (without Supernetting)

Routing table of the router (with Supernetting)

Supernetting

55

4 class C addresses combine to make one supernetwork

Supernetting

• Introduction

• Classless Interdomain Routing

• Subnetting vs. Supernetting

• Why supernetting?

• Supernetting rules

• Exercises

Supernetting rules

1. The number of blocks must be a power of 2 (1, 2, 4, 8, 16, . . .).

Examples: a. 198.47.32.0 198.47.33.0 198.47.34.0 => can’t be used to form a

supernet, there are only three blocks.

b. 198.47.32.0 198.47.33.0 198.47.34.0 198.47.35.0=> can be used to form a supernet.

57

Supernetting rules

2. The blocks must be contiguous in the address space (no gaps between the blocks).

Examples: a. 198.47.32.0 198.47.42.0 198.47.52.0 198.47.62.0 => can’t be used to

form a supernet, No, the blocks are not contiguous.

b. 198.47.32.0 198.47.33.0 198.47.34.0 198.47.35.0=> can be used to form a supernet, no gaps between the blocks.

58

Supernetting rules

3. The third byte of the first address in the superblock must be evenly divisible by the number of blocks. In other words, if the number of blocks is N, the third byte must be divisible by N.

Examples: a. 198.47.31.0 198.47.32.0 198.47.33.0 198.47.52.0 => can’t be used to

form a supernet, 31 in the first block is not divisible by 4.

b. 198.47.32.0 198.47.33.0 198.47.34.0 198.47.35.0=> can be used to form a supernet, the thirs byte 32 is divisible by 4.

59

Supernetting rules

1. The number of blocks must be a power of 2 (1, 2, 4, 8, 16, . . .).

2. The blocks must be contiguous in the address space (no gaps between the blocks).

3. The third byte of the first address in the superblock must be evenly divisible by the number of blocks. In other words, if the number of blocks is N, the third byte must be divisible by N.

60

Supernetting

• Introduction

• Classless Interdomain Routing

• Subnetting vs. Supernetting

• Why supernetting?

• Supernetting rules

• Exercises

Exercise 1

• A company needs 600 addresses. Which of the following set of class C blocks can be used to form a supernet for this company?

a. 198.47.32.0 198.47.33.0 198.47.34.0

b. 198.47.32.0 198.47.42.0 198.47.52.0 198.47.62.0

c. 198.47.31.0 198.47.32.0 198.47.33.0 198.47.52.0

d. 198.47.32.0 198.47.33.0 198.47.34.0 198.47.35.0

62

Exercise 1

A company needs 600 addresses. Which of the following set of class C blocks can be used to form a supernet for this company?

a. 198.47.32.0 198.47.33.0 198.47.34.0

No, there are only three blocks.

b. 198.47.32.0 198.47.42.0 198.47.52.0 198.47.62.0

No, the blocks are not contiguous.

c. 198.47.31.0 198.47.32.0 198.47.33.0 198.47.52.0

No, 31 in the first block is not divisible by 4.

d. 198.47.32.0 198.47.33.0 198.47.34.0 198.47.35.0

Yes, all three requirements are fulfilled.

63

Exercise 2

We need to make a supernetwork out of 16 class C blocks. What is the supernet mask?

Exercise 2

We need to make a supernetwork out of 16 class C blocks. What is the supernet mask?

Solution

We need 16 blocks. For 14=6 blocks we need to change four 1s to 0s in the default mask. So the mask is

11111111 11111111 11110000 00000000

or

255.255.240.0

Exercise 3

• A supernet has a first address of 205.16.32.0 and a supernet mask of 255.255.248.0. A router receives three packets with the following destination addresses:

• 205.16.37.44

• 205.16.42.56

• 205.17.33.76

Which packet belongs to the supernet?

Exercise 3

We apply the supernet mask to see if we can find the beginning address.

205.16.37.44 AND 255.255.248.0  205.16.32.0

205.16.42.56 AND 255.255.248.0  205.16.40.0

205.17.33.76 AND 255.255.248.0  205.17.32.0

Only the first address belongs to this supernet.

Exercise 4

• A supernet has a first address of 205.16.32.0 and a supernet mask of 255.255.248.0. How many blocks are in this supernet and what is the range of addresses?

Exercise 4

• A supernet has a first address of 205.16.32.0 and a supernet mask of 255.255.248.0. How many blocks are in this supernet and what is the range of addresses?

• The supernet has 21 1s. The default mask has 24 1s. Since the difference is 3, there are 23 or 8 blocks in this supernet. The blocks are 205.16.32.0 to 205.16.39.0. The first address is 205.16.32.0. The last address is 205.16.39.255.