Vous êtes sur la page 1sur 92

2000, Cisco Systems, Inc.

8-1
Chapter 8
Interconnecting
Networks with
TCP/IP
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-3
Upon completion of this chapter, you will
be able to perform the following tasks:
Identify the IP protocol stack, its protocol layer
functions, and commonly used IP protocols.
Identify IP address classes, IP addresses, IP subnet
masks, IP network numbers, subnet numbers, and
possible host numbers.
Configure IP addresses and subnet masks on a
router interface and optionally configure a host table.
Interconnect the VLANs with a Layer 3 device such
as a router on a stick.

Objectives
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-4
Early protocol suite
Universal
Introduction to TCP/IP
Host
Internet
TCP/IP
Host
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-5
TCP/IP Protocol Stack
7
6
5
4
3
2
5
4
3
2
Application
Presentation
Session
Transport
Network
Data-Link
Physical 1
Application
Transport
Internet
Data-Link
Physical
1
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-6
Application Layer Overview
*Used by the Router
Application
Transport
Internet
Data-Link
Physical
File Transfer
- TFTP*
- FTP*
- NFS
E-Mail
- SMTP
Remote Login
- Telnet*
- rlogin*
Network Management
- SNMP*
Name Management
- DNS*
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-7
Transport Layer Overview
Transmission Control
Protocol (TCP)

User Datagram
Protocol (UDP)
Application
Transport
Internet
Data-Link
Physical
Connection-
Oriented

Connectionless

2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-8
TCP Segment Format
Source Port (16) Destination Port (16)
Sequence Number (32)
Header
Length (4)
Acknowledgment Number (32)
Reserved (6)
Code Bits (6) Window (16)
Checksum (16) Urgent (16)
Options (0 or 32 if Any)
Data (Varies)
20
Bytes
Bit 0
Bit 15 Bit 16 Bit 31
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-9
Port Numbers
TCP
Port
Numbers
F
T
P
Transport
Layer
T
E
L
N
E
T
D
N
S
S
N
M
P
T
F
T
P
S
M
T
P
UDP
Application
Layer
21 23 25 53 69 161
R
I
P
520
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-10
TCP Port Numbers
Source
Port
Destination
Port

Host A
1028 23
SP DP
Host Z
Telnet Z
Destination port = 23.
Send packet to my
Telnet
application.
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-11
Send SYN
(seq = 100 ctl = SYN)
SYN Received
Host A Host B
TCP Three-Way
Handshake/Open Connection
1
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-12
Send SYN
(seq = 100 ctl = SYN)
SYN Received
Send SYN, ACK
(seq = 300 ack = 101
ctl = syn,ack)
Host A Host B
SYN Received
1
2
TCP Three-Way
Handshake/Open Connection
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-13
Send SYN
(seq = 100 ctl = SYN)
SYN Received
Send SYN, ACK
(seq = 300 ack = 101
ctl = syn,ack)
Established
(seq = 101 ack = 301
ctl = ack)
Host A Host B
1
2
3
SYN Received
TCP Three-Way
Handshake/Open Connection
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-14
TCP Simple Acknowledgment
Window Size = 1
Sender Receiver
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-15
TCP Simple Acknowledgment
Window Size = 1
Sender Receiver
Send 1
Receive 1
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-16
TCP Simple Acknowledgment
Window Size = 1
Sender Receiver
Send 1
Receive 1
Receive ACK 2
Send ACK 2
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-17
TCP Simple Acknowledgment
Window Size = 1
Sender Receiver
Send 1
Receive 1
Receive ACK 2
Send ACK 2
Send 2
Receive 2
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-18
TCP Simple Acknowledgment
Window Size = 1
Sender Receiver
Send 1
Receive 1
Receive ACK 2
Send ACK 2
Send 2
Receive 2
Receive ACK 3
Send ACK 3
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-19
TCP Simple Acknowledgment
Window Size = 1
Sender Receiver
Send 1
Receive 1
Receive ACK 2
Send ACK 2
Send 2
Receive 2
Receive ACK 3
Send ACK 3
Send 3
Receive 3
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-20
Window Size = 1
Sender Receiver
Send 1
Receive 1
Receive ACK 2
Send ACK 2
Send 2
Receive 2
Receive ACK 3
Send ACK 3
Send 3
Receive 3
Receive ACK 4
Send ACK 4
TCP Simple Acknowledgment
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-21
TCP Sequence and
Acknowledgment Numbers
Source
Port
Destination
Port
Sequence

