Share to: share facebook share twitter share wa share telegram print page

Ping (networking utility)

Ping
Original author(s)Mike Muuss
Developer(s)Various open-source and commercial developers
Initial release1983; 41 years ago (1983)
PlatformCross-platform
TypeCommand
LicensePublic-domain, BSD, GPL, MIT

ping is a computer network administration software utility used to test the reachability of a host on an Internet Protocol (IP) network. It is available for virtually all operating systems that have networking capability, including most embedded network administration software.

Ping measures the round-trip time for messages sent from the originating host to a destination computer that are echoed back to the source. The name comes from active sonar terminology that sends a pulse of sound and listens for the echo to detect objects under water.[1]

Ping operates by means of Internet Control Message Protocol (ICMP) packets. Pinging involves sending an ICMP echo request to the target host and waiting for an ICMP echo reply. The program reports errors, packet loss, and a statistical summary of the results, typically including the minimum, maximum, the mean round-trip times, and standard deviation of the mean.

The command-line options of the ping utility and its output vary between the numerous implementations. Options may include the size of the payload, count of tests, limits for the number of network hops (TTL) that probes traverse, interval between the requests and time to wait for a response. Many systems provide a companion utility ping6, for testing on Internet Protocol version 6 (IPv6) networks, which implement ICMPv6.

History

DOS version of ping

The ping utility was written by Mike Muuss in December 1983 during his employment at the Ballistic Research Laboratory, now the US Army Research Laboratory. A remark by David Mills on using ICMP echo packets for IP network diagnosis and measurements prompted Muuss to create the utility to troubleshoot network problems.[1] The author named it after the sound that sonar makes, since its methodology is analogous to sonar's echolocation.[1][2] The backronym Packet InterNet Groper for PING has been used for over 30 years,[timeframe?] and although Muuss says that from his point of view PING was not intended as an acronym, he has acknowledged Mills' expansion of the name.[1][3] The first released version was public domain software; all subsequent versions have been licensed under the BSD license. Ping was first included in 4.3BSD.[4] The FreeDOS version was developed by Erick Engelke and is licensed under the GPL.[5] Tim Crawford developed the ReactOS version. It is licensed under the MIT License.[6]

RFC 1122 prescribes that any host must process ICMP echo requests and issue echo replies in return.[7]

Invocation example

The following is the output of running ping on Linux for sending five probes (1-second interval by default, configurable via -i option) to the target host www.example.com:

$ ping -c 5 www.example.com

PING www.example.com (93.184.216.34): 56 data bytes
64 bytes from 93.184.216.34: icmp_seq=0 ttl=56 time=11.632 ms
64 bytes from 93.184.216.34: icmp_seq=1 ttl=56 time=11.726 ms
64 bytes from 93.184.216.34: icmp_seq=2 ttl=56 time=10.683 ms
64 bytes from 93.184.216.34: icmp_seq=3 ttl=56 time=9.674 ms
64 bytes from 93.184.216.34: icmp_seq=4 ttl=56 time=11.127 ms

--- www.example.com ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 9.674/10.968/11.726/0.748 ms

The output lists each probe message and the results obtained. Finally, it lists the statistics of the entire test. In this example, the shortest round trip time was 9.674 ms, the average was 10.968 ms, and the maximum value was 11.726 ms. The measurement had a standard deviation of 0.748 ms.

Error indications

In cases of no response from the target host, most implementations display either nothing or periodically print notifications about timing out. Possible ping results indicating a problem include the following:

  • H, !N or !P – host, network or protocol unreachable
  • S – source route failed
  • F – fragmentation needed
  • U or !W – destination network/host unknown
  • I – source host is isolated
  • A – communication with destination network administratively prohibited
  • Z – communication with destination host administratively prohibited
  • Q – for this ToS the destination network is unreachable
  • T – for this ToS the destination host is unreachable
  • X – communication administratively prohibited
  • V – host precedence violation
  • C – precedence cutoff in effect

In case of error, the target host or an intermediate router sends back an ICMP error message, for example host unreachable or TTL exceeded in transit. In addition, these messages include the first eight bytes of the original message (in this case header of the ICMP echo request, including the quench value), so the ping utility can match responses to originating queries.[8]

Message format

ICMP packet

IPv4 datagram
  Bits 0–7 Bits 8–15 Bits 16–23 Bits 24–31
