150 likes | 162 Views
Learn about ICMP, its message format, and its usage in communication conditions that require attention. Explore ICMP error messages, ping and traceroute programs, IP source routing, and network routing principles.
E N D
CSCE 515:Computer Network Programming Chin-Tser Huang huangct@cse.sc.edu University of South Carolina
Internet Control Message Protocol (ICMP) • Utilized by either IP or higher layer (TCP or UDP) to communicate conditions that require attention • Two main categories • Query message • Error message • Usage of an ICMP message is determined by type and code fields
ICMP Message Format 0 7 8 15 16 31 type code checksum payload
ICMP Address Mask Request and Reply 0 7 8 15 16 31 type(17 or 18) code(0) checksum identifier sequence number subnet mask
ICMP Timestamp Request and Reply 0 7 8 15 16 31 type(13 or 14) code(0) checksum identifier sequence number originate timestamp receive timestamp transmit timestamp
ICMP Unreachable Error 0 7 8 15 16 31 type(3) code(0-15) checksum unused (must be 0) IP header + first 8 bytes of original datagram data
ICMP Time Exceeded 0 7 8 15 16 31 type(11) code(0 or 1) checksum unused (must be 0) IP header + first 8 bytes of original datagram data
ping Program • Test whether another host is reachable • -n option to set number of echo request to send • -i option to set TTL • -r option to record route • -s option to set timestamp • -w option to set timeout to wait for each reply
ICMP Echo Request and Reply 0 7 8 15 16 31 type(0 or 8) code(0) checksum identifier sequence number optional data
IP Record Route Option 39 bytes code len ptr IP addr #1 IP addr #2 … IP addr #9 1 1 1 4 4 4
traceroute Program • Display the route that IP datagrams follow from one host to another • Can use IP source route option • -g option to specify intermediate routers to be used with loose source routing (up to 8 times) • -G option to specify intermediate routers to be used with strict source routing (up to 8 times)
IP Source Routing dest = D {#R1,R2,R3} S R1 R2 R3 D dest = R1 dest = R2 dest = R3 dest = D {#R2,R3,D} {R1,#R3,D} {R1,R2,#D} {R1,R2,R3#}
IP Source Route Option 39 bytes code len ptr IP addr #1 IP addr #2 … IP addr #9 1 1 1 4 4 4
IP Processing routing daemon route command netstat command routing table updates from adjacent routers UDP TCP ICMP our packet (one of our IP address or broadcast addresses)? ICMP forward datagram redirects IP output: calculate next hop router (if necessary) (if forwarding enabled) routing table source routing process IP options IP input queue IP layer network interfaces
Next Class • Routing principles • Routing protocols • Read TI Ch. 9, 10 • Project 2 will be passed out