Acknowledgment

Source Dest. Seq. Ack.
1028 23 10 1
I just
sent number
10.
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-22
TCP Sequence and
Acknowledgment Numbers
I just got number
10, now I need
number 11.
Source
Port
Destination
Port

Sequence

Acknowledgment

1028 23
Source Dest.
10
Seq.
1
Ack.
1028 23
Source Dest.
11
Seq.
1
Ack.
I just
sent number
10.
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-23
TCP Sequence and
Acknowledgment Numbers
Source
Port
Destination
Port

Sequence

Acknowledgment

1028 23
Source Dest.
11
Seq.
2
Ack.
1028 23
Source Dest.
10
Seq.
1
Ack.
1028 23
Source Dest.
11
Seq.
1
Ack.
I just got number
10, now I need
number 11.
I just
sent number
11.
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-24
TCP Sequence and
Acknowledgment Numbers
Source
Port
Destination
Port

Sequence

Acknowledgment

1028 23
Source Dest.
11
Seq.
101
Ack.
1028 23
Source Dest.
10
Seq.
100
Ack.
1028 23
Source Dest.
11
Seq.
100
Ack.
1028 23
Source Dest.
12
Seq.
101
Ack.
I just got number
11, now I need
number 12.
I just
sent number
11.
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-25
TCP Windowing
Sender Receiver
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-26
TCP Windowing
Window Size = 3
Send 2
Sender Receiver
Window Size = 3
Send 1
Window Size = 3
Send 3
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-27
Window Size = 3
Send 2
TCP Windowing
Sender
Window Size = 3
Send 1
Window Size = 3
Send 3
ACK 3
Window Size = 2
Packet 3 Is
Dropped
Receiver
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-28
Window Size = 3
Send 2
TCP Windowing
Sender
Window Size = 3
Send 1
Window Size = 3
Send 3
ACK 3
Window Size = 2
Packet 3 Is
Dropped
Window Size = 3
Send 4
Window Size = 3
Send 3
Receiver
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-29
Window Size = 3
Send 2
TCP Windowing
Sender
Window Size = 3
Send 1
Window Size = 3
Send 3
ACK 3
Window Size = 2
Packet 3 Is
Dropped
Window Size = 3
Send 4
Window Size = 3
Send 3
ACK 5
Window Size = 2
Receiver
Window Size = 3
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-30
No sequence or acknowledgment fields
UDP Segment Format
Source Port (16)
Destination Port (16)
Length (16)
Data (if Any)
1
Bit 0
Bit 15 Bit 16 Bit 31
Checksum (16)
8
Bytes
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-31
Internet Layer Overview
In the OSI reference model, the network layer
corresponds to the TCP/IP Internet layer.
Internet Protocol (IP)

Internet Control Message
Protocol (ICMP)

Address Resolution
Protocol (ARP)

Reverse Address
Resolution Protocol (RARP)
Application
Transport
Internet
Data-Link
Physical
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-32
IP Datagram
Version
(4)
Destination IP Address (32)
Options (0 or 32 if Any)
Data (Varies if Any)
1
Bit 0
Bit 15 Bit 16 Bit 31
Header
Length (4)
Priority &Type
of Service (8)
Total Length (16)
Identification (16)
Flags
(3)
Fragment Offset (13)
Time-to-Live (8)
Protocol (8) Header Checksum (16)
Source IP Address (32)
20
Bytes
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-33
Determines destination upper-layer protocol
Protocol Field
Transport
Layer
Internet
Layer
TCP UDP
Protocol
Numbers
IP
17 6
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-34
Internet Control Message
Protocol
Application
Transport
Internet
Data-Link
Physical
Destination
Unreachable

