Professional Documents
Culture Documents
Hcna 4 (Icmp +arp +transport Layer)
Hcna 4 (Icmp +arp +transport Layer)
Protocol
Lecture 4: ARP + ICMP HCNA-01
ICMP
Message
Return Message
ICMP Format
0 8 15 31
Internet Header + 64 bits of Original Data Datagram – Dependant on ICMP Type Field
3 0 Network Unreachable
3 1 Host Unreachable
3 2 Protocol Unreachable
3 3 Port Unreachable
8 0 Echo Request
ICMP (Routing)
Server A
Public Network
20.0.0.1/24
20.0.0.2/24
10.0.0.200/24
③ ① 10.0.0.100/24
② ICMP Redirect
IP: 10.0.0.1/24
Gateway: 10.0.0.100/24
Host A
ICMP (Diagnostics)
Host A Server
Two separate messages are used for the request and reply.
ICMP (Errors)
.2 10.0.0.0/24 .1 .2 20.0.0.0/24 .1
Host A Server
Packet Forwarding
.1 10.0.0.0/24 .2
RTA RTB
<RTA>ping ?
-a Select source IP address, the default is the IP address of
the output interface
-c Specify the number of echo requests to be sent, the
default is 5
-t Timeout in milliseconds to wait for each reply, the
default is 2000ms
STRING<1-255> IP address or hostname of a remote system
……
<RTA>ping 10.0.0.2
Ping Results
<RTA>ping 10.0.0.2
PING 10.0.0.2 : 56 data bytes, press CTRL_C to break
Reply from 10.0.0.2 : bytes=56 Sequence=1 ttl=255 time=340 ms
Reply from 10.0.0.2 : bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 10.0.0.2 : bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 10.0.0.2 : bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 10.0.0.2 : bytes=56 Sequence=5 ttl=255 time=30 ms
30.0.0.0/24
Host A RTA RTB Host B
10.0.0.0/24 20.0.0.0/24
<RTA>tracert ?
-a Set source IP address, the default is the IP
address of the output interface
-f First time to live, the default is 1
-m Max time to live, the default is 30
-name Display the host name of the router on each hop
-p Destination UDP port number, the default is 33434
STRING<1-255> IP address or hostname of a remote system
……
<RTA>tracert 30.0.0.2
Traceroute Results
<RTA>tracert 30.0.0.2
1 10.0.0.2 130 ms 50 ms 40 ms
2 20.0.0.2 80 ms 60 ms 80 ms
3 30.0.0.2 80 ms 60 ms 70 ms
TTL value is used to define a hop limit for each set of results.
Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi
Lecture 4: ARP + ICMP HCNA-01
Summary
Which two ICMP message types are used as part of a successful
Ping?
In the event that the TTL value in the IP header of a datagram
reaches zero, what action will be taken by the receiving gateway?
ARP
IP: 10.1.1.1/24 IP : 10.1.1.2/24
MAC: 00-01-02-03-04-AA MAC: 00-01-02-03-04-BB
Host A Host B
Dest IP : 10.1.1.2
Source IP : 10.1.1.1
Data link forwarding relies on knowledge of the MAC address of the data
link layer destination.
Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi
Lecture 4: ARP + ICMP HCNA-01
• ARP accepts an IP address from the IP protocol, maps the address to the
corresponding link-layer address, and passes it to the data-link layer.
0 15 31
ARP Process
Host B
10.0.0.2
00-01-02-03-04-BB
Host A Host C
10.0.0.1 10.0.0.3
00-01-02-03-04-AA 00-01-02-03-04-CC
10.0.0.2
00-01-02-03-04-BB
Host A Host C
10.0.0.1 10.0.0.3
00-01-02-03-04-AA 00-01-02-03-04-CC
Host A>arp -a
• When a source device want to communicate, it checks its ARP cache for MAC
address of destination.
10.0.0.2
00-01-02-03-04-BB
Host A Host C
10.0.0.1 10.0.0.3
00-01-02-03-04-AA 00-01-02-03-04-CC
• If ARP mapping is not in the local cache, source will generate an ARP request
message and broadcast it.
10.0.0.2
00-01-02-03-04-BB
Host A Host C
10.0.0.1 10.0.0.3
00-01-02-03-04-AA 00-01-02-03-04-CC
Host C>arp -a
Internet address Physical address Type
10.0.0.1 00-01-02-03-04-AA Dynamic
• ARP request is received by all devices in the network and they compare the destination IP with
their own IP address; if match fails, it is dropped.
• The correct destination host accepts the packet and sends an ARP reply.
• The destination will update its local ARP cache, since it may need to contact the sender.
10.0.0.2
00-01-02-03-04-BB
Host A Host C
10.0.0.1 10.0.0.3
00-01-02-03-04-AA 00-01-02-03-04-CC
ARP Cache
Host B
10.0.0.2
00-01-02-03-04-BB
Host A Host C
10.0.0.1 10.0.0.3
00-01-02-03-04-AA 00-01-02-03-04-CC
Host A>arp -a
Internet address Physical address Type
10.0.0.3 00-01-02-03-04-CC Dynamic
• The source will receive and process the ARP reply and saves the sender’s
MAC.
Gratuitous ARP
IP: 10.0.0.1/24
MAC: 00-01-02-03-04-AA
Host A
Summary
Prior to generating an ARP request, what action must be taken by an
end station?
When are gratuitous ARP messages generated and propagated on
the local network?
TCP
• Transmission Control Protocol (TCP) is a connection-
oriented, reliable protocol.
Request Reply
TCP Ports
Host A HTTP Server
Protocol Port
FTP 20 - 21
HTTP 80
TELNET 23
SMTP 25
TCP Header
0 15 31
Sequence Number
Header NC E U A P R S F
Resv. S W C R C S S Y I Window
Length R E GK HT N N
Options Padding
Send 1,2,3
Acknowledge 4
Send 4,5,6
Acknowledge 4
Send 4,5,6
Host A Server A
Host A Server A
Closed
0 15 16 31
Host A Host B
Host A Host B
Voice/Video
Packet Loss
Scenario Introduction
Host A Server A
RTA RTB
Host B
Server B
10.1.1.2/24 172.16.10.2/24
Path Discovery
RTA RTB
10.1.1.1/24 G0/0/0 Internet 172.16.10.1/24
10.1.1.254/24
Host B Server B
10.1.1.2/24 172.16.10.2/24
ARP
Host A Host A> arp -a
Internet address Physical address Type
10.1.1.254 00-01-02-03-04-08 Dynamic
10.1.1.2 00-01-02-03-04-06 Dynamic
10.1.1.1/24 RTA
00-01-02-03-04-05
G0/0/0
Host B 10.1.1.254/24 Internet
00-01-02-03-04-08
10.1.1.2/24
00-01-02-03-04-06
The ARP cache table is used to discover the data link next-hop.
TCP Encapsulation
Host A
Segment
Network
Source Port Destination Port
Sequence Number
Data Link
Acknowledgement Number
Header N C E UA P RS F
Resv. S W C R C S S Y I Window
Length R E GK H T N N Physical
Checksum Urgent Pointer
Options Padding
IP Encapsulation
Host A
Packet (Datagram)
Network
Version Header DS Field Total Length
Length
Destination IP Address
IP Options
Ethernet Framing
Host A
Frame
Transport
Frame Forwarding
Host A
Data link layer uses carrier sense to detect for existing traffic.
Frame Processing
Host A
Error Check
RTA
DESTINATION MAC
G0/0/0
Host B 00-01-02-03-04-08
TYPE
0x0800
Packet Processing
Frame Decapsulation
Server A
RTB
172.16.10.1/24
08-07-06-05-04-AA
G0/0/1 Server B
172.16.10.2/24
08-07-06-05-04-BB
D.MAC S.MAC Type(0x0800)
Packet Decapsulation
Server A
172.16.10.2/24 IP Options
08-07-06-05-04-BB
Segment Decapsulation
Server A
RTB 172.16.10.1/24
02-03-04-05-06-AA Source Port: 1027 Destination Port: 80
Sequence Number
G0/0/1
Server B Acknowledgement Number
Header N C E UA P R S F
Length Resv. S W C R C S S Y I Window
R E GK H T N N
Checksum Urgent Pointer
172.16.10.2/24
02-03-04-05-06-BB Options Padding
Summary
How does the data in the frame ultimately reach the application it is intended
for?
When multiple sessions of the same application are active (e.g. multiple web
browsers), how does the return data reach the correct session?