Header
(20 bytes)
Version/IHL Type of service (ToS) Length
Identification flags and offset
Time to live (TTL) Protocol Header checksum
Source IP address
Destination IP address
ICMP header
(8 bytes)
Type of message Code Checksum
Header data
ICMP payload
(optional)
Payload data
IPv6 datagram
  Bits 0–3 Bits 4–7 Bits 8–11 Bits 12–15 Bits 16–23 Bits 24–31
Header
(40 bytes)
Version Traffic class Flow label
Payload length Next header Hop limit
Source address (128 bits)
Destination address (128 bits)
ICMP6 header
(8 bytes)
Type of message Code Checksum
Header data
ICMP6 payload
(optional)
Payload data

Generic composition of an ICMP packet:[9]

  • IPv4 Header (in blue): protocol set to 1 (ICMP) and Type of Service set to 0.
  • IPv6 Header (in blue): Next Header set to 58 (ICMP6)
  • ICMP Header (in red):
    • Type of ICMP message (8 bits)
    • Code (8 bits)
    • Checksum (16 bits), the 16-bit ones' complement of the ones' complement sum of the packet. For IPv4, this is calculated from the ICMP message starting with the Type field[10] (the IP header is not included). For IPv6 this is calculated from the ICMP message, prepended with an IPv6 pseudo-header.[11]
    • Header Data (32 bits) field, which in this case (ICMP echo request and replies), will be composed of an identifier (16 bits) and sequence number (16 bits).
  • ICMP Payload: payload for the different kind of answers; can be an arbitrary length, left to implementation detail. However, the packet including IP and ICMP headers must be less than the maximum transmission unit of the network or risk being fragmented.

Echo request

The echo request (ping) is an ICMP/ICMP6 message.

00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Type = 8(IPv4, ICMP) 128(IPv6,ICMP6) Code = 0 Checksum
Identifier Sequence Number
Payload

The Identifier and Sequence Number can be used by the client to match the reply with the request that caused the reply. In practice, most Linux systems use a unique identifier for every ping process, and sequence number is an increasing number within that process. Windows uses a fixed identifier, which varies between Windows versions, and a sequence number that is only reset at boot time.

Echo reply

The echo reply is an ICMP message generated in response to an echo request; it is mandatory for all hosts and must include the exact payload received in the request.

00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Type = 0(IPv4,ICMP) 129(IPv6,ICMP6) Code = 0 Checksum
Identifier Sequence Number
Payload
  • The identifier and sequence number can be used by the client to associate each echo request with its reply.

Payload

The payload of the packet is generally filled with ASCII characters, as the output of the tcpdump utility shows in the last 32 bytes of the following example (after the eight-byte ICMP header starting with 0x0800):

16:24:47.966461 IP (tos 0x0, ttl 128, id 15103, offset 0, flags [none],
proto: ICMP (1), length: 60) 192.168.146.22 > 192.168.144.5: ICMP echo request,
id 1, seq 38, length 40
       0x0000:  4500 003c 3aff 0000 8001 5c55 c0a8 9216  E..<:.....\U....
       0x0010:  c0a8 9005 0800 4d35 0001 0026 6162 6364  ......M5...&abcd
       0x0020:  6566 6768 696a 6b6c 6d6e 6f70 7172 7374  efghijklmnopqrst
       0x0030:  7576 7761 6263 6465 6667 6869            uvwabcdefghi

The payload may include a timestamp indicating the time of transmission and a sequence number, which are not found in this example. This allows ping to compute the round trip time in a stateless manner without needing to record the time of transmission of each packet.

The payload may also include a magic packet for the Wake-on-LAN protocol, but the minimum payload, in that case, is longer than shown. The Echo Request typically does not receive any reply if the host was sleeping in hibernation state, but the host still wakes up from sleep state if its interface is configured to accept wakeup requests. If the host is already active and configured to allow replies to incoming ICMP Echo Request packets, the returned reply should include the same payload. This may be used to detect that the remote host was effectively woken up, by repeating a new request after some delay to allow the host to resume its network services. If the host was just sleeping in low power active state, a single request wakes up that host just enough to allow its Echo Reply service to reply instantly if that service was enabled. The host does not need to wake up all devices completely and may return to low-power mode after a short delay. Such configuration may be used to avoid a host to enter in hibernation state, with much longer wake-up delay, after some time passed in low power active mode.[citation needed]

Security loopholes

To conduct a denial-of-service attack, an attacker may send ping requests as fast as possible, possibly overwhelming the victim with ICMP echo requests. This technique is called a ping flood.[12]

Ping requests to multiple addresses, ping sweeps, may be used to obtain a list of all hosts on a network.

See also