Echo (Ping)

Other
ICMP
1
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-35
Address Resolution Protocol
172.16.3.1 172.16.3.2
IP: 172.16.3.2 = ???
I need the
Ethernet
address of
176.16.3.2.
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-36
Address Resolution Protocol
172.16.3.1 172.16.3.2
IP: 172.16.3.2 = ???
I heard that broadcast.
The message is for me.
Here is my Ethernet
address.
I need the
Ethernet
address of
176.16.3.2.
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-37
Address Resolution Protocol
172.16.3.1
IP: 172.16.3.2
Ethernet: 0800.0020.1111
172.16.3.2
IP: 172.16.3.2 = ???
I heard that broadcast.
The message is for me.
Here is my Ethernet
address.
I need the
Ethernet
address of
176.16.3.2.
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-38
Address Resolution Protocol
Map IP MAC
Local ARP
172.16.3.1
IP: 172.16.3.2
Ethernet: 0800.0020.1111
172.16.3.2
IP: 172.16.3.2 = ???
I heard that broadcast.
The message is for me.
Here is my Ethernet
address.
I need the
Ethernet
address of
176.16.3.2.
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-39
Reverse ARP
Ethernet: 0800.0020.1111 IP = ???
What is
my IP
address?
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-40
Reverse ARP
Ethernet: 0800.0020.1111 IP = ???
What is
my IP
address?
I heard that
broadcast.
Your IP
address is
172.16.3.25.
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-41
Reverse ARP
Ethernet: 0800.0020.1111
IP: 172.16.3.25
Ethernet: 0800.0020.1111 IP = ???
What is
my IP
address?
I heard that
broadcast.
Your IP
address is
172.16.3.25.
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-42
Reverse ARP
Map MAC IP

Ethernet: 0800.0020.1111
IP: 172.16.3.25
Ethernet: 0800.0020.1111 IP = ???
What is
my IP
address?
I heard that
broadcast.
Your IP
address is
172.16.3.25.
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-43
Unique addressing allows communication
between end stations.
Path choice is based on destination address.
Location is represented by an address
Introduction to TCP/IP
Addresses
172.18.0.2
172.18.0.1
172.17.0.2 172.17.0.1
172.16.0.2
172.16.0.1
SA DA HDR DATA
10.13.0.0
192.168.1.0
10.13.0.1
192.168.1.1
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-44
IP Addressing
255 255
255 255
Dotted
Decimal
Maximum
Network Host
32 Bits
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-45
IP Addressing
255 255
255 255
Dotted
Decimal
Maximum
Network Host
1
2
8

6
4

3
2

1
6

8

4

2

1

11111111 11111111 11111111 11111111 Binary
32 Bits
1 8 9 16 17 24 25 32
1
2
8

6
4

3
2

1
6

8

4

2

1

1
2
8

6
4

3
2

1
6

8

4

2

1

1
2
8

6
4

3
2

1
6

8

4

2

1

2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-46
IP Addressing
255 255
255 255
Dotted
Decimal
Maximum
Network Host
1
2
8

6
4

3
2

1
6

8

4

2

1

11111111 11111111 11111111 11111111
10101100 00010000 01111010 11001100
Binary
32 Bits
172 16 122 204
Example
Decimal
Example
Binary
1 8 9 16 17 24 25 32
1
2
8

6
4

3
2

1
6

8

4

2

1

1
2
8

6
4

3
2

1
6

8

4

2

1

1
2
8

6
4

3
2

1
6

8

4

2

1

