iWork ’08 Quick Tour

Download Report

Transcript iWork ’08 Quick Tour

ICMP & ICMPv6
2008. 3. 7
DPNM Lab.
Byungchul Park ([email protected])
ICMP
Internet Control Message Protocol
Introduction
ICMP: Internet Control Message Protocol
ICMP is often considered part of the IP layer
Why
the ICMP is
needed?
Application
Telnet,
FTP, e-mail, etc
Transport
Lacks
of IP !!! TCP, UDP
Network
IP, ICMP, IGMP
Unreliable and connectionless datagram delivery
Link
device driver and interface card
Best-effort delivery service
Lack of error control and lack of assistance mechanisms
No error-reporting and error-correcting mechanisms
Lacks of mechanism for host and management queries
 ICMP has been designed to compensate for the above
deficiencies.
Introduction
ICMP: Internet Control Message Protocol
ICMP message are transmitted within IP datagrams
Although ICMP is used primarily by IP, it is possible for an application
to also access it. (e.g. Traceroute, Ping)
ICMP Messages
Types of Messages
ICMP message are transmitted within IP datagrams
ICMP Messages
Error-reporting
Query
Error reporting : report problems that a router or host may
encounter when it processes an IP packet
Query message : get specific information from router or a host in
order to help a host or network management.
ICMP Messages (cont.)
Types of Messages
Category
Error-reporting
message
Type
Message
3
Destination unreachable
4
Source quench
11
Time exceeded
12
Parameter problem
5
Redirection
8 or 0
Echo request or reply
13 or 14
Timestamp request and reply
17 or 18
Address mask request and reply
10 or 9
Router solicitation and advertisement
Query message
Message Format
ICMP Message Format
Type : message type(8 bit)
Code : specify the reason for the particular message
Checksum : 16 bit
Message Format
ICMP common field and message Type
Type
code
description
0
0
3
0-15
4
0
5
0-3
8
0
Echo request
9
0
Router advertisement
10
0
Router solicitation
11
0-1
Time exceeded
12
0-1
Parameter problem
13
0
Timestamp request
14
0
Timestamp reply
17
0
Address mask request
18
0
Address mask reply
Echo reply
Destination unreachable
Source quench
Redirection
IP, as an unreliable protocol, is not
concerned with error checking and error
control. ICMP was designed, in part, to
compensate for this shortcoming. ICMP
does not correct errors, it simply reports
them.
Error Reporting
ICMP: Internet Control Message Protocol
Main responsibilities of ICMP
Error messages are always sent to the original source
Error Reporting
Destination
unreachable
Source
quench
Time
exceeded
Parameter
problems
Redirection
ICMP always reports error messages to the original source.
Error Reporting
Contents of data field for error messages
When an ICMP error message is sent, the message always contains
the IP header and the first 8 bytes of the IP datagram that caused the
ICMP error to be generated.
Error Reporting
Destination Unreachable
When a router cannot route a datagram or a host cannot deliver a datagram, the datagram
is discarded and the router or host send s a destination unreachable message back to the
source.
Format
Destination-unreachable messages with codes 2 or 3 can be created only by the
destination host. Other destination-unreachable messages can be created only by
routers.
A router cannot detect all problems that prevent the delivery of a packet
There is no flow-control mechanism in the IP protocol.
Error Reporting
Destination Unreachable
Code Field : the reason for discarding the datagram
code
Reasons for error
0
Network unreachable
1
Host unreachable
2
Protocol unreachable
3
Port unreachable
4
Fragmentation needed and DF set
5
Source route failed
6
Destination network unknown
7
Destination host unknown
8
Source host isolated
9
Communication with destination network administratively prohibited
10
Communication with destination host administratively prohibited
11
Network unreachable for type of services
12
Host unreachable for type of services
Error Reporting
Time-Exceeded message
Code 0 is used only by routers to show that the value of the time-to-live field is zero.
Code 1 is used only by the destination host to show that not all of the fragments have
arrived within a set time.
Whenever a router receives a datagram with a time-to-live value of zero, it discards the
datagram and sends a time-exceeded message to the original source.
When the final destination does not receive all of the fragments in a set time, it discards
the received fragments and sends a time-exceeded message to the original source.
Format
Error Reporting
Parameter problem
Code 0: Main header problem
Code 1: Problem in the option field
A parameter-problem message can be created by a router or the destination host.
Format
Error Reporting
Redirection concept
When a host send a datagram, which is destined for another network, to the wrong
router, the router that receives the datagram will forward the datagram to the correct
router. However, to update the routing table of host, it send a redirection message to
host.
When a new host come up, its routing table has a limited number of entries. It usually
knows only a default router, so they can send to wrong router.
Error Reporting
Redirection concept
A redirection message is sent from a router to host on the same local network.
Redirection message format
Code 0:
Code 1:
Code 2:
Code 3:
Format
Network specific
Host specific
Network specific (specified service)
Host specific (specified service)
ICMP can also diagnose some network
problems through the query messages, a
group of four different pairs of messages. In
this type of ICMP message, a node sends a
message that is answered in a specific
format by the destination node.
Query
ICMP: Internet Control Message Protocol
Diagnose some network problems
Query messages
Query
Echo
request & reply
Timestamp
request & reply
Address mask
Request & reply
Router solicitation
& advertisement
Query
Echo Request and Reply
An echo-request message can be sent by a host or router. An echo-reply message is
sent by the host or router which receives an echo-request message.
Echo-request and echo-reply messages can be used by network managers to check the
operation of the IP protocol
Echo-request and echo-reply messages can test the reachability of a host. this is
usually done by invoking the ping command.
Query
Timestamp Request and Reply
The timestamp-request and timestamp-reply messages can be used to
synchronize two clocks in two machines if the exact one-way time duration is
known.
Timestamp-request and timestamp-reply messages can be used to calculate
the round-trip time between a source and a destination machine even if their
clocks are not synchronized.
Each field is represented by the unit of Miliseconds from midnight in Universal
Time
3 timestamp fields(original, receive, transmit) are 32 bit long,
(0~4,294,967,295), but a timestamp in this case cannot exceed 86,400,000=
24x60x60x1000.
Query
Timestamp Request and Reply
Format
Steps
Sender create a timestamp-request message
Insert the sending time to Original timestamp field
Other 2 fields is 0
Receiver create the timestamp-reply message
Copy the value of the original timestamp to same field
Insert the receiving time of the request message to the receive
timestamp
Query
Address-Mask Request and Reply
When a host want to know about a full IP address which part of address defines the
network and subnetwork address and which part corresponds to the host identifier.
Masking is needed for diskless station at statr-up time.(BOOTP protocol)
Mask-request and mask-reply message format
Query
Router solicitation and Advertisement
A host the want to send data to a host on outside network needs to know the address of
routers connected to its own network.
A host can broadcast(or multicast) a router-solicitation message
A router or routers that received the solicitation message broadcast their routing
information using the router-advertisement message.
Router-solicitation message format
Query
Router solicitation and Advertisement
Router advertisement message format
The preference level is used to select a router as the default router.
If the preference level is 0, the router is considered the default router.
If the preference level is 8000000016, the router should be never selected as the
default router.
ICMPv6
Internet Control Message Protocol Version 6
Comparison of network layers in IPv4 and IPv 6
ICMPv6: Internet Control Message Protocol version 6
Message Format
Router solicitation and Advertisement
General format of ICMPv6 messages
Error Reporting
Router solicitation and Advertisement
Error Reporting
Destination
unreachable
Packet too big
Time
exceeded
Parameter
problems
Redirection
Error Reporting
Comparison Error Reporting function between v4 and v6
Type of Message
V4
V6
Destination unreachable
Yes
Yes
Source quench
Yes
No
Packet too big
No
Yes
Time exceeded
Yes
Yes
Parameter problem
Yes
Yes
Redirection
Yes
Yes
Query
ICMPv6: Internet Control Message Protocol version 6
Diagnose some network problems
Query messages
Query
Echo
request & reply
Group
membership
Neighbor solicitation
& advertisement
Router solicitation
& advertisement
Query
ICMPv6: Internet Control Message Protocol version 6
Type of Message
V4
V6
Echo request and reply
Yes
Yes
Timestamp request and reply
Yes
No
Address mask request and reply
Yes
No
Router solicitation
Yes
Yes
Neighbor solicitation
ARP
Yes
Group membership
IGMP
Yes