Ping and Traceroute
Ping and Traceroute
Ping and Traceroute
Contents
1
1.1
History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2
1.3
Error indications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4
Message format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.1
ICMP packet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.2
Echo request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.3
Echo reply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.4
Payload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.5
Security considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.6
See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.7
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.8
External links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Traceroute
2.1
Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3
Origins
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4
See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.5
References
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6
External links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.7
2.7.1
Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.7.2
Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.7.3
Content license . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 1
com:
1.1 History
The ping utility was authored by Mike Muuss in December 1983 as a tool to troubleshoot problems in an IP network. He was inspired by a remark by David Mills on
using ICMP echo packets for IP network diagnosis and
measurements.[3] The author named it after the sound that
sonar makes, since its methodology is similar to sonars
echo location.[1][4]
RFC 1122 prescribes that any host must process an echorequest and issue an echo-reply in return.[5]
1.4.4 Payload
The payload of the packet is generally lled with ASCII
characters, as the output of the tcpdump utility shows:
16:24:47.966461 IP (tos 0x0, ttl 128, id 15103, oset 0, ags [none], proto: ICMP (1), length: 60)
192.168.146.22 > 192.168.144.5: ICMP echo request,
Generic composition of an ICMP 32-byte packet:[7]
id 1, seq 38, length 40 0x0000: 4500 003c 3a 0000
8001 5c55 c0a8 9216 E..<:.....\U.... 0x0010: c0a8
IP Header (in blue): protocol set to 1 (ICMP) and 9005 0800 4d35 0001 0026 6162 6364 ......M5...&abcd
0x0020: 6566 6768 696a 6b6c 6d6e 6f70 7172 7374
Type of Service set to 0.
efghijklmnopqrst 0x0030: 7576 7761 6263 6465 6667
ICMP Header (in red):
6869 uvwabcdefghi
1.4.1
ICMP packet
1.4.2
Echo request
1.7 References
[1] Mike Muuss. The Story of the PING Program.
Adelphi, MD, USA: U.S. Army Research Laboratory.
Archived from the original on 8 September 2010. Retrieved 8 September 2010. I named it after the sound that
a sonar makes, inspired by the whole principle of echolocation.
[2] Mills, D.L. (December 1983). Internet Delay Experiments. IETF. p. 1. STD 8. RFC 889. https://tools.ietf.
org/html/rfc889#page-1. Retrieved June 26, 2015.
[3] The Story of the PING Program, Mike Muuss
[4] Salus, Peter (1994). A Quarter Century of UNIX.
Addison-Wesley. ISBN 0-201-54777-5.
[5] RFC 1122 - Requirements for Internet Hosts -- Communication Layers. p. 42. Retrieved 2012-03-19. Every host MUST implement an ICMP Echo server function that receives Echo Requests and sends corresponding
Echo Replies.
[6] ICMP: Internet Control Message Protocol.
repo.hackerzvoice.net. January 13, 2000. Retrieved
December 4, 2014.
[7] RFC 792 - Internet Control Message Protocol.
Tools.ietf.org. Retrieved 2014-02-02.
[8] RFC Sourcebooks page on ICMP. Retrieved 20 December 2010.
[9] Shields Up, Firewall Test. Retrieved 4 June 2010. [text
shown if your computer replies to ping requests] Ping
is among the oldest and most common methods used to
locate systems prior to further exploitation.
[10] Windows rewall: how block ICMP echo response.
[11] redhat linux /proc/sys/net/ipv4 parameters.
Chapter 2
Traceroute
In computing, traceroute is a computer network diagnostic tool for displaying the route (path) and measuring transit delays of packets across an Internet Protocol
(IP) network. The history of the route is recorded as the
round-trip times of the packets received from each successive host (remote node) in the route (path); the sum
of the mean times in each hop indicates the total time
spent to establish the connection. Traceroute proceeds
unless all (three) sent packets are lost more than twice,
then the connection is lost and the route cannot be evaluated. Ping, on the other hand, only computes the nal
round-trip times from the destination point.
Hop 192.168.1.2 Depth 1 Probe status: unsuccessful Parent: () Return code: Label-switched at stack-depth 1
Sender timestamp: 2008-04-17 09:35:27 EDT 400.88
msec Receiver timestamp: 2008-04-17 09:35:27 EDT
427.87 msec Response time: 26.92 msec MTU: Unknown Multipath type: IP Address Range 1: 127.0.0.64
~ 127.0.0.127 Label Stack: Label 1 Value 299792 Protocol RSVP-TE
2.1 Implementation
Traceroute, by default, sends a sequence of User Datagram Protocol (UDP) packets addressed to a destination
host; ICMP Echo Request or TCP SYN packets can also
be used.[1] The time-to-live (TTL) value, also known as
hop limit, is used in determining the intermediate routers
being traversed towards the destination. Routers decre- The sender expects a reply within a specied number of
ment TTL values of packets by one when routing and dis- seconds. If a packet is not acknowledged within the excard packets whose TTL value has reached zero, return- pected interval, an asterisk is displayed. The Internet Pro4
2.3. ORIGINS
tocol does not require packets to take the same route towards a particular destination, thus hosts listed might be
hosts that other packets have traversed. If the host at hop
#N does not reply, the hop is skipped in the output.
2.3 Origins
The traceroute manual page states that the original traceroute program was written by Van Jacobson in 1987 from
a suggestion by Steve Deering, with particularly cogent
suggestions or xes from C. Philip Wood, Tim Seaver
and Ken Adelman. Also, the inventor of the ping program, Mike Muuss, states on his website that traceroute
was written using kernel ICMP support that he had earlier
The implementations of traceroute shipped with Linux, coded to enable raw ICMP sockets when he rst wrote the
FreeBSD, NetBSD, OpenBSD, DragonFly BSD, and OS ping program.[5]
X include an option to use ICMP Echo packets (-I), or
any arbitrary protocol (-P) such as UDP, TCP or ICMP.
On Linux, tracepath is a utility similar to traceroute,
2.4 See also
with the primary dierence of not requiring superuser
privileges.[3]
Looking Glass server
Cisco's implementation of traceroute also uses a sequence
MTR (software) computer software which comof UDP datagrams, each with incrementing TTL values,
bines the functionality of the traceroute and ping
to an invalid port number at the remote host; by default,
programs in a single network diagnostic tool
UDP port 33434 is used. Extended version of this command (known as the extended traceroute command) can
netsni-ng a Linux networking toolkit with an
change the destination port number used by the UDP
autonomous system traceroute utility
[4]
probe messages.
2.2 Usage
Most implementations include at least options to specify
the number of queries to send per hop, time to wait for a
response, the hop limit and port to use. Invoking traceroute with no specied options displays the list of available options, while man traceroute presents more details,
including the displayed error ags. Simple example on
Linux:
$ traceroute -w 3 -q 1 -m 16 example.com
In the example above, selected options are to wait for
three seconds (instead of ve), send out only one query
to each hop (instead of three), limit the maximum number of hops to 16 before giving up (instead of 30), with
example.com as the nal host.
This can help identify incorrect routing table denitions
PathPing a Windows NT network utility that combines the functionality of ping with that of traceroute
(or tracert)
2.5 References
[1] traceroute(8) - Linux man page. linux.die.net. Retrieved 2014-02-26.
[2] Comer, Douglas (2004). Computer Network and Internets
with Internet Applications. Pearson Education, Inc. pp.
360362. ISBN 0131433512.
[3] tracepath(8) Linux man page. linux.die.net. Retrieved
2015-06-21.
[4] Understanding the Ping and Traceroute Commands.
Cisco IOS Software Releases 12.1 Mainline. cisco.com.
2006-11-29. Retrieved 2013-12-08.
[5] The Story of the PING Program
CHAPTER 2. TRACEROUTE
This article is based on material taken from the Free Online Dictionary of Computing prior to 1 November 2008
and incorporated under the relicensing terms of the
GFDL, version 1.3 or later.
Text
2.7.2
Images
CHAPTER 2. TRACEROUTE
Contributors:
Created from scratch in Adobe Illustrator. Based on Image:Question book.png created by User:Equazcion Original artist:
Tkgd2007
File:Shot_of_Traceroute_on_Mac.png Source: https://upload.wikimedia.org/wikipedia/commons/f/f4/Shot_of_Traceroute_on_Mac.
png License: CC BY-SA 3.0 Contributors: Own work Original artist: Mylogon
File:Traceroute.png Source: https://upload.wikimedia.org/wikipedia/commons/6/66/Traceroute.png License: Public domain Contributors: Transferred from en.wikipedia Original artist: Original uploader was Jaho at en.wikipedia
2.7.3
Content license