Fred Kuhns Applied Research Laboratory ICMP and IP Options Fred Kuhns Applied Research Laboratory
ICMP – RFC 792 Purposes of ICMP (Protocol == 1) ICMP Message IP Hdr ICMP Hdr Data 20B 4B+ Variable Type Code Checksum Optional Data ICMP Message Purposes of ICMP (Protocol == 1) Error reporting from routers or destination host to source host. ICMP data includes header and first 64 bytes of data from the IP packet that caused the error Only fragment 0 of fragmented messages generate ICMP error messages Control messages between routers/hosts.
ICMP Message Types Type Field Code Message Echo Reply 3 - Destination Unreachable (Error) Network Unreachable 1 Host Unreachable 2 Protocol Unreachable 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 service 12 Host unreachable for type of service Source Quench Report congestion to original host Redirect – request host use different route Redirect for network (obsolete) Redirect for host Redirect for type-of-service and network Redirect for type-of-service and host Type Field Code Message 8 Echo Request 9 Router Advertisement 10 Router Solicitation 11 - Time Exceeded for a Datagram Time-to-live equals 0 during transit (traceroute) 1 Time-to-live equals 0 during reassembly Timeout occurred while waiting for fragments 12 Parameter Problem – any other error condition (incorrect option IP Header bad Required option missing 13 Timestamp Request 14 Timestamp Reply 15 Information Request (obsolete) 16 Information Reply (obsolete) 17 Address Mask Request 18 Address Mask Reply From Comer, “Internetworking with TCP/IP”, volume 1, 4th edition, 2000.
ICMP Echo Request type = 8 Reply type = 0 ICMP Message Type = 0/8 Code = 0 Checksum Identifier Sequence Number Optional Data ICMP Message Request type = 8 Reply type = 0
Typical ICMP Error Message Type Code Checksum Unused, must be zero Internet Header plus first 64 bits (8 Bytes) of datagram ICMP Message Destination unreachable blah, blah, blah
Internet Header plus first 64 bits of datagram ICMP - Redirect Type Code Checksum Router 32 bit IP address Internet Header plus first 64 bits of datagram tells a host to use a different route, however the original packet is still forwarded.
ICMP - Parameter Problem Type = 12 Code = 0/1 Checksum Pointer Unused, must be zero Internet Header plus first 64 bits of datagram Pointer identifies the problem octet
ICMP - Timestamps Times in milliseconds since midnight, universal time Type = 13/14 Code = 0 Checksum Identifier Sequence Number Originate Timestamp Receive Timestamp Transmit Timestamp Times in milliseconds since midnight, universal time Originate Timestamp – filled in by sender Receive timestamp – filled in by receiver immediately on receiving Transmit timestamp - filled in by receiver immediately before sending
ICMP - Subnet Mask ICMP request for subnet mask – host to router Type = 17/18 Code = 0 Checksum Identifier Sequence Number Address Mask ICMP request for subnet mask – host to router
ICMP - Router Discovery Type = 9 Code = 0 Checksum # Addresses Address Size Lifetime Router Address 1 Preference Level 1 Additional Router Addres/Preferences Lifetime default is 30 minutes Periodic retransmission default time is 10 minutes Multicast to 224.0.0.1 (all-systems address) or broadcast if multicast is not supported Router advertises
ICMP - Router solicitation Type = 10 Code = 0 Checksum Reserved Request router to reply with a router advertisement If multicast supported sent to 224.0.0.2 (all-routers address) Host to routers
IP Options IP Header (20 Bytes) Code Variable (0 – 43) ... Code Byte Expanded Copy (bit) Option Class (2 bits) Option Number (5 bits) IP header field HLEN (4bits) = total header length in 4-Byte words. Max is 15 4-Byte words or 60 Bytes. IP header is 20 bytes, leaving a max of 40 Bytes for IP options. Two valid formats: 1) single byte option (code) or 2) Code byte, length byte (total bytes in option) followed by option data. Code Byte: Copy bit – indicates if option should be copied into all fragments or just first. Option class specify the general 0 – Datagram or network control; 1 – reserved; 2 – debugging and measurement; 3 – reserved. Option number – specific class of option. See next slide
IP Options With the exception of LFS, none seem particularly useful. 7/8/2019 IP Options Class Number Length Description 1 End of option list – used if options do not end at end of header No operation – used to align octets in a list of options 2 11 DoD Basic security (rfc 1108) 3 var Loose source routing, used to request route that include specified routers 5 DoD extended security (rfc 1108) 7 Record route, used to trace a route 8 4 Stream identifier, used to carry a SATNET stream identifier (obsolete) 9 Strict source routing, use to specify an exact path through network MTU probe, used for Path MTU discovery (new method uses ICMP) 12 MTU reply, used for path MTU discovery 20 Router alert, Router should examine this datagram (rfc 2113) 21 Selective directed broadcast (rfc 1770) 22 LFS – Light Weight Flow setup protocol Internet timestamp, used to record timestamp along a route 18 Traceroute, record route in option (rfc 1393) With the exception of LFS, none seem particularly useful. IP Header plus options must end on a 4 byte boundary