Professional Documents
Culture Documents
Interconnecting
Networks with
TCP/IP
2000, Cisco Systems, Inc.
8-1
Objectives
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 three device
such as a router on a stick.
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-3
Introduction to TCP/IP
Host
Host
Internet
TCP/IP
www.cisco.com
ICND v1.0a8-4
Application
Presentation
Session
Transport
Transport
Network
Internet
Data Link
Data Link
Application
4
3
2
1
Physical
Physical
www.cisco.com
ICND v1.0a8-5
Application
Transport
Internet
Data Link
File Transfer
- TFTP *
- FTP *
- NFS
E-Mail
- SMTP
Remote Login
- Telnet *
- rlogin *
Network Management
- SNMP *
Name Management
- DNS*
*Used by the router
Physical
www.cisco.com
ICND v1.0a8-6
Application
Transport
Transmission Control
Protocol (TCP)
ConnectionOriented
User Datagram
Protocol (UDP)
Connectionless
Internet
Data Link
Physical
www.cisco.com
ICND v1.0a8-7
Bit 15 Bit 16
Bit 31
Destination port (16)
20
Bytes
Window (16)
Urgent (16)
Options (0 or 32 if any)
Data (varies)
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-8
Port Numbers
Application
Layer
Transport
Layer
2000, Cisco Systems, Inc.
F
T
P
T
E
L
N
E
T
S
M
T
P
D
N
S
T
F
T
P
S
N
M
P
R
I
P
21
23
25
53
69
161
520
Port
Numbers
UDP
TCP
www.cisco.com
ICND v1.0a8-9
Dest.
Port
Telnet Z
Host Z
Host A
SP
DP
1028
23
www.cisco.com
ICND v1.0a8-10
Host B
Send SYN
(seq=100 ctl=SYN)
SYN received
www.cisco.com
ICND v1.0a8-11
Host B
Send SYN
(seq=100 ctl=SYN)
SYN received
Send SYN, ACK 2
(seq=300 ack=101 ctl=syn,ack)
SYN received
www.cisco.com
ICND v1.0a8-12
Host B
Send SYN
(seq=100 ctl=SYN)
SYN received
Send SYN, ACK 2
(seq=300 ack=101 ctl=syn,ack)
SYN received
Established
(seq=101 ack=301 ctl=ack)
www.cisco.com
ICND v1.0a8-13
Receiver
Window size = 1
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-14
Receiver
Send 1
Receive 1
Window size = 1
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-15
Receiver
Send 1
Receive 1
Send ACK 2
Receive ACK 2
Window size = 1
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-16
Receiver
Send 1
Receive 1
Send ACK 2
Receive ACK 2
Send 2
Receive 2
Window size = 1
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-17
Receiver
Send 1
Receive 1
Send ACK 2
Receive ACK 2
Send 2
Receive 2
Send ACK 3
Receive ACK 3
Window size = 1
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-18
Receiver
Send 1
Receive 1
Send ACK 2
Receive ACK 2
Send 2
Receive 2
Send ACK 3
Receive ACK 3
Send 3
Receive 3
Window size = 1
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-19
Receiver
Send 1
Receive 1
Send ACK 2
Receive ACK 2
Send 2
Receive 2
Send ACK 3
Receive ACK 3
Send 3
Receive 3
Send ACK 4
Receive ACK 4
Window size = 1
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-20
Dest.
Port
Sequence
#
Acknowledgement
#
I just
sent #10.
23
10
www.cisco.com
ICND v1.0a8-21
Dest.
Port
Sequence
#
Acknowledgement
#
I just
sent #10.
www.cisco.com
ICND v1.0a8-22
Dest.
Port
Sequence
#
Acknowledgement
#
I just
sent #11.
23
11
www.cisco.com
ICND v1.0a8-23
Dest.
Port
Sequence
#
Acknowledgement
#
I just
sent #11.
23
11
101
Source Dest. Seq. Ack.
23
1028 101
12
www.cisco.com
ICND v1.0a8-24
TCP Windowing
Sender
Receiver
www.cisco.com
ICND v1.0a8-25
TCP Windowing
Sender
Window size = 3
Send 1
Receiver
Window size = 3
Send 2
Window size = 3
Send 3
www.cisco.com
ICND v1.0a8-26
TCP Windowing
Sender
Window size = 3
Send 1
Receiver
Window size = 3
Send 2
Window size = 3
Send 3
ACK 3
Window size = 2
www.cisco.com
Packet 3 is
Dropped
ICND v1.0a8-27
TCP Windowing
Sender
Window size = 3
Send 1
Receiver
Window size = 3
Send 2
Window size = 3
Send 3
ACK 3
Window size = 2
Packet 3 is
Dropped
Window size = 3
Send 3
Window size = 3
Send 4
www.cisco.com
ICND v1.0a8-28
TCP Windowing
Sender
Window size = 3
Send 1
Window size = 3
Receiver
Window size = 3
Send 2
Window size = 3
Send 3
Packet 3 is
ACK 3
Window size = 2 Dropped
Window size = 3
Send 3
Window size = 3
Send 4
ACK 5
Window size = 2
www.cisco.com
ICND v1.0a8-29
Bit 15 Bit 16
Bit 31
Destination port (16)
8
Bytes
Checksum (16)
Data (if any)
www.cisco.com
ICND v1.0a8-30
Transport
Internet
Data Link
Physical
Reverse Address
Resolution Protocol (RARP)
www.cisco.com
ICND v1.0a8-31
IP Datagram
Bit
1 0
Version
(4)
Bit 15 Bit 16
Header
Length (4)
Identification (16)
Time to live (8)
Bit 31
Protocol (8)
20
Bytes
www.cisco.com
ICND v1.0a8-32
Protocol Field
Transport
Layer
UDP
TCP
6
Internet
Layer
17
Protocol
Numbers
IP
www.cisco.com
ICND v1.0a8-33
Destination
Unreachable
Transport
1
ICMP
Echo (Ping)
Internet
Other
Data Link
Physical
www.cisco.com
ICND v1.0a8-34
172.16.3.2
www.cisco.com
ICND v1.0a8-35
172.16.3.2
www.cisco.com
ICND v1.0a8-36
172.16.3.2
www.cisco.com
ICND v1.0a8-37
172.16.3.2
Map IP
MAC
Local ARP
www.cisco.com
ICND v1.0a8-38
Reverse ARP
What is
my IP
address?
www.cisco.com
ICND v1.0a8-39
Reverse ARP
I heard that
broadcast.
Your IP
address is
172.16.3.25.
What is
my IP
address?
www.cisco.com
ICND v1.0a8-40
Reverse ARP
I heard that
broadcast.
Your IP
address is
172.16.3.25.
What is
my IP
address?
www.cisco.com
ICND v1.0a8-41
Reverse ARP
I heard that
broadcast.
Your IP
address is
172.16.3.25.
What is
my IP
address?
Map MAC
2000, Cisco Systems, Inc.
www.cisco.com
IP
ICND v1.0a8-42
Introduction to TCP/IP
Addresses
172.18.0.1
172.18.0.2
10.13.0.0
10.13.0.1
172.16.0.1
172.17.0.1
172.16.0.2
172.17.0.2
192.168.1.0
192.168.1.1
www.cisco.com
ICND v1.0a8-43
IP Addressing
32 bits
Dotted
Decimal
Maximum
Network
255
255
www.cisco.com
Host
255
255
ICND v1.0a8-44
IP Addressing
32 bits
Dotted
Decimal
Network
16 17
255
24 25
32
11111111 11111111
11111111 11111111
128
64
32
16
8
4
2
1
128
64
32
16
8
4
2
1
8 9
255
128
64
32
16
8
4
2
1
128
64
32
16
8
4
2
1
Binary
255
255
Maximum
Host
www.cisco.com
ICND v1.0a8-45
IP Addressing
32 bits
Dotted
Decimal
Network
16 17
255
24 25
32
11111111 11111111
11111111 11111111
128
64
32
16
8
4
2
1
128
64
32
16
8
4
2
1
8 9
255
128
64
32
16
8
4
2
1
128
64
32
16
8
4
2
1
Binary
255
255
Maximum
Host
Example
172
16
122
204
Decimal
Example 10101100 00010000 01111010 11001100
Binary
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-46
IP Address Classes
8 bits
8 bits
8 bits
8 bits
Host
Host
Host
Host
Host
Class A:
Network
Class B:
Network Network
Class C:
Class D:
Multicast
Class E:
Research
www.cisco.com
Host
ICND v1.0a8-47
IP Address Classes
Bits:
Class A:
Bits:
Class B:
Bits:
Class C:
Bits:
Class D:
2000, Cisco Systems, Inc.
8 9
0NNNNNNN
16 17
24 25
Host
Host
32
Host
Range (1-126)
1
8 9
10NNNNNN
16 17
Network
Range (128-191)
1
8 9
110NNNNN
Host
16 17
Network
Range (192-223)
1
8 9
1110MMMM
24 25
Host
24 25
Network
16 17
32
32
Host
24 25
32
Range (224-239)
www.cisco.com
ICND v1.0a8-48
Host Addresses
172.16.2.2
10.1.1.1
10.6.24.2
E1
172.16.3.10
E0
172.16.2.1
10.250.8.11
172.16.12.12
172.16
Network
2000, Cisco Systems, Inc.
12 . 12
Host
10.180.30.118
Routing Table
Network
Interface
172.16.0.0
E0
10.0.0.0
E1
www.cisco.com
ICND v1.0a8-49
...
...
N
1
2
3
...
16
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
172
Host
11111111 11111101
11111111 11111110
11111111 11111111
65534
65535
65536
2
65534
www.cisco.com
ICND v1.0a8-50
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
www.cisco.com
ICND v1.0a8-51
Class
10.2.1.1
10.0.0.0
0.2.1.1
128.63.2.100
128.63.0.0
0.0.2.100
201.222.5.64
201.222.5.0
0.0.0.64
192.6.141.2
192.6.141.0
0.0.0.2
130.113.64.16
130.113.0.0
0.0.64.16
256.241.201.10
Network
Host
Nonexistent
www.cisco.com
ICND v1.0a8-52
172.16.255.253 172.16.255.254
...
172.16.0.0
Network 172.16.0.0
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-53
172.16.3.0
172.16.4.0
172.16.1.0
172.16.2.0
Network 172.16.0.0
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-54
Subnet Addressing
172.16.2.200
172.16.3.5
172.16.3.1
E1
172.16.2.2
E0
172.16.2.1
172.16.3.100
172.16.2.160
172.16
Network
2000, Cisco Systems, Inc.
172.16.3.150
2 . 160
Host
172.16.0.0
E0
172.16.0.0
E1
www.cisco.com
ICND v1.0a8-55
Subnet Addressing
172.16.2.200
172.16.3.5
172.16.3.1
E1
E0
172.16.2.1
172.16.2.2
172.16.3.100
172.16.2.160
172.16
Network
2000, Cisco Systems, Inc.
172.16.3.150
160
Subnet Host
E0
172.16.3.0
E1
www.cisco.com
ICND v1.0a8-56
Subnet Mask
Network
IP
Address
172
Host
16
Network
Default
Subnet
Mask
8-bit
Subnet
Mask
255
0
Host
255
11111111
11111111
00000000
00000000
Also written as /16 where 16 represents the number of 1s
in the mask.
Network
Subnet
Host
255
255
255
ICND v1.0a8-57
32
16
128
192
224
240
248
252
254
255
www.cisco.com
ICND v1.0a8-58
Host
172.16.2.160
10101100
00010000
00000010
10100000
255.255.0.0
11111111
11111111
00000000
00000000
10101100
00010000
00000000
00000000
172
16
Network
Number
www.cisco.com
ICND v1.0a8-59
Host
10101100
00010000
00000010
10100000
11111111
11111111
11111111
00000000
10101100
00010000
00000010
00000000
172
16
128
192
224
240
248
252
254
255
255.255.255.0
Subnet
Network
Number
www.cisco.com
ICND v1.0a8-60
255.255.255.192
Network
Number
Host
10101100
00010000
00000010
10100000
11111111
11111111
11111111
11000000
10101100
00010000
00000010
10000000
128
192
224
240
248
252
254
255
172.16.2.160
Subnet
128
192
224
240
248
252
254
255
Network
172
16
128
www.cisco.com
ICND v1.0a8-61
Address
Subnet Mask
172.16.2.10
255.255.255.0
10.6.24.20
255.255.240.0
10.30.36.12
255.255.255.0
www.cisco.com
Class
Subnet
ICND v1.0a8-62
Address
Subnet Mask
Class
Subnet
172.16.2.10
255.255.255.0
172.16.2.0
10.6.24.20
255.255.240.0
10.6.16.0
10.30.36.12
255.255.255.0
10.30.36.0
www.cisco.com
ICND v1.0a8-63
Broadcast Addresses
172.16.3.0
172.16.4.0
172.16.1.0
172.16.2.0
172.16.3.255
(Directed broadcast)
255.255.255.255
(Local network broadcast)
172.16.255.255
(All subnets broadcast)
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-64
Addressing Summary
Example
172.16.2.160
172
16
10101100
00010000
160
Mask
255.255.255.192
Subnet 4
Broadcast
First
Last
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-65
Addressing Summary
Example
172.16.2.160
255.255.255.192
172
16
10101100
00010000
11111111
11111111
160
www.cisco.com
ICND v1.0a8-66
Addressing Summary
Example
172
16
160
3
172.16.2.160
255.255.255.192
10101100
00010000
11111111
11111111
www.cisco.com
ICND v1.0a8-67
Addressing Summary
Example
172
16
160
3
172.16.2.160
255.255.255.192
10101100
00010000
11111111
11111111
www.cisco.com
ICND v1.0a8-68
Addressing Summary
Example
172
16
160
3
172.16.2.160
255.255.255.192
10101100
00010000
11111111
11111111
10111111 Broadcast
5
First
Last
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-69
Addressing Summary
Example
172
16
160
3
172.16.2.160
255.255.255.192
10101100
00010000
11111111
11111111
10111111 Broadcast
5
10000001 First
Last
2000, Cisco Systems, Inc.
www.cisco.com
ICND v1.0a8-70
Addressing Summary
Example
172
16
160
3
172.16.2.160
255.255.255.192
10101100
00010000
11111111
11111111
10111111 Broadcast
www.cisco.com
5
10000001 First
10111110 Last
ICND v1.0a8-71
Addressing Summary
Example
172
16
160
3
172.16.2.160
255.255.255.192
10101100
00010000
11111111
11111111
10101100
00010000
10101100
00010000
10101100
00010000
5
00000010 10000001 First
10101100
00010000
www.cisco.com
ICND v1.0a8-72
Addressing Summary
Example
172
16
160
3
10101100
00010000
255.255.255.192 11111111
8
9
172.16.2.128
10101100
11111111
00010000
10101100
00010000
172.16.2.160
172.16.2.191
172.16.2.129
10101100
00010000
5
00000010 10000001 First
172.16.2.190
10101100
00010000
www.cisco.com
ICND v1.0a8-73
Network
Subnet
Host
172.16.2.121: 10101100
00010000
00000010
01111001
255.255.255.0: 11111111
11111111
11111111
00000000
Subnet: 10101100
00010000
00000010
00000000
Broadcast: 10101100
00010000
00000010
11111111
www.cisco.com
ICND v1.0a8-74
Subnet Planning
20 subnets
5 hosts per subnet
Class C address:
192.168.5.0
192.168.5.16
Other
subnets
192.168.5.32
192.168.5.48
www.cisco.com
ICND v1.0a8-75
Network
192.168.5.121: 11000000
10101000
00000101
01111001
255.255.255.248: 11111111
11111111
11111111
11111000
Subnet: 11000000
Broadcast: 11000000
10101000
00000101
01111000
10101000
00000101
01111111
www.cisco.com
ICND v1.0a8-76
Address
Subnet Mask
201.222.10.60
255.255.255.248
15.16.193.6
255.255.248.0
128.16.32.13
255.255.255.252
153.50.6.27
255.255.255.128
Class
www.cisco.com
Subnet
Broadcast
ICND v1.0a8-77
Subnet Mask
Class
Subnet
Broadcast
201.222.10.60 255.255.255.248
201.222.10.56
201.222.10.63
15.16.193.6
255.255.248.0
15.16.192.0
15.16.199.255
128.16.32.13
255.255.255.252
128.16.32.12
128.16.32.15
153.50.6.27
255.255.255.128
153.50.6.0
153.50.6.127
www.cisco.com
ICND v1.0a8-78
Switch IP Address
Configuration
Switch(config)#ip address ip-address subnet-mask
www.cisco.com
ICND v1.0a8-79
Router IP Address
Configuration
www.cisco.com
ICND v1.0a8-80
Router IP Address
Configuration
Router#term ip netmask-format {bitcount|
decimal | hexadecimal}
www.cisco.com
ICND v1.0a8-81
www.cisco.com
ICND v1.0a8-82
www.cisco.com
ICND v1.0a8-83
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#
www.cisco.com
ICND v1.0a8-84
Bob
www.cisco.com
ICND v1.0a8-85
Router on
a stick
VLAN 2
Application
10.1.1.2
10.2.2.2
TCP
IP
ISL
Ethernet
www.cisco.com
ICND v1.0a8-86
www.cisco.com
ICND v1.0a8-87
ISL Encapsulation
www.cisco.com
ICND v1.0a8-88
10.1.1.2
VLAN 2
10.2.2.2
www.cisco.com
ICND v1.0a8-89
S0
172.16.1.1
VLAN 1
VLAN 2
172.16.1.2
10.2.2.2
Application
interface Serial0
ip address 172.16.1.1 255.255.255.0
TCP
IP
HDLC
Serial
10.1.1.2
www.cisco.com
ICND v1.0a8-90
Visual Objective
SUBNET
10.1.1.0
10.2.2.0
10.3.3.0
10.4.4.0
10.5.5.0
10.6.6.0
10.7.7.0
10.8.8.0
10.9.9.0
10.10.10.0
10.11.11.0
10.12.12.0
10.13.13.0
VLAN
1
2
3
4
5
6
7
8
9
10
11
12
13
POD
wg_ro_x, wg_sw_x, core_sw_a, core_sw_b
wg_pc_a, core_server, core_ro
wg_pc_b, core_server, core_ro
wg_pc_c, core_server, core_ro
wg_pc_d, core_server, core_ro
wg_pc_e, core_server, core_ro
wg_pc_f, core_server, core_ro
wg_pc_g, core_server, core_ro
wg_pc_h, core_server, core_ro
wg_pc_i, core_server, core_ro
wg_pc_j, core_server, core_ro
wg_pc_k, core_server, core_ro
wg_pc_l, core_server, core_ro
VLAN2
fa0/26
e0/1
(port A)
VLAN13
fa0/23
fa0/27
(port B)
...
fa0/1
fa0/24
wg_pc_l
10.13.13.12
wg_sw_l
10.1.1.120
fa0/0
core_ server
fa0/27
(port B)
wg_sw_a
10.1.1.10
fa0/26 e0/1
(port A)
Core_ro
wg_pc_a
10.2.2.12
fa0/12
fa0/13
core_sw_a fa0/14
10.1.1.2
www.cisco.com
fa0/12
fa0/13
fa0/1
fa0/14 core_sw_b
10.1.1.4
ICND v1.0a8-91
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
www.cisco.com
ICND v1.0a8-92
Review Questions
1. What is the difference between the TCP and
UDP transport layer protocols?
www.cisco.com
ICND v1.0a8-93