chapter subnets in tcp/ip networks © n. ganesan, ph.d

48
Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D.

Upload: miles-mccormick

Post on 22-Dec-2015

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

Chapter

Subnets in TCP/IP Networks© N. Ganesan, Ph.D.

Page 2: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Chapter Objectives

Page 3: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

Module

Introduction to Subnetting

Page 4: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Subnetting

• Division of a network into subnets– For example, division of a Class B

address into several Class C addresses

• Some of the host IDs are used for creating subnet IDs

Page 5: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Need for Subnetting

• Classes A and B have a large number of hosts corresponding to each network ID

• It may be desirable to subdivide the hosts in Class C subnets

• Often, there is a limitation on the number of hosts that could be hosted on a single network segment– The limitation may be imposed by concerns

related to the management of hardware• Smaller broadcast domains are more

efficient and easy to manage

Page 6: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Subnetting Principle

• Use parts of the host IDs for subnetting purpose

• A subnet mask is used to facilitate the flow of traffic between the different subnets and the outside network (hops)– A hop is the distance a data packet

travels form one node to the other

Page 7: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Using Host IDs to Subnet

140 15 0 0

Class B Network

140 15 1 0

140 15 2 0

Subnet 1

Subnet 2

Third octet is now used for subnet IDs

140 15 3 0

Subnet 3

Page 8: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Subnet Configuration

140 15 1 0

140 15 1 1

Subnet ID

First Host ID

140 15 1 254…..

Last Host ID

Page 9: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Routing of Traffic

140.15.0.0140.15.2.0

140.15.1.0

140.15.3.0

Routing

Subnets

1

2

3Outside world

Page 10: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

End of Module

Page 11: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

Module

Subnetting Example

Page 12: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Subnetting Example

• Consider the case of a class C address 195. 175.25.0 assigned to an organization

• Subnets can be constructed by allocating part of the higher-order bits of the host ID

• Assume that three of the higher-order bits of the host ID are to be reserved for that purpose

Page 13: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Subnetting Structure

195 175 25 0

11100000

Subnet Mask

Page 14: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Sub Net Last Octet Subnet ID1 00000000 195.175.25.

02 00100000 195.175.25.

323 01000000 195.175.25.

644 01100000 195.175.25.

965 10000000 195.175.25.

1286 10100000 195.175.25.

1607 11000000 195.175.25.

1928 11100000 195.175.25.

224

UsableSubnets

(6)

Page 15: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Sample Subnet Division

Router

195.175.25.32 195.175.25.64

195.175.25.33...

195.175.25.62

195.175.25.65...

195.175.25.94

30 hosts per subnet.

Subnet 2Subnet 1

Page 16: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Total Number of Subnets and Hosts

• All zeros and ones are not used– This has been overcome in the new

RFC

• Total number of subnets is 6• Number of hosts per subnet is 30• Subnet mask is 255.255.255.224

– 255.255.255.11100000

Page 17: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

End of Module

Page 18: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

Module

The Routing Process

Page 19: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Overview of the Masking Process

• IP address and subnet masks are used for the masking operation

• The purpose of masking is to identify whether an IP address corresponds to a local host or a remote host

• The mathematical technique used is known as the ANDing process

Page 20: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

ANDing Process

• Similar to the AND Boolean operator

• Consider A = B and C– A is true only when B and C are true– Otherwise, A is false for all other

scenarios

Page 21: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

ANDing Table

B C B AND C

0 0 0

0 1 0

1 0 0

1 1 1

Page 22: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Subnet Masking

• AND host IP and subnet mask value at startup to identify network ID

• AND destination IP address and subnet mask value determine either of the following:– IP represents local host– IP represents remote host

Page 23: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Subnet Masking Example

• Subnet ID: 195.175.25.32• Subnet Mask: 255.255.255.224 • Host address

– 195.175.25.34• Case 1 destination address

– 195.175.25.40• Case 2 destination address

– 195.175.25.67

Page 24: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Network Scenario

RouterSubnet Mask: 255.255.255.224

Host195.175.25.34

Local Host195.175.25.40

OutsideWorld

195.175.25.40

195.175.25.67

Page 25: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Computing Subnet ID at Startup

Host ID 195 175 25 3411000011

10101111

00011001

00100010

Subnet Mask

255 255 255 22411111111

11111111

11111111

11100000

ANDingResult

195 175 25 3211000011

10101111

00011001

