SlideShare uma empresa Scribd logo
1 de 32
Internet Control Message
      Protocol ICMP




   The Internet Control Message Protocol (ICMP) is a control
protocol that is considered to be an integral part of IP, although
it is architecturally layered upon IP - it uses IP to carry its data
      end-to-end. ICMP provides error reporting, congestion
            reporting, and first-hop router redirection.

                                                                   1
Introduction
 IP provides best-effort delivery
 Delivery problems can be ignored;
 datagrams can be "dropped on the floor"
 Internet Control Message Protocol (ICMP)
 provides error-reporting mechanism




                                2
IP and ICMP




              3
ICMP Features
 ICMP uses IP as if ICMP were a higher-
 level protocol (that is, ICMP messages are
 encapsulated in IP datagrams). However,
 ICMP is an integral part of IP and must be
 implemented by every IP module.
 ICMP is used to report some errors, not to
 make IP reliable. Datagrams may still be
 undelivered without any report on their
 loss. Reliability must be implemented by
 the higher-level protocols that use IP.
                                 4
ICMP Features
 ICMP can report errors on any IP datagram
 with the exception of ICMP messages, to
 avoid infinite repetitions.
 For fragmented IP datagrams, ICMP
 messages are only sent about errors on
 fragment zero. That is, ICMP messages
 never refer to an IP datagram with a non-
 zero fragment offset field.


                                5
ICMP Features
 ICMP has rules regarding error message
 generation to prevent broadcast storms
 ICMP messages are never sent in response to
 datagrams with a destination IP address that is a
 broadcast or a multicast address.
 ICMP messages are never sent in response to a
 datagram which does not have a source IP
 address which represents a unique host. That is,
 the source address cannot be zero, a loopback
 address, a broadcast address or a multicast
 address.
                                      6
Error Message Generation
Rules
 ICMP errors messages are not generated
 in response to
   an ICMP error message
   datagrams destined to an IP broadcast
   address
   datagrams sent as a link-layer broadcast
   a fragment other than the first
   a datagram whose source address does not
   define a single host

                                  7
ICMP Features
 ICMP messages are never sent in response to
 ICMP error messages. They may be sent in
 response to ICMP query messages (ICMP types
 0, 8, 9, 10 and 13 through 18).
 RFC 792 states that ICMP messages “may” be
 generated to report IP datagram processing
 errors, not “must”. In practice, routers will almost
 always generate ICMP messages for errors, but
 for destination hosts, the number of ICMP
 messages generated is implementation
 dependent.
                                         8
ICMP Message Format
ICMP messages are described in RFC 792 and RFC 950,
belong to STD 5 and are mandatory.
ICMP messages are sent in IP datagrams. The IP header
will always have a Protocol number of 1, indicating ICMP
and a type of service of zero (routine). The IP data field will
contain the actual ICMP message in the format shown in
the figure below:




                                                9
ICMP Message Transport
 ICMP encapsulated in IP
 But ... how can that work?
 ICMP messages sent in response to incoming
 datagrams with problems
 ICMP message not sent for ICMP message




                                   10
Error Detection
 Internet layer can detect a variety of errors:
    Checksum (header only!)
    TTL expires
    No route to destination network
    Can't deliver to destination host (e.g., no ARP
    reply)
 Internet layer discards datagrams with problems
 Some - e.g., checksum error - can't trigger error
 messages

                                        11
Types of Messages
 ICMP defines two types of messages: error
 and informational messages
 Error messages:
   Source quench
   Time exceeded
   Destination unreachable
   Redirect
   Fragmentation required
 Informational messages:
   Echo request/reply
   Address mask request/reply
   Router discovery             12
ICMP: Message Types
       Type           Message
         0    Echo reply
         3    Destination unreachable
         4    Source quench
         5    Redirect
         8    Echo request
        11    Time exceeded
        12    Parameter unintelligible
        13    Time-stamp request
        14    Time-stamp reply
        15    Information request
        16    Information reply
        17    Address mask request
        18    Address mask reply         13
