Chapter 5 of TCP/IP Protocol Suite - Cs

11 downloads 944 Views 69KB Size Report
Forouzan Notes. 5-2. COSC 6377 - Fall 2000. Figure 5-1. A network with two levels of hierarchy (not subnetted). To the rest of the Internet. 141.14.2.20. 141.14 .
Slides from TCP/IP - Forouzan

Chapter 5

Subnetting and Supernetting • • • • •

Subnetting Masking Examples of Subnetting Variable-Length Subnetting Supernetting

Forouzan Notes

COSC 6377 - Fall 2000

Figure 5-1

5-1

A network with two levels of hierarchy (not subnetted)

141.14.2.105 141.14.2.21 141.14.2.20

141.14.7.96 141.14.7.95

To the rest of the Internet

R1

Network

141.14.0.0

141.14.22.64

141.14.7.44 141.14.22.9

Forouzan Notes

Forouzan Notes

141.14.22.8

COSC 6377 - Fall 2000

COSC 6377 - Fall 2000

5-2

5-

Slides from TCP/IP - Forouzan

Figure 5-2

A network with three levels of hierarchy (subnetted)

141.14.2.21

141.14.2.105

141.14.2.20 141.14.7.45 141.14.7.44

141.14.7.96

141.14.2.0 To the rest of the Internet

Subnetwork

R1

141.14.7.0 Subnetwork

Subnetwork

141.14.22.0

Site 141.14.0.0

141.14.22.8 141.14.22.64

141.14.22.9

Forouzan Notes

COSC 6377 - Fall 2000

Figure 5-3

5-3

Addresses in a network with and without subnetting

141 . 14 . 2 . 21 Netid

Hostid

Network access

Host access

a. Without subnetting

141 . 14 . 2 . 21 Netid

Subnetid

Subnetwork access

Hostid Host access

b. With subnetting Forouzan Notes

Forouzan Notes

COSC 6377 - Fall 2000

COSC 6377 - Fall 2000

5-4

5-

Slides from TCP/IP - Forouzan

Figure 5-4

Hierarchy concept in a telephone number

( 408 ) 864 - 8902 Area code

Forouzan Notes

Exchange

Connection

COSC 6377 - Fall 2000

5-5

Figure 5-5

Masking

141.14.2.21

Mask

141.14.0.0

IP address

255.255.0.0

Network address

a. Without subnetting

141.14.2.21

Mask

IP address

255.255.255.0

141.14.2.0 Subnetwork address

b. With subnetting Forouzan Notes

Forouzan Notes

COSC 6377 - Fall 2000

COSC 6377 - Fall 2000

5-6

5-

Slides from TCP/IP - Forouzan

Figure 5-6

Applying bit-wise and operator to achieve masking

IP address

141.14.2.21 10001101 00001110

Mask

11111111 141.14.0.0 Network 10001101 address

00000010 00010101

11111111

00000000 00000000

00001110

00000000 00000000

a. Without subnetting IP address

141.14.2.21 10001101 00001110

Mask

11111111 141.14.2.0 Subnetwork 10001101 address

00000010 00010101

11111111

11111111

00000000

00001110

00000010 00000000

b. With subnetting Forouzan Notes

COSC 6377 - Fall 2000

Figure 5-7

5-7

Special addresses in subnetting

Subnetid

Hostid

Any

All 0s Subnetwork address All 1s

Any

Broadcast to all hosts in a specific subnet All 0s

Any Subnetid all 0s

All 1s

Any Subnetid all 1s

Forouzan Notes

Forouzan Notes

COSC 6377 - Fall 2000

COSC 6377 - Fall 2000

5-8

5-

Slides from TCP/IP - Forouzan

Figure 5-8

Masks in example 1

255.0.0.0

Mask Netid

Hostid

11111111 00000000

00000000

00000000

a. Without subnetting

Mask Netid

255.255.192.0 Subnetid

11111111 11111111

Hostid

11000000

00000000

b. With subnetting

Forouzan Notes

COSC 6377 - Fall 2000

Figure 5-9

5-9

Range of addresses in example 1

