02.data Communication Basics - TCPIP Model
02.data Communication Basics - TCPIP Model
Application layer
Session layer
• Established by United States Department of Defense (DOD), the Transmission Control Protocol/Internet
Protocol (TCP/IP) suite ensures data integrity and maintains communications in destructive wars.
ARP
Data link layer Ethernet Fast Eth
Physical layer
Application Layer
• HTTP 80
The Hypertext Transfer Protocol provides web page browsing
Application layer services.
• Telnet 23
The remote login protocol provides remote management
services.
Host-to-host layer • FTP 20 and 21
The File Transfer Protocol provides shared network file
resource services.
Internet layer • SMTP 25
The Simple Mail Transfer Protocol provides Internet e-mail
services.
Data link layer
• POP3 110
The Post Office Protocol provides Internet e-mail services.
Physical layer • TFTP 69 (UDP)
The Trivial File Transfer Protocol transfers simple text files.
Application Layer
Application layer
Physical layer
Host-to-Host Layer
TCP UDP
Connection-oriented Connectionless
Reliable transmission Best-effort transmission
Flow control and sliding window mechanism None
TCP-based applications: web browser and UDP-based applications: Domain Name
File Transfer Protocol (FTP) System (DNS)
Host-to-Host Layer
Options (0 or 32 if any)
Data (varies)
Host-to-Host Layer
Unlike the TCP packet header, a UDP packet header does not contain
the Sequence number and Acknowledgement number fields.
TCP Connection Establishment (Three-way Handshake)
Host A Host B
Seq=0 Ctl=SYN
1 Sends an SYN Receives an SYN message.
message.
Host A Host B
Seq=100
Seq=300 Ack=101
1 Sends a FIN
request to Seq=101 Ack=301 Ctl=FIN, Ack
Receives a FIN message.
terminate the
connection. Seq=301 Ack=102 Ctl=Ack Sends an Ack
2
message.
Seq=301 Ack=102 Ctl=FIN, Ack
Sends a FIN request to
3
terminate the connection.
4 Sends an Ack Seq=102 Ack=302 Ctl=Ack
message.
Host-to-Host Layer TCP Sliding Window Mechanism
Host A Host B
Seq=100 Win=3 Ctl=SYN Buffer on the receive end
1
Seq=200 Ack=101 Win=3 Ctl=SYN, Ack
Three-way
handshake Seq=101 Ack=201 Win=3 Ctl=SYN, Ack
Seq=101 Win=3
2
Seq=102 Win=3
Sends data.
Seq=103 Win=3
3
Ack=104 Win=1 Ctl=Ack
4
5 Seq=104 Win=3
Window size determines the maximum
of bytes that can be sent before an Ack
message is received.
Internet Layer
Application layer
Physical layer
Internet Layer
• IP packet format
Options (0 or 32 if any)
• On an Ethernet network, a data transmit end fills in fields of IP (Layer 3) and Ethernet (Layer 2)
headers when constructing data, in which the destination IP address and destination MAC
address are key information.
• The Address Resolution Protocol (ARP) provides the following basic functions:
SW
Source MAC
address Layer 2 Ethernet
G0/0/1 G0/0/2
Destination header
MAC address
Sender's IP
address
Sender's MAC ARP packet
address
Destination IP PC2
address PC1
Destination
MAC address
ARP Spoofing
SW R1
Internet
PC2 192.168.1.254
192.168.1.1
PC1
Internet Layer Tool
• Ping (ICMP)
• Ping is a command used on network devices, Windows OS, Unix OS, and Linux OS. It is a small and useful
application based on the Internet Control Messages Protocol (ICMP).
C:\Users\mypc>ping 10.1.10.93
Pinging 10.1.10.93 with 32 bytes of data:
Reply from 10.1.10.93 : Bytes=32 Time=7ms TTL=58
Reply from 10.1.10.93 : Bytes=32 Time=8ms TTL=58
Reply from 10.1.10.93 : Bytes=32 Time=8ms TTL=58
Reply from 10.1.10.93 : Bytes=32 Time=8ms TTL=58
PC R1 R2 Server
IP Address and
Device Interface MAC Address
Mask
PC NIC 192.168.1.1/24 8C70-AAAA-0001
R1 GE0/0/0 192.168.1.254/24 0018-0011-0001
R1 GE0/0/1 192.168.12.1/24 0018-0011-0002
R2 GE0/0/0 192.168.12.2/24 0018-0022-0001
R2 GE0/0/1 192.168.2.254/24 0018-0022-0002
Server NIC 192.168.2.1/24 8C70-AAAA-0002
TCP/IP Reference Model
PC R1 R2 Server
Host-to-host Host-to-host
layer layer
Internet layer Internet layer Internet layer Internet layer
Data link layer Data link layer Data link layer Data link layer
Physical layer Physical layer Physical layer Physical layer
TCP/IP Reference Model
PC R1 R2 Server
1
Data
Data
(HTTP application data)
TCP/IP Reference Model
PC R1 R2 Server
PC R1 R2 Server
Layer3 IP header
SIP 192.168.1.1
Source port 1025 Data
DIP 192.168.2.1
Destination port 80 (HTTP application data)
Protocol number 6
TCP/IP Reference Model
PC R1 R2 Server
PC R1 R2 Server
PC R1 R2 Server
PC R1 R2 Server
SIP 192.168.1.1
Source port 1025 Data
DIP 192.168.2.1
Destination port 80 (HTTP application data)
Protocol number 6
IP header TCP header Valid payload
TCP/IP Reference Model
PC R1 R2 Server
8
Eth header IP header TCP header Data
PC R1 R2 Server
PC R1 R2 Server
10
SIP 192.168.1.1
Source port 1025 Data
DIP 192.168.2.1
Destination port 80 (HTTP application data)
Protocol number 6
IP header TCP header Valid payload
TCP/IP Reference Model
PC R1 R2 Server
11
PC R1 R2 Server
12