ICMP Message Types
Type Code Description                    Query Error Type   Code   Description                       Query   Error
0    0    Echo reply                     •           5             Redirect
3         Destination unreachable:                          0       Redirect for network                     •
     0     Network unreachable                 •            1       Redirect for host                        •
     1     Host unreachable                    •            2       Redirect for TOS and Net                 •
     2     Protocol unreachable                             3       Redirect for TOS and Host                •
                                               •
     3     Port unreachable                    •     8      0      Echo request                      •
     4     Fragmentation needed                •     9      0      Router advertisement              •
     5     Source route failed                 •     10     0      Router solicitation               •
     6     Destination network unknown               11            Time exceeded
                                               •
     7     Destination host unknown                         0       TTL equals 0 during transit              •
                                               •
     8     Source host isolated                             1       TTL equals 0 during reassembly           •
     9     Destination net prohibited          •
                                                     12            Parameter problem
     10    Destination host prohibited         •
                                                            0       IP header bad                            •
     11    Network unreachable for TOS         •            1       Required option missing                  •
     12    Host unreachable for TOS            •     13     0      Timestamp request                 •
     13    Communication prohibited            •     14     0      Timestamp reply                   •
     14    Host precedence violation           •     15     0      Information request               •
     15    Precedence cutoff in effect         •     16     0      Information reply                 •
4    0    Source quench                        •     17     0      Address mask request              •
                                                     18     0      Address mask reply                •

                                                                                    14
ICMP and Reachability
 An internet host, A, is reachable from
 another host, B, if datagrams can be
 delivered from A to B
 ping program tests reachability - sends
 datagram from B to A that A echoes back
 to B
 Uses ICMP echo request and echo reply
 messages
 Internet layer includes code to reply to
 incoming ICMP echo request messages
                                   15
Destination Unreachable
Codes
Code   Meaning
0      Network unreachable
1      Host unreachable
2      Protocol unreachable
3      Port unreachable
4      Fragmentation need and don’t fragment bit set
5      Source route failed
6      Destination network unknown
7      Destination host unknown
8      Source host isolated
9      Communication with dest net administratively prohibited
10     Communication with dest host administratively prohibited
11     Network unreachable for type of service
12     Host unreachable for type of service
                                               16
ICMP Unreachable Error
 Unreachable errors are generate for a
 number of reasons
   network unreachable
   host unreachable

     type (3)        code (0-15)                   16-bit checksum

                            unused (must be 0)


         IP header (including options) + first 8 bytes of IP datagram data




                                                              17
Handling of ICMP Messages
 Type   Code   Description                    Handled by
 0      0      Echo reply                     User process
 3             Destination unreachable:
        0       Network unreachable           “No route to host”
        1       Host unreachable              “No route to host”
        2       Protocol unreachable          “Connection refused”
        3       Port unreachable              “Connection refused”
        4       Fragmentation needed          “Message too long”
        5       Source route failed           “No route to host”
        6       Destination network unknown   “Network is unreachable”
        7       Destination host unknown      “No route to host”
        8       Source host isolated          “No route to host”
        9       Destination net prohibited    “Network is unreachable”
        10      Destination host prohibited   “No route to host”
        11      Network unreachable for TOS   “Network is unreachable”
        12      Host unreachable for TOS      “No route to host”
        13      Communication prohibited      (ignored)
        14      Host precedence violation     (ignored)
        15      Precedence cutoff in effect   (ignored)
 4      0      Source quench                  Kernel for TCP; ignored by UDP
                                                               18