Special addresses (hostid all 0s)

Special addresses (hostid all 1s)

... ... ... ... ...

Special addresses (subnetid all 0s)

X.0.0.0

X.0.0.1

1st subnet

X.0.64.0

X.0.64.1

2nd subnet

X.0.128.0

X.0.128.1

X.255.128.0

X.255.128.1

X.255.192.0

X.255.192.1

1022nd subnet

.. .

X.0.63.254

X.0.63.255

X.0.127.254

X.0.127.255

X.0.191.254

X.0.191.255

.. .

X.255.191.254 X.255.191.255 X.255.255.254 X.255.255.255

Special addresses (subnetid all 1s)

Forouzan Notes

Forouzan Notes

COSC 6377 - Fall 2000

COSC 6377 - Fall 2000

5-10

5-

Slides from TCP/IP - Forouzan

Figure 5-10

Subnetworks in example 1

X.0.64.1

X.0.64.2

X.0.127.254

...

X.0.64.0 Subnetwork X.0.128.2 X.0.128.1

To the rest of the Internet

R1

X.0.191.254

...

X.0.128.0

...

Subnetwork

X.255.128.2 X.255.128.1

X.255.191.254

...

Site

X.255.128.0

X.0.0.0

Forouzan Notes

Subnetwork

COSC 6377 - Fall 2000

5-11

Figure 5-11

Mask in example 2

255.255.0.0

Mask Netid

11111111

Hostid

11111111

00000000

00000000

a. Without subnetting

255.255.240.0

Mask Netid

11111111

Subnetid

11111111

1111 0000

Hostid

00000000

b. With subnetting

Forouzan Notes

Forouzan Notes

COSC 6377 - Fall 2000

COSC 6377 - Fall 2000

5-12

5-

Slides from TCP/IP - Forouzan

Figure 5-12

Range of addresses in example 2

Special addresses (hostid all 0s)

Special addresses (hostid all 1s)

... ... ... ... ...

Special addresses (subnetid all 0s)

X.Y.0.0

X.Y.0.1

1st subnet

X.Y.16.0

X.Y.16.1

2nd subnet

X.Y.32.0

.. .

X.Y.32.1

14th subnet X.Y.224.0

X.Y.224.1

X.Y.240.0

X.Y.240.1

X.Y.15.254

X.Y.15.255

X.Y.31.254

X.Y.31.255

X.Y.47.254

X.Y.47.255

X.Y.239.254

X.Y.239.255

X.Y.255.254

X.Y.255.255

.. .

Special addresses (subnetid all 1s) Forouzan Notes

COSC 6377 - Fall 2000

5-13

Figure 5-13

Subnetworks in example 2

X.Y.16.2 X.Y.16.1

...

X.Y.31.254

X.Y.16.0 Subnetwork X.Y.32.2 X.Y.32.1

To the rest of the Internet

R1

X.Y.47.254

...

X.Y.32.0

...

Subnetwork

X.Y.224.2 X.Y.224.1

...

Site

X.Y.224.0

X.Y.0.0

McGraw-Hill Forouzan Notes

Forouzan Notes

X.Y.239.254

Subnetwork



COSC 6377 - Fall 2000 The

McGraw-Hill Companies, Inc., 2000 5-14

COSC 6377 - Fall 2000

5-

Slides from TCP/IP - Forouzan

Figure 5-14

Masks in example 3

255.255.255.0

Mask

Netid

11111111

Hostid

11111111

11111111

00000000

a. Without subnetting

Mask

255.255.255.224 Netid

11111111

Subnetid Hostid

11111111

11111111 111 00000

b. With subnetting Forouzan Notes

COSC 6377 - Fall 2000

Figure 5-15

5-15

Range of addresses in example 3

Special addresses hostid all 1s

Special addresses hostid all 0s Special addresses subnetid all 0s

X.Y.Z.0

X.Y.Z.1

1st subnet

X.Y.Z.32

X.Y.Z.33

2nd subnet

X.Y.Z.64

X.Y.Z.65

6th subnet

X.Y.Z.192

