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