Handling of ICMP Messages
  Type   Code   Description                       Handled by
  5             Redirect
         0       Redirect for network             Kernel updates routing table
         1       Redirect for host                Kernel updates routing table
         2       Redirect for TOS and Net         Kernel updates routing table
         3       Redirect for TOS and Host        Kernel updates routing table
  8      0      Echo request                      Kernel generates reply
  9      0      Router advertisement              User process
  10     0      Router solicitation               User process
  11            Time exceeded
         0       TTL equals 0 during transit      User process
         1       TTL equals 0 during reassembly   User process
  12            Parameter problem
         0       IP header bad                    “Protocol not available”
         1       Required option missing          “Protocol not available”
  13     0      Timestamp request                 Kernel generates reply
  14     0      Timestamp reply                   User process
  15     0      Information request               Kernel generates reply
  16     0      Information reply                 User process
  17     0      Address mask request              Kernel generates reply
  18     0      Address mask reply                User process
                                                                 19
Ping Program
 Ping stands for “Packet InterNet Groper”
 The ping program tests whether another
 host is reachable
 The program works by sending an ICMP
 echo request to a host, expecting an ICMP
 echo reply to be returned
 Normally ping is used as a diagnostic tool
 to test network connectivity

                                 20
Client/Server Programs
 Ping is is an example of a client/server
 program
   the client sends the request to a server
   the server returns the reply
 Most TCP/IP implementations support the
 ping server directly in the kernel




                                       21
Ping Implementation
 Unix implementations set the identifier field to the
 process ID of the sender
 The sequence number starts at 0 and is
 incremented every time a new echo request is
 sent
 Ping operates in one of two modes
    send a single request, if a response is received
    the host is alive
    send one request every second
 Ping in Action
 IP Record Route Option
                                        22
ICMP and Internet Routes
 List of all routers on path from A to B is called the route
 from A to B
 traceroute uses UDP to non-existent port and TTL field to
 find route via expanding ring search
 Sends ICMP echo messages with increasing TTL
    Router that decrements TTL to 0 sends ICMP time
    exceeded message, with router's address as source
    address
    First, with TTL 1, gets to first router, which discards
    and sends time exceeded message
    Next, with TTL 2, gets through first router to second
    router
    Continue until message from destination received
 traceroute must accommodate varying network delays
 Must also accommodate dynamically changing routes
                                                 23
ICMP and Path MTU
Discovery
 Fragmentation should be avoided
 How can source configure outgoing datagrams to
 avoid fragmentation?
 Source determines path MTU - smallest network
 MTU on path from source to destination
 Source probes path using IP datagrams with
 don't fragment flag
 Router responds with ICMP fragmentation
 required message
 Source sends smaller probes until destination
 reached                             24
Information Request/Reply:
 This request is intended for a diskless system to
 obtain its subnet mask
 Set source and destination addresses to 0 in the
 request and broadcast
 Server replies back with your IP address
 (Not used. Replaced by RARP and BOOTP)
 Address Mask Request/Reply: What is the subnet
 mask on this net? Replied by “Address mask
 agent”
    type (17 or 18)        code (0)                  16-bit checksum

     identifier (can be set to anything)    sequence (can be set to anything)

                                32-bit subnet mask            25
ICMP Messages:
Fragmentation Required
 Fragmentation Required: Datagram was
 longer than MTU and “No Fragment bit”
 was set.




                               26
ICMP Messages: Time
Exceeded
 Time Exceeded: Time to live field in one of
 your packets became zero.” or
 “Reassembly timer expired at the
 destination.




                                  27
ICMP Messages: Redirect
     Default route may cause extra hop
     Router that forwards datagram on same
     interface sends ICMP redirect
     Host installs new route with correct router
     as next hop                            Host Y
                   Router A            Host Y is reachable
                                       in one hop through
                                            Router A
             IP Packet

                 Redirection:
         “Next time, use Router A
Host X    for this destination host”       Router B
                                                  28
ICMP Messages: Redirect
 Redirect: Please send to router X instead
 of me.
 0 = Redirect datagrams for the network
 1 = Redirect datagrams for the host
 2 = Redirect datagrams for the type of
 service and net
 3 = Redirect datagrams for the type of
 service and host

                                 29