2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-47
Class A:
Class B:
Class C:
Class D: Multicast
Class E: Research
IP Address Classes
Network Host Host Host
Network Network Host Host
Network Network Network Host
8 Bits 8 Bits 8 Bits 8 Bits
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-48
IP Address Classes
1
Class A:
Bits:
0NNNNNNN Host Host Host
8 9 16 17 24 25 32
Range (1-126)
1
Class B:
Bits:
10NNNNNN Network Host Host
8 9 16 17 24 25 32
Range (128-191)
1
Class C:
Bits:
110NNNNN Network Network Host
8 9 16 17 24 25 32
Range (192-223)
1
Class D:
Bits:
1110MMMM
Multicast Group Multicast Group Multicast Group
8 9 16 17 24 25 32
Range (224-239)
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-49
Host Addresses
172.16.2.2
172.16.3.10
172.16.12.12
10.1.1.1
10.250.8.11
10.180.30.118
E1
172.16 12 12
Network Host
. .
Network Interface
172.16.0.0
10.0.0.0
E0
E1
Routing Table
172.16.2.1
10.6.24.2
E0
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-50
11111111
Determining Available Host
Addresses
172 16 0 0
10101100 00010000 00000000
00000000
1
6

1
5

1
4

1
3

1
2

1
1

1
0



9

8

7

6

5

4

3

2

1

Network Host
00000000 00000001
11111111 11111111
11111111 11111110
.
.
.

.
.
.

00000000 00000011
11111101
1
2
3
65534
65535
65536

.
.
.

2
65534
N
2
N
2 = 2
16
2 = 65534
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-51
IP Address Classes Exercise
Address Class Network Host
10.2.1.1
128.63.2.100
201.222.5.64
192.6.141.2
130.113.64.16
256.241.201.10
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-52
IP Address Classes Exercise
Answers
Address Class Network Host
10.2.1.1
128.63.2.100
201.222.5.64
192.6.141.2
130.113.64.16
256.241.201.10
A
B
C
C
B
Nonexistent
10.0.0.0
128.63.0.0
201.222.5.0
192.6.141.0
130.113.0.0
0.2.1.1
0.0.2.100
0.0.0.64
0.0.0.2
0.0.64.16
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-53
Network 172.16.0.0
172.16.0.0
Addressing Without Subnets
172.16.0.1 172.16.0.2 172.16.0.3
...
172.16.255.253 172.16.255.254
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-54
Network 172.16.0.0
Addressing with Subnets
172.16.1.0 172.16.2.0
172.16.3.0
172.16.4.0
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-55
Subnet Addressing
172.16.2.200
172.16.2.2
172.16.2.160
172.16.2.1
172.16.3.5
172.16.3.100
172.16.3.150
E0
172.16
Network
Network Interface
172.16.0.0
172.16.0.0
E0
E1
New Routing Table
2 160
Host
. .
172.16.3.1
E1
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-56
Subnet Addressing
172.16.2.200
172.16.2.2
172.16.2.160
172.16.2.1
172.16.3.5
172.16.3.100
172.16.3.150
172.16.3.1
E0
E1
172.16 2 160
Network Host
. .
Network Interface
172.16.2.0
172.16.3.0
E0
E1
New Routing Table
Subnet
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-57
Subnet Mask
172 16 0 0
255 255 0 0
255 255 255 0
IP
Address
Default
Subnet
Mask
8-Bit
Subnet
Mask
Network Host
Network Host
Network Subnet Host
Also written as /16, where 16 represents the number of 1s
in the mask
Also written as /24, where 24 represents the number of
1s in the mask

11111111 11111111 00000000 00000000
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-58
Decimal Equivalents of Bit
Patterns
0 0 0 0 0 0 0 0 = 0
1 0 0 0 0 0 0 0 = 128
1 1 0 0 0 0 0 0 = 192
1 1 1 0 0 0 0 0 = 224
1 1 1 1 0 0 0 0 = 240
1 1 1 1 1 0 0 0 = 248
1 1 1 1 1 1 0 0 = 252
1 1 1 1 1 1 1 0 = 254
1 1 1 1 1 1 1 1 = 255
128 64 32 16 8 4 2 1
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-59
16
Network
Host
172 0 0
10101100
11111111
10101100
00010000
11111111
00010000
00000000
00000000
10100000
00000000
00000000
Subnets not in usethe default
00000010
Subnet Mask Without Subnets
172.16.2.160
255.255.0.0
Network
Number
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-60
Network number extended by eight bits
Subnet Mask with Subnets
16
Network Host
172.16.2.160
255.255.255.0
172 2 0
10101100
11111111
10101100
00010000
11111111
00010000
11111111
00000010
10100000
00000000
00000000
00000010
Subnet
Network
Number
1
2
8