References

  1. ^ a b c d Mike Muuss. "The Story of the PING Program". U.S. Army Research Laboratory. Archived from the original on 25 October 2019. Retrieved 8 September 2010. My original impetus for writing PING for 4.2a BSD UNIX came from an offhand remark in July 1983 by Dr. Dave Mills ... I named it after the sound that a sonar makes, inspired by the whole principle of echo-location ... From my point of view PING is not an acronym standing for Packet InterNet Grouper, it's a sonar analogy. However, I've heard second-hand that Dave Mills offered this expansion of the name, so perhaps we're both right.
  2. ^ Salus, Peter (1994). A Quarter Century of UNIX. Addison-Wesley. ISBN 978-0-201-54777-1.
  3. ^ Mills, D.L. (December 1983). Internet Delay Experiments. IETF. doi:10.17487/RFC0889. RFC 889. Retrieved 26 November 2019.
  4. ^ "man page ping section 8". www.manpagez.com.
  5. ^ "ibiblio.org FreeDOS Package -- ping (Networking)". www.ibiblio.org.
  6. ^ "GitHub - reactos/reactos: A free Windows-compatible Operating System". 8 August 2019 – via GitHub.
  7. ^ Braden, Robert T. (October 1989). Requirements for Internet Hosts -- Communication Layers. p. 42. doi:10.17487/RFC1122. RFC 1122. Every host MUST implement an ICMP Echo server function that receives Echo Requests and sends corresponding Echo Replies.
  8. ^ "ICMP: Internet Control Message Protocol". repo.hackerzvoice.net. 13 January 2000. Archived from the original on 4 August 2016. Retrieved 4 December 2014.
  9. ^ Postel, J. (September 1981). "RFC 792 - Internet Control Message Protocol". Tools.ietf.org. doi:10.17487/RFC0792. Retrieved 2 February 2014. {{cite journal}}: Cite journal requires |journal= (help)
  10. ^ "RFC Sourcebook's page on ICMP". Archived from the original on 6 July 2018. Retrieved 20 December 2010.
  11. ^ Gupta, Mukesh; Conta, Alex (March 2006). Gupta, M (ed.). "RFC 4443 - Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification". doi:10.17487/RFC4443. Retrieved 10 April 2020. {{cite journal}}: Cite journal requires |journal= (help)
  12. ^ "What is a Ping Flood | ICMP Flood | DDoS Attack Glossary | Imperva". Learning Center. Retrieved 26 July 2021.

Further reading

External links

Read more information:

Gila GamlielLahir24 Februari 1974 (umur 50)Tempat lahirGedera, IsraelKnesset16, 18, 19, 20, 21, 22, 23, 24Faksi yang diwakili di Knesset2003–2006Likud2009–LikudJabatan menteri2015–2020Menteri Kesetaraan Sosial2020–Menteri Perlindungan Lingkungan Hidup Gila Gamliel (Ibrani: גִּלָּה גַּמְלִיאֵל, lahir 24 Februari 1974) adalah seorang politikus asal Israel yang sekarang menjabat sebagai anggota Knesset untuk Likud, dan Menteri Perlindungan Lingkungan Hidup. Ia sebelum…

In number theory, Cramér's conjecture, formulated by the Swedish mathematician Harald Cramér in 1936,[1] is an estimate for the size of gaps between consecutive prime numbers: intuitively, that gaps between consecutive primes are always small, and the conjecture quantifies asymptotically just how small they must be. It states that p n + 1 − p n = O ( ( log ⁡ p n ) 2 ) ,   {\displaystyle p_{n+1}-p_{n}=O((\log p_{n})^{2}),\ } where pn denotes the nth prime number, O is…

Dua puluh dua distrik (shabiya) di Libya saat ini (sejak tahun 2007) Distrik adalah wilayah administratif tingkat satu di Libya. Lihat pula ISO 3166-2:LY lbsDistrik di Libya sejak 2007Al Bayda · Al Butnan · Al Jabal al Akhdar · Al Jabal al Gharbi · Al Jfara · Al Jufrah · Al Kufrah · Al Marj · Al Murgub · An Nuqat al Khams · Al Wahat · Az Zawiyah · Benghazi ·&#…

BojongDesaNegara IndonesiaProvinsiJawa BaratKabupatenPangandaranKecamatanParigiKode pos46519[1]Kode Kemendagri32.18.01.2004 Luas... km²Jumlah penduduk... jiwaKepadatan... jiwa/km² Untuk kegunaan lain, lihat Bojong. Bojong adalah desa di kecamatan Parigi, Kabupaten Pangandaran, Jawa Barat, Indonesia. Citumang Referensi ^ Kode Pos Kecamatan Parigi Pranala luar (Indonesia) Keputusan Menteri Dalam Negeri Nomor 050-145 Tahun 2022 tentang Pemberian dan Pemutakhiran Kode, Data Wilayah Ad…