ICMP Timestamp Request &
Reply
 Used to return the current time from
 another host
 Could be used for (primitive) time
 synchronization protocol, but NTP and
 XNTP do a much better job
   type (13 or 14)        code (0)                     16-bit checksum

    identifier (can be set to anything)    sequence (can be set to anything)

                          32-bit originate timestamp

                           32-bit receive timestamp

                           32-bit transmit timestamp
                                                                30
ICMP Timestamp Request &
Reply
 The recommended value to be returned is
 the number of milliseconds since midnight,
 Coordinated Universal Time (UTC).
 A drawback is that only the time since
 midnight is returned. The caller must know
 the date form some other means




                                 31
ICMP Summary
Internet layer provides best-effort delivery service
May choose to report errors for some problems
ICMP provides error message service
ICMP is the control sibling of IP
ICMP is used by IP and uses IP as network layer
protocol - Encapsulated in IP datagram - Not reliable
Feedback about problems
   e.g. time to live expired
ICMP is used for ping, traceroute, and path MTU
discovery
Transfer of (control) messages from routers and
hosts to hosts
                                       32

Mais conteúdo relacionado

Mais procurados (20)

Transport layer
Transport layer Transport layer
Transport layer
 
Network layer tanenbaum
Network layer tanenbaumNetwork layer tanenbaum
Network layer tanenbaum
 
Icmp
IcmpIcmp
Icmp
 
Distance vector routing
Distance vector routingDistance vector routing
Distance vector routing
 
IPV6 ADDRESS
IPV6 ADDRESSIPV6 ADDRESS
IPV6 ADDRESS
 
Subnetting Presentation
Subnetting PresentationSubnetting Presentation
Subnetting Presentation
 
Ports & sockets
Ports  & sockets Ports  & sockets
Ports & sockets
 
TCP and UDP
TCP and UDP TCP and UDP
TCP and UDP
 
Ipv6
Ipv6Ipv6
Ipv6
 
Presentation on arp protocol
Presentation on arp protocolPresentation on arp protocol
Presentation on arp protocol
 
Transport layer protocol
Transport layer protocolTransport layer protocol
Transport layer protocol
 
Simple Mail Transfer Protocol
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
Simple Mail Transfer Protocol
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
Snmp
SnmpSnmp
Snmp
 
Internet protocol (ip) ppt
Internet protocol (ip) pptInternet protocol (ip) ppt
Internet protocol (ip) ppt
 
Ipv4 header
Ipv4 headerIpv4 header
Ipv4 header
 
Transport layer services
Transport layer servicesTransport layer services
Transport layer services
 
Address resolution protocol
Address resolution protocolAddress resolution protocol
Address resolution protocol
 
IP Multicasting
IP MulticastingIP Multicasting
IP Multicasting
 
Computer network switching
Computer network switchingComputer network switching
Computer network switching
 

Semelhante a Internet control message protocol

Semelhante a Internet control message protocol (20)

ICMP.ppt
ICMP.pptICMP.ppt
ICMP.ppt
 
05 coms 525 tcpip - icmp
05   coms 525 tcpip - icmp05   coms 525 tcpip - icmp
05 coms 525 tcpip - icmp
 
5. icmp
5. icmp5. icmp
5. icmp
 
Unit05
Unit05Unit05
Unit05
 
Internet Protocol.pdf
Internet Protocol.pdfInternet Protocol.pdf
Internet Protocol.pdf
 
Address resolution protocol and internet control message protocol
Address resolution protocol and internet control message protocolAddress resolution protocol and internet control message protocol
Address resolution protocol and internet control message protocol
 
Ip and icmp
Ip and icmpIp and icmp
Ip and icmp
 
Respostas wireshark icmp
Respostas wireshark icmpRespostas wireshark icmp
Respostas wireshark icmp
 
vulnerabilities in IP.pdf
vulnerabilities in IP.pdfvulnerabilities in IP.pdf
vulnerabilities in IP.pdf
 
