-
Notifications
You must be signed in to change notification settings - Fork 3
/
traceroute.8
861 lines (831 loc) · 28.8 KB
/
traceroute.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
.\" Copyright(c) 2023 Alessandro Improta, Luca Sani, Catchpoint Systems, Inc.
.\" Copyright (c) 2006 Dmitry Butskoy ([email protected])
.\" License: GPL v2 or any later version
.\" See COPYING for the status of this software
.TH TRACEROUTE 8 "27 October 2023" "Traceroute" "Traceroute For Linux"
.\" .UC 6
.SH NAME
traceroute \- print the route packets trace to network host
.SH SYNOPSIS
.na
.BR traceroute " [" \-46dFITUnreAV "] [" "\-f first_ttl" "] [" "\-g gate,..." ]
.br
.ti +8
.BR "" [ "-H max_consecutive_hop_failures" "] [" "--failures max_consecutive_hop_failures" "]
.ti +8
.BR "" [ "-i device" "] [" "-m max_ttl" "] [" "-p port" "] [" "-s src_addr" ]
.br
.ti +8
.BR "" [ "-q nqueries" "] [" "-N squeries" "] [" "-t tos" ]
.ti +8
.BR "" [ "-Q timeout" "] [" "--timeout timeout" "]
.br
.ti +8
.BR "" [ "-l flow_label" "] [" "-w waittimes" "] [" "-z sendwait" "] [" "-UL" "] [" "-D" ]
.br
.ti +8
.BR "" [ "-P proto" "] [" "--sport=port" "] [" "-M method" "] [" "-O mod_options" ]
.br
.ti +8
.BR "" [ "--mtu" "] [" "--back" ]
.br
.ti +8
.BR "" [ "--tcpinsession" "]
.br
.ti +8
.BR "" [ "--ecn=num" "] [" "--dscp=num" "]
.br
.ti +8
.BR "" [ "--quic ]
.br
.ti +8
.BR "" [ "--loose-match ]
.br
.BR host " [" "packet_len" "]"
.br
.BR traceroute6
.RI " [" options ]
.ad
.SH DESCRIPTION
.I traceroute
tracks the route packets taken from an IP network on their
way to a given host. It utilizes the IP protocol's time to live (TTL) field
and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway
along the path to the host.
.P
.I traceroute6
is equivalent to
.I traceroute
.B \-6
.PP
The only required parameter is the name or IP address of the
destination
.BR host \ .
The optional
.B packet_len\fR`gth
is the total size of the probing packet (default 60 bytes
for IPv4 and 80 for IPv6). The specified size can be ignored
in some situations or increased up to a minimal value.
.PP
This program attempts to trace the route an IP packet would follow to some
internet host by launching probe
packets with a small ttl (time to live) then listening for an
ICMP "time exceeded" reply from a gateway. We start our probes
with a ttl of one and increase by one until we get an ICMP "port
unreachable" (or TCP reset), which means we got to the "host", or hit a max (which
defaults to 30 hops). Three probes (by default) are sent at each ttl setting
and a line is printed showing the ttl, address of the gateway and
round trip time of each probe. The address can be followed by additional
information when requested. If the probe answers come from
different gateways, the address of each responding system will
be printed. If there is no response within a certain timeout,
an "*" (asterisk) is printed for that probe.
.PP
After the trip time, some additional annotation can be printed:
.BR !H ,
.BR !N ,
or
.B !P
(host, network or protocol unreachable),
.B !S
(source route failed),
.B !F
(fragmentation needed),
.B !X
(communication administratively prohibited),
.B !V
(host precedence violation),
.B !C
(precedence cutoff in effect), or
.B !<num>
(ICMP unreachable code <num>).
If almost all the probes result in some kind of unreachable, traceroute
will give up and exit.
.PP
We don't want the destination host to process the UDP probe packets,
so the destination port is set to an unlikely value (you can change it with the
.B \-p
flag). There is no such a problem for ICMP or TCP tracerouting (for TCP we
use half-open technique, which prevents our probes to be seen by applications
on the destination host).
.PP
In the modern network environment the traditional traceroute methods
can not be always applicable, because of widespread use of firewalls.
Such firewalls filter the "unlikely" UDP ports, or even ICMP echoes.
To solve this, some additional tracerouting methods are implemented
(including tcp), see
.B LIST OF AVAILABLE METHODS
below. Such methods try to use particular protocol
and source/destination port, in order to bypass firewalls (to be seen
by firewalls just as a start of allowed type of a network session).
.SH OPTIONS
.TP
.BI \--help
Print help info and exit.
.TP
.BR \-4 ", " \-6
Explicitly force IPv4 or IPv6 tracerouting. By default, the program
will try to resolve the name given, and choose the appropriate
protocol automatically. If resolving a host name returns both
IPv4 and IPv6 addresses,
.I traceroute
will use IPv4.
.TP
.B \-I, \-\-icmp
Use ICMP ECHO for probes
.TP
.B \-T, \-\-tcp
Use TCP SYN for probes
.TP
.B \-\-tcpinsession
Use TCP InSession. See https://www.catchpoint.com/blog/traceroute-insession-catchpoints-effort-towards-a-more-reliable-network-diagnostic-tool
.TP
.B \-d, --debug
Enable socket level debugging (when the Linux kernel supports it)
.TP
.B \-F, --dont-fragment
Do not fragment probe packets. (For IPv4 it also sets DF bit, which tells
intermediate routers not to fragment remotely as well).
.br
Varying the size of the probing packet by the
.B packet_len
command line parameter, you can manually obtain information
about the MTU of individual network hops. The
.B \--mtu
option (see below) tries to do this automatically.
.br
.br
Note, that non-fragmented features (like
.B \-F
or
.B \--mtu\fR)
work properly since the Linux kernel 2.6.22 only.
Before that version, IPv6 was always fragmented, IPv4 could use
the once the discovered final mtu only (from the route cache), which can be
less than the actual mtu of a device.
.TP
.B \-Q, --timeout
Specifies the overall timeout in seconds for the tool execution (max 65535 seconds).
.br
.TP
.B \-H, --failures
Sets the max number of consecutive hops that can fail before terminating traceroute.
By default this limit is set to max_hops (255), but it can be changed via this option.
An hop is considered to be "failed" when all the probes within the probe timeout.
.TP
.BI \-f " first_ttl" ", --first=" first_ttl
Specifies with what TTL to start. Defaults to 1.
.TP
.BI \-g " gateway" ", --gateway=" gateway
Tells traceroute to add an IP source routing option to the outgoing
packet that tells the network to route the packet through the
specified
.IR gateway
(most routers have disabled source routing for security reasons).
In general, several
.IR gateway\fR's
is allowed (comma separated). For IPv6, the form of
.IR num\fB,\fIaddr\fB,\fIaddr...
is allowed, where
.IR num
is a route header type (default is type 2). Note the type 0 route header
is now deprecated (rfc5095).
.TP
.BI \-i " interface" ", --interface=" interface
Specifies the interface through which
.I traceroute
should send packets. By default, the interface is selected
according to the routing table.
.TP
.BI \-m " max_ttl" ", --max-hops=" max_ttl
Specifies the maximum number of hops (max time-to-live value)
.I traceroute
will probe. The default is 30, the max is 255.
.TP
.BI \-N " squeries" ", --sim-queries=" squeries
Specifies the number of probe packets sent out simultaneously.
Sending several probes concurrently can speed up
.I traceroute
considerably. The default value is 16.
.br
Note that some routers and hosts can use ICMP rate throttling. In such
a situation specifying too large number can lead to loss of some responses.
.TP
.BI \-n
Do not try to map IP addresses to host names when displaying them.
.TP
.BI \-p " port" ", --port=" port
For UDP tracing, specifies the destination port base
.I traceroute
will use (the destination port number will be incremented by each probe).
.br
For ICMP tracing, specifies the initial ICMP sequence value (incremented
by each probe too).
.br
For TCP and others specifies just the (constant) destination
port to connect.
.TP
.BI \-t " tos" ", --tos=" num
For IPv4, set the Type of Service (TOS) and Precedence value. Useful values
are 16 (low delay) and 8 (high throughput). Note that in order to use
some TOS precedence values, you have to be super user.
This option excludes --ecn and -dscp. Allowed values are between
0 and 255.
.br
For IPv6, set the Traffic Control value.
.TP
.BI \-\-ecn=num
Set the ECN value in the Type of Service (TOS) field. ECN (rfc3168) values can either
be 0 for non-ECT, 1 for ECT(0), 2 for ECT(1) and 3 for CE. Traceroute will
report the ECN value for each expiring probe. This option excludes -t (--tos) and
might be used in conjunction with --dscp. Allowed values are between 0 and 3.
.TP
.BI \-\-dscp=dscp
Set the DSCP value in the Type of Service (TOS) field.
This option excludes -t (--tos) and might be used in conjunction with --ecn.
Allowed values are between 0 and 63.
.TP
.BI \-l " flow_label" ", --flowlabel=" flow_label
Use specified flow_label for IPv6 packets.
.TP
.BI \-w " max\fR[\fB,\fIhere\fB,\fInear\fR]" ", --wait=" max\fR[\fB,\fIhere\fB,\fInear\fR]
Determines how long to wait for a response to a probe.
.br
.br
There are three (in general) float values separated by a comma
(or a slash).
.IR Max
specifies the maximum time (in seconds, default 5.0) to wait, in any case.
.br
.br
Traditional traceroute implementation always waited whole
.IR max
seconds for any probe. But if we already have some replies from the
.B same
hop, or even from some
.B next
hop, we can use the round trip time of such a reply as a hint
to determine the actual reasonable amount of time to wait.
.br
.br
The optional
.IR here
(default 3.0) specifies a factor to multiply the round trip time of an already
received response from the
.B same
hop. The resulting value is used as a timeout for the probe, instead of
(but no more than)
.IR max\fR.
The optional
.IR near
(default 10.0) specifies a similar factor for a response from some
.B next
hop.
(The time of the first found result is used in both cases).
.br
.br
First, we look for the
.B same
hop (of the probe which will be printed first from now).
If nothing found, then look for some
.B next
hop. If nothing found, use
.IR max\fR.
If
.IR here
and/or
.IR near
have zero values, the corresponding computation is skipped.
.br
.IR Here
and
.IR near
are always set to zero if only
.IR max
is specified (for compatibility with previous versions).
.TP
.BI \-q " nqueries" ", --queries=" nqueries
Sets the number of probe packets per hop. The default is 3, the max is 10.
.TP
.BI \-r
Bypass the normal routing tables and send directly to a host on
an attached network. If the host is not on a directly-attached
network, an error is returned. This option can be used to ping a
local host through an interface that has no route through it.
.TP
.BI \-s " source_addr" ", --source=" source_addr
Chooses an alternative source address. Note that you must select the
address of one of the interfaces.
By default, the address of the outgoing interface is used.
.TP
.BI \-z " sendwait" ", --sendwait=" sendwait
Minimal time interval between probes (default 0).
If the value is more than 10, then it specifies a number in milliseconds,
else it is a number of seconds (float point values allowed too).
Useful when some routers use rate-limit for ICMP messages.
.TP
.B \-e, \-\-extensions
Show ICMP extensions (rfc4884). The general form is
.I CLASS\fB/\fITYPE\fB:
followed by a hexadecimal dump.
The MPLS (rfc4950) is shown parsed, in a form:
.B MPLS:L=\fIlabel\fB,E=\fIexp_use\fB,S=\fIstack_bottom\fB,T=\fITTL
(more objects separated by
.B /
).
.TP
.B \-A, \-\-as\-path\-lookups
Perform AS path lookups in routing registries and print results
directly after the corresponding addresses.
.TP
.B \-V, \-\-version
Print the version and exit.
.br
.P
There are additional options intended for advanced usage
(such as alternate trace methods etc.):
.TP
.B \--sport\fR=\fIport
Chooses the source port to use. Implies
.B \-N\ 1\fR\ -w\ 5 .
Normally source ports (if applicable) are chosen by the system.
.TP
.B \--fwmark\fR=\fImark
Set the firewall mark for outgoing packets (since the Linux kernel 2.6.25).
.TP
.BI \-M " method" ", --module=" name
Use specified method for traceroute operations. Default traditional udp method
has name
.IR default ,
icmp
.BR "" ( "-I" ) "
and tcp
.BR "" ( "-T" ) "
have names
.I icmp
and
.I tcp
respectively.
.br
Method-specific options can be passed by
.BR \-O\ .
Most methods have their simple shortcuts,
.BR "" ( "-I " means " -M icmp" ,
etc).
.TP
.BI \-O " option" ", --options=" options
Specifies some method-specific option. Several options are separated by comma (or use several
.B \-O
on cmdline).
Each method may have its own specific options, or many not have them at all.
To print information about available options, use
.BR \-O\ help .
.TP
.B \-U, \-\-udp
Use UDP to particular destination port for tracerouting (instead of increasing
the port per each probe). Default port is 53 (dns).
.TP
.BI \-UL
Use UDPLITE for tracerouting (default port is 53).
.TP
.B \-D, \-\-dccp
Use DCCP Requests for probes.
.TP
.BI \-P " protocol" ", --protocol=" protocol
Use raw packet of specified protocol for tracerouting. Default protocol is
253 (rfc3692).
.TP
.BI \--mtu
Discover MTU along the path being traced. Implies
.BR \-F\ \-N\ 1 .
New
.I mtu
is printed once in a form of
.B F=\fINUM
at the first probe of a hop which requires such
.I mtu
to be reached. (Actually, the correspond "frag needed" icmp message
normally is sent by the previous hop).
.br
.br
Note, that some routers might cache once the seen information
on a fragmentation. Thus you can receive the final mtu from a closer hop.
Try to specify an unusual
.I tos
by
.B \-t
, this can help for one attempt (then it can be cached there as well).
.br
See
.B \-F
option for more info.
.TP
.BI \--back
Print the number of backward hops when it seems different with the forward
direction. This number is guessed in assumption that remote hops send reply
packets with initial ttl set to either 64, or 128 or 255 (which seems
a common practice). It is printed as a negate value in a form of '-NUM' .
.TP
.BI \--quic
Use QUIC Initial packets for probes
.TP
.BI \--loose-match
Run in "Loose match" mode. When running in this mode traceroute opens an additional
raw ICMP socket (the same used to report ToS/DSCP/ECN value in output)
where all ICMP error packets (e.g. ICMP_TTL_EXCEEDED) are received and filtered
ignoring the source address of the encapsulated probe - hereafter called the offending probe.
This allows traceroute to run properly in Azure environments, where the source IP of the
offending probe is left to the public IP address of the Azure network instead
of being translated back to the private address of the original sending interface.
This is problematic because ICMP error packets having this characterstic are discarded
by the kernel and thus they are never delivered to the application layer (traceroute).
Note that probes are sent in the same way as usual, i.e. via the dedicated protocol
sockets.
.br
.br
Skipping the check on the source address of the offending probe leaves enough checks to be sure that
the ICMP error packet is acceptable, and specifically that does not belong to another
traceroute process running on the same machine. Please note that the ICMP error
packet is actually addressed to the machine itself and thus is delievered to the raw ICMP socket.
These are the explicit checks done in the loose match scenario depending on the protocol being used:
.RS
.BI UDP:
An ICMP error packet is accepted if the destination IP, destination and source port of the
offending probe are equal to the destination IP, destination and source port of a probe sent.
Note that when running in UDP mode, the source port of the probe sent is determined
by the OS via the `bind` syscall, thus it is ensured to be unique across processes.
Note also that the source UDP port is preserved (or translated back) correctly
for this reason can be used in the checks (differently from the source IP).
.br
.BI ICMP:
An ICMP error packet is accepted if the Identifier and Sequence number fields
of the offending probe are equal to the Identfier and Sequence number fields of a
probe sent. Note that the Identifier field is the PID of the running
traceroute, thus it is ensured to be unique across processes.
.br
.BI TCP\ and\ TCP\ InSession:
An ICMP error packet is accepted if the destination IP, destination and source port
of the offending probe are equal to the destination IP, destination and source port of a
probe sent. Note that when running in TCP mode, the source port of the probe sent is determined
by the OS via the `bind` syscall, thus it is ensured to be unique across processes.
Note also that the source TCP port is preserved (or translated back) correctly
for this reason can be used in the checks (differently from the source IP).
Note that in TCP and TCP InSession mode the destination port is preserved
across probes.
Note also that the source TCP port is preserved (or translated back) correctly
for this reason can be used in the checks (differently from the source IP).
.br
.BI QUIC:
(type)
An ICMP error packet is accepted if the destination IP, destination and source port of the
offending probe are equal to the destination IP, destination and source port of a probe sent.
Please note that when running in QUIC mode, the source port of the sent probe is determined
by the OS via the `bind` syscall, thus it is ensured to be unique across processes.
Note that in QUIC mode the destination port is preserved
across probes.
Note also that the source QUIC port is preserved (or translated back) correctly
for this reason can be used in the checks (differently from the source IP).
.br
.br
Note that this mode works provided that ICMP inbound packets are allowed on the machine
where traceroute is running. On Azure they are not allowed by default and they
can be enabled provided that the Azure VM has also assigned a public IP.
.RE
.TP
.BI \--disable-extra-ping
Some methods may trigger an extra ping at the end if some conditions specific to the method are met.
This consist in sending
.BI nqueries
probes at destination.
The extra pings are reported after the last hop and are preceeded by a "+" symbol.
The number of the last hop is repeated, highlighting that these are extra pings for
the hop that reached the destination. This option is to disable the extra ping
mechanism regardles whether the method-specific conditions are met or not.
.br
.SH LIST OF AVAILABLE METHODS
In general, a particular traceroute method may have to be chosen by
.BR \-M\ name ,
but most of the methods have their simple cmdline switches
(you can see them after the method name, if present).
.SS default
The traditional, ancient method of tracerouting. Used by default.
.P
Probe packets are udp datagrams with so-called "unlikely" destination ports.
The "unlikely" port of the first probe is 33434, then for each next probe
it is incremented by one. Since the ports are expected to be unused,
the destination host normally returns "icmp unreach port" as a final response.
(Nobody knows what happens when some application listens for such ports,
though).
.P
This method is allowed for unprivileged users.
.SS icmp \ \ \ \-I
Most usual method for now, which uses icmp echo packets for probes.
.br
If you can ping(8) the destination host, icmp tracerouting is applicable
as well.
.P
This method may be allowed for unprivileged users
since the kernel 3.0 (IPv4, for IPv6 since 3.11), which supports new
.I dgram icmp
(or
.IR \fR"\fIping\fR")
sockets. To allow such sockets, sysadmin should provide
.I net/ipv4/ping_group_range
sysctl range to match any group of the user.
.br
Options:
.TP
.B raw
Use only raw sockets (the traditional way).
.br
This way is tried first by default (for compatibility reasons),
then new dgram icmp sockets as fallback.
.TP
.B dgram
Use only dgram icmp sockets.
.SS tcp \ \ \ \ \-T
Well-known modern method, intended to bypass firewalls.
.br
Uses the constant destination port (default is 80, http).
.P
If some filters are present in the network path, then most probably
any "unlikely" udp ports (as for
.I default
method) or even icmp echoes (as for
.IR icmp )
are filtered, and whole tracerouting will just stop at such a firewall.
To bypass a network filter, we have to use only allowed protocol/port
combinations. If we trace for some, say, mailserver, then more likely
.B \-T \-p 25
can reach it, even when
.B \-I
can not.
.P
This method uses well-known "half-open technique", which prevents
applications on the destination host from seeing our probes at all.
Normally, a tcp syn is sent. For non-listened ports we receive tcp reset,
and all is done. For active listening ports we receive tcp syn+ack, but
answer by tcp reset (instead of expected tcp ack), this way the remote tcp
session is dropped even without the application ever taking notice.
.P
There are a few options for
.I tcp
method:
.TP
.B syn,ack,fin,rst,psh,urg,ece,cwr
Sets specified tcp flags for probe packet, in any combination.
.TP
.B flags\fR=\fInum
Sets the flags field in the tcp header exactly to
.IR num .
.TP
.B ecn
Send syn packet with tcp flags ECE and CWR (for Explicit Congestion
Notification, rfc3168).
.IP
Extra pings may be launched at the end of the traceroute to
allow the proper reporting of TCP flags in case ECN has been set. In detail, the
extra pings are run if the following three conditions are met: i) the IP level
ECN value - herafter called IP-ECN - provided as input via the --ecn option is greater
than zero; ii) the TCP info option is set; iii) the TCP ECN is in use - either explicitly
via the TCP ecn option or implicitly via the /proc/sys/net/ipv4/tcp_ecn value.
The extra pings consist in sending nqueries probes to the last hop with
IP-ECN set to zero. Indeed, it has been experimentally observed that sending a SYN
with ECE and CWR flags set to 1 and an IP-ECN value different from zero may cause a
destination supporting ECN mechanism to send a SYN with ECE flag not set, thus claiming
that ECN mechanism is not supported. This is likely to happen because the original
rfc3168 does not allow TCP control packets (like a SYN) to have an IP-ECN value
different from zero.
.TP
.B sack,timestamps,window_scaling
Use the corresponding tcp header option in the outgoing probe packet.
.TP
.B sysctl
Use current sysctl
.IR "" ( "/proc/sys/net/*" )
setting for the tcp header options above and
.BR ecn
or
.BR acc-ecn .
Always set by default, if nothing else specified.
.TP
.B mss\fR=\fInum
Use value of
.I num
for maxseg tcp header option (when
.BR syn ).
.TP
.B info
Print tcp flags of final tcp replies when the target host is reached.
Allows to determine whether an application listens the port and
other useful things.
.TP
.B acc-ecn
Send syn packet with tcp flags ECE, CWR and AE for AccECN checks.
.IP
Used in conjunction with the TCP
.BR info
option, this can be useful to check whether the target host supports AccECN, similarly
to what can be done with the
.BR ecn
option.
At the time of writing this manual AccECN mechanism for TCP is not yet an RFC
and the latest proposed standard is the number 27 (https://datatracker.ietf.org/doc/html/draft-ietf-tcpm-accurate-ecn-27).
.P
Default options is
.BR syn,sysctl .
.br
.SS tcpconn
An initial implementation of tcp method, simple using connect(2) call,
which does full tcp session opening. Not recommended for normal use, because
a destination application is always affected (and can be confused).
.SS udp \ \ \ \ \-U
Use udp datagram with constant destination port (default 53, dns).
.br
Intended to bypass firewall as well.
.P
Note, that unlike in
.I tcp
method, the correspond application on the destination host
.B always
receive our probes (with random data), and most can easily be confused
by them. Most cases it will not respond to our packets though, so we will never
see the final hop in the trace. (Fortunately, it seems that at least
dns servers replies with something angry).
.P
This method is allowed for unprivileged users.
.SS udplite \ \ \-UL
Use udplite datagram for probes (with constant destination port,
default 53).
.P
This method is allowed for unprivileged users.
.br
Options:
.TP
.B coverage\fR=\fInum
Set udplite send coverage to
.IR num .
.SS dccp \ \ \-D
Use DCCP Request packets for probes (rfc4340).
.P
This method uses the same "half-open technique" as used for TCP.
The default destination port is 33434.
.P
Options:
.TP
.B service\fR=\fInum
Set DCCP service code to
.IR num
(default is 1885957735).
.SS raw \ \ \ \ \-P proto
Send raw packet of protocol
.IR proto .
.br
No protocol-specific headers are used, just IP header only.
.br
Implies
.B \-N\ 1\fR\ -w\ 5 .
.br
Options:
.TP
.B protocol\fR=\fIproto
Use IP protocol
.I proto
(default 253).
.SS tcpinsession
Opens a TCP connection with the destination and sends TCP probes within the opened connection.
The default destination port is 80.
.P
This method prevents false packet loss introduced by firewall and router configurations related to
security and ensures that packets follow a single flow, akin to a regular TCP session, to bypass load-balanced routers.
.P
This method uses the connect() syscall to open the session with the destination,
thus the content of /proc/sys/net/ipv4/* affects the flags and options sent during
the TCP handshake.
.P
Differently from other methods,
.I tcpinsession
will show an additional first line containing the RTT related to the initial TCP handshake ("hand"), as well as the TCP info requested
via the options described hereafter.
.P
Please bear in mind that with this method most of the usual TCP options are not available because probes being sent are data probes.
Thus it does not make sense -- for example -- to allow to set a SYN flag to data probes.
The options available for
.I tcpinsession
method are the following:
.TP
.B sack
Show whether the other party supports SACK or not in the syn/ack received from the destination during the initial TCP handshake.
.TP
.B mss
Show the value of maxseg tcp header option found in the syn/ack received from the destination during the initial TCP handshake.
.TP
.B info
Print tcp flags found in the syn/ack received from the destination during the initial TCP handshake.
.br
.SS quic
Performs a QUIC-based traceroute. QUIC Initial packets containing a CRYPTO
frame are used as probes. If the destination is reached and replies with a
QUIC packet, its type is included into the probe output to distinguish it from
an ICMP error that can be returned by the destination too (typically a port unreachable).
QUIC version currently supported is 1 and QUIC Probes are encrypted/decrypted
according to RFC9000/RFC9001. Retry packets are handled as per RFC, to maximize
the possiblity to get an Initial packet from the destination and the ECN
counters. Encryption and decryption routeines leverage openssl3, which is a required
dependency to run and compile the tool. If openssl3 is not available the tool
can still be compiled, but the QUIC method will not be available.
.br
.br
When a QUIC packet is received, additional information about the packet type
is reported within `< >`. The format is `<Q:packet type>`, where the following
packet types are expected:
.P
.RS
.BI I
Initial packet.
.br
.br
.BI R
Retry packet.
.br
.br
.BI V
Version Negotiation packet.
.br
.br
.BI U
(type)
Unexpected QUIC packet with its hex type.
.RE
Since this version of traceroute handles also Retry packets,
when a Retry packet is received the format will be <Q:R+I>.
.br
.br
When a non-zero ECN value is provided as input and the destination replies
with a packet (typically an Initial packet) containing an ACK frame that includes
ECN counters (0x03), information about the value of the counters are reported
within `< >`. The format is <ECT0:val,ECT1:val,ECN-CE:val>, where ECT0, ECT1
and ECN-CE are respectively the counters for the ECN codepoints ECT(0) (0x02),
ECT(1) (0x01) and CE (0x03).
.br
Options:
.TP
.B print_dest_rtt_mode\fR=\fImode
Controls which RTT(s) to print when a Retry packet is received. Possible modes are:
.br
.br
.BI all
(deafult): prints the RTT of both the Retry and Initial packets. The two RTTs are separated by a `+`.
.br
.br
.BI first
prints the RTT of the Initial packet.
.br
.br
.BI last
prints the RTT of the Retry packet.
.br
.br
.BI sum
prints the RTT as the sum of the Retry and Initial packets RTT.
.SH NOTES
.PP
To speed up work, normally several probes are sent simultaneously.
On the other hand, it creates a "storm of packages", especially
in the reply direction. Routers can throttle the rate of icmp responses,
and some of replies can be lost. To avoid this, decrease the number
of simultaneous probes, or even set it to 1 (like in initial traceroute
implementation), i.e.
.B \-N 1
.PP
The final (target) host can drop some of the simultaneous probes,
and might even answer only the latest ones. It can lead to extra
"looks like expired" hops near the final hop. We use a smart algorithm
to auto-detect such a situation, but if it cannot help in your case, just use
.B \-N 1
too.
.PP
For even greater stability you can slow down the program's work by
.B \-z
option, for example use
.B \-z 0.5
for half-second pause between probes.
.PP
To avoid an extra waiting, we use adaptive algorithm for timeouts (see
.B \-w
option for more info). It can lead to premature expiry
(especially when response times differ at times) and printing "*"
instead of a time. In such a case, switch this algorithm off, by specifying
.B \-w
with the desired timeout only (for example,
.B \-w 5\fR).
.PP
If some hops report nothing for every method, the last chance to obtain
something is to use
.B ping -R
command (IPv4, and for nearest 8 hops only).
.SH SEE ALSO
.BR ping (8),
.BR ping6 (8),
.BR tcpdump (8),
.BR netstat (8)