Часть серии статей о Холокосте Идеология и политика Расовая гигиена · Расовый антисемитизм · Нацистская расовая политика · Нюрнбергские расовые законы Шоа Лагеря смерти Белжец · Дахау · Майданек · Малый Тростенец · Маутхаузен · …

Independent State of Papua New GuineaIndependen Stet bilong Papua NiuginiPapua Niu Gini Flagga Statsvapen Valspråk: Unity in diversity Nationalsång: O arise all you sons of this land läge Huvudstad(även största stad) Port Moresby Officiella språk engelska, hiri motu, tok pisin Demonym papuan[1] Statsskick Monarki (samväldesrike)  -  Kung Charles III  -  Generalguvernör Bob Dadae  -  Premiärminister James Marape Självständighet från Australien&#…

Peta menunjukan jaringan kereta api India. Transportasi rel umumnya digunakan untuk transportasi jarak jauh di India. Hampir seluruh pengoperasian kereta api di India ditangani oleh perusahaan negeri, Indian Railways, di bawah Departemen Kereta Api. Jalur ini dikatakan sebagai jaringan terbesar ke-2 di dunia. Sarana dan Prasarana Umumnya di India menggunakan rel berukuran 1,676 mm atau rel lebar, hal ini dikarenakan India merupakan salah satu negara dengan penduduk terbanyak di dunia sehing…

سفارة البرتغال في المملكة المتحدة البرتغال المملكة المتحدة الإحداثيات 51°29′59″N 0°09′19″W / 51.4996°N 0.155194°W / 51.4996; -0.155194 البلد المملكة المتحدة  المكان لندن الاختصاص المملكة المتحدة  الموقع الالكتروني الموقع الرسمي تعديل مصدري - تعديل   سفارة البرتغال في الممل…

Stade ReimsNama lengkapStade de Reims-ChampagneBerdiri1911StadionStadion Auguste Delaune, Reims(Kapasitas: 21.684)KetuaJean-Pierre CaillotManajerWilliam Still [[1]]LigaLigue 12013–14ke-11, Ligue 1Situs webSitus web resmi klub Kostum kandang Kostum tandang Kostum ketiga Musim ini Stade de Reims adalah tim sepak bola Prancis yang saat ini bermain di divisi dua liga Prancis. Tim yang bermarkas di kota Reims ini memiliki prestasi gemilang pada dekade tahun 1950 hingga awal tahun 1960. Saat in…