NP - Unit 3 - Forwarding Datagram and ICMP
NP - Unit 3 - Forwarding Datagram and ICMPNP - Unit 3 - Forwarding Datagram and ICMP
NP - Unit 3 - Forwarding Datagram and ICMP
 
Q1 On Ch09 Tcpip Protocol Suite And Ip Addressing
Q1 On Ch09 Tcpip Protocol Suite And Ip AddressingQ1 On Ch09 Tcpip Protocol Suite And Ip Addressing
Q1 On Ch09 Tcpip Protocol Suite And Ip Addressing
 
Internetworking
InternetworkingInternetworking
Internetworking
 
Internet protocol
Internet protocolInternet protocol
Internet protocol
 
Icmp V4 And Icmp V6
Icmp V4 And Icmp V6Icmp V4 And Icmp V6
Icmp V4 And Icmp V6
 
CoAP Talk
CoAP TalkCoAP Talk
CoAP Talk
 
Mobile ipv6
Mobile ipv6Mobile ipv6
Mobile ipv6
 
It 3-icmp-igmp
It 3-icmp-igmpIt 3-icmp-igmp
It 3-icmp-igmp
 
IT307 Exploring the Networks.pptx
IT307 Exploring the Networks.pptxIT307 Exploring the Networks.pptx
IT307 Exploring the Networks.pptx
 
Packet sniffing
Packet sniffingPacket sniffing
Packet sniffing
 
IPv6 basic introduction
IPv6 basic introductionIPv6 basic introduction
IPv6 basic introduction
 

Mais de asimnawaz54

Lecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceLecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceasimnawaz54
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceasimnawaz54
 
Expert systems with applications
Expert systems with applicationsExpert systems with applications
Expert systems with applicationsasimnawaz54
 
Establishing knowledge base
Establishing knowledge baseEstablishing knowledge base
Establishing knowledge baseasimnawaz54
 
Designing the expert system
Designing the expert systemDesigning the expert system
Designing the expert systemasimnawaz54
 
1 s2.0-s0957417410007244-main
1 s2.0-s0957417410007244-main1 s2.0-s0957417410007244-main
1 s2.0-s0957417410007244-mainasimnawaz54
 
Packet switching
Packet switchingPacket switching
Packet switchingasimnawaz54
 
Network layer and circuit switching
Network layer and circuit switchingNetwork layer and circuit switching
Network layer and circuit switchingasimnawaz54
 
Network layer and circuit switching
Network layer and circuit switchingNetwork layer and circuit switching
Network layer and circuit switchingasimnawaz54
 
Requirements analysis
Requirements analysisRequirements analysis
Requirements analysisasimnawaz54
 
Advanced software engineering lab 2
Advanced software engineering lab 2Advanced software engineering lab 2
Advanced software engineering lab 2asimnawaz54
 
Object oriented analysis lab1
Object oriented analysis lab1Object oriented analysis lab1
Object oriented analysis lab1asimnawaz54
 
Ooad sequence diagram lecture
Ooad sequence diagram lectureOoad sequence diagram lecture
Ooad sequence diagram lectureasimnawaz54
 

Mais de asimnawaz54 (15)

Lecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceLecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inference
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
 
Expert systems with applications
Expert systems with applicationsExpert systems with applications
Expert systems with applications
 
Establishing knowledge base
Establishing knowledge baseEstablishing knowledge base
Establishing knowledge base
 
Designing the expert system
Designing the expert systemDesigning the expert system
Designing the expert system
 
1 s2.0-s0957417410007244-main
1 s2.0-s0957417410007244-main1 s2.0-s0957417410007244-main
1 s2.0-s0957417410007244-main
 
Packet switching
Packet switchingPacket switching
Packet switching
 
Network layer and circuit switching
Network layer and circuit switchingNetwork layer and circuit switching
Network layer and circuit switching
 
Network layer and circuit switching
Network layer and circuit switchingNetwork layer and circuit switching
Network layer and circuit switching
 
Ipv6up
Ipv6upIpv6up
Ipv6up
 
