400 likes | 664 Views
ICMP. CST 415. Topics. ICMP Defined ICMP Packet Generation ICMP Packet Structure. Problem Definition. IP defines a set of host to host services for interconnected networks. These services are unreliable Connectivity is provided through gateways and routers
E N D
ICMP CST 415 CST 415 - Computer Networks
Topics • ICMP Defined • ICMP Packet Generation • ICMP Packet Structure CST 415 - Computer Networks
Problem Definition • IP defines a set of host to host services for interconnected networks. • These services are unreliable • Connectivity is provided through gateways and routers • Gateways and routers must have dynamic behavior. • Network traffic will vary • Behavior will change depending on the dynamic Internet configuration. • Routers and gateways will dump packets they cannot deal with. CST 415 - Computer Networks
Problem Definition • Since IP is unreliable, we can expect packets to be lost. • What happens to the system when: • A host is removed from the network? • A router is removed from the network? What are the ramifications of ignoring problems in datagram related message delivery? CST 415 - Computer Networks
ICMP Defined • Routers need a way to communicate back to host computers when a problem arises. • To do this, a protocol has been defined (RFC 792). Internet Control Messaging Protocol CST 415 - Computer Networks
ICMP Defined • ICMP was defined as an error reporting mechanism. • When an error is encountered, ICMP is used to allow a router to report the error to the original source of the packet. • The originator of the datagram can then make a decision on how to deal with the problem. CST 415 - Computer Networks
ICMP Defined ICMP General Operation ICMP provides a feedback mechanism when an IP message is sent. In this example, device A sends an IP datagram to device B. When it gets to router R3 a problem of some sort is detected, dropping the datagram. R3 sends an ICMP message back to A to tell it that something happened, hopefully with enough information to let A correct the problem. R3 can only send the ICMP message back to A, not to R2 or R1. CST 415 - Computer Networks
ICMP Packet Generation ICMP will be sent when: • A network destination is unreachable. • A host destination is unreachable. • A Protocol unreachable. • A Port unreachable. • Packet fragmentation failure. • Source route failure. CST 415 - Computer Networks
ICMP Packet Generation ICMP will be sent when: • A Packet is killed due to timeout. • IP packet parameter problem. • A router needs to slow down the traffic coming into it. • A router needs to inform another router to send traffic to a different router. CST 415 - Computer Networks
ICMP Packet Generation ICMP will be sent when: • Echo request/reply (e.g. ping). • Timestamp request/reply • A router needs to get information from another router. CST 415 - Computer Networks
ICMP Packet Format The ICMP packet is encapsulated inside an IP packet. ICMP IP 802.3 CST 415 - Computer Networks
ICMP Packet Format There are 15 different types of ICMP packet. Each type of ICMP packet starts with the same fields: • Type – 8 bits : Defines the type of this ICMP packet. • Code – 8 bits : Depending on the type, this field provides further information about the packet. • Checksum – 16 bits : The 16 bit checksum for the ICMP packet header + data. CST 415 - Computer Networks
ICMP Packet Format The type field is interpreted as: CST 415 - Computer Networks
ICMP Packet Format Echo Request/Reply (Ping): • Used for debugging connections. • Host or router sends a Ping request. • The destination (the “pingee”) sends back a response. CST 415 - Computer Networks
ICMP Packet Format • Type – 8: echo request 0: echo reply • Code – 0 (not used) • Identifier – The ID of this ping request (used to match the ping response). • Sequence Number – In a multiple ping, the ping packet in the ping sequence. • Could be used to measure percent packet loss. • Optional Data – Any data sent in the request will be sent back in the response. CST 415 - Computer Networks
ICMP Packet Format Destination Unreachable Report: • Used by a router when it cannot forward a datagram. • After the ICMP message is sent back, the router will dump the undeliverable datagram. CST 415 - Computer Networks
ICMP Packet Format The code field is interpreted as: CST 415 - Computer Networks
ICMP Packet Format • Type – 8: echo request 0: echo reply • Code – 0 (not used) • Identifier – The ID of this ping request (used to match the ping response). • Sequence Number – In a multiple ping, the ping packet in the ping sequence. • Could be used to measure percent packet loss. • Optional Data – Any data sent in the request will be sent back in the response. CST 415 - Computer Networks
ICMP Packet Format • Routers are just special purpose computing devices with: • Limited physical resources • Memory • Processor cycles • Limited bandwidth • Routers overwhelmed by datagram traffic are called “congested”. CST 415 - Computer Networks
ICMP Packet Format Source Quench: • Used by a router to tell a host sending it datagrams to “shut up!”. • The host computer will slow down sending of to the router until it no longer receives Source Quench. • When this occurs, the host will begin increasing datagram traffic. CST 415 - Computer Networks
ICMP Packet Format • Type – 4 • Code – 0 (not used) • Header of the offending datagram plus the first 64 bits of the offending data payload. CST 415 - Computer Networks
ICMP Packet Format Route Change Request: • A router may need to request that a host send to a different router. CST 415 - Computer Networks
ICMP Packet Format Route Change Request: • Host computer typically have minimal information related to packet routing. • After a host machine boots, a router may need to inform a host machine of route configuration changes. • Used by a router to tell a host to send traffic to a different router. CST 415 - Computer Networks
ICMP Packet Format • Type – 5 • Code – 0 to 3 • Router Internet Address – The IP address of the router that the host should use instead of “this” router. • Header of the redirected datagram plus the first 64 bits of the offending data payload. • The datagram being re-routed will be dumped. CST 415 - Computer Networks
ICMP Packet Format The Route Change Request code field is interpreted as: CST 415 - Computer Networks
ICMP Packet Format Circular or Long Route Detection: • The Internet is unstable because of message latency • There is no way to detect global state at any given point in time. • Why? • This inherent instability can bring about routing cycles. • If a datagram enters a routing cycle, it will pass endlessly from one router to the next in the cycle. CST 415 - Computer Networks
ICMP Packet Format • Type – 11 (Time Exceeded) • Code – • 0 : Time-to-live count exceeded (i.e. was decremented to 0). • 1 : Fragment reassembly time exceeded. • Header of the dumped datagram plus the first 64 bits of the offending data payload. • The datagram timed-out will be dumped. CST 415 - Computer Networks
ICMP Packet Format Parameter Problem: • Datagrams can have any other of ailments that plague the digital information realm. • The Parameter Problem ICMP packet is an attempt to inform of other packet ailments. • Bad packets will be dumped. CST 415 - Computer Networks
ICMP Packet Format • Type – 12 (Parameter Problem) • Code – • 0 : General Problem • 1 : A required option is missing (i.e. security) • Pointer – The octet in the datagram that caused the problem. • The dumped datagram IP header plus 64 bits of the datagram. CST 415 - Computer Networks
ICMP Packet Format Clock Synch and Transit Time Estimate: • In large scale distributed systems, clock synchronization is essential. • To handle this synchronization, a host can solicit a timestamp from another machine on the network. CST 415 - Computer Networks
ICMP Packet Format • Type – 13 (Request), 14 (Reply) • Code – 0 • Identifier/Sequence Number – Used to associate requests with replies. • Originate Timestamp – The time the request packet was sent. • Receive Timestamp – The time the request packet was received at the destination. • Transmit Timestamp – The time the response packet was sent back. CST 415 - Computer Networks
ICMP Packet Format Obtaining a subnet mask: • When subnet addressing is being used, a host must obtain the correct mask from the router. • A host must be able to determine what router to send a packet to, depending on the subnet mask. CST 415 - Computer Networks
ICMP Packet Format • Type – 17 (Request), 18 (Reply) • Code – 0 • Identifier/Sequence Number – Used to associate requests with replies. • Address Mask – The subnet mask that a router will use for routing the packet. CST 415 - Computer Networks
ICMP Packet Format Router Discovery: • To send datagram packets to other networks on the Internet, a host must know what router to send their datagrams. • Broadcast the router discovery packet on the LAN, the routers will respond with addressing information for the host. CST 415 - Computer Networks
ICMP Packet Format • Type – 9 • Code – 0 • Num Addrs – The number of address/precedence fields in the packet. • Addr Size – The time the request packet was sent. • Lifetime – The amount of time this router will support this connection ( typically 30 minutes). • Router Addr “n” – The IP address of a router. • Preference level “n” – A twos compliment value indicating the “desireability” for this router. CST 415 - Computer Networks
ICMP Packet Format Router Solicitation: • When a host machine boots, it must immediately discover the routers it can communicate with. • This is done by broadcasting a Router Solicitation on the network. • When a router receives a solicitation message, it will send back a normal router advertisement packet. CST 415 - Computer Networks