00100000Yields subnet ID.

Page 26: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

TCP/IPPropertiesof the Host

Page 27: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Masking of Destination Address:Case 1

Destinati-nation IP

195 175 25 4011000011

10101111

00011001

00101000

Subnet Mask

255 255 255 22411111111

11111111

11111111

11100000

ANDingResult

195 175 25 3211000011

10101111

00011001

00100000

Yields subnet ID to be that of the local subnet.

Page 28: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Case 1 Forwarding of Data Packets

• The destination host is local• Broadcast for the hardware

address of the local host at IP 195.175.25.40

• Send information to the local host

Page 29: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Masking of Destination Address:Case 2

Destinati-nation IP

195 175 25 6711000011

10101111

00011001

01000011

Subnet Mask

255 255 255 22411111111

11111111

11111111

11100000

ANDingResult

195 175 25 6411000011

10101111

00011001

01000000

Yields subnet ID to be that of different subnet.

Page 30: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Case 2 Forwarding of Data Packets

• The destination host is remote• Send information to the gateway • The router at the gateway will

route the data packet to the appropriate subnet

Page 31: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Gateway IP address

specified In TCP/IP

properties.

Page 32: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Summary of Transmission and Routing of Data

Packets

RouterSubnet Mask: 255.255.255.224

Host195.175.25.34

Local Host195.175.25.40

Subnet at 195.175.25

.64

195.175.25.40(Case 1)

195.175.25.67(Case 2)

Page 33: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Valid Subnet Masks for Class C Addresses

Subnet Mask Subnets

Hosts Host Total

255.255.255.192

2 62 124

255.255.255.224

6 30 180

255.255.255.240

14 14 196

255.255.255.248

30 6 180

255.255.255.252

62 2 124

255.255.255.254255.255.255.255

Page 34: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

End of Module

Page 35: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

Module

Subnetting Convention

Page 36: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Subnet Convention

• Consider the following Class C example– 195.175.25.0/27

• In the above case, the first three octets and the first three higher-order bits of the fourth octet are used in subnet masking – 3*8+3 = 27 bits from the beginning of

the 32 bit IP address

Page 37: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Subnet Convention Illustrated

11111111

11111111

11111111

11100000

8 Bits 8 Bits 8 Bits 3 Bits

Total number of masking bits = 27

195.175.25.0/27

Network ID

Page 38: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Variable Length Subnets

Source: Microsoft

White Paper

135.41.0.0/16

135.41.0.0/17 135.41.128.0.0/17

135.41.128.0/21

135.41.128.0./17

135.41.248.0/21

135.41.248.0/24

1 Network, 32,766 hosts

15 Networks, 2046 hosts per network

135.41.255.0/21

Subnet

Subnet

8 Networks, 254 hosts per network

Page 39: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

End of Module

Page 40: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

Module

Classless Inter-Domain Routing (CIDR)

Page 41: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Classless Inter-Domain Routing (CIDR)

• To avoid the depletion of the class B addresses, it is subnetted and assigned as class C addresses

• To avoid the proliferation of network IDs that would complicate entries in the routing tables, they were folded for easing the routing process

• The above is known as CIDR

Page 42: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Subnetting of Class B Example

• Consider the requirement of 2000 hosts by a company

• Allocation of one class B network ID would yield 65,534 hosts– Far more than required

• The solution is to subnet a B class address– 8 C class network IDs with each network being

able to support 254 hosts– The total number of hosts supported is 2,032

Page 43: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

CIDR

• CIDR enables the folding of network IDs • The Internet router tables will need one

entry for network ID with the use of a subnet mask for supernetting– Otherwise, the table need to carry 8 entries

in the previous example

• RIP for IP version 2, OSPF and BGPv2 are protocols that support CIDR

Page 44: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Classless Addressing

Fixed Variable

Fixed + Zeros

Fixed + Variables

Network ID

Host IDs

Page 45: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

End of Module

Page 46: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

Module

Supernetting

Page 47: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

© N. Ganesan, All rights reserved.

Supernetting and CIDR

220.78.168.0

Source: Microsoft White Paper on

TCP/IP

Network ID220.78.168.0

Subnet Mask255.255.248.0

(For supernetting)220.78.175.0

220.778.168.0

Internet Router Entry

Network ID

.

.

.

8 Network IDs

Page 48: Chapter Subnets in TCP/IP Networks © N. Ganesan, Ph.D

End of Module

End of Chapter