Ipv4
Ipv4Ipv4
Ipv4
 
Requirements analysis
Requirements analysisRequirements analysis
Requirements analysis
 
Advanced software engineering lab 2
Advanced software engineering lab 2Advanced software engineering lab 2
Advanced software engineering lab 2
 
Object oriented analysis lab1
Object oriented analysis lab1Object oriented analysis lab1
Object oriented analysis lab1
 
Ooad sequence diagram lecture
Ooad sequence diagram lectureOoad sequence diagram lecture
Ooad sequence diagram lecture
 

Último

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 

Último (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Internet control message protocol

  • 1. Internet Control Message Protocol ICMP The Internet Control Message Protocol (ICMP) is a control protocol that is considered to be an integral part of IP, although it is architecturally layered upon IP - it uses IP to carry its data end-to-end. ICMP provides error reporting, congestion reporting, and first-hop router redirection. 1
  • 2. Introduction IP provides best-effort delivery Delivery problems can be ignored; datagrams can be "dropped on the floor" Internet Control Message Protocol (ICMP) provides error-reporting mechanism 2
  • 4. ICMP Features ICMP uses IP as if ICMP were a higher- level protocol (that is, ICMP messages are encapsulated in IP datagrams). However, ICMP is an integral part of IP and must be implemented by every IP module. ICMP is used to report some errors, not to make IP reliable. Datagrams may still be undelivered without any report on their loss. Reliability must be implemented by the higher-level protocols that use IP. 4
  • 5. ICMP Features ICMP can report errors on any IP datagram with the exception of ICMP messages, to avoid infinite repetitions. For fragmented IP datagrams, ICMP messages are only sent about errors on fragment zero. That is, ICMP messages never refer to an IP datagram with a non- zero fragment offset field. 5
  • 6. ICMP Features ICMP has rules regarding error message generation to prevent broadcast storms ICMP messages are never sent in response to datagrams with a destination IP address that is a broadcast or a multicast address. ICMP messages are never sent in response to a datagram which does not have a source IP address which represents a unique host. That is, the source address cannot be zero, a loopback address, a broadcast address or a multicast address. 6
  • 7. Error Message Generation Rules ICMP errors messages are not generated in response to an ICMP error message datagrams destined to an IP broadcast address datagrams sent as a link-layer broadcast a fragment other than the first a datagram whose source address does not define a single host 7
  • 8. ICMP Features ICMP messages are never sent in response to ICMP error messages. They may be sent in response to ICMP query messages (ICMP types 0, 8, 9, 10 and 13 through 18). RFC 792 states that ICMP messages “may” be generated to report IP datagram processing errors, not “must”. In practice, routers will almost always generate ICMP messages for errors, but for destination hosts, the number of ICMP messages generated is implementation dependent. 8
  • 9. ICMP Message Format ICMP messages are described in RFC 792 and RFC 950, belong to STD 5 and are mandatory. ICMP messages are sent in IP datagrams. The IP header will always have a Protocol number of 1, indicating ICMP and a type of service of zero (routine). The IP data field will contain the actual ICMP message in the format shown in the figure below: 9
  • 10. ICMP Message Transport ICMP encapsulated in IP But ... how can that work? ICMP messages sent in response to incoming datagrams with problems ICMP message not sent for ICMP message 10
  • 11. Error Detection Internet layer can detect a variety of errors: Checksum (header only!) TTL expires No route to destination network Can't deliver to destination host (e.g., no ARP reply) Internet layer discards datagrams with problems Some - e.g., checksum error - can't trigger error messages 11
  • 12. Types of Messages ICMP defines two types of messages: error and informational messages Error messages: Source quench Time exceeded Destination unreachable Redirect Fragmentation required Informational messages: Echo request/reply Address mask request/reply Router discovery 12
  • 13. ICMP: Message Types Type Message 0 Echo reply 3 Destination unreachable 4 Source quench 5 Redirect 8 Echo request 11 Time exceeded 12 Parameter unintelligible 13 Time-stamp request 14 Time-stamp reply 15 Information request 16 Information reply 17 Address mask request 18 Address mask reply 13
  • 14. ICMP Message Types Type Code Description Query Error Type Code Description Query Error 0 0 Echo reply • 5 Redirect 3 Destination unreachable: 0 Redirect for network • 0 Network unreachable • 1 Redirect for host • 1 Host unreachable • 2 Redirect for TOS and Net • 2 Protocol unreachable 3 Redirect for TOS and Host • • 3 Port unreachable • 8 0 Echo request • 4 Fragmentation needed • 9 0 Router advertisement • 5 Source route failed • 10 0 Router solicitation • 6 Destination network unknown 11 Time exceeded • 7 Destination host unknown 0 TTL equals 0 during transit • • 8 Source host isolated 1 TTL equals 0 during reassembly • 9 Destination net prohibited • 12 Parameter problem 10 Destination host prohibited • 0 IP header bad • 11 Network unreachable for TOS • 1 Required option missing • 12 Host unreachable for TOS • 13 0 Timestamp request • 13 Communication prohibited • 14 0 Timestamp reply • 14 Host precedence violation • 15 0 Information request • 15 Precedence cutoff in effect • 16 0 Information reply • 4 0 Source quench • 17 0 Address mask request • 18 0 Address mask reply • 14
  • 15. ICMP and Reachability An internet host, A, is reachable from another host, B, if datagrams can be delivered from A to B ping program tests reachability - sends datagram from B to A that A echoes back to B Uses ICMP echo request and echo reply messages Internet layer includes code to reply to incoming ICMP echo request messages 15
  • 16. Destination Unreachable Codes Code Meaning 0 Network unreachable 1 Host unreachable 2 Protocol unreachable 3 Port unreachable 4 Fragmentation need and don’t fragment bit set 5 Source route failed 6 Destination network unknown 7 Destination host unknown 8 Source host isolated 9 Communication with dest net administratively prohibited 10 Communication with dest host administratively prohibited 11 Network unreachable for type of service 12 Host unreachable for type of service 16
  • 17. ICMP Unreachable Error Unreachable errors are generate for a number of reasons network unreachable host unreachable type (3) code (0-15) 16-bit checksum unused (must be 0) IP header (including options) + first 8 bytes of IP datagram data 17
  • 18. Handling of ICMP Messages Type Code Description Handled by 0 0 Echo reply User process 3 Destination unreachable: 0 Network unreachable “No route to host” 1 Host unreachable “No route to host” 2 Protocol unreachable “Connection refused” 3 Port unreachable “Connection refused” 4 Fragmentation needed “Message too long” 5 Source route failed “No route to host” 6 Destination network unknown “Network is unreachable” 7 Destination host unknown “No route to host” 8 Source host isolated “No route to host” 9 Destination net prohibited “Network is unreachable” 10 Destination host prohibited “No route to host” 11 Network unreachable for TOS “Network is unreachable” 12 Host unreachable for TOS “No route to host” 13 Communication prohibited (ignored) 14 Host precedence violation (ignored) 15 Precedence cutoff in effect (ignored) 4 0 Source quench Kernel for TCP; ignored by UDP 18
  • 19. Handling of ICMP Messages Type Code Description Handled by 5 Redirect 0 Redirect for network Kernel updates routing table 1 Redirect for host Kernel updates routing table 2 Redirect for TOS and Net Kernel updates routing table 3 Redirect for TOS and Host Kernel updates routing table 8 0 Echo request Kernel generates reply 9 0 Router advertisement User process 10 0 Router solicitation User process 11 Time exceeded 0 TTL equals 0 during transit User process 1 TTL equals 0 during reassembly User process 12 Parameter problem 0 IP header bad “Protocol not available” 1 Required option missing “Protocol not available” 13 0 Timestamp request Kernel generates reply 14 0 Timestamp reply User process 15 0 Information request Kernel generates reply 16 0 Information reply User process 17 0 Address mask request Kernel generates reply 18 0 Address mask reply User process 19
  • 20. Ping Program Ping stands for “Packet InterNet Groper” The ping program tests whether another host is reachable The program works by sending an ICMP echo request to a host, expecting an ICMP echo reply to be returned Normally ping is used as a diagnostic tool to test network connectivity 20
  • 21. Client/Server Programs Ping is is an example of a client/server program the client sends the request to a server the server returns the reply Most TCP/IP implementations support the ping server directly in the kernel 21
  • 22. Ping Implementation Unix implementations set the identifier field to the process ID of the sender The sequence number starts at 0 and is incremented every time a new echo request is sent Ping operates in one of two modes send a single request, if a response is received the host is alive send one request every second Ping in Action IP Record Route Option 22
  • 23. ICMP and Internet Routes List of all routers on path from A to B is called the route from A to B traceroute uses UDP to non-existent port and TTL field to find route via expanding ring search Sends ICMP echo messages with increasing TTL Router that decrements TTL to 0 sends ICMP time exceeded message, with router's address as source address First, with TTL 1, gets to first router, which discards and sends time exceeded message Next, with TTL 2, gets through first router to second router Continue until message from destination received traceroute must accommodate varying network delays Must also accommodate dynamically changing routes 23
  • 24. ICMP and Path MTU Discovery Fragmentation should be avoided How can source configure outgoing datagrams to avoid fragmentation? Source determines path MTU - smallest network MTU on path from source to destination Source probes path using IP datagrams with don't fragment flag Router responds with ICMP fragmentation required message Source sends smaller probes until destination reached 24
  • 25. Information Request/Reply: This request is intended for a diskless system to obtain its subnet mask Set source and destination addresses to 0 in the request and broadcast Server replies back with your IP address (Not used. Replaced by RARP and BOOTP) Address Mask Request/Reply: What is the subnet mask on this net? Replied by “Address mask agent” type (17 or 18) code (0) 16-bit checksum identifier (can be set to anything) sequence (can be set to anything) 32-bit subnet mask 25
  • 26. ICMP Messages: Fragmentation Required Fragmentation Required: Datagram was longer than MTU and “No Fragment bit” was set. 26
  • 27. ICMP Messages: Time Exceeded Time Exceeded: Time to live field in one of your packets became zero.” or “Reassembly timer expired at the destination. 27
  • 28. ICMP Messages: Redirect Default route may cause extra hop Router that forwards datagram on same interface sends ICMP redirect Host installs new route with correct router as next hop Host Y Router A Host Y is reachable in one hop through Router A IP Packet Redirection: “Next time, use Router A Host X for this destination host” Router B 28
  • 29. ICMP Messages: Redirect Redirect: Please send to router X instead of me. 0 = Redirect datagrams for the network 1 = Redirect datagrams for the host 2 = Redirect datagrams for the type of service and net 3 = Redirect datagrams for the type of service and host 29
  • 30. ICMP Timestamp Request & Reply Used to return the current time from another host Could be used for (primitive) time synchronization protocol, but NTP and XNTP do a much better job type (13 or 14) code (0) 16-bit checksum identifier (can be set to anything) sequence (can be set to anything) 32-bit originate timestamp 32-bit receive timestamp 32-bit transmit timestamp 30
  • 31. ICMP Timestamp Request & Reply The recommended value to be returned is the number of milliseconds since midnight, Coordinated Universal Time (UTC). A drawback is that only the time since midnight is returned. The caller must know the date form some other means 31
  • 32. ICMP Summary Internet layer provides best-effort delivery service May choose to report errors for some problems ICMP provides error message service ICMP is the control sibling of IP ICMP is used by IP and uses IP as network layer protocol - Encapsulated in IP datagram - Not reliable Feedback about problems e.g. time to live expired ICMP is used for ping, traceroute, and path MTU discovery Transfer of (control) messages from routers and hosts to hosts 32