1
9
2

2
2
4

2
4
0

2
4
8

2
5
2

2
5
4

2
5
5

2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-61
Subnet Mask with Subnets
(cont.)
Network
Host
172.16.2.160
255.255.255.192
10101100
11111111
10101100
00010000
11111111
00010000
11111111
00000010
10100000
11000000
10000000
00000010
Subnet
Network number extended by ten bits
16 172 2 128
Network
Number
1
2
8

1
9
2

2
2
4

2
4
0

2
4
8

2
5
2

2
5
4

2
5
5

1
2
8

1
9
2

2
2
4

2
4
0

2
4
8

2
5
2

2
5
4

2
5
5

2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-62
Subnet Mask Exercise
Address Subnet Mask Class Subnet
172.16.2.10
10.6.24.20
10.30.36.12
255.255.255.0
255.255.240.0
255.255.255.0
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-63
Subnet Mask Exercise
Answers
Address Subnet Mask Class Subnet
172.16.2.10
10.6.24.20
10.30.36.12
255.255.255.0
255.255.240.0
255.255.255.0
B
A
A
172.16.2.0
10.6.16.0
10.30.36.0
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-64
Broadcast Addresses
172.16.1.0
172.16.2.0
172.16.3.0
172.16.4.0
172.16.3.255
(Directed Broadcast)
255.255.255.255
(Local Network Broadcast)
X
172.16.255.255
(All Subnets Broadcast)
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-65
Addressing Summary
Example
16 172 2 160
10101100 00010000 10100000 00000010
Host
Mask
Subnet
Broadcast
Last
First
172.16.2.160
255.255.255.192
4
1
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-66
Addressing Summary
Example
10101100
11111111
00010000
11111111
11111111
10100000
11000000
00000010
Host
Mask
Subnet
Broadcast
Last
First
172.16.2.160
255.255.255.192
1
2
16 172 2 160
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-67
Addressing Summary
Example
10101100
11111111
00010000
11111111
11111111
10100000
11000000
00000010
Host
Mask
Subnet
Broadcast
Last
First
172.16.2.160
255.255.255.192
1
2
3
7
16 172 2 160
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-68
Addressing Summary
Example
10101100
11111111
00010000
11111111
11111111
10100000
11000000
10000000
00000010
Host
Mask
Subnet
Broadcast
Last
First
172.16.2.160
255.255.255.192
1
2
3
4
16 172 2 160
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-69
Addressing Summary
Example
10101100
11111111
00010000
11111111
11111111
10100000
11000000
10000000
00000010
10111111
Host
Mask
Subnet
Broadcast
Last
First
172.16.2.160
255.255.255.192
1
2
3
4
5
6
16 172 2 160
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-70
Addressing Summary
Example
10101100
11111111
00010000
11111111
11111111
10100000
11000000
10000000
00000010
10111111
10000001
Host
Mask
Subnet
Broadcast
Last
First
172.16.2.160
255.255.255.192
1
2
3
4
5
6
16 172 2 160
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-71
Addressing Summary
Example
10101100
11111111
00010000
11111111
11111111
10100000
11000000
10000000
00000010
10111111
10000001
10111110
Host
Mask
Subnet
Broadcast
Last
First
172.16.2.160
255.255.255.192
1
2
3
4
5
6
7
16 172 2 160
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-72
Addressing Summary
Example
10101100
11111111
10101100
00010000
11111111
00010000
11111111
00000010
10100000
11000000
10000000
00000010
10101100 00010000 00000010 10111111
10101100 00010000 00000010 10000001
10101100 00010000 00000010 10111110
Host
Mask
Subnet
Broadcast
Last
First
172.16.2.160
255.255.255.192
1
2
3
4
5
6
7
8
16 172 2 160
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-73
Addressing Summary
Example
10101100
11111111
10101100
00010000
11111111
00010000
11111111
00000010
10100000
11000000
10000000
00000010
10101100 00010000 00000010 10111111
10101100 00010000 00000010 10000001
10101100 00010000 00000010 10111110
Host
Mask
Subnet
Broadcast
Last
First
172.16.2.160
255.255.255.192
172.16.2.128
172.16.2.191
172.16.2.129
172.16.2.190
1
2
3
4
5
6
7
8
9
16 172 2 160
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-74
IP Host Address: 172.16.2.121
Subnet Mask: 255.255.255.0
Subnet Address = 172.16.2.0
Host Addresses = 172.16.2.1172.16.2.254
Broadcast Address = 172.16.2.255
Eight Bits of Subnetting
Network Subnet Host
10101100 00010000 00000010 11111111
172.16.2.121:
255.255.255.0:
10101100
11111111
Subnet: 10101100 00010000
00010000
11111111
00000010
00000010
11111111
01111001
00000000
00000000
Class B Subnet Example
Broadcast:
Network
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-75
Subnet Planning
Other
Subnets
192.168.5.16
192.168.5.32 192.168.5.48
20 Subnets
5 Hosts per Subnet
Class C Address:
192.168.5.0
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-76
11111000
IP Host Address: 192.168.5.121
Subnet Mask: 255.255.255.248
Network
Subnet Host
192.168.5.121: 11000000
11111111
Subnet: 11000000 10101000
10101000
11111111
00000101
00000101
11111111
01111001
01111000
255.255.255.248:
Class C Subnet Planning
Example
Subnet Address = 192.168.5.120
Host Addresses = 192.168.5.121192.168.5.126
Broadcast Address = 192.168.5.127
Five Bits of Subnetting
Broadcast:
Network Network
11000000 10101000 00000101 01111111
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-77
Broadcast Addresses Exercise
Address Class Subnet Broadcast
201.222.10.60 255.255.255.248
Subnet Mask
15.16.193.6 255.255.248.0
128.16.32.13 255.255.255.252
153.50.6.27 255.255.255.128
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-78
Broadcast Addresses Exercise
Answers
153.50.6.127
Address Class Subnet Broadcast
201.222.10.60 255.255.255.248 C 201.222.10.63 201.222.10.56
Subnet Mask
15.16.193.6 255.255.248.0 A 15.16.199.255 15.16.192.0
128.16.32.13 255.255.255.252 B 128.16.32.15 128.16.32.12
153.50.6.27 255.255.255.128 B 153.50.6.0
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-79
Switch IP Address
Configuration
Assigns an address and subnet mask
Starts IP processing on a switch
Switch(config)#ip address ip-address subnet-mask
Switch(config)#ip default-gateway ip-address
Specifies a default gateway
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-80
Router IP Address
Configuration
Assigns an address and subnet mask
Starts IP processing on a router interface
Router(config-if)#ip address ip-address subnet-mask
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-81
Router IP Address
Configuration
Router(config-line)#ip netmask-format
{bitcount | decimal | hexadecimal}
Sets the format of the network mask for
a specific line
Router#term ip netmask-format {bitcount |
decimal | hexadecimal}
Sets the display format of the network
mask for the current session
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-82
Defines the static host name to IP
address mapping