X.Y.Z.193

X.Y.Z.224

X.Y.Z.225

.. .

... ... ... ... ...

X.Y.Z.30

X.Y.Z.31

X.Y.Z.62

X.Y.Z.63

X.Y.Z.94

X.Y.Z.95

X.Y.Z.222

X.Y.Z.223

X.Y.Z.254

X.Y.Z.255

.. .

Special addresses subnetid all 1s

Forouzan Notes

Forouzan Notes

COSC 6377 - Fall 2000

COSC 6377 - Fall 2000

5-16

5-

Slides from TCP/IP - Forouzan

Figure 5-16

Subnetworks in example 3

X.Y.Z.34 X.Y.Z.33

...

X.Y.Z.62

X.Y.Z.32 Subnetwork

To the rest of the Internet

X.Y.Z.66 X.Y.Z.65

R1

...

X.Y.Z.94

X.Y.Z.64 Subnetwork

...

X.Y.Z.194 X.Y.Z.193

Site

X.Y.Z.192

X.Y.Z.0

Forouzan Notes

...

X.Y.Z.222

Subnetwork

COSC 6377 - Fall 2000

Figure 5-17

5-17

Variable-length subnetting

Site

62 hosts

X.Y.Z.0 62 hosts First mask 255.255.255.192 62 hosts

30 hosts

Router

Second mask 255.255.255.224 30 hosts

Forouzan Notes

Forouzan Notes

COSC 6377 - Fall 2000

COSC 6377 - Fall 2000

5-18

5-

Slides from TCP/IP - Forouzan

Figure 5-18

Supernetwork

First class C address

Second class C address

X.Y.32.254

X.Y.33.1

X.Y.32.2 X.Y.32.1

To the rest of the Internet

X.Y.33.253 X.Y.33.254

Supernetwork

R1

X.Y.32.0

X.Y.35.254 X.Y.35.253

X.Y.34.1 X.Y.34.2 X.Y.35.1

X.Y.34.254

Fourth class C address

Forouzan Notes

Third class C address

COSC 6377 - Fall 2000

5-19

Figure 5-19

Supernet mask Netid 11111111

Hostid 11111111

11111111

11111111

Subnetid Hostid 11000000 11111111

Netid 11111111

a. Subnetting

4 subnets out of 1 network

Netid 11111111

Hostid 11111111

11111111

00000000

11111111

111111 00

Hostid 00000000

Supernetid 11111111

b. Supernetting

Forouzan Notes

Forouzan Notes

00000000

1 supernet out of 4 networks

COSC 6377 - Fall 2000

COSC 6377 - Fall 2000

5-20

5-

Slides from TCP/IP - Forouzan

Figure 5-20

Two ways of defining a supernet

X.Y.32.0

, 255.255.252.0 Same

X.Y.32.0

Forouzan Notes

,

1024

COSC 6377 - Fall 2000

Figure 5-21

Example of supernetting

X.Y.33.4

X.Y.39.12

xxxxxxxx

yyyyyyyy 00100001

00000100

xxxxxxxx

yyyyyyyy 00100111

00001100

11111111

11111111

11111100

00000000

11111111

11111111

11111100

00000000

xxxxxxxx

yyyyyyyy 00100000

00000000

xxxxxxxx

yyyyyyyy 00100100

00000000

X.Y.32.0

Forouzan Notes

Forouzan Notes

5-21

X.Y.36.0

COSC 6377 - Fall 2000

COSC 6377 - Fall 2000

5-22

5-

Slides from TCP/IP - Forouzan

Figure 5-22

CIDR

Default mask 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0

.. .

Network Next hop address address X.Y.32.0 ........... X.Y.33.0 ........... X.Y.34.0 ........... X.Y.35.0 ...........

.. .

.. .

a. Routing table without supernet mask Default mask

Network Next hop address address 255.255.252.0 X.Y.32.0 ...........

.. .

.. .

.. .

b. Routing table with supernet mask

Forouzan Notes

Forouzan Notes

COSC 6377 - Fall 2000

COSC 6377 - Fall 2000

5-23

5-