Rumah Sakit Umum DaerahDr. Moewardiꦫꦸꦩꦃ​ꦱꦏꦶꦠ꧀​ꦈꦩꦸꦩ꧀​ꦝꦲꦺꦫꦃ​ꦝꦺꦴꦏ꧀ꦠꦼꦂ​ꦩꦺꦴꦮꦼꦮꦂꦢꦶRumah Sakit Umum Dhaérah Dhokter MoewardiPemerintah Provinsi Jawa TengahGeografiLokasiJl. Kolonel Sutarto 132, Kota Surakarta, Jawa Tengah, IndonesiaOrganisasiAsuransi kesehatanBPJS KesehatanPendanaanRumah sakit publikJenisRumah sakit umumAfiliasi dengan universitasFakultas Kedokteran Universitas Sebelas MaretPelayananStandar pelayanan (ti…

Election in Pennsylvania Main article: 1824 United States presidential election 1824 United States presidential election in Pennsylvania ← 1820 October 26 – December 2, 1824 1828 →   Nominee Andrew Jackson John Quincy Adams William H. Crawford Party Democratic-Republican Democratic-Republican Democratic-Republican Home state Tennessee Massachusetts Georgia Running mate John C. Calhoun John C. Calhoun Nathaniel Macon Electoral vote 28 0 0 Popular v…

Not to be confused with Kunten. Municipality in Aargau, SwitzerlandKüntenMunicipality Coat of armsLocation of Künten KüntenShow map of SwitzerlandKüntenShow map of Canton of AargauCoordinates: 47°24′N 8°20′E / 47.400°N 8.333°E / 47.400; 8.333CountrySwitzerlandCantonAargauDistrictBadenArea[1] • Total4.89 km2 (1.89 sq mi)Elevation425 m (1,394 ft)Population (31 December 2018)[2] • Total1,749…

Antipaus Benediktus XIII Benediktus XIII (25 November 1328 – 23 Mei 1423), dikenal dengan julukan el Papa Luna dalam bahasa Aragon dan Spanyol, adalah orang Aragon dan secara resmi dianggap oleh Gereja Katolik Roma sebagai seorang Antipaus. Benediktus XIII ini berbeda dengan Paus Benediktus XIII dari Gereja Katolik Roma yang memerintah dari tanggal 27 Mei 1724 hingga 21 Februari 1730. Masa Muda Pedro Martínez de Luna lahir di Illueca, Aragon (bagian dari Spanyol sekarang) pada t…

Untuk kegunaan lain, lihat Caplak (disambiguasi). Caplak Caplak Ixodes scapularis dewasa Klasifikasi ilmiah Kerajaan: Animalia Filum: Arthropoda Subfilum: Chelicerata Kelas: Arachnida Superordo: Parasitiformes Ordo: Ixodida Superfamili: Ixodoidea Familia Ixodidae - Caplak keras Argasidae - Caplak lunak Nuttalliellidae Diversitas [[Tick|18 genera, ca. 900 jenis]] Caplak atau dikenali dengan nama lainnya di Sumatra, Kalimantan, dan Semenanjung Malaya Sengkenit, cengkenit, kutu babi, tempiras, atau…

Bulgarian footballer Galin Ivanov Ivanov with Slavia Sofia in 2013Personal informationFull name Galin Stefanov IvanovDate of birth (1988-04-15) 15 April 1988 (age 35)Place of birth Kazanlak, BulgariaHeight 1.78 m (5 ft 10 in)Position(s) Attacking midflelder / WingerTeam informationCurrent team Slavia SofiaNumber 33Youth career0000–2000 Rozova Dolina2000–2005 Trayana Stara Zagora2006 Levski SofiaSenior career*Years Team Apps (Gls)2006 Levski Sofia 1 (0)2006–2007 Beroe St…

وايومينغ الإحداثيات 42°49′31″N 78°05′07″W / 42.8253°N 78.0853°W / 42.8253; -78.0853  [1] تقسيم إداري  البلد الولايات المتحدة[2]  التقسيم الأعلى مقاطعة وايومينغ  خصائص جغرافية  المساحة 1.732336 كيلومتر مربع1.732337 كيلومتر مربع (1 أبريل 2010)  ارتفاع 301 متر  عدد السكان …

Glen MillsWest Chester Railroad tourist train stationRestored Glen Mills stationGeneral informationLocation130 Glen Mills RoadGlen Mills, PennsylvaniaCoordinates39°55′12″N 75°29′25″W / 39.9199°N 75.4904°W / 39.9199; -75.4904Owned byWest Chester RailroadLine(s)Pennsylvania Railroad, SEPTA R3 West Chester LinePlatforms1 side platformTracks1ConstructionStructure typeQueen Anne gothicHistoryOpened1882, 1997 (as heritage railway)ClosedSeptember 19, 1986[1&…

Village in Rhode Island, US View from Point Judith ferry dock Point Judith is a village and a small cape, on the coast of Narragansett, Rhode Island, on the western side of Narragansett Bay where it opens out onto Rhode Island Sound. It is the location for the year-round ferry service that connects Block Island to the mainland[1] and contains the fishing hamlet of Galilee, Rhode Island. Map showing Point Judith Point Judith by William Trost Richards History Point Judith was either named …

CHR radio station in Augusta, Maine WMME-FMAugusta, MaineBroadcast areaSouth-Central MaineFrequency92.3 MHzBranding92 MooseProgrammingFormatTop 40 (CHR)AffiliationsCompass Media NetworksOwnershipOwnerTownsquare Media(Townsquare License, LLC)Sister stationsWEBB, WJZNHistoryFirst air dateJanuary 14, 1981 (1981-01-14)[1]Former call signsWSCL (1981–1983)WRDO-FM (1983–1987)Former frequencies92.1 MHz (1981–1982)Call sign meaningMoose MainETechnical informationFacility ID52…

Town in the state of Maine, United States Town in Maine, United StatesPembroke, MaineTownUnion Square in 2012Pembroke, MaineLocation within the state of MaineCoordinates: 44°56′55″N 67°10′35″W / 44.94861°N 67.17639°W / 44.94861; -67.17639CountryUnited StatesStateMaineCountyWashingtonIncorporated1832Area[1] • Total35.26 sq mi (91.32 km2) • Land27.36 sq mi (70.86 km2) • Water7.90 sq&#…

Kembali kehalaman sebelumnya