Hosts/interfaces are selectable by name or
IP address
Router IP Host Names
Router(config)#ip host name [tcp-port-number]
address [address]
ip host Norine 172.16.3.1 192.168.3.1
ip host Roger 172.16.4.3
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-83
Specifies one or more hosts that supply a
host name to logical address resolution
Router Name Server
Configuration
Router(config)#ip name-server server-address1
[[server-address2]...[server-address6]]
DNS Server
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-84
DNS is enabled by default.
Router Name System

Router(config)#ip domain-lookup
Router(config)#end
Router#pat
Translating pat"...domain server (255.255.255.255)
% Unknown command or computer name, or unable to find computer address
Router#config t
Router(config)#no ip domain-lookup
Router(config)#end
Router#pat
Translating pat"
% Unknown command or computer name, or unable to find computer address
Router#
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-85
Router Display Host Names
Router#show hosts
Default domain is not set
Name/address lookup uses domain service
Name servers are 255.255.255.255

Host Flags Age Type Address(es)
Norine (perm, OK) 0 IP 172.16.100.100
Roger (perm, OK) 0 IP 172.16.100.101
Frank (perm, OK) 0 IP 172.16.200.200
Bob (perm, OK) 0 IP 172.16.200.201

Shows the host table
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-86
VLAN-to-VLAN Overview
VLAN 1
VLAN 2
ISL
10.1.1.2 10.2.2.2
Network layer devices combine multiple
broadcast domains.
Router on
a Stick
Application
TCP
IP
ISL
Ethernet

