]> The Tcpdump Group git mirrors - tcpdump/blob - tcpdump.1.in
Revert "Clean a bunch of fuzzed files not to fuzz the container."
[tcpdump] / tcpdump.1.in
1 .\" $NetBSD: tcpdump.8,v 1.9 2003/03/31 00:18:17 perry Exp $
2 .\"
3 .\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
4 .\" The Regents of the University of California. All rights reserved.
5 .\" All rights reserved.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that: (1) source code distributions
9 .\" retain the above copyright notice and this paragraph in its entirety, (2)
10 .\" distributions including binary code include the above copyright notice and
11 .\" this paragraph in its entirety in the documentation or other materials
12 .\" provided with the distribution, and (3) all advertising materials mentioning
13 .\" features or use of this software display the following acknowledgement:
14 .\" ``This product includes software developed by the University of California,
15 .\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
16 .\" the University nor the names of its contributors may be used to endorse
17 .\" or promote products derived from this software without specific prior
18 .\" written permission.
19 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
20 .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
21 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 .\"
23 .TH TCPDUMP 1 "17 January 2022"
24 .SH NAME
25 tcpdump \- dump traffic on a network
26 .SH SYNOPSIS
27 .na
28 .B tcpdump
29 [
30 .B \-AbdDefhHIJKlLnNOpqStuUvxX#
31 ] [
32 .B \-B
33 .I buffer_size
34 ]
35 .br
36 .ti +8
37 [
38 .B \-c
39 .I count
40 ]
41 [
42 .B \-\-count
43 ]
44 [
45 .B \-C
46 .I file_size
47 ]
48 .ti +8
49 [
50 .B \-E
51 .I spi@ipaddr algo:secret,...
52 ]
53 .ti +8
54 [
55 .B \-F
56 .I file
57 ]
58 [
59 .B \-G
60 .I rotate_seconds
61 ]
62 [
63 .B \-i
64 .I interface
65 ]
66 .ti +8
67 [
68 .B \-\-immediate\-mode
69 ]
70 [
71 .B \-j
72 .I tstamp_type
73 ]
74 [
75 .B \-m
76 .I module
77 ]
78 .ti +8
79 [
80 .B \-M
81 .I secret
82 ]
83 [
84 .B \-\-number
85 ]
86 [
87 .B \-\-print
88 ]
89 .ti +8
90 [
91 .B \-\-print\-sampling
92 .I nth
93 ]
94 [
95 .B \-Q
96 .I in|out|inout
97 ]
98 [
99 .B \-r
100 .I file
101 ]
102 .ti +8
103 [
104 .B \-s
105 .I snaplen
106 ]
107 [
108 .B \-T
109 .I type
110 ]
111 [
112 .B \-\-version
113 ]
114 [
115 .B \-V
116 .I file
117 ]
118 .ti +8
119 [
120 .B \-w
121 .I file
122 ]
123 [
124 .B \-W
125 .I filecount
126 ]
127 [
128 .B \-y
129 .I datalinktype
130 ]
131 .ti +8
132 [
133 .B \-z
134 .I postrotate-command
135 ]
136 [
137 .B \-Z
138 .I user
139 ]
140 .ti +8
141 [
142 .BI \-\-time\-stamp\-precision= tstamp_precision
143 ]
144 .ti +8
145 [
146 .BI \-\-micro
147 ]
148 [
149 .BI \-\-nano
150 ]
151 .ti +8
152 [
153 .I expression
154 ]
155 .br
156 .ad
157 .SH DESCRIPTION
158 .LP
159 \fITcpdump\fP prints out a description of the contents of packets on a
160 network interface that match the Boolean \fIexpression\fP (see
161 .BR \%pcap-filter (@MAN_MISC_INFO@)
162 for the \fIexpression\fP syntax); the
163 description is preceded by a time stamp, printed, by default, as hours,
164 minutes, seconds, and fractions of a second since midnight. It can also
165 be run with the
166 .B \-w
167 flag, which causes it to save the packet data to a file for later
168 analysis, and/or with the
169 .B \-r
170 flag, which causes it to read from a saved packet file rather than to
171 read packets from a network interface. It can also be run with the
172 .B \-V
173 flag, which causes it to read a list of saved packet files. In all cases,
174 only packets that match
175 .I expression
176 will be processed by
177 .IR tcpdump .
178 .LP
179 .I Tcpdump
180 will, if not run with the
181 .B \-c
182 flag, continue capturing packets until it is interrupted by a SIGINT
183 signal (generated, for example, by typing your interrupt character,
184 typically control-C) or a SIGTERM signal (typically generated with the
185 .BR kill (1)
186 command); if run with the
187 .B \-c
188 flag, it will capture packets until it is interrupted by a SIGINT or
189 SIGTERM signal or the specified number of packets have been processed.
190 .LP
191 When
192 .I tcpdump
193 finishes capturing packets, it will report counts of:
194 .IP
195 packets ``captured'' (this is the number of packets that
196 .I tcpdump
197 has received and processed);
198 .IP
199 packets ``received by filter'' (the meaning of this depends on the OS on
200 which you're running
201 .IR tcpdump ,
202 and possibly on the way the OS was configured - if a filter was
203 specified on the command line, on some OSes it counts packets regardless
204 of whether they were matched by the filter expression and, even if they
205 were matched by the filter expression, regardless of whether
206 .I tcpdump
207 has read and processed them yet, on other OSes it counts only packets that were
208 matched by the filter expression regardless of whether
209 .I tcpdump
210 has read and processed them yet, and on other OSes it counts only
211 packets that were matched by the filter expression and were processed by
212 .IR tcpdump );
213 .IP
214 packets ``dropped by kernel'' (this is the number of packets that were
215 dropped, due to a lack of buffer space, by the packet capture mechanism
216 in the OS on which
217 .I tcpdump
218 is running, if the OS reports that information to applications; if not,
219 it will be reported as 0).
220 .LP
221 On platforms that support the SIGINFO signal, such as most BSDs
222 (including macOS) and Digital/Tru64 UNIX, it will report those counts
223 when it receives a SIGINFO signal (generated, for example, by typing
224 your ``status'' character, typically control-T, although on some
225 platforms, such as macOS, the ``status'' character is not set by
226 default, so you must set it with
227 .BR stty (1)
228 in order to use it) and will continue capturing packets. On platforms that
229 do not support the SIGINFO signal, the same can be achieved by using the
230 SIGUSR1 signal.
231 .LP
232 Using the SIGUSR2 signal along with the
233 .B \-w
234 flag will forcibly flush the packet buffer into the output file.
235 .LP
236 Reading packets from a network interface may require that you have
237 special privileges; see the
238 .BR pcap (3PCAP)
239 man page for details. Reading a saved packet file doesn't require
240 special privileges.
241 .SH OPTIONS
242 .TP
243 .B \-A
244 Print each packet (minus its link level header) in ASCII. Handy for
245 capturing web pages.
246 .TP
247 .B \-b
248 Print the AS number in BGP packets in ASDOT notation rather than ASPLAIN
249 notation.
250 .TP
251 .BI \-B " buffer_size"
252 .PD 0
253 .TP
254 .BI \-\-buffer\-size= buffer_size
255 .PD
256 Set the operating system capture buffer size to \fIbuffer_size\fP, in
257 units of KiB (1024 bytes).
258 .TP
259 .BI \-c " count"
260 Exit after receiving \fIcount\fP packets.
261 .TP
262 .BI \-\-count
263 Print only on stdout the packet count when reading capture file(s) instead
264 of parsing/printing the packets. If a filter is specified on the command
265 line, \fItcpdump\fP counts only packets that were matched by the filter
266 expression.
267 .TP
268 .BI \-C " file_size"
269 Before writing a raw packet to a savefile, check whether the file is
270 currently larger than \fIfile_size\fP and, if so, close the current
271 savefile and open a new one. Savefiles after the first savefile will
272 have the name specified with the
273 .B \-w
274 flag, with a number after it, starting at 1 and continuing upward.
275 The default unit of \fIfile_size\fP is millions of bytes (1,000,000 bytes,
276 not 1,048,576 bytes).
277 .IP
278 By adding a suffix of k/K, m/M or g/G to the value, the unit
279 can be changed to 1,024 (KiB), 1,048,576 (MiB), or 1,073,741,824 (GiB)
280 respectively.
281 .TP
282 .B \-d
283 Dump the compiled packet-matching code in a human readable form to
284 standard output and stop.
285 .IP
286 Please mind that although code compilation is always DLT-specific,
287 typically it is impossible (and unnecessary) to specify which DLT to use
288 for the dump because \fItcpdump\fP uses either the DLT of the input pcap
289 file specified with
290 .BR -r ,
291 or the default DLT of the network interface specified with
292 .BR -i ,
293 or the particular DLT of the network interface specified with
294 .B -y
295 and
296 .B -i
297 respectively. In these cases the dump shows the same exact code that
298 would filter the input file or the network interface without
299 .BR -d .
300 .IP
301 However, when neither
302 .B -r
303 nor
304 .B -i
305 is specified, specifying
306 .B -d
307 prevents \fItcpdump\fP from guessing a suitable network interface (see
308 .BR -i ).
309 In this case the DLT defaults to EN10MB and can be set to another valid
310 value manually with
311 .BR -y .
312 .TP
313 .B \-dd
314 Dump packet-matching code as a
315 .B C
316 program fragment.
317 .TP
318 .B \-ddd
319 Dump packet-matching code as decimal numbers (preceded with a count).
320 .TP
321 .B \-D
322 .PD 0
323 .TP
324 .B \-\-list\-interfaces
325 .PD
326 Print the list of the network interfaces available on the system and on
327 which
328 .I tcpdump
329 can capture packets. For each network interface, a number and an
330 interface name, possibly followed by a text description of the
331 interface, are printed. The interface name or the number can be supplied
332 to the
333 .B \-i
334 flag to specify an interface on which to capture.
335 .IP
336 This can be useful on systems that don't have a command to list them
337 (e.g., Windows systems, or UNIX systems lacking
338 .BR "ifconfig \-a" );
339 the number can be useful on Windows 2000 and later systems, where the
340 interface name is a somewhat complex string.
341 .IP
342 The
343 .B \-D
344 flag will not be supported if
345 .I tcpdump
346 was built with an older version of
347 .I libpcap
348 that lacks the
349 .BR pcap_findalldevs (3PCAP)
350 function.
351 .TP
352 .B \-e
353 Print the link-level header on each dump line. This can be used, for
354 example, to print MAC layer addresses for protocols such as Ethernet and
355 IEEE 802.11.
356 .TP
357 .B \-E
358 Use \fIspi@ipaddr algo:secret\fP for decrypting IPsec ESP packets that
359 are addressed to \fIaddr\fP and contain Security Parameter Index value
360 \fIspi\fP. This combination may be repeated with comma or newline separation.
361 .IP
362 Note that setting the secret for IPv4 ESP packets is supported at this time.
363 .IP
364 Algorithms may be
365 \fBdes-cbc\fP,
366 \fB3des-cbc\fP,
367 \fBblowfish-cbc\fP,
368 \fBrc3-cbc\fP,
369 \fBcast128-cbc\fP, or
370 \fBnone\fP.
371 The default is \fBdes-cbc\fP.
372 The ability to decrypt packets is only present if \fItcpdump\fP was compiled
373 with cryptography enabled.
374 .IP
375 \fIsecret\fP is the ASCII text for ESP secret key.
376 If preceded by 0x, then a hex value will be read.
377 .IP
378 The option assumes RFC 2406 ESP, not RFC 1827 ESP.
379 The option is only for debugging purposes, and
380 the use of this option with a true `secret' key is discouraged.
381 By presenting IPsec secret key onto command line
382 you make it visible to others, via
383 .IR ps (1)
384 and other occasions.
385 .IP
386 In addition to the above syntax, the syntax \fIfile name\fP may be used
387 to have tcpdump read the provided file in. The file is opened upon
388 receiving the first ESP packet, so any special permissions that tcpdump
389 may have been given should already have been given up.
390 .TP
391 .B \-f
392 Print `foreign' IPv4 addresses numerically rather than symbolically
393 (this option is intended to get around serious brain damage in
394 Sun's NIS server \(em usually it hangs forever translating non-local
395 internet numbers).
396 .IP
397 The test for `foreign' IPv4 addresses is done using the IPv4 address and
398 netmask of the interface on which capture is being done. If that
399 address or netmask are not available, available, either because the
400 interface on which capture is being done has no address or netmask or
401 because the capture is being done on the Linux "any" interface, which
402 can capture on more than one interface, this option will not work
403 correctly.
404 .TP
405 .BI \-F " file"
406 Use \fIfile\fP as input for the filter expression.
407 An additional expression given on the command line is ignored.
408 .TP
409 .BI \-G " rotate_seconds"
410 If specified, rotates the dump file specified with the
411 .B \-w
412 option every \fIrotate_seconds\fP seconds.
413 Savefiles will have the name specified by
414 .B \-w
415 which should include a time format as defined by
416 .BR strftime (3).
417 If no time format is specified, each new file will overwrite the previous.
418 Whenever a generated filename is not unique, tcpdump will overwrite the
419 pre-existing data; providing a time specification that is coarser than the
420 capture period is therefore not advised.
421 .IP
422 If used in conjunction with the
423 .B \-C
424 option, filenames will take the form of `\fIfile\fP<count>'.
425 .TP
426 .B \-h
427 .PD 0
428 .TP
429 .B \-\-help
430 .PD
431 Print the tcpdump and libpcap version strings, print a usage message,
432 and exit.
433 .TP
434 .B \-\-version
435 .PD
436 Print the tcpdump and libpcap version strings and exit.
437 .TP
438 .B \-H
439 Attempt to detect 802.11s draft mesh headers.
440 .TP
441 .BI \-i " interface"
442 .PD 0
443 .TP
444 .BI \-\-interface= interface
445 .PD
446 Listen, report the list of link-layer types, report the list of time
447 stamp types, or report the results of compiling a filter expression on
448 \fIinterface\fP. If unspecified and if the
449 .B -d
450 flag is not given, \fItcpdump\fP searches the system
451 interface list for the lowest numbered, configured up interface
452 (excluding loopback), which may turn out to be, for example, ``eth0''.
453 .IP
454 On Linux systems with 2.2 or later kernels, an
455 .I interface
456 argument of ``any'' can be used to capture packets from all interfaces.
457 Note that captures on the ``any'' device will not be done in promiscuous
458 mode.
459 .IP
460 If the
461 .B \-D
462 flag is supported, an interface number as printed by that flag can be
463 used as the
464 .I interface
465 argument, if no interface on the system has that number as a name.
466 .TP
467 .B \-I
468 .PD 0
469 .TP
470 .B \-\-monitor\-mode
471 .PD
472 Put the interface in "monitor mode"; this is supported only on IEEE
473 802.11 Wi-Fi interfaces, and supported only on some operating systems.
474 .IP
475 Note that in monitor mode the adapter might disassociate from the
476 network with which it's associated, so that you will not be able to use
477 any wireless networks with that adapter. This could prevent accessing
478 files on a network server, or resolving host names or network addresses,
479 if you are capturing in monitor mode and are not connected to another
480 network with another adapter.
481 .IP
482 This flag will affect the output of the
483 .B \-L
484 flag. If
485 .B \-I
486 isn't specified, only those link-layer types available when not in
487 monitor mode will be shown; if
488 .B \-I
489 is specified, only those link-layer types available when in monitor mode
490 will be shown.
491 .TP
492 .BI \-\-immediate\-mode
493 Capture in "immediate mode". In this mode, packets are delivered to
494 tcpdump as soon as they arrive, rather than being buffered for
495 efficiency. This is the default when printing packets rather than
496 saving packets to a ``savefile'' if the packets are being printed to a
497 terminal rather than to a file or pipe.
498 .TP
499 .BI \-j " tstamp_type"
500 .PD 0
501 .TP
502 .BI \-\-time\-stamp\-type= tstamp_type
503 .PD
504 Set the time stamp type for the capture to \fItstamp_type\fP. The names
505 to use for the time stamp types are given in
506 .BR \%pcap-tstamp (@MAN_MISC_INFO@);
507 not all the types listed there will necessarily be valid for any given
508 interface.
509 .TP
510 .B \-J
511 .PD 0
512 .TP
513 .B \-\-list\-time\-stamp\-types
514 .PD
515 List the supported time stamp types for the interface and exit. If the
516 time stamp type cannot be set for the interface, no time stamp types are
517 listed.
518 .TP
519 .BI \-\-time\-stamp\-precision= tstamp_precision
520 When capturing, set the time stamp precision for the capture to
521 \fItstamp_precision\fP. Note that availability of high precision time
522 stamps (nanoseconds) and their actual accuracy is platform and hardware
523 dependent. Also note that when writing captures made with nanosecond
524 accuracy to a savefile, the time stamps are written with nanosecond
525 resolution, and the file is written with a different magic number, to
526 indicate that the time stamps are in seconds and nanoseconds; not all
527 programs that read pcap savefiles will be able to read those captures.
528 .IP
529 When reading a savefile, convert time stamps to the precision specified
530 by \fItimestamp_precision\fP, and display them with that resolution. If
531 the precision specified is less than the precision of time stamps in the
532 file, the conversion will lose precision.
533 .IP
534 The supported values for \fItimestamp_precision\fP are \fBmicro\fP for
535 microsecond resolution and \fBnano\fP for nanosecond resolution. The
536 default is microsecond resolution.
537 .TP
538 .B \-\-micro
539 .PD 0
540 .TP
541 .B \-\-nano
542 .PD
543 Shorthands for \fB\-\-time\-stamp\-precision=micro\fP or
544 \fB\-\-time\-stamp\-precision=nano\fP, adjusting the time stamp
545 precision accordingly. When reading packets from a savefile, using
546 \fB\-\-micro\fP truncates time stamps if the savefile was created with
547 nanosecond precision. In contrast, a savefile created with microsecond
548 precision will have trailing zeroes added to the time stamp when
549 \fB\-\-nano\fP is used.
550 .TP
551 .B \-K
552 .PD 0
553 .TP
554 .B \-\-dont\-verify\-checksums
555 .PD
556 Don't attempt to verify IP, TCP, or UDP checksums. This is useful for
557 interfaces that perform some or all of those checksum calculation in
558 hardware; otherwise, all outgoing TCP checksums will be flagged as bad.
559 .TP
560 .B \-l
561 Make stdout line buffered.
562 Useful if you want to see the data
563 while capturing it.
564 E.g.,
565 .IP
566 .RS
567 .RS
568 .nf
569 \fBtcpdump \-l | tee dat\fP
570 .fi
571 .RE
572 .RE
573 .IP
574 or
575 .IP
576 .RS
577 .RS
578 .nf
579 \fBtcpdump \-l > dat & tail \-f dat\fP
580 .fi
581 .RE
582 .RE
583 .IP
584 Note that on Windows,``line buffered'' means ``unbuffered'', so that
585 WinDump will write each character individually if
586 .B \-l
587 is specified.
588 .IP
589 .B \-U
590 is similar to
591 .B \-l
592 in its behavior, but it will cause output to be ``packet-buffered'', so
593 that the output is written to stdout at the end of each packet rather
594 than at the end of each line; this is buffered on all platforms,
595 including Windows.
596 .TP
597 .B \-L
598 .PD 0
599 .TP
600 .B \-\-list\-data\-link\-types
601 .PD
602 List the known data link types for the interface, in the specified mode,
603 and exit. The list of known data link types may be dependent on the
604 specified mode; for example, on some platforms, a Wi-Fi interface might
605 support one set of data link types when not in monitor mode (for
606 example, it might support only fake Ethernet headers, or might support
607 802.11 headers but not support 802.11 headers with radio information)
608 and another set of data link types when in monitor mode (for example, it
609 might support 802.11 headers, or 802.11 headers with radio information,
610 only in monitor mode).
611 .TP
612 .BI \-m " module"
613 Load SMI MIB module definitions from file \fImodule\fR.
614 This option
615 can be used several times to load several MIB modules into \fItcpdump\fP.
616 .TP
617 .BI \-M " secret"
618 Use \fIsecret\fP as a shared secret for validating the digests found in
619 TCP segments with the TCP-MD5 option (RFC 2385), if present.
620 .TP
621 .B \-n
622 Don't convert addresses (i.e., host addresses, port numbers, etc.) to names.
623 .TP
624 .B \-N
625 Don't print domain name qualification of host names.
626 E.g.,
627 if you give this flag then \fItcpdump\fP will print ``nic''
628 instead of ``nic.ddn.mil''.
629 .TP
630 .B \-#
631 .PD 0
632 .TP
633 .B \-\-number
634 .PD
635 Print an optional packet number at the beginning of the line.
636 .TP
637 .B \-O
638 .PD 0
639 .TP
640 .B \-\-no\-optimize
641 .PD
642 Do not run the packet-matching code optimizer.
643 This is useful only
644 if you suspect a bug in the optimizer.
645 .TP
646 .B \-p
647 .PD 0
648 .TP
649 .B \-\-no\-promiscuous\-mode
650 .PD
651 \fIDon't\fP put the interface
652 into promiscuous mode.
653 Note that the interface might be in promiscuous
654 mode for some other reason; hence, `-p' cannot be used as an abbreviation for
655 `ether host {local-hw-addr} or ether broadcast'.
656 .TP
657 .BI \-\-print
658 Print parsed packet output, even if the raw packets are being saved to a
659 file with the
660 .B \-w
661 flag.
662 .TP
663 .BI \-\-print\-sampling= nth
664 .PD
665 Print every \fInth\fP packet. This option enables the \fB--print\fP flag.
666 .IP
667 Unprinted packets are not parsed, which decreases processing time. Setting
668 \fInth\fP to \fB100\fP for example, will (counting from 1) parse and print the
669 100th packet, 200th patcket, 300th packet, and so on.
670 .IP
671 This option also enables the \fB-S\fP flag, as relative TCP sequence
672 numbers are not tracked for unprinted packets.
673 .TP
674 .BI \-Q " direction"
675 .PD 0
676 .TP
677 .BI \-\-direction= direction
678 .PD
679 Choose send/receive direction \fIdirection\fR for which packets should be
680 captured. Possible values are `in', `out' and `inout'. Not available
681 on all platforms.
682 .TP
683 .B \-q
684 Quick (quiet?) output.
685 Print less protocol information so output
686 lines are shorter.
687 .TP
688 .BI \-r " file"
689 Read packets from \fIfile\fR (which was created with the
690 .B \-w
691 option or by other tools that write pcap or pcapng files).
692 Standard input is used if \fIfile\fR is ``-''.
693 .TP
694 .B \-S
695 .PD 0
696 .TP
697 .B \-\-absolute\-tcp\-sequence\-numbers
698 .PD
699 Print absolute, rather than relative, TCP sequence numbers.
700 .TP
701 .BI \-s " snaplen"
702 .PD 0
703 .TP
704 .BI \-\-snapshot\-length= snaplen
705 .PD
706 Snarf \fIsnaplen\fP bytes of data from each packet rather than the
707 default of 262144 bytes.
708 Packets truncated because of a limited snapshot
709 are indicated in the output with ``[|\fIproto\fP]'', where \fIproto\fP
710 is the name of the protocol level at which the truncation has occurred.
711 .IP
712 Note that taking larger snapshots both increases
713 the amount of time it takes to process packets and, effectively,
714 decreases the amount of packet buffering.
715 This may cause packets to be
716 lost.
717 Note also that taking smaller snapshots will discard data from protocols
718 above the transport layer, which loses information that may be
719 important. NFS and AFS requests and replies, for example, are very
720 large, and much of the detail won't be available if a too-short snapshot
721 length is selected.
722 .IP
723 If you need to reduce the snapshot size below the default, you should
724 limit \fIsnaplen\fP to the smallest number that will capture the
725 protocol information you're interested in. Setting
726 \fIsnaplen\fP to 0 sets it to the default of 262144,
727 for backwards compatibility with recent older versions of
728 .IR tcpdump .
729 .TP
730 .BI \-T " type"
731 Force packets selected by "\fIexpression\fP" to be interpreted the
732 specified \fItype\fR.
733 Currently known types are
734 \fBaodv\fR (Ad-hoc On-demand Distance Vector protocol),
735 \fBcarp\fR (Common Address Redundancy Protocol),
736 \fBcnfp\fR (Cisco NetFlow protocol),
737 \fBdomain\fR (Domain Name System),
738 \fBlmp\fR (Link Management Protocol),
739 \fBpgm\fR (Pragmatic General Multicast),
740 \fBpgm_zmtp1\fR (ZMTP/1.0 inside PGM/EPGM),
741 \fBptp\fR (Precision Time Protocol),
742 \fBquic\fR (QUIC),
743 \fBradius\fR (RADIUS),
744 \fBresp\fR (REdis Serialization Protocol),
745 \fBrpc\fR (Remote Procedure Call),
746 \fBrtcp\fR (Real-Time Applications control protocol),
747 \fBrtp\fR (Real-Time Applications protocol),
748 \fBsnmp\fR (Simple Network Management Protocol),
749 \fBsomeip\fR (SOME/IP),
750 \fBtftp\fR (Trivial File Transfer Protocol),
751 \fBvat\fR (Visual Audio Tool),
752 \fBvxlan\fR (Virtual eXtensible Local Area Network),
753 \fBwb\fR (distributed White Board)
754 and
755 \fBzmtp1\fR (ZeroMQ Message Transport Protocol 1.0).
756 .IP
757 Note that the \fBpgm\fR type above affects UDP interpretation only, the native
758 PGM is always recognised as IP protocol 113 regardless. UDP-encapsulated PGM is
759 often called "EPGM" or "PGM/UDP".
760 .IP
761 Note that the \fBpgm_zmtp1\fR type above affects interpretation of both native
762 PGM and UDP at once. During the native PGM decoding the application data of an
763 ODATA/RDATA packet would be decoded as a ZeroMQ datagram with ZMTP/1.0 frames.
764 During the UDP decoding in addition to that any UDP packet would be treated as
765 an encapsulated PGM packet.
766 .TP
767 .B \-t
768 \fIDon't\fP print a timestamp on each dump line.
769 .TP
770 .B \-tt
771 Print the timestamp, as seconds since January 1, 1970, 00:00:00, UTC, and
772 fractions of a second since that time, on each dump line.
773 .TP
774 .B \-ttt
775 Print a delta (microsecond or nanosecond resolution depending on the
776 .B \-\-time\-stamp-precision
777 option) between current and previous line on each dump line.
778 The default is microsecond resolution.
779 .TP
780 .B \-tttt
781 Print a timestamp, as hours, minutes, seconds, and fractions of a second
782 since midnight, preceded by the date, on each dump line.
783 .TP
784 .B \-ttttt
785 Print a delta (microsecond or nanosecond resolution depending on the
786 .B \-\-time\-stamp-precision
787 option) between current and first line on each dump line.
788 The default is microsecond resolution.
789 .TP
790 .B \-u
791 Print undecoded NFS handles.
792 .TP
793 .B \-U
794 .PD 0
795 .TP
796 .B \-\-packet\-buffered
797 .PD
798 If the
799 .B \-w
800 option is not specified, or if it is specified but the
801 .B \-\-print
802 flag is also specified, make the printed packet output
803 ``packet-buffered''; i.e., as the description of the contents of each
804 packet is printed, it will be written to the standard output, rather
805 than, when not writing to a terminal, being written only when the output
806 buffer fills.
807 .IP
808 If the
809 .B \-w
810 option is specified, make the saved raw packet output
811 ``packet-buffered''; i.e., as each packet is saved, it will be written
812 to the output file, rather than being written only when the output
813 buffer fills.
814 .IP
815 The
816 .B \-U
817 flag will not be supported if
818 .I tcpdump
819 was built with an older version of
820 .I libpcap
821 that lacks the
822 .BR pcap_dump_flush (3PCAP)
823 function.
824 .TP
825 .B \-v
826 When parsing and printing, produce (slightly more) verbose output.
827 For example, the time to live,
828 identification, total length and options in an IP packet are printed.
829 Also enables additional packet integrity checks such as verifying the
830 IP and ICMP header checksum.
831 .IP
832 When writing to a file with the
833 .B \-w
834 option and at the same time not reading from a file with the
835 .B \-r
836 option, report to stderr, once per second, the number of packets captured. In
837 Solaris, FreeBSD and possibly other operating systems this periodic update
838 currently can cause loss of captured packets on their way from the kernel to
839 tcpdump.
840 .TP
841 .B \-vv
842 Even more verbose output.
843 For example, additional fields are
844 printed from NFS reply packets, and SMB packets are fully decoded.
845 .TP
846 .B \-vvv
847 Even more verbose output.
848 For example,
849 telnet \fBSB\fP ... \fBSE\fP options
850 are printed in full.
851 With
852 .B \-X
853 Telnet options are printed in hex as well.
854 .TP
855 .BI \-V " file"
856 Read a list of filenames from \fIfile\fR. Standard input is used
857 if \fIfile\fR is ``-''.
858 .TP
859 .BI \-w " file"
860 Write the raw packets to \fIfile\fR rather than parsing and printing
861 them out.
862 They can later be printed with the \-r option.
863 Standard output is used if \fIfile\fR is ``-''.
864 .IP
865 This output will be buffered if written to a file or pipe, so a program
866 reading from the file or pipe may not see packets for an arbitrary
867 amount of time after they are received. Use the
868 .B \-U
869 flag to cause packets to be written as soon as they are received.
870 .IP
871 The MIME type \fIapplication/vnd.tcpdump.pcap\fP has been registered
872 with IANA for \fIpcap\fP files. The filename extension \fI.pcap\fP
873 appears to be the most commonly used along with \fI.cap\fP and
874 \fI.dmp\fP. \fITcpdump\fP itself doesn't check the extension when
875 reading capture files and doesn't add an extension when writing them
876 (it uses magic numbers in the file header instead). However, many
877 operating systems and applications will use the extension if it is
878 present and adding one (e.g. .pcap) is recommended.
879 .IP
880 See
881 .BR \%pcap-savefile (@MAN_FILE_FORMATS@)
882 for a description of the file format.
883 .TP
884 .BI \-W " filecount"
885 Used in conjunction with the
886 .B \-C
887 option, this will limit the number
888 of files created to the specified number, and begin overwriting files
889 from the beginning, thus creating a 'rotating' buffer.
890 In addition, it will name
891 the files with enough leading 0s to support the maximum number of
892 files, allowing them to sort correctly.
893 .IP
894 Used in conjunction with the
895 .B \-G
896 option, this will limit the number of rotated dump files that get
897 created, exiting with status 0 when reaching the limit.
898 .IP
899 If used in conjunction with both
900 .B \-C
901 and
902 .B \-G,
903 the
904 .B \-W
905 option will currently be ignored, and will only affect the file name.
906 .TP
907 .B \-x
908 When parsing and printing,
909 in addition to printing the headers of each packet, print the data of
910 each packet (minus its link level header) in hex.
911 The smaller of the entire packet or
912 .I snaplen
913 bytes will be printed. Note that this is the entire link-layer
914 packet, so for link layers that pad (e.g. Ethernet), the padding bytes
915 will also be printed when the higher layer packet is shorter than the
916 required padding.
917 In the current implementation this flag may have the same effect as
918 .B \-xx
919 if the packet is truncated.
920 .TP
921 .B \-xx
922 When parsing and printing,
923 in addition to printing the headers of each packet, print the data of
924 each packet,
925 .I including
926 its link level header, in hex.
927 .TP
928 .B \-X
929 When parsing and printing,
930 in addition to printing the headers of each packet, print the data of
931 each packet (minus its link level header) in hex and ASCII.
932 This is very handy for analysing new protocols.
933 In the current implementation this flag may have the same effect as
934 .B \-XX
935 if the packet is truncated.
936 .TP
937 .B \-XX
938 When parsing and printing,
939 in addition to printing the headers of each packet, print the data of
940 each packet,
941 .I including
942 its link level header, in hex and ASCII.
943 .TP
944 .BI \-y " datalinktype"
945 .PD 0
946 .TP
947 .BI \-\-linktype= datalinktype
948 .PD
949 Set the data link type to use while capturing packets (see
950 .BR -L )
951 or just compiling and dumping packet-matching code (see
952 .BR -d )
953 to \fIdatalinktype\fP.
954 .TP
955 .BI \-z " postrotate-command"
956 Used in conjunction with the
957 .B -C
958 or
959 .B -G
960 options, this will make
961 .I tcpdump
962 run "
963 .I postrotate-command file
964 " where
965 .I file
966 is the savefile being closed after each rotation. For example, specifying
967 .B \-z gzip
968 or
969 .B \-z bzip2
970 will compress each savefile using gzip or bzip2.
971 .IP
972 Note that tcpdump will run the command in parallel to the capture, using
973 the lowest priority so that this doesn't disturb the capture process.
974 .IP
975 And in case you would like to use a command that itself takes flags or
976 different arguments, you can always write a shell script that will take the
977 savefile name as the only argument, make the flags & arguments arrangements
978 and execute the command that you want.
979 .TP
980 .BI \-Z " user"
981 .PD 0
982 .TP
983 .BI \-\-relinquish\-privileges= user
984 .PD
985 If
986 .I tcpdump
987 is running as root, after opening the capture device or input savefile,
988 but before opening any savefiles for output, change the user ID to
989 .I user
990 and the group ID to the primary group of
991 .IR user .
992 .IP
993 This behavior can also be enabled by default at compile time.
994 .IP "\fI expression\fP"
995 .RS
996 selects which packets will be dumped.
997 If no \fIexpression\fP
998 is given, all packets on the net will be dumped.
999 Otherwise,
1000 only packets for which \fIexpression\fP is `true' will be dumped.
1001 .LP
1002 For the \fIexpression\fP syntax, see
1003 .BR \%pcap-filter (@MAN_MISC_INFO@).
1004 .LP
1005 The \fIexpression\fP argument can be passed to \fItcpdump\fP as either a single
1006 Shell argument, or as multiple Shell arguments, whichever is more convenient.
1007 Generally, if the expression contains Shell metacharacters, such as
1008 backslashes used to escape protocol names, it is easier to pass it as
1009 a single, quoted argument rather than to escape the Shell
1010 metacharacters.
1011 Multiple arguments are concatenated with spaces before being parsed.
1012 .SH EXAMPLES
1013 .LP
1014 To print all packets arriving at or departing from \fIsundown\fP:
1015 .RS
1016 .nf
1017 \fBtcpdump host sundown\fP
1018 .fi
1019 .RE
1020 .LP
1021 To print traffic between \fIhelios\fR and either \fIhot\fR or \fIace\fR:
1022 .RS
1023 .nf
1024 \fBtcpdump host helios and \\( hot or ace \\)\fP
1025 .fi
1026 .RE
1027 .LP
1028 To print all IP packets between \fIace\fR and any host except \fIhelios\fR:
1029 .RS
1030 .nf
1031 \fBtcpdump ip host ace and not helios\fP
1032 .fi
1033 .RE
1034 .LP
1035 To print all traffic between local hosts and hosts at Berkeley:
1036 .RS
1037 .nf
1038 .B
1039 tcpdump net ucb-ether
1040 .fi
1041 .RE
1042 .LP
1043 To print all ftp traffic through internet gateway \fIsnup\fP:
1044 (note that the expression is quoted to prevent the shell from
1045 (mis-)interpreting the parentheses):
1046 .RS
1047 .nf
1048 .B
1049 tcpdump 'gateway snup and (port ftp or ftp-data)'
1050 .fi
1051 .RE
1052 .LP
1053 To print traffic neither sourced from nor destined for local hosts
1054 (if you gateway to one other net, this stuff should never make it
1055 onto your local net).
1056 .RS
1057 .nf
1058 .B
1059 tcpdump ip and not net \fIlocalnet\fP
1060 .fi
1061 .RE
1062 .LP
1063 To print the start and end packets (the SYN and FIN packets) of each
1064 TCP conversation that involves a non-local host.
1065 .RS
1066 .nf
1067 .B
1068 tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net \fIlocalnet\fP'
1069 .fi
1070 .RE
1071 .LP
1072 To print the TCP packets with flags RST and ACK both set.
1073 (i.e. select only the RST and ACK flags in the flags field, and if the result
1074 is "RST and ACK both set", match)
1075 .RS
1076 .nf
1077 .B
1078 tcpdump 'tcp[tcpflags] & (tcp-rst|tcp-ack) == (tcp-rst|tcp-ack)'
1079 .fi
1080 .RE
1081 .LP
1082 To print all IPv4 HTTP packets to and from port 80, i.e. print only
1083 packets that contain data, not, for example, SYN and FIN packets and
1084 ACK-only packets. (IPv6 is left as an exercise for the reader.)
1085 .RS
1086 .nf
1087 .B
1088 tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
1089 .fi
1090 .RE
1091 .LP
1092 To print IP packets longer than 576 bytes sent through gateway \fIsnup\fP:
1093 .RS
1094 .nf
1095 .B
1096 tcpdump 'gateway snup and ip[2:2] > 576'
1097 .fi
1098 .RE
1099 .LP
1100 To print IP broadcast or multicast packets that were
1101 .I not
1102 sent via Ethernet broadcast or multicast:
1103 .RS
1104 .nf
1105 .B
1106 tcpdump 'ether[0] & 1 = 0 and ip[16] >= 224'
1107 .fi
1108 .RE
1109 .LP
1110 To print all ICMP packets that are not echo requests/replies (i.e., not
1111 ping packets):
1112 .RS
1113 .nf
1114 .B
1115 tcpdump 'icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply'
1116 .fi
1117 .RE
1118 .SH OUTPUT FORMAT
1119 .LP
1120 The output of \fItcpdump\fP is protocol dependent.
1121 The following
1122 gives a brief description and examples of most of the formats.
1123 .de HD
1124 .sp 1.5
1125 .B
1126 ..
1127 .HD
1128 Timestamps
1129 .LP
1130 By default, all output lines are preceded by a timestamp.
1131 The timestamp
1132 is the current clock time in the form
1133 .RS
1134 .nf
1135 \fIhh:mm:ss.frac\fP
1136 .fi
1137 .RE
1138 and is as accurate as the kernel's clock.
1139 The timestamp reflects the time the kernel applied a time stamp to the packet.
1140 No attempt is made to account for the time lag between when the network
1141 interface finished receiving the packet from the network and when the
1142 kernel applied a time stamp to the packet; that time lag could include a
1143 delay between the time when the network interface finished receiving a
1144 packet from the network and the time when an interrupt was delivered to
1145 the kernel to get it to read the packet and a delay between the time
1146 when the kernel serviced the `new packet' interrupt and the time when it
1147 applied a time stamp to the packet.
1148 .HD
1149 Link Level Headers
1150 .LP
1151 If the '-e' option is given, the link level header is printed out.
1152 On Ethernets, the source and destination addresses, protocol,
1153 and packet length are printed.
1154 .LP
1155 On FDDI networks, the '-e' option causes \fItcpdump\fP to print
1156 the `frame control' field, the source and destination addresses,
1157 and the packet length.
1158 (The `frame control' field governs the
1159 interpretation of the rest of the packet.
1160 Normal packets (such
1161 as those containing IP datagrams) are `async' packets, with a priority
1162 value between 0 and 7; for example, `\fBasync4\fR'.
1163 Such packets
1164 are assumed to contain an 802.2 Logical Link Control (LLC) packet;
1165 the LLC header is printed if it is \fInot\fR an ISO datagram or a
1166 so-called SNAP packet.
1167 .LP
1168 On Token Ring networks, the '-e' option causes \fItcpdump\fP to print
1169 the `access control' and `frame control' fields, the source and
1170 destination addresses, and the packet length.
1171 As on FDDI networks,
1172 packets are assumed to contain an LLC packet.
1173 Regardless of whether
1174 the '-e' option is specified or not, the source routing information is
1175 printed for source-routed packets.
1176 .LP
1177 On 802.11 networks, the '-e' option causes \fItcpdump\fP to print
1178 the `frame control' fields, all of the addresses in the 802.11 header,
1179 and the packet length.
1180 As on FDDI networks,
1181 packets are assumed to contain an LLC packet.
1182 .LP
1183 \fI(N.B.: The following description assumes familiarity with
1184 the SLIP compression algorithm described in RFC 1144.)\fP
1185 .LP
1186 On SLIP links, a direction indicator (``I'' for inbound, ``O'' for outbound),
1187 packet type, and compression information are printed out.
1188 The packet type is printed first.
1189 The three types are \fIip\fP, \fIutcp\fP, and \fIctcp\fP.
1190 No further link information is printed for \fIip\fR packets.
1191 For TCP packets, the connection identifier is printed following the type.
1192 If the packet is compressed, its encoded header is printed out.
1193 The special cases are printed out as
1194 \fB*S+\fIn\fR and \fB*SA+\fIn\fR, where \fIn\fR is the amount by which
1195 the sequence number (or sequence number and ack) has changed.
1196 If it is not a special case,
1197 zero or more changes are printed.
1198 A change is indicated by U (urgent pointer), W (window), A (ack),
1199 S (sequence number), and I (packet ID), followed by a delta (+n or -n),
1200 or a new value (=n).
1201 Finally, the amount of data in the packet and compressed header length
1202 are printed.
1203 .LP
1204 For example, the following line shows an outbound compressed TCP packet,
1205 with an implicit connection identifier; the ack has changed by 6,
1206 the sequence number by 49, and the packet ID by 6; there are 3 bytes of
1207 data and 6 bytes of compressed header:
1208 .RS
1209 .nf
1210 \fBO ctcp * A+6 S+49 I+6 3 (6)\fP
1211 .fi
1212 .RE
1213 .HD
1214 ARP/RARP Packets
1215 .LP
1216 ARP/RARP output shows the type of request and its arguments.
1217 The
1218 format is intended to be self explanatory.
1219 Here is a short sample taken from the start of an `rlogin' from
1220 host \fIrtsg\fP to host \fIcsam\fP:
1221 .RS
1222 .nf
1223 .sp .5
1224 \f(CWarp who-has csam tell rtsg
1225 arp reply csam is-at CSAM\fR
1226 .sp .5
1227 .fi
1228 .RE
1229 The first line says that rtsg sent an ARP packet asking
1230 for the Ethernet address of internet host csam.
1231 Csam
1232 replies with its Ethernet address (in this example, Ethernet addresses
1233 are in caps and internet addresses in lower case).
1234 .LP
1235 This would look less redundant if we had done \fItcpdump \-n\fP:
1236 .RS
1237 .nf
1238 .sp .5
1239 \f(CWarp who-has 128.3.254.6 tell 128.3.254.68
1240 arp reply 128.3.254.6 is-at 02:07:01:00:01:c4\fP
1241 .fi
1242 .RE
1243 .LP
1244 If we had done \fItcpdump \-e\fP, the fact that the first packet is
1245 broadcast and the second is point-to-point would be visible:
1246 .RS
1247 .nf
1248 .sp .5
1249 \f(CWRTSG Broadcast 0806 64: arp who-has csam tell rtsg
1250 CSAM RTSG 0806 64: arp reply csam is-at CSAM\fR
1251 .sp .5
1252 .fi
1253 .RE
1254 For the first packet this says the Ethernet source address is RTSG, the
1255 destination is the Ethernet broadcast address, the type field
1256 contained hex 0806 (type ETHER_ARP) and the total length was 64 bytes.
1257 .HD
1258 IPv4 Packets
1259 .LP
1260 If the link-layer header is not being printed, for IPv4 packets,
1261 \fBIP\fP is printed after the time stamp.
1262 .LP
1263 If the
1264 .B \-v
1265 flag is specified, information from the IPv4 header is shown in
1266 parentheses after the \fBIP\fP or the link-layer header.
1267 The general format of this information is:
1268 .RS
1269 .nf
1270 .sp .5
1271 tos \fItos\fP, ttl \fIttl\fP, id \fIid\fP, offset \fIoffset\fP, flags [\fIflags\fP], proto \fIproto\fP, length \fIlength\fP, options (\fIoptions\fP)
1272 .sp .5
1273 .fi
1274 .RE
1275 \fItos\fP is the type of service field; if the ECN bits are non-zero,
1276 those are reported as \fBECT(1)\fP, \fBECT(0)\fP, or \fBCE\fP.
1277 \fIttl\fP is the time-to-live; it is not reported if it is zero.
1278 \fIid\fP is the IP identification field.
1279 \fIoffset\fP is the fragment offset field; it is printed whether this is
1280 part of a fragmented datagram or not.
1281 \fIflags\fP are the MF and DF flags; \fB+\fP is reported if MF is set,
1282 and \fBDF\fP is reported if F is set. If neither are set, \fB.\fP is
1283 reported.
1284 \fIproto\fP is the protocol ID field.
1285 \fIlength\fP is the total length field.
1286 \fIoptions\fP are the IP options, if any.
1287 .LP
1288 Next, for TCP and UDP packets, the source and destination IP addresses
1289 and TCP or UDP ports, with a dot between each IP address and its
1290 corresponding port, will be printed, with a > separating the source and
1291 destination. For other protocols, the addresses will be printed, with
1292 a > separating the source and destination. Higher level protocol
1293 information, if any, will be printed after that.
1294 .LP
1295 For fragmented IP datagrams, the first fragment contains the higher
1296 level protocol header; fragments after the first contain no higher level
1297 protocol header. Fragmentation information will be printed only with
1298 the
1299 .B \-v
1300 flag, in the IP header information, as described above.
1301 .HD
1302 TCP Packets
1303 .LP
1304 \fI(N.B.:The following description assumes familiarity with
1305 the TCP protocol described in RFC 793.
1306 If you are not familiar
1307 with the protocol, this description will not
1308 be of much use to you.)\fP
1309 .LP
1310 The general format of a TCP protocol line is:
1311 .RS
1312 .nf
1313 .sp .5
1314 \fIsrc\fP > \fIdst\fP: Flags [\fItcpflags\fP], seq \fIdata-seqno\fP, ack \fIackno\fP, win \fIwindow\fP, urg \fIurgent\fP, options [\fIopts\fP], length \fIlen\fP
1315 .sp .5
1316 .fi
1317 .RE
1318 \fISrc\fP and \fIdst\fP are the source and destination IP
1319 addresses and ports.
1320 \fITcpflags\fP are some combination of S (SYN),
1321 F (FIN), P (PUSH), R (RST), U (URG), W (ECN CWR), E (ECN-Echo) or
1322 `.' (ACK), or `none' if no flags are set.
1323 \fIData-seqno\fP describes the portion of sequence space covered
1324 by the data in this packet (see example below).
1325 \fIAckno\fP is sequence number of the next data expected the other
1326 direction on this connection.
1327 \fIWindow\fP is the number of bytes of receive buffer space available
1328 the other direction on this connection.
1329 \fIUrg\fP indicates there is `urgent' data in the packet.
1330 \fIOpts\fP are TCP options (e.g., mss 1024).
1331 \fILen\fP is the length of payload data.
1332 .LP
1333 \fIIptype\fR, \fISrc\fP, \fIdst\fP, and \fIflags\fP are always present.
1334 The other fields
1335 depend on the contents of the packet's TCP protocol header and
1336 are output only if appropriate.
1337 .LP
1338 Here is the opening portion of an rlogin from host \fIrtsg\fP to
1339 host \fIcsam\fP.
1340 .RS
1341 .nf
1342 .sp .5
1343 \f(CWIP rtsg.1023 > csam.login: Flags [S], seq 768512:768512, win 4096, opts [mss 1024]
1344 IP csam.login > rtsg.1023: Flags [S.], seq, 947648:947648, ack 768513, win 4096, opts [mss 1024]
1345 IP rtsg.1023 > csam.login: Flags [.], ack 1, win 4096
1346 IP rtsg.1023 > csam.login: Flags [P.], seq 1:2, ack 1, win 4096, length 1
1347 IP csam.login > rtsg.1023: Flags [.], ack 2, win 4096
1348 IP rtsg.1023 > csam.login: Flags [P.], seq 2:21, ack 1, win 4096, length 19
1349 IP csam.login > rtsg.1023: Flags [P.], seq 1:2, ack 21, win 4077, length 1
1350 IP csam.login > rtsg.1023: Flags [P.], seq 2:3, ack 21, win 4077, urg 1, length 1
1351 IP csam.login > rtsg.1023: Flags [P.], seq 3:4, ack 21, win 4077, urg 1, length 1\fR
1352 .sp .5
1353 .fi
1354 .RE
1355 The first line says that TCP port 1023 on rtsg sent a packet
1356 to port \fIlogin\fP
1357 on csam.
1358 The \fBS\fP indicates that the \fISYN\fP flag was set.
1359 The packet sequence number was 768512 and it contained no data.
1360 (The notation is `first:last' which means `sequence
1361 numbers \fIfirst\fP
1362 up to but not including \fIlast\fP'.)
1363 There was no piggy-backed ACK, the available receive window was 4096
1364 bytes and there was a max-segment-size option requesting an MSS of
1365 1024 bytes.
1366 .LP
1367 Csam replies with a similar packet except it includes a piggy-backed
1368 ACK for rtsg's SYN.
1369 Rtsg then ACKs csam's SYN.
1370 The `.' means the ACK flag was set.
1371 The packet contained no data so there is no data sequence number or length.
1372 Note that the ACK sequence
1373 number is a small integer (1).
1374 The first time \fItcpdump\fP sees a
1375 TCP `conversation', it prints the sequence number from the packet.
1376 On subsequent packets of the conversation, the difference between
1377 the current packet's sequence number and this initial sequence number
1378 is printed.
1379 This means that sequence numbers after the
1380 first can be interpreted
1381 as relative byte positions in the conversation's data stream (with the
1382 first data byte each direction being `1').
1383 `-S' will override this
1384 feature, causing the original sequence numbers to be output.
1385 .LP
1386 On the 6th line, rtsg sends csam 19 bytes of data (bytes 2 through 20
1387 in the rtsg \(-> csam side of the conversation).
1388 The PUSH flag is set in the packet.
1389 On the 7th line, csam says it's received data sent by rtsg up to
1390 but not including byte 21.
1391 Most of this data is apparently sitting in the
1392 socket buffer since csam's receive window has gotten 19 bytes smaller.
1393 Csam also sends one byte of data to rtsg in this packet.
1394 On the 8th and 9th lines,
1395 csam sends two bytes of urgent, pushed data to rtsg.
1396 .LP
1397 If the snapshot was small enough that \fItcpdump\fP didn't capture
1398 the full TCP header, it interprets as much of the header as it can
1399 and then reports ``[|\fItcp\fP]'' to indicate the remainder could not
1400 be interpreted.
1401 If the header contains a bogus option (one with a length
1402 that's either too small or beyond the end of the header), \fItcpdump\fP
1403 reports it as ``[\fIbad opt\fP]'' and does not interpret any further
1404 options (since it's impossible to tell where they start).
1405 If the header
1406 length indicates options are present but the IP datagram length is not
1407 long enough for the options to actually be there, \fItcpdump\fP reports
1408 it as ``[\fIbad hdr length\fP]''.
1409 .HD
1410 .B Capturing TCP packets with particular flag combinations (SYN-ACK, URG-ACK, etc.)
1411 .PP
1412 There are 8 bits in the control bits section of the TCP header:
1413 .IP
1414 .I CWR | ECE | URG | ACK | PSH | RST | SYN | FIN
1415 .PP
1416 Let's assume that we want to watch packets used in establishing
1417 a TCP connection.
1418 Recall that TCP uses a 3-way handshake protocol
1419 when it initializes a new connection; the connection sequence with
1420 regard to the TCP control bits is
1421 .PP
1422 .RS
1423 1) Caller sends SYN
1424 .RE
1425 .RS
1426 2) Recipient responds with SYN, ACK
1427 .RE
1428 .RS
1429 3) Caller sends ACK
1430 .RE
1431 .PP
1432 Now we're interested in capturing packets that have only the
1433 SYN bit set (Step 1).
1434 Note that we don't want packets from step 2
1435 (SYN-ACK), just a plain initial SYN.
1436 What we need is a correct filter
1437 expression for \fItcpdump\fP.
1438 .PP
1439 Recall the structure of a TCP header without options:
1440 .PP
1441 .nf
1442 0 15 31
1443 -----------------------------------------------------------------
1444 | source port | destination port |
1445 -----------------------------------------------------------------
1446 | sequence number |
1447 -----------------------------------------------------------------
1448 | acknowledgment number |
1449 -----------------------------------------------------------------
1450 | HL | rsvd |C|E|U|A|P|R|S|F| window size |
1451 -----------------------------------------------------------------
1452 | TCP checksum | urgent pointer |
1453 -----------------------------------------------------------------
1454 .fi
1455 .PP
1456 A TCP header usually holds 20 octets of data, unless options are
1457 present.
1458 The first line of the graph contains octets 0 - 3, the
1459 second line shows octets 4 - 7 etc.
1460 .PP
1461 Starting to count with 0, the relevant TCP control bits are contained
1462 in octet 13:
1463 .PP
1464 .nf
1465 0 7| 15| 23| 31
1466 ----------------|---------------|---------------|----------------
1467 | HL | rsvd |C|E|U|A|P|R|S|F| window size |
1468 ----------------|---------------|---------------|----------------
1469 | | 13th octet | | |
1470 .fi
1471 .PP
1472 Let's have a closer look at octet no. 13:
1473 .PP
1474 .nf
1475 | |
1476 |---------------|
1477 |C|E|U|A|P|R|S|F|
1478 |---------------|
1479 |7 5 3 0|
1480 .fi
1481 .PP
1482 These are the TCP control bits we are interested
1483 in.
1484 We have numbered the bits in this octet from 0 to 7, right to
1485 left, so the PSH bit is bit number 3, while the URG bit is number 5.
1486 .PP
1487 Recall that we want to capture packets with only SYN set.
1488 Let's see what happens to octet 13 if a TCP datagram arrives
1489 with the SYN bit set in its header:
1490 .PP
1491 .nf
1492 |C|E|U|A|P|R|S|F|
1493 |---------------|
1494 |0 0 0 0 0 0 1 0|
1495 |---------------|
1496 |7 6 5 4 3 2 1 0|
1497 .fi
1498 .PP
1499 Looking at the
1500 control bits section we see that only bit number 1 (SYN) is set.
1501 .PP
1502 Assuming that octet number 13 is an 8-bit unsigned integer in
1503 network byte order, the binary value of this octet is
1504 .IP
1505 00000010
1506 .PP
1507 and its decimal representation is
1508 .PP
1509 .nf
1510 7 6 5 4 3 2 1 0
1511 0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 1*2 + 0*2 = 2
1512 .fi
1513 .PP
1514 We're almost done, because now we know that if only SYN is set,
1515 the value of the 13th octet in the TCP header, when interpreted
1516 as a 8-bit unsigned integer in network byte order, must be exactly 2.
1517 .PP
1518 This relationship can be expressed as
1519 .RS
1520 .B
1521 tcp[13] == 2
1522 .RE
1523 .PP
1524 We can use this expression as the filter for \fItcpdump\fP in order
1525 to watch packets which have only SYN set:
1526 .RS
1527 .B
1528 tcpdump -i xl0 tcp[13] == 2
1529 .RE
1530 .PP
1531 The expression says "let the 13th octet of a TCP datagram have
1532 the decimal value 2", which is exactly what we want.
1533 .PP
1534 Now, let's assume that we need to capture SYN packets, but we
1535 don't care if ACK or any other TCP control bit is set at the
1536 same time.
1537 Let's see what happens to octet 13 when a TCP datagram
1538 with SYN-ACK set arrives:
1539 .PP
1540 .nf
1541 |C|E|U|A|P|R|S|F|
1542 |---------------|
1543 |0 0 0 1 0 0 1 0|
1544 |---------------|
1545 |7 6 5 4 3 2 1 0|
1546 .fi
1547 .PP
1548 Now bits 1 and 4 are set in the 13th octet.
1549 The binary value of
1550 octet 13 is
1551 .IP
1552 00010010
1553 .PP
1554 which translates to decimal
1555 .PP
1556 .nf
1557 7 6 5 4 3 2 1 0
1558 0*2 + 0*2 + 0*2 + 1*2 + 0*2 + 0*2 + 1*2 + 0*2 = 18
1559 .fi
1560 .PP
1561 Now we can't just use 'tcp[13] == 18' in the \fItcpdump\fP filter
1562 expression, because that would select only those packets that have
1563 SYN-ACK set, but not those with only SYN set.
1564 Remember that we don't care
1565 if ACK or any other control bit is set as long as SYN is set.
1566 .PP
1567 In order to achieve our goal, we need to logically AND the
1568 binary value of octet 13 with some other value to preserve
1569 the SYN bit.
1570 We know that we want SYN to be set in any case,
1571 so we'll logically AND the value in the 13th octet with
1572 the binary value of a SYN:
1573 .PP
1574 .nf
1575
1576 00010010 SYN-ACK 00000010 SYN
1577 AND 00000010 (we want SYN) AND 00000010 (we want SYN)
1578 -------- --------
1579 = 00000010 = 00000010
1580 .fi
1581 .PP
1582 We see that this AND operation delivers the same result
1583 regardless whether ACK or another TCP control bit is set.
1584 The decimal representation of the AND value as well as
1585 the result of this operation is 2 (binary 00000010),
1586 so we know that for packets with SYN set the following
1587 relation must hold true:
1588 .IP
1589 ( ( value of octet 13 ) AND ( 2 ) ) == ( 2 )
1590 .PP
1591 This points us to the \fItcpdump\fP filter expression
1592 .RS
1593 .B
1594 tcpdump -i xl0 'tcp[13] & 2 == 2'
1595 .RE
1596 .PP
1597 Some offsets and field values may be expressed as names
1598 rather than as numeric values. For example tcp[13] may
1599 be replaced with tcp[tcpflags]. The following TCP flag
1600 field values are also available: tcp-fin, tcp-syn, tcp-rst,
1601 tcp-push, tcp-ack, tcp-urg.
1602 .PP
1603 This can be demonstrated as:
1604 .RS
1605 .B
1606 tcpdump -i xl0 'tcp[tcpflags] & tcp-push != 0'
1607 .RE
1608 .PP
1609 Note that you should use single quotes or a backslash
1610 in the expression to hide the AND ('&') special character
1611 from the shell.
1612 .HD
1613 .B
1614 UDP Packets
1615 .LP
1616 UDP format is illustrated by this rwho packet:
1617 .RS
1618 .nf
1619 .sp .5
1620 \f(CWactinide.who > broadcast.who: udp 84\fP
1621 .sp .5
1622 .fi
1623 .RE
1624 This says that port \fIwho\fP on host \fIactinide\fP sent a UDP
1625 datagram to port \fIwho\fP on host \fIbroadcast\fP, the Internet
1626 broadcast address.
1627 The packet contained 84 bytes of user data.
1628 .LP
1629 Some UDP services are recognized (from the source or destination
1630 port number) and the higher level protocol information printed.
1631 In particular, Domain Name service requests (RFC 1034/1035) and Sun
1632 RPC calls (RFC 1050) to NFS.
1633 .HD
1634 TCP or UDP Name Server Requests
1635 .LP
1636 \fI(N.B.:The following description assumes familiarity with
1637 the Domain Service protocol described in RFC 1035.
1638 If you are not familiar
1639 with the protocol, the following description will appear to be written
1640 in Greek.)\fP
1641 .LP
1642 Name server requests are formatted as
1643 .RS
1644 .nf
1645 .sp .5
1646 \fIsrc > dst: id op? flags qtype qclass name (len)\fP
1647 .sp .5
1648 \f(CWh2opolo.1538 > helios.domain: 3+ A? ucbvax.berkeley.edu. (37)\fR
1649 .sp .5
1650 .fi
1651 .RE
1652 Host \fIh2opolo\fP asked the domain server on \fIhelios\fP for an
1653 address record (qtype=A) associated with the name \fIucbvax.berkeley.edu.\fP
1654 The query id was `3'.
1655 The `+' indicates the \fIrecursion desired\fP flag
1656 was set.
1657 The query length was 37 bytes, excluding the TCP or UDP and
1658 IP protocol headers.
1659 The query operation was the normal one, \fIQuery\fP,
1660 so the op field was omitted.
1661 If the op had been anything else, it would
1662 have been printed between the `3' and the `+'.
1663 Similarly, the qclass was the normal one,
1664 \fIC_IN\fP, and omitted.
1665 Any other qclass would have been printed
1666 immediately after the `A'.
1667 .LP
1668 A few anomalies are checked and may result in extra fields enclosed in
1669 square brackets: If a query contains an answer, authority records or
1670 additional records section,
1671 .IR ancount ,
1672 .IR nscount ,
1673 or
1674 .I arcount
1675 are printed as `[\fIn\fPa]', `[\fIn\fPn]' or `[\fIn\fPau]' where \fIn\fP
1676 is the appropriate count.
1677 If any of the response bits are set (AA, RA or rcode) or any of the
1678 `must be zero' bits are set in bytes two and three, `[b2&3=\fIx\fP]'
1679 is printed, where \fIx\fP is the hex value of header bytes two and three.
1680 .HD
1681 TCP or UDP Name Server Responses
1682 .LP
1683 Name server responses are formatted as
1684 .RS
1685 .nf
1686 .sp .5
1687 \fIsrc > dst: id op rcode flags a/n/au type class data (len)\fP
1688 .sp .5
1689 \f(CWhelios.domain > h2opolo.1538: 3 3/3/7 A 128.32.137.3 (273)
1690 helios.domain > h2opolo.1537: 2 NXDomain* 0/1/0 (97)\fR
1691 .sp .5
1692 .fi
1693 .RE
1694 In the first example, \fIhelios\fP responds to query id 3 from \fIh2opolo\fP
1695 with 3 answer records, 3 name server records and 7 additional records.
1696 The first answer record is type A (address) and its data is internet
1697 address 128.32.137.3.
1698 The total size of the response was 273 bytes,
1699 excluding TCP or UDP and IP headers.
1700 The op (Query) and response code
1701 (NoError) were omitted, as was the class (C_IN) of the A record.
1702 .LP
1703 In the second example, \fIhelios\fP responds to query 2 with a
1704 response code of non-existent domain (NXDomain) with no answers,
1705 one name server and no authority records.
1706 The `*' indicates that
1707 the \fIauthoritative answer\fP bit was set.
1708 Since there were no
1709 answers, no type, class or data were printed.
1710 .LP
1711 Other flag characters that might appear are `\-' (recursion available,
1712 RA, \fInot\fP set) and `|' (truncated message, TC, set).
1713 If the
1714 `question' section doesn't contain exactly one entry, `[\fIn\fPq]'
1715 is printed.
1716 .HD
1717 SMB/CIFS decoding
1718 .LP
1719 \fItcpdump\fP now includes fairly extensive SMB/CIFS/NBT decoding for data
1720 on UDP/137, UDP/138 and TCP/139.
1721 Some primitive decoding of IPX and
1722 NetBEUI SMB data is also done.
1723 .LP
1724 By default a fairly minimal decode is done, with a much more detailed
1725 decode done if -v is used.
1726 Be warned that with -v a single SMB packet
1727 may take up a page or more, so only use -v if you really want all the
1728 gory details.
1729 .LP
1730 For information on SMB packet formats and what all the fields mean see
1731 \%https://download.samba.org/pub/samba/specs/ and other online resources.
1732 The SMB patches were written by Andrew Tridgell
1733 (tridge@samba.org).
1734 .HD
1735 NFS Requests and Replies
1736 .LP
1737 Sun NFS (Network File System) requests and replies are printed as:
1738 .RS
1739 .nf
1740 .sp .5
1741 \fIsrc.sport > dst.nfs: NFS request xid xid len op args\fP
1742 \fIsrc.nfs > dst.dport: NFS reply xid xid reply stat len op results\fP
1743 .sp .5
1744 \f(CW
1745 sushi.1023 > wrl.nfs: NFS request xid 26377
1746 112 readlink fh 21,24/10.73165
1747 wrl.nfs > sushi.1023: NFS reply xid 26377
1748 reply ok 40 readlink "../var"
1749 sushi.1022 > wrl.nfs: NFS request xid 8219
1750 144 lookup fh 9,74/4096.6878 "xcolors"
1751 wrl.nfs > sushi.1022: NFS reply xid 8219
1752 reply ok 128 lookup fh 9,74/4134.3150
1753 \fR
1754 .sp .5
1755 .fi
1756 .RE
1757 In the first line, host \fIsushi\fP sends a transaction with id \fI26377\fP
1758 to \fIwrl\fP.
1759 The request was 112 bytes,
1760 excluding the UDP and IP headers.
1761 The operation was a \fIreadlink\fP
1762 (read symbolic link) on file handle (\fIfh\fP) 21,24/10.731657119.
1763 (If one is lucky, as in this case, the file handle can be interpreted
1764 as a major,minor device number pair, followed by the inode number and
1765 generation number.) In the second line, \fIwrl\fP replies `ok' with
1766 the same transaction id and the contents of the link.
1767 .LP
1768 In the third line, \fIsushi\fP asks (using a new transaction id) \fIwrl\fP
1769 to lookup the name `\fIxcolors\fP' in directory file 9,74/4096.6878. In
1770 the fourth line, \fIwrl\fP sends a reply with the respective transaction id.
1771 .LP
1772 Note that the data printed
1773 depends on the operation type.
1774 The format is intended to be self
1775 explanatory if read in conjunction with
1776 an NFS protocol spec.
1777 Also note that older versions of tcpdump printed NFS packets in a
1778 slightly different format: the transaction id (xid) would be printed
1779 instead of the non-NFS port number of the packet.
1780 .LP
1781 If the \-v (verbose) flag is given, additional information is printed.
1782 For example:
1783 .RS
1784 .nf
1785 .sp .5
1786 \f(CW
1787 sushi.1023 > wrl.nfs: NFS request xid 79658
1788 148 read fh 21,11/12.195 8192 bytes @ 24576
1789 wrl.nfs > sushi.1023: NFS reply xid 79658
1790 reply ok 1472 read REG 100664 ids 417/0 sz 29388
1791 \fP
1792 .sp .5
1793 .fi
1794 .RE
1795 (\-v also prints the IP header TTL, ID, length, and fragmentation fields,
1796 which have been omitted from this example.) In the first line,
1797 \fIsushi\fP asks \fIwrl\fP to read 8192 bytes from file 21,11/12.195,
1798 at byte offset 24576.
1799 \fIWrl\fP replies `ok'; the packet shown on the
1800 second line is the first fragment of the reply, and hence is only 1472
1801 bytes long (the other bytes will follow in subsequent fragments, but
1802 these fragments do not have NFS or even UDP headers and so might not be
1803 printed, depending on the filter expression used).
1804 Because the \-v flag
1805 is given, some of the file attributes (which are returned in addition
1806 to the file data) are printed: the file type (``REG'', for regular file),
1807 the file mode (in octal), the UID and GID, and the file size.
1808 .LP
1809 If the \-v flag is given more than once, even more details are printed.
1810 .LP
1811 NFS reply packets do not explicitly identify the RPC operation.
1812 Instead,
1813 \fItcpdump\fP keeps track of ``recent'' requests, and matches them to the
1814 replies using the transaction ID.
1815 If a reply does not closely follow the
1816 corresponding request, it might not be parsable.
1817 .HD
1818 AFS Requests and Replies
1819 .LP
1820 Transarc AFS (Andrew File System) requests and replies are printed
1821 as:
1822 .HD
1823 .RS
1824 .nf
1825 .sp .5
1826 \fIsrc.sport > dst.dport: rx packet-type\fP
1827 \fIsrc.sport > dst.dport: rx packet-type service call call-name args\fP
1828 \fIsrc.sport > dst.dport: rx packet-type service reply call-name args\fP
1829 .sp .5
1830 \f(CW
1831 elvis.7001 > pike.afsfs:
1832 rx data fs call rename old fid 536876964/1/1 ".newsrc.new"
1833 new fid 536876964/1/1 ".newsrc"
1834 pike.afsfs > elvis.7001: rx data fs reply rename
1835 \fR
1836 .sp .5
1837 .fi
1838 .RE
1839 In the first line, host elvis sends a RX packet to pike.
1840 This was
1841 a RX data packet to the fs (fileserver) service, and is the start of
1842 an RPC call.
1843 The RPC call was a rename, with the old directory file id
1844 of 536876964/1/1 and an old filename of `.newsrc.new', and a new directory
1845 file id of 536876964/1/1 and a new filename of `.newsrc'.
1846 The host pike
1847 responds with a RPC reply to the rename call (which was successful, because
1848 it was a data packet and not an abort packet).
1849 .LP
1850 In general, all AFS RPCs are decoded at least by RPC call name.
1851 Most
1852 AFS RPCs have at least some of the arguments decoded (generally only
1853 the `interesting' arguments, for some definition of interesting).
1854 .LP
1855 The format is intended to be self-describing, but it will probably
1856 not be useful to people who are not familiar with the workings of
1857 AFS and RX.
1858 .LP
1859 If the -v (verbose) flag is given twice, acknowledgement packets and
1860 additional header information is printed, such as the RX call ID,
1861 call number, sequence number, serial number, and the RX packet flags.
1862 .LP
1863 If the -v flag is given twice, additional information is printed,
1864 such as the RX call ID, serial number, and the RX packet flags.
1865 The MTU negotiation information is also printed from RX ack packets.
1866 .LP
1867 If the -v flag is given three times, the security index and service id
1868 are printed.
1869 .LP
1870 Error codes are printed for abort packets, with the exception of Ubik
1871 beacon packets (because abort packets are used to signify a yes vote
1872 for the Ubik protocol).
1873 .LP
1874 AFS reply packets do not explicitly identify the RPC operation.
1875 Instead,
1876 \fItcpdump\fP keeps track of ``recent'' requests, and matches them to the
1877 replies using the call number and service ID.
1878 If a reply does not closely
1879 follow the
1880 corresponding request, it might not be parsable.
1881
1882 .HD
1883 KIP AppleTalk (DDP in UDP)
1884 .LP
1885 AppleTalk DDP packets encapsulated in UDP datagrams are de-encapsulated
1886 and dumped as DDP packets (i.e., all the UDP header information is
1887 discarded).
1888 The file
1889 .I /etc/atalk.names
1890 is used to translate AppleTalk net and node numbers to names.
1891 Lines in this file have the form
1892 .RS
1893 .nf
1894 .sp .5
1895 \fInumber name\fP
1896
1897 \f(CW1.254 ether
1898 16.1 icsd-net
1899 1.254.110 ace\fR
1900 .sp .5
1901 .fi
1902 .RE
1903 The first two lines give the names of AppleTalk networks.
1904 The third
1905 line gives the name of a particular host (a host is distinguished
1906 from a net by the 3rd octet in the number \-
1907 a net number \fImust\fP have two octets and a host number \fImust\fP
1908 have three octets.) The number and name should be separated by
1909 whitespace (blanks or tabs).
1910 The
1911 .I /etc/atalk.names
1912 file may contain blank lines or comment lines (lines starting with
1913 a `#').
1914 .LP
1915 AppleTalk addresses are printed in the form
1916 .RS
1917 .nf
1918 .sp .5
1919 \fInet.host.port\fP
1920
1921 \f(CW144.1.209.2 > icsd-net.112.220
1922 office.2 > icsd-net.112.220
1923 jssmag.149.235 > icsd-net.2\fR
1924 .sp .5
1925 .fi
1926 .RE
1927 (If the
1928 .I /etc/atalk.names
1929 doesn't exist or doesn't contain an entry for some AppleTalk
1930 host/net number, addresses are printed in numeric form.)
1931 In the first example, NBP (DDP port 2) on net 144.1 node 209
1932 is sending to whatever is listening on port 220 of net icsd node 112.
1933 The second line is the same except the full name of the source node
1934 is known (`office').
1935 The third line is a send from port 235 on
1936 net jssmag node 149 to broadcast on the icsd-net NBP port (note that
1937 the broadcast address (255) is indicated by a net name with no host
1938 number \- for this reason it's a good idea to keep node names and
1939 net names distinct in /etc/atalk.names).
1940 .LP
1941 NBP (name binding protocol) and ATP (AppleTalk transaction protocol)
1942 packets have their contents interpreted.
1943 Other protocols just dump
1944 the protocol name (or number if no name is registered for the
1945 protocol) and packet size.
1946
1947 \fBNBP packets\fP are formatted like the following examples:
1948 .RS
1949 .nf
1950 .sp .5
1951 \f(CWicsd-net.112.220 > jssmag.2: nbp-lkup 190: "=:LaserWriter@*"
1952 jssmag.209.2 > icsd-net.112.220: nbp-reply 190: "RM1140:LaserWriter@*" 250
1953 techpit.2 > icsd-net.112.220: nbp-reply 190: "techpit:LaserWriter@*" 186\fR
1954 .sp .5
1955 .fi
1956 .RE
1957 The first line is a name lookup request for laserwriters sent by net icsd host
1958 112 and broadcast on net jssmag.
1959 The nbp id for the lookup is 190.
1960 The second line shows a reply for this request (note that it has the
1961 same id) from host jssmag.209 saying that it has a laserwriter
1962 resource named "RM1140" registered on port 250.
1963 The third line is
1964 another reply to the same request saying host techpit has laserwriter
1965 "techpit" registered on port 186.
1966
1967 \fBATP packet\fP formatting is demonstrated by the following example:
1968 .RS
1969 .nf
1970 .sp .5
1971 \f(CWjssmag.209.165 > helios.132: atp-req 12266<0-7> 0xae030001
1972 helios.132 > jssmag.209.165: atp-resp 12266:0 (512) 0xae040000
1973 helios.132 > jssmag.209.165: atp-resp 12266:1 (512) 0xae040000
1974 helios.132 > jssmag.209.165: atp-resp 12266:2 (512) 0xae040000
1975 helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
1976 helios.132 > jssmag.209.165: atp-resp 12266:4 (512) 0xae040000
1977 helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
1978 helios.132 > jssmag.209.165: atp-resp 12266:6 (512) 0xae040000
1979 helios.132 > jssmag.209.165: atp-resp*12266:7 (512) 0xae040000
1980 jssmag.209.165 > helios.132: atp-req 12266<3,5> 0xae030001
1981 helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
1982 helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
1983 jssmag.209.165 > helios.132: atp-rel 12266<0-7> 0xae030001
1984 jssmag.209.133 > helios.132: atp-req* 12267<0-7> 0xae030002\fR
1985 .sp .5
1986 .fi
1987 .RE
1988 Jssmag.209 initiates transaction id 12266 with host helios by requesting
1989 up to 8 packets (the `<0-7>').
1990 The hex number at the end of the line
1991 is the value of the `userdata' field in the request.
1992 .LP
1993 Helios responds with 8 512-byte packets.
1994 The `:digit' following the
1995 transaction id gives the packet sequence number in the transaction
1996 and the number in parens is the amount of data in the packet,
1997 excluding the ATP header.
1998 The `*' on packet 7 indicates that the
1999 EOM bit was set.
2000 .LP
2001 Jssmag.209 then requests that packets 3 & 5 be retransmitted.
2002 Helios
2003 resends them then jssmag.209 releases the transaction.
2004 Finally,
2005 jssmag.209 initiates the next request.
2006 The `*' on the request
2007 indicates that XO (`exactly once') was \fInot\fP set.
2008
2009 .SH "SEE ALSO"
2010 .BR stty (1),
2011 .BR pcap (3PCAP),
2012 .BR bpf (4),
2013 .BR nit (4P),
2014 .BR \%pcap-savefile (@MAN_FILE_FORMATS@),
2015 .BR \%pcap-filter (@MAN_MISC_INFO@),
2016 .BR \%pcap-tstamp (@MAN_MISC_INFO@)
2017 .LP
2018 .RS
2019 .na
2020 .I https://www.iana.org/assignments/media-types/application/vnd.tcpdump.pcap
2021 .ad
2022 .RE
2023 .LP
2024 .SH AUTHORS
2025 The original authors are:
2026 .LP
2027 Van Jacobson,
2028 Craig Leres and
2029 Steven McCanne, all of the
2030 Lawrence Berkeley National Laboratory, University of California, Berkeley, CA.
2031 .LP
2032 It is currently maintained by The Tcpdump Group.
2033 .LP
2034 The current version is available via HTTPS:
2035 .LP
2036 .RS
2037 .I https://www.tcpdump.org/
2038 .RE
2039 .LP
2040 The original distribution is available via anonymous ftp:
2041 .LP
2042 .RS
2043 .I ftp://ftp.ee.lbl.gov/old/tcpdump.tar.Z
2044 .RE
2045 .LP
2046 IPv6/IPsec support is added by WIDE/KAME project.
2047 This program uses OpenSSL/LibreSSL, under specific configurations.
2048 .SH BUGS
2049 To report a security issue please send an e-mail to \%security@tcpdump.org.
2050 .LP
2051 To report bugs and other problems, contribute patches, request a
2052 feature, provide generic feedback etc. please see the file
2053 .I CONTRIBUTING
2054 in the tcpdump source tree root.
2055 .LP
2056 NIT doesn't let you watch your own outbound traffic, BPF will.
2057 We recommend that you use the latter.
2058 .LP
2059 On Linux systems with 2.0[.x] kernels:
2060 .IP
2061 packets on the loopback device will be seen twice;
2062 .IP
2063 packet filtering cannot be done in the kernel, so that all packets must
2064 be copied from the kernel in order to be filtered in user mode;
2065 .IP
2066 all of a packet, not just the part that's within the snapshot length,
2067 will be copied from the kernel (the 2.0[.x] packet capture mechanism, if
2068 asked to copy only part of a packet to userspace, will not report the
2069 true length of the packet; this would cause most IP packets to get an
2070 error from
2071 .BR tcpdump );
2072 .IP
2073 capturing on some PPP devices won't work correctly.
2074 .LP
2075 We recommend that you upgrade to a 2.2 or later kernel.
2076 .LP
2077 Some attempt should be made to reassemble IP fragments or, at least
2078 to compute the right length for the higher level protocol.
2079 .LP
2080 Name server inverse queries are not dumped correctly: the (empty)
2081 question section is printed rather than real query in the answer
2082 section.
2083 Some believe that inverse queries are themselves a bug and
2084 prefer to fix the program generating them rather than \fItcpdump\fP.
2085 .LP
2086 A packet trace that crosses a daylight savings time change will give
2087 skewed time stamps (the time change is ignored).
2088 .LP
2089 Filter expressions on fields other than those in Token Ring headers will
2090 not correctly handle source-routed Token Ring packets.
2091 .LP
2092 Filter expressions on fields other than those in 802.11 headers will not
2093 correctly handle 802.11 data packets with both To DS and From DS set.
2094 .LP
2095 .BR "ip6 proto"
2096 should chase header chain, but at this moment it does not.
2097 .BR "ip6 protochain"
2098 is supplied for this behavior.
2099 .LP
2100 Arithmetic expression against transport layer headers, like \fBtcp[0]\fP,
2101 does not work against IPv6 packets.
2102 It only looks at IPv4 packets.