fa0/0
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-87
Dividing a Physical Interface
into Subinterfaces
FastEthernet0/0
FastEthernet0/0.2
FastEthernet0/0.3
FastEthernet0/0.1
Physical interfaces can be divided into
multiple subinterfaces.
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-88
ISL Encapsulation
Enables ISL on a subinterface
Router(config-subif)#encapsulation isl vlan identifier
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-89
Routing Between VLANs
VLAN 1
VLAN 2
ISL
interface fastethernet 0/0
no ip address
!
interface fastethernet 0/0.1
ip address 10.1.1.1 255.255.255.0
encapsulation isl 1
interface fastethernet 0/0.2
ip address 10.2.2.1 255.255.255.0
encapsulation isl 2
Fast
E0/0
10.1.1.2 10.2.2.2
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-90
Routing Between WANs
ISL
interface Serial0
ip address 172.16.1.1 255.255.255.0
Application
TCP
IP
HDLC
Serial
S0
172.16.1.1
172.16.1.2
VLAN 1
VLAN 2
10.1.1.2 10.2.2.2
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-91
Visual Objective

core_ server

wg_sw_a
10.1.1.10
wg_sw_l
10.1.1.120
...
e0/1
fa0/26
(Port A)
e0/1
fa0/26
(Port A)
fa0/1 fa0/12
fa0/24
core_sw_a
10.1.1.2
core_sw_b
10.1.1.4
fa0/12 fa0/1
fa0/13 fa0/13
fa0/27
(Port B)
fa0/27
(Port B)
wg_pc_a
10.2.2.12
wg_pc_l
10.13.13.12
core_ro
fa0/23
fa0/0
fa0/14 fa0/14
VLAN2
VLAN13
Subnet VLAN Pod

10.1.1.0 1 wg_ro_x, wg_sw_x, core_sw_a, core_sw_b
10.2.2.0 2 wg_pc_a, core_server, core_ro
10.3.3.0 3 wg_pc_b, core_server, core_ro
10.4.4.0 4 wg_pc_c, core_server, core_ro
10.5.5.0 5 wg_pc_d, core_server, core_ro
10.6.6.0 6 wg_pc_e, core_server, core_ro
10.7.7.0 7 wg_pc_f, core_server, core_ro
10.8.8.0 8 wg_pc_g, core_server, core_ro
10.9.9.0 9 wg_pc_h, core_server, core_ro
10.10.10.0 10 wg_pc_i, core_server, core_ro
10.11.11.0 11 wg_pc_j, core_server, core_ro
10.12.12.0 12 wg_pc_k, core_server, core_ro
10.13.13.0 13 wg_pc_l, core_server, core_ro
2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-92
Summary
After completing this chapter, you should be
able to perform the following tasks:
Identify the TCP/IP protocol stack and the
functions of each layer.
Separate an IP address into its subcomponents:
the network, subnet, and host portions.
Configure IP addresses on Cisco router and
switch interfaces.
Interconnect VLANs using a Layer 3 device such
as a router on a stick.

2000, Cisco Systems, Inc. www.cisco.com ICND v1.18-93
Review Questions
1. What is the difference between the TCP and
UDP transport layer protocols?
2. Given a host with IP address 192.168.20.1
255.255.255.240, how many other hosts can
you have in that network?
3. What is required to interconnect separate
VLANs?

Vous aimerez peut-être aussi