1TCPDUMP(8)                  System Manager's Manual                 TCPDUMP(8)
2
3
4

NAME

6       tcpdump - dump traffic on a network
7

SYNOPSIS

9       tcpdump [ -AbdDefhHIJKlLnNOpqStuUvxX# ] [ -B buffer_size ]
10               [ -c count ]
11               [ -C file_size ] [ -G rotate_seconds ] [ -F file ]
12               [ -i interface ] [ -j tstamp_type ] [ -m module ] [ -M secret ]
13               [ --number ] [ -Q|-P in|out|inout ]
14               [ -r file ] [ -V file ] [ -s snaplen ] [ -T type ] [ -w file ]
15               [ -W filecount ]
16               [ -E spi@ipaddr algo:secret,...  ]
17               [ -y datalinktype ] [ -z postrotate-command ] [ -Z user ]
18               [ --time-stamp-precision=tstamp_precision ]
19               [ --immediate-mode ] [ --version ]
20               [ expression ]
21

DESCRIPTION

23       Tcpdump  prints  out a description of the contents of packets on a net‐
24       work interface that match the boolean expression;  the  description  is
25       preceded  by a time stamp, printed, by default, as hours, minutes, sec‐
26       onds, and fractions of a second since midnight.  It  can  also  be  run
27       with the -w flag, which causes it to save the packet data to a file for
28       later analysis, and/or with the -r flag, which causes it to read from a
29       saved packet file rather than to read packets from a network interface.
30       It can also be run with the -V flag, which causes it to read a list  of
31       saved  packet  files.  In all cases, only packets that match expression
32       will be processed by tcpdump.
33
34       Tcpdump will, if not run with the -c flag, continue  capturing  packets
35       until  it is interrupted by a SIGINT signal (generated, for example, by
36       typing your interrupt character, typically control-C) or a SIGTERM sig‐
37       nal  (typically generated with the kill(1) command); if run with the -c
38       flag, it will capture packets until it is interrupted by  a  SIGINT  or
39       SIGTERM signal or the specified number of packets have been processed.
40
41       When tcpdump finishes capturing packets, it will report counts of:
42
43              packets ``captured'' (this is the number of packets that tcpdump
44              has received and processed);
45
46              packets ``received by filter'' (the meaning of this  depends  on
47              the  OS on which you're running tcpdump, and possibly on the way
48              the OS was configured - if a filter was specified on the command
49              line,  on some OSes it counts packets regardless of whether they
50              were matched by the filter expression and,  even  if  they  were
51              matched  by the filter expression, regardless of whether tcpdump
52              has read and processed them yet, on other OSes  it  counts  only
53              packets that were matched by the filter expression regardless of
54              whether tcpdump has read and processed them yet,  and  on  other
55              OSes  it  counts  only  packets  that were matched by the filter
56              expression and were processed by tcpdump);
57
58              packets ``dropped by kernel'' (this is  the  number  of  packets
59              that  were dropped, due to a lack of buffer space, by the packet
60              capture mechanism in the OS on which tcpdump is running, if  the
61              OS  reports that information to applications; if not, it will be
62              reported as 0).
63
64       On platforms that  support  the  SIGINFO  signal,  such  as  most  BSDs
65       (including  Mac  OS  X)  and  Digital/Tru64  UNIX, it will report those
66       counts when it receives a SIGINFO signal (generated,  for  example,  by
67       typing your ``status'' character, typically control-T, although on some
68       platforms, such as Mac OS X, the ``status'' character  is  not  set  by
69       default,  so  you must set it with stty(1) in order to use it) and will
70       continue capturing packets. On platforms that do not support  the  SIG‐
71       INFO signal, the same can be achieved by using the SIGUSR1 signal.
72
73       Reading packets from a network interface may require that you have spe‐
74       cial privileges; see the pcap (3PCAP) man page for details.  Reading  a
75       saved packet file doesn't require special privileges.
76

OPTIONS

78       -A     Print each packet (minus its link level header) in ASCII.  Handy
79              for capturing web pages.
80
81       -b     Print the AS number in BGP packets in ASDOT notation rather than
82              ASPLAIN notation.
83
84       -B buffer_size
85       --buffer-size=buffer_size
86              Set  the operating system capture buffer size to buffer_size, in
87              units of KiB (1024 bytes).
88
89       -c count
90              Exit after receiving count packets.
91
92       -C file_size
93              Before writing a raw packet to a  savefile,  check  whether  the
94              file  is  currently  larger than file_size and, if so, close the
95              current savefile and open a new one.  Savefiles after the  first
96              savefile  will  have the name specified with the -w flag, with a
97              number after it, starting at 1 and continuing upward.  The units
98              of  file_size  are  millions  of  bytes  (1,000,000  bytes,  not
99              1,048,576 bytes).
100
101       -d     Dump the compiled packet-matching code in a human readable  form
102              to standard output and stop.
103
104       -dd    Dump packet-matching code as a C program fragment.
105
106       -ddd   Dump  packet-matching  code  as decimal numbers (preceded with a
107              count).
108
109       -D
110       --list-interfaces
111              Print the list of the network interfaces available on the system
112              and  on  which  tcpdump  can  capture packets.  For each network
113              interface, a number and an interface name, possibly followed  by
114              a  text description of the interface, is printed.  The interface
115              name or the number can be supplied to the -i flag to specify  an
116              interface on which to capture.
117
118              This  can be useful on systems that don't have a command to list
119              them (e.g., Windows systems, or UNIX  systems  lacking  ifconfig
120              -a); the number can be useful on Windows 2000 and later systems,
121              where the interface name is a somewhat complex string.
122
123              The -D flag will not be supported if tcpdump was built  with  an
124              older version of libpcap that lacks the pcap_findalldevs() func‐
125              tion.
126
127       -e     Print the link-level header on each  dump  line.   This  can  be
128              used,  for  example,  to print MAC layer addresses for protocols
129              such as Ethernet and IEEE 802.11.
130
131       -E     Use spi@ipaddr algo:secret for decrypting IPsec ESP packets that
132              are addressed to addr and contain Security Parameter Index value
133              spi. This combination may be repeated with comma or newline sep‐
134              aration.
135
136              Note  that  setting the secret for IPv4 ESP packets is supported
137              at this time.
138
139              Algorithms may  be  des-cbc,  3des-cbc,  blowfish-cbc,  rc3-cbc,
140              cast128-cbc,  or  none.  The default is des-cbc.  The ability to
141              decrypt packets is only present if  tcpdump  was  compiled  with
142              cryptography enabled.
143
144              secret is the ASCII text for ESP secret key.  If preceded by 0x,
145              then a hex value will be read.
146
147              The option assumes RFC2406 ESP, not RFC1827 ESP.  The option  is
148              only  for  debugging purposes, and the use of this option with a
149              true `secret' key is discouraged.  By  presenting  IPsec  secret
150              key  onto  command line you make it visible to others, via ps(1)
151              and other occasions.
152
153              In addition to the above syntax, the syntax  file  name  may  be
154              used  to  have  tcpdump  read  the provided file in. The file is
155              opened upon receiving the first ESP packet, so any special  per‐
156              missions  that  tcpdump  may have been given should already have
157              been given up.
158
159       -f     Print `foreign' IPv4 addresses numerically rather than  symboli‐
160              cally  (this option is intended to get around serious brain dam‐
161              age in Sun's NIS server — usually it hangs  forever  translating
162              non-local internet numbers).
163
164              The  test  for  `foreign'  IPv4 addresses is done using the IPv4
165              address and netmask of the interface on which capture  is  being
166              done.   If that address or netmask are not available, available,
167              either because the interface on which capture is being done  has
168              no  address  or  netmask or because the capture is being done on
169              the Linux "any" interface, which can capture on  more  than  one
170              interface, this option will not work correctly.
171
172       -F file
173              Use  file  as  input  for  the filter expression.  An additional
174              expression given on the command line is ignored.
175
176       -G rotate_seconds
177              If specified, rotates the dump file specified with the -w option
178              every  rotate_seconds  seconds.   Savefiles  will  have the name
179              specified by -w which should include a time format as defined by
180              strftime(3).  If no time format is specified, each new file will
181              overwrite the previous.
182
183              If used in conjunction with the -C option, filenames  will  take
184              the form of `file<count>'.
185
186       -h
187       --help Print  the  tcpdump  and  libpcap version strings, print a usage
188              message, and exit.
189
190       --version
191              Print the tcpdump and libpcap version strings and exit.
192
193       -H     Attempt to detect 802.11s draft mesh headers.
194
195       -i interface
196       --interface=interface
197              Listen on interface.  If unspecified, tcpdump searches the  sys‐
198              tem interface list for the lowest numbered, configured up inter‐
199              face (excluding loopback), which may turn out to be,  for  exam‐
200              ple, ``eth0''.
201
202              On  Linux  systems with 2.2 or later kernels, an interface argu‐
203              ment of ``any'' can be used to capture packets from  all  inter‐
204              faces.   Note  that  captures  on the ``any'' device will not be
205              done in promiscuous mode.
206
207              If the -D flag is supported, an interface number as  printed  by
208              that flag can be used as the interface argument, if no interface
209              on the system has that number as a name.
210
211       -I
212       --monitor-mode
213              Put the interface in "monitor mode"; this is supported  only  on
214              IEEE 802.11 Wi-Fi interfaces, and supported only on some operat‐
215              ing systems.
216
217              Note that in monitor mode the adapter  might  disassociate  from
218              the  network with which it's associated, so that you will not be
219              able to use any wireless networks with that adapter.  This could
220              prevent  accessing  files on a network server, or resolving host
221              names or network addresses, if you are capturing in monitor mode
222              and are not connected to another network with another adapter.
223
224              This  flag  will  affect the output of the -L flag.  If -I isn't
225              specified, only those link-layer types  available  when  not  in
226              monitor mode will be shown; if -I is specified, only those link-
227              layer types available when in monitor mode will be shown.
228
229       --immediate-mode
230              Capture in "immediate mode".  In this mode, packets  are  deliv‐
231              ered  to  tcpdump  as  soon  as  they  arrive, rather than being
232              buffered for efficiency.  This  is  the  default  when  printing
233              packets  rather  than  saving  packets  to a ``savefile'' if the
234              packets are being printed to a terminal rather than to a file or
235              pipe.
236
237       -j tstamp_type
238       --time-stamp-type=tstamp_type
239              Set  the  time  stamp  type for the capture to tstamp_type.  The
240              names to use for  the  time  stamp  types  are  given  in  pcap-
241              tstamp(7);  not  all  the types listed there will necessarily be
242              valid for any given interface.
243
244       -J
245       --list-time-stamp-types
246              List the supported time stamp types for the interface and  exit.
247              If  the time stamp type cannot be set for the interface, no time
248              stamp types are listed.
249
250       --time-stamp-precision=tstamp_precision
251              When capturing, set the time stamp precision for the capture  to
252              tstamp_precision.  Note that availability of high precision time
253              stamps (nanoseconds) and their actual accuracy is  platform  and
254              hardware  dependent.   Also note that when writing captures made
255              with nanosecond accuracy to a  savefile,  the  time  stamps  are
256              written with nanosecond resolution, and the file is written with
257              a different magic number, to indicate that the time  stamps  are
258              in  seconds  and  nanoseconds;  not  all programs that read pcap
259              savefiles will be able to read those captures.
260
261       When reading a savefile, convert time stamps to the precision specified
262       by  timestamp_precision, and display them with that resolution.  If the
263       precision specified is less than the precision of time  stamps  in  the
264       file, the conversion will lose precision.
265
266       The  supported values for timestamp_precision are micro for microsecond
267       resolution  and  nano  for  nanosecond  resolution.   The  default   is
268       microsecond resolution.
269
270       -K
271       --dont-verify-checksums
272              Don't attempt to verify IP, TCP, or UDP checksums.  This is use‐
273              ful for interfaces that perform some or all  of  those  checksum
274              calculation  in  hardware; otherwise, all outgoing TCP checksums
275              will be flagged as bad.
276
277       -l     Make stdout line buffered.  Useful if you want to see  the  data
278              while capturing it.  E.g.,
279
280                     tcpdump -l | tee dat
281
282              or
283
284                     tcpdump -l > dat & tail -f dat
285
286              Note  that on Windows,``line buffered'' means ``unbuffered'', so
287              that WinDump will write each character  individually  if  -l  is
288              specified.
289
290              -U is similar to -l in its behavior, but it will cause output to
291              be ``packet-buffered'', so that the output is written to  stdout
292              at  the  end of each packet rather than at the end of each line;
293              this is buffered on all platforms, including Windows.
294
295       -L
296       --list-data-link-types
297              List the known data link types for the interface, in the  speci‐
298              fied  mode,  and exit.  The list of known data link types may be
299              dependent on the specified mode; for example, on some platforms,
300              a  Wi-Fi interface might support one set of data link types when
301              not in monitor mode (for example, it  might  support  only  fake
302              Ethernet  headers,  or might support 802.11 headers but not sup‐
303              port 802.11 headers with radio information) and another  set  of
304              data link types when in monitor mode (for example, it might sup‐
305              port 802.11 headers, or 802.11 headers with  radio  information,
306              only in monitor mode).
307
308       -m module
309              Load  SMI  MIB module definitions from file module.  This option
310              can be used several times to load several MIB modules into  tcp‐
311              dump.
312
313       -M secret
314              Use  secret  as a shared secret for validating the digests found
315              in TCP segments with the TCP-MD5 option (RFC 2385), if present.
316
317       -n     Don't convert host addresses to names.   This  can  be  used  to
318              avoid DNS lookups.
319
320       -nn    Don't convert protocol and port numbers etc. to names either.
321
322       -N     Don't  print  domain name qualification of host names.  E.g., if
323              you give this flag then tcpdump will print  ``nic''  instead  of
324              ``nic.ddn.mil''.
325
326       -#
327       --number
328              Print an optional packet number at the beginning of the line.
329
330       -O
331       --no-optimize
332              Do  not  run the packet-matching code optimizer.  This is useful
333              only if you suspect a bug in the optimizer.
334
335       -p
336       --no-promiscuous-mode
337              Don't put the interface into promiscuous mode.   Note  that  the
338              interface  might  be  in promiscuous mode for some other reason;
339              hence, `-p' cannot be used as an abbreviation  for  `ether  host
340              {local-hw-addr} or ether broadcast'.
341
342       -Q|-P direction
343       --direction=direction
344              Choose send/receive direction direction for which packets should
345              be captured. Possible values are `in', `out'  and  `inout'.  Not
346              available on all platforms.
347
348       -q     Quick  (quiet?) output.  Print less protocol information so out‐
349              put lines are shorter.
350
351       -r file
352              Read packets from file (which was created with the -w option  or
353              by  other  tools  that  write  pcap or pcap-ng files).  Standard
354              input is used if file is ``-''.
355
356       -S
357       --absolute-tcp-sequence-numbers
358              Print absolute, rather than relative, TCP sequence numbers.
359
360       -s snaplen
361       --snapshot-length=snaplen
362              Snarf snaplen bytes of data from each  packet  rather  than  the
363              default of 262144 bytes.  Packets truncated because of a limited
364              snapshot are indicated in the output  with  ``[|proto]'',  where
365              proto  is the name of the protocol level at which the truncation
366              has occurred.  Note that taking larger snapshots both  increases
367              the amount of time it takes to process packets and, effectively,
368              decreases the amount of packet buffering.  This may cause  pack‐
369              ets to be lost.  You should limit snaplen to the smallest number
370              that will capture the protocol information you're interested in.
371              Setting snaplen to 0 sets it to the default of 262144, for back‐
372              wards compatibility with recent older versions of tcpdump.
373
374       -T type
375              Force packets selected by "expression"  to  be  interpreted  the
376              specified  type.   Currently  known  types  are aodv (Ad-hoc On-
377              demand Distance Vector protocol), carp  (Common  Address  Redun‐
378              dancy  Protocol),  cnfp (Cisco NetFlow protocol), lmp (Link Man‐
379              agement Protocol), pgm (Pragmatic General Multicast),  pgm_zmtp1
380              (ZMTP/1.0 inside PGM/EPGM), resp (REdis Serialization Protocol),
381              radius (RADIUS), rpc (Remote  Procedure  Call),  rtp  (Real-Time
382              Applications  protocol),  rtcp  (Real-Time  Applications control
383              protocol),  snmp  (Simple  Network  Management  Protocol),  tftp
384              (Trivial  File  Transfer  Protocol), vat (Visual Audio Tool), wb
385              (distributed White Board), zmtp1 (ZeroMQ Message Transport  Pro‐
386              tocol 1.0) and vxlan (Virtual eXtensible Local Area Network).
387
388              Note  that  the  pgm type above affects UDP interpretation only,
389              the native PGM is always recognised as IP protocol  113  regard‐
390              less. UDP-encapsulated PGM is often called "EPGM" or "PGM/UDP".
391
392              Note  that  the  pgm_zmtp1  type above affects interpretation of
393              both native PGM and UDP at once. During the native PGM  decoding
394              the  application  data of an ODATA/RDATA packet would be decoded
395              as a ZeroMQ datagram  with  ZMTP/1.0  frames.   During  the  UDP
396              decoding  in addition to that any UDP packet would be treated as
397              an encapsulated PGM packet.
398
399       -t     Don't print a timestamp on each dump line.
400
401       -tt    Print the timestamp, as seconds since January 1, 1970, 00:00:00,
402              UTC,  and  fractions  of  a second since that time, on each dump
403              line.
404
405       -ttt   Print a delta (micro-second resolution) between current and pre‐
406              vious line on each dump line.
407
408       -tttt  Print  a timestamp, as hours, minutes, seconds, and fractions of
409              a second since midnight, preceded by  the  date,  on  each  dump
410              line.
411
412       -ttttt Print  a  delta  (micro-second  resolution)  between current and
413              first line on each dump line.
414
415       -u     Print undecoded NFS handles.
416
417       -U
418       --packet-buffered
419              If the -w option is not specified, make the printed packet  out‐
420              put  ``packet-buffered'';  i.e.,  as the description of the con‐
421              tents of each packet is printed, it will be written to the stan‐
422              dard  output, rather than, when not writing to a terminal, being
423              written only when the output buffer fills.
424
425              If the -w option is specified, make the saved raw packet  output
426              ``packet-buffered'';  i.e.,  as each packet is saved, it will be
427              written to the output file, rather than being written only  when
428              the output buffer fills.
429
430              The  -U  flag will not be supported if tcpdump was built with an
431              older version of libpcap that lacks the pcap_dump_flush()  func‐
432              tion.
433
434       -v     When  parsing and printing, produce (slightly more) verbose out‐
435              put.  For example,  the  time  to  live,  identification,  total
436              length  and  options  in an IP packet are printed.  Also enables
437              additional packet integrity checks such as verifying the IP  and
438              ICMP header checksum.
439
440              When writing to a file with the -w option, report, every 10 sec‐
441              onds, the number of packets captured.
442
443       -vv    Even more verbose output.  For example,  additional  fields  are
444              printed  from  NFS  reply  packets,  and  SMB  packets are fully
445              decoded.
446
447       -vvv   Even more verbose output.  For example, telnet SB ... SE options
448              are  printed in full.  With -X Telnet options are printed in hex
449              as well.
450
451       -V file
452              Read a list of filenames from file. Standard input  is  used  if
453              file is ``-''.
454
455       -w file
456              Write  the  raw packets to file rather than parsing and printing
457              them out.  They can later be printed with the -r option.   Stan‐
458              dard output is used if file is ``-''.
459
460              This  output will be buffered if written to a file or pipe, so a
461              program reading from the file or pipe may not see packets for an
462              arbitrary  amount  of  time after they are received.  Use the -U
463              flag to cause  packets  to  be  written  as  soon  as  they  are
464              received.
465
466              The  MIME  type application/vnd.tcpdump.pcap has been registered
467              with IANA for pcap files. The filename extension  .pcap  appears
468              to  be  the most commonly used along with .cap and .dmp. Tcpdump
469              itself doesn't check the extension when  reading  capture  files
470              and  doesn't  add  an extension when writing them (it uses magic
471              numbers in the file header  instead).  However,  many  operating
472              systems and applications will use the extension if it is present
473              and adding one (e.g. .pcap) is recommended.
474
475              See pcap-savefile(5) for a description of the file format.
476
477       -W     Used in conjunction with the -C option, this will limit the num‐
478              ber  of  files  created to the specified number, and begin over‐
479              writing files from the beginning,  thus  creating  a  'rotating'
480              buffer.  In addition, it will name the files with enough leading
481              0s to support the maximum number of files, allowing them to sort
482              correctly.
483
484              Used in conjunction with the -G option, this will limit the num‐
485              ber of rotated dump files that get created, exiting with  status
486              0 when reaching the limit. If used with -C as well, the behavior
487              will result in cyclical files per timeslice.
488
489       -x     When parsing and printing, in addition to printing  the  headers
490              of  each  packet,  print the data of each packet (minus its link
491              level header) in hex.  The  smaller  of  the  entire  packet  or
492              snaplen  bytes  will  be  printed.  Note that this is the entire
493              link-layer packet, so for link layers that pad (e.g.  Ethernet),
494              the  padding  bytes  will  also be printed when the higher layer
495              packet is shorter than the required padding.
496
497       -xx    When parsing and printing, in addition to printing  the  headers
498              of  each  packet,  print  the data of each packet, including its
499              link level header, in hex.
500
501       -X     When parsing and printing, in addition to printing  the  headers
502              of  each  packet,  print the data of each packet (minus its link
503              level header)  in  hex  and  ASCII.   This  is  very  handy  for
504              analysing new protocols.
505
506       -XX    When  parsing  and printing, in addition to printing the headers
507              of each packet, print the data of  each  packet,  including  its
508              link level header, in hex and ASCII.
509
510       -y datalinktype
511       --linktype=datalinktype
512              Set  the  data  link  type  to  use  while  capturing packets to
513              datalinktype.
514
515       -z postrotate-command
516              Used in conjunction with the -C or -G options,  this  will  make
517              tcpdump  run " postrotate-command file " where file is the save‐
518              file being closed after each rotation. For  example,  specifying
519              -z  gzip  or  -z bzip2 will compress each savefile using gzip or
520              bzip2.
521
522              Note that tcpdump will run the command in parallel to  the  cap‐
523              ture, using the lowest priority so that this doesn't disturb the
524              capture process.
525
526              And in case you would like to use a command  that  itself  takes
527              flags  or  different  arguments,  you  can  always write a shell
528              script that will take the savefile name as  the  only  argument,
529              make  the flags & arguments arrangements and execute the command
530              that you want.
531
532       -Z user
533       --relinquish-privileges=user
534              If tcpdump is running as root, after opening the capture  device
535              or  input savefile, but before opening any savefiles for output,
536              change the user ID to user and the group ID to the primary group
537              of user.
538
539              This behavior can also be enabled by default at compile time.
540
541        expression
542              selects  which  packets  will  be  dumped.   If no expression is
543              given, all packets on the net will be dumped.   Otherwise,  only
544              packets for which expression is `true' will be dumped.
545
546              For the expression syntax, see pcap-filter(7).
547
548              The  expression  argument  can  be passed to tcpdump as either a
549              single Shell argument, or as multiple Shell arguments, whichever
550              is more convenient.  Generally, if the expression contains Shell
551              metacharacters, such as  backslashes  used  to  escape  protocol
552              names,  it  is  easier  to  pass it as a single, quoted argument
553              rather than to escape the Shell metacharacters.  Multiple  argu‐
554              ments are concatenated with spaces before being parsed.
555

EXAMPLES

557       To print all packets arriving at or departing from sundown:
558              tcpdump host sundown
559
560       To print traffic between helios and either hot or ace:
561              tcpdump host helios and \( hot or ace \)
562
563       To print all IP packets between ace and any host except helios:
564              tcpdump ip host ace and not helios
565
566       To print all traffic between local hosts and hosts at Berkeley:
567              tcpdump net ucb-ether
568
569       To  print all ftp traffic through internet gateway snup: (note that the
570       expression is quoted to prevent the shell from  (mis-)interpreting  the
571       parentheses):
572              tcpdump 'gateway snup and (port ftp or ftp-data)'
573
574       To  print traffic neither sourced from nor destined for local hosts (if
575       you gateway to one other net, this stuff should never make it onto your
576       local net).
577              tcpdump ip and not net localnet
578
579       To  print  the  start and end packets (the SYN and FIN packets) of each
580       TCP conversation that involves a non-local host.
581              tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net localnet'
582
583       To print all IPv4 HTTP packets to and from port  80,  i.e.  print  only
584       packets  that  contain  data, not, for example, SYN and FIN packets and
585       ACK-only packets.  (IPv6 is left as an exercise for the reader.)
586              tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
587
588       To print IP packets longer than 576 bytes sent through gateway snup:
589              tcpdump 'gateway snup and ip[2:2] > 576'
590
591       To print IP broadcast or multicast packets that were not sent via  Eth‐
592       ernet broadcast or multicast:
593              tcpdump 'ether[0] & 1 = 0 and ip[16] >= 224'
594
595       To print all ICMP packets that are not echo requests/replies (i.e., not
596       ping packets):
597              tcpdump 'icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply'
598

OUTPUT FORMAT

600       The output of tcpdump is protocol dependent.   The  following  gives  a
601       brief description and examples of most of the formats.
602
603       Timestamps
604
605       By  default,  all  output lines are preceded by a timestamp.  The time‐
606       stamp is the current clock time in the form
607              hh:mm:ss.frac
608       and is as accurate as the kernel's clock.  The timestamp  reflects  the
609       time the kernel applied a time stamp to the packet.  No attempt is made
610       to account for the time lag between when the network interface finished
611       receiving  the  packet  from  the network and when the kernel applied a
612       time stamp to the packet; that time lag could include a  delay  between
613       the  time  when  the network interface finished receiving a packet from
614       the network and the time when an interrupt was delivered to the  kernel
615       to get it to read the packet and a delay between the time when the ker‐
616       nel serviced the `new packet' interrupt and the time when it applied  a
617       time stamp to the packet.
618
619       Link Level Headers
620
621       If  the '-e' option is given, the link level header is printed out.  On
622       Ethernets, the source and destination addresses, protocol,  and  packet
623       length are printed.
624
625       On  FDDI  networks, the  '-e' option causes tcpdump to print the `frame
626       control' field,  the source and destination addresses, and  the  packet
627       length.   (The  `frame control' field governs the interpretation of the
628       rest of the packet.  Normal packets (such as those containing IP  data‐
629       grams)  are `async' packets, with a priority value between 0 and 7; for
630       example, `async4'.  Such packets are assumed to contain an 802.2  Logi‐
631       cal  Link  Control (LLC) packet; the LLC header is printed if it is not
632       an ISO datagram or a so-called SNAP packet.
633
634       On Token Ring networks, the '-e' option causes  tcpdump  to  print  the
635       `access control' and `frame control' fields, the source and destination
636       addresses, and the packet length.  As on  FDDI  networks,  packets  are
637       assumed  to  contain  an  LLC  packet.   Regardless of whether the '-e'
638       option is specified or not, the source routing information  is  printed
639       for source-routed packets.
640
641       On  802.11 networks, the '-e' option causes tcpdump to print the `frame
642       control' fields, all of the addresses in the  802.11  header,  and  the
643       packet  length.  As on FDDI networks, packets are assumed to contain an
644       LLC packet.
645
646       (N.B.: The following description assumes familiarity with the SLIP com‐
647       pression algorithm described in RFC-1144.)
648
649       On SLIP links, a direction indicator (``I'' for inbound, ``O'' for out‐
650       bound), packet type, and compression information are printed out.   The
651       packet  type is printed first.  The three types are ip, utcp, and ctcp.
652       No further link information is printed for ip packets.  For  TCP  pack‐
653       ets,  the  connection identifier is printed following the type.  If the
654       packet is compressed, its encoded header is printed out.   The  special
655       cases are printed out as *S+n and *SA+n, where n is the amount by which
656       the sequence number (or sequence number and ack) has changed.  If it is
657       not  a  special  case,  zero  or more changes are printed.  A change is
658       indicated by U (urgent pointer), W (window), A (ack), S (sequence  num‐
659       ber), and I (packet ID), followed by a delta (+n or -n), or a new value
660       (=n).  Finally, the amount of data in the packet and compressed  header
661       length are printed.
662
663       For  example,  the  following  line  shows  an  outbound compressed TCP
664       packet, with an implicit connection identifier; the ack has changed  by
665       6, the sequence number by 49, and the packet ID by 6; there are 3 bytes
666       of data and 6 bytes of compressed header:
667              O ctcp * A+6 S+49 I+6 3 (6)
668
669       ARP/RARP Packets
670
671       Arp/rarp output shows the type of request and its arguments.  The  for‐
672       mat  is  intended to be self explanatory.  Here is a short sample taken
673       from the start of an `rlogin' from host rtsg to host csam:
674              arp who-has csam tell rtsg
675              arp reply csam is-at CSAM
676       The first line says that rtsg sent an arp packet asking for the  Ether‐
677       net  address  of  internet  host  csam.  Csam replies with its Ethernet
678       address (in this example, Ethernet addresses are in caps  and  internet
679       addresses in lower case).
680
681       This would look less redundant if we had done tcpdump -n:
682              arp who-has 128.3.254.6 tell 128.3.254.68
683              arp reply 128.3.254.6 is-at 02:07:01:00:01:c4
684
685       If  we had done tcpdump -e, the fact that the first packet is broadcast
686       and the second is point-to-point would be visible:
687              RTSG Broadcast 0806  64: arp who-has csam tell rtsg
688              CSAM RTSG 0806  64: arp reply csam is-at CSAM
689       For the first packet this says the Ethernet source address is RTSG, the
690       destination is the Ethernet broadcast address, the type field contained
691       hex 0806 (type ETHER_ARP) and the total length was 64 bytes.
692
693       IPv4 Packets
694
695       If the link-layer header is not being printed, for IPv4 packets, IP  is
696       printed after the time stamp.
697
698       If  the -v flag is specified, information from the IPv4 header is shown
699       in parentheses after the IP or the link-layer header.  The general for‐
700       mat of this information is:
701              tos tos, ttl ttl, id id, offset offset, flags [flags], proto proto, length length, options (options)
702       tos  is  the type of service field; if the ECN bits are non-zero, those
703       are reported as ECT(1), ECT(0), or CE.  ttl is the time-to-live; it  is
704       not reported if it is zero.  id is the IP identification field.  offset
705       is the fragment offset field; it is printed whether this is part  of  a
706       fragmented  datagram  or  not.   flags  are  the  MF and DF flags; + is
707       reported if MF is set, and DFP is reported if F is set.  If neither are
708       set,  .  is  reported.   proto is the protocol ID field.  length is the
709       total length field.  options are the IP options, if any.
710
711       Next, for TCP and UDP packets, the source and destination IP  addresses
712       and TCP or UDP ports, with a dot between each IP address and its corre‐
713       sponding port, will be printed, with a > separating the source and des‐
714       tination.  For other protocols, the addresses will be printed, with a >
715       separating the source and destination.  Higher level protocol  informa‐
716       tion, if any, will be printed after that.
717
718       For  fragmented  IP  datagrams,  the first fragment contains the higher
719       level protocol header; fragments after  the  first  contain  no  higher
720       level  protocol header.  Fragmentation information will be printed only
721       with the -v flag, in the IP header information, as described above.
722
723       TCP Packets
724
725       (N.B.:The following description assumes familiarity with the TCP proto‐
726       col  described  in RFC-793.  If you are not familiar with the protocol,
727       this description will not be of much use to you.)
728
729       The general format of a TCP protocol line is:
730              src > dst: Flags [tcpflags], seq data-seqno, ack ackno, win window, urg urgent, options [opts], length len
731       Src and dst are the source and  destination  IP  addresses  and  ports.
732       Tcpflags are some combination of S (SYN), F (FIN), P (PUSH), R (RST), U
733       (URG), W (ECN CWR), E (ECN-Echo) or `.' (ACK), or `none'  if  no  flags
734       are set.  Data-seqno describes the portion of sequence space covered by
735       the data in this packet (see example below).  Ackno is sequence  number
736       of the next data expected the other direction on this connection.  Win‐
737       dow is the number of bytes of receive buffer space available the  other
738       direction  on this connection.  Urg indicates there is `urgent' data in
739       the packet.  Opts are TCP options (e.g., mss 1024).  Len is the  length
740       of payload data.
741
742       Iptype,  Src,  dst,  and  flags  are  always present.  The other fields
743       depend on the contents of the packet's TCP protocol header and are out‐
744       put only if appropriate.
745
746       Here is the opening portion of an rlogin from host rtsg to host csam.
747              IP rtsg.1023 > csam.login: Flags [S], seq 768512:768512, win 4096, opts [mss 1024]
748              IP csam.login > rtsg.1023: Flags [S.], seq, 947648:947648, ack 768513, win 4096, opts [mss 1024]
749              IP rtsg.1023 > csam.login: Flags [.], ack 1, win 4096
750              IP rtsg.1023 > csam.login: Flags [P.], seq 1:2, ack 1, win 4096, length 1
751              IP csam.login > rtsg.1023: Flags [.], ack 2, win 4096
752              IP rtsg.1023 > csam.login: Flags [P.], seq 2:21, ack 1, win 4096, length 19
753              IP csam.login > rtsg.1023: Flags [P.], seq 1:2, ack 21, win 4077, length 1
754              IP csam.login > rtsg.1023: Flags [P.], seq 2:3, ack 21, win 4077, urg 1, length 1
755              IP csam.login > rtsg.1023: Flags [P.], seq 3:4, ack 21, win 4077, urg 1, length 1
756       The  first  line  says that TCP port 1023 on rtsg sent a packet to port
757       login on csam.  The S indicates that the SYN flag was set.  The  packet
758       sequence  number was 768512 and it contained no data.  (The notation is
759       `first:last' which means `sequence numbers first up to but not  includ‐
760       ing last.)  There was no piggy-backed ack, the available receive window
761       was 4096 bytes and there was a max-segment-size  option  requesting  an
762       mss of 1024 bytes.
763
764       Csam  replies  with  a similar packet except it includes a piggy-backed
765       ack for rtsg's SYN.  Rtsg then acks csam's SYN.  The `.' means the  ACK
766       flag  was  set.   The  packet  contained  no  data  so there is no data
767       sequence number or length.  Note that the  ack  sequence  number  is  a
768       small  integer  (1).  The first time tcpdump sees a TCP `conversation',
769       it prints the sequence number from the packet.  On  subsequent  packets
770       of  the  conversation,  the  difference  between  the  current packet's
771       sequence number and this initial  sequence  number  is  printed.   This
772       means that sequence numbers after the first can be interpreted as rela‐
773       tive byte positions in the conversation's data stream (with  the  first
774       data  byte each direction being `1').  `-S' will override this feature,
775       causing the original sequence numbers to be output.
776
777       On the 6th line, rtsg sends csam 19 bytes of data (bytes 2  through  20
778       in  the rtsg → csam side of the conversation).  The PUSH flag is set in
779       the packet.  On the 7th line, csam says it's received data sent by rtsg
780       up  to but not including byte 21.  Most of this data is apparently sit‐
781       ting in the socket buffer since csam's receive  window  has  gotten  19
782       bytes  smaller.   Csam  also  sends  one  byte  of data to rtsg in this
783       packet.  On the 8th and 9th lines, csam  sends  two  bytes  of  urgent,
784       pushed data to rtsg.
785
786       If  the  snapshot was small enough that tcpdump didn't capture the full
787       TCP header, it interprets as much of the header  as  it  can  and  then
788       reports  ``[|tcp]'' to indicate the remainder could not be interpreted.
789       If the header contains a bogus option (one with a length that's  either
790       too  small  or  beyond  the  end  of the header), tcpdump reports it as
791       ``[bad opt]'' and does not interpret any further  options  (since  it's
792       impossible  to  tell where they start).  If the header length indicates
793       options are present but the IP datagram length is not long  enough  for
794       the  options  to  actually  be  there, tcpdump reports it as ``[bad hdr
795       length]''.
796
797       Capturing TCP packets with particular flag combinations (SYN-ACK,  URG-
798       ACK, etc.)
799
800       There are 8 bits in the control bits section of the TCP header:
801
802              CWR | ECE | URG | ACK | PSH | RST | SYN | FIN
803
804       Let's  assume  that we want to watch packets used in establishing a TCP
805       connection.  Recall that TCP uses a 3-way handshake  protocol  when  it
806       initializes  a  new  connection; the connection sequence with regard to
807       the TCP control bits is
808
809              1) Caller sends SYN
810              2) Recipient responds with SYN, ACK
811              3) Caller sends ACK
812
813       Now we're interested in capturing packets that have only  the  SYN  bit
814       set  (Step  1).  Note that we don't want packets from step 2 (SYN-ACK),
815       just a plain initial SYN.  What we need is a correct filter  expression
816       for tcpdump.
817
818       Recall the structure of a TCP header without options:
819
820        0                            15                              31
821       -----------------------------------------------------------------
822       |          source port          |       destination port        |
823       -----------------------------------------------------------------
824       |                        sequence number                        |
825       -----------------------------------------------------------------
826       |                     acknowledgment number                     |
827       -----------------------------------------------------------------
828       |  HL   | rsvd  |C|E|U|A|P|R|S|F|        window size            |
829       -----------------------------------------------------------------
830       |         TCP checksum          |       urgent pointer          |
831       -----------------------------------------------------------------
832
833       A  TCP  header  usually  holds  20  octets  of data, unless options are
834       present.  The first line of the graph contains octets 0 - 3, the second
835       line shows octets 4 - 7 etc.
836
837       Starting  to  count with 0, the relevant TCP control bits are contained
838       in octet 13:
839
840        0             7|             15|             23|             31
841       ----------------|---------------|---------------|----------------
842       |  HL   | rsvd  |C|E|U|A|P|R|S|F|        window size            |
843       ----------------|---------------|---------------|----------------
844       |               |  13th octet   |               |               |
845
846       Let's have a closer look at octet no. 13:
847
848                       |               |
849                       |---------------|
850                       |C|E|U|A|P|R|S|F|
851                       |---------------|
852                       |7   5   3     0|
853
854       These are the TCP control bits we are interested in.  We have  numbered
855       the  bits  in  this octet from 0 to 7, right to left, so the PSH bit is
856       bit number 3, while the URG bit is number 5.
857
858       Recall that we want to capture packets with only SYN  set.   Let's  see
859       what happens to octet 13 if a TCP datagram arrives with the SYN bit set
860       in its header:
861
862                       |C|E|U|A|P|R|S|F|
863                       |---------------|
864                       |0 0 0 0 0 0 1 0|
865                       |---------------|
866                       |7 6 5 4 3 2 1 0|
867
868       Looking at the control bits section we see that only bit number 1 (SYN)
869       is set.
870
871       Assuming  that  octet number 13 is an 8-bit unsigned integer in network
872       byte order, the binary value of this octet is
873
874              00000010
875
876       and its decimal representation is
877
878          7     6     5     4     3     2     1     0
879       0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 1*2 + 0*2  =  2
880
881       We're almost done, because now we know that if only  SYN  is  set,  the
882       value  of the 13th octet in the TCP header, when interpreted as a 8-bit
883       unsigned integer in network byte order, must be exactly 2.
884
885       This relationship can be expressed as
886              tcp[13] == 2
887
888       We can use this expression as the filter for tcpdump in order to  watch
889       packets which have only SYN set:
890              tcpdump -i xl0 tcp[13] == 2
891
892       The expression says "let the 13th octet of a TCP datagram have the dec‐
893       imal value 2", which is exactly what we want.
894
895       Now, let's assume that we need to capture SYN  packets,  but  we  don't
896       care  if  ACK  or  any  other  TCP control bit is set at the same time.
897       Let's see what happens to octet 13 when a TCP datagram with SYN-ACK set
898       arrives:
899
900            |C|E|U|A|P|R|S|F|
901            |---------------|
902            |0 0 0 1 0 0 1 0|
903            |---------------|
904            |7 6 5 4 3 2 1 0|
905
906       Now  bits 1 and 4 are set in the 13th octet.  The binary value of octet
907       13 is
908
909                   00010010
910
911       which translates to decimal
912
913          7     6     5     4     3     2     1     0
914       0*2 + 0*2 + 0*2 + 1*2 + 0*2 + 0*2 + 1*2 + 0*2   = 18
915
916       Now we can't just use 'tcp[13] == 18' in the tcpdump filter expression,
917       because that would select only those packets that have SYN-ACK set, but
918       not those with only SYN set.  Remember that we don't care if ACK or any
919       other control bit is set as long as SYN is set.
920
921       In order to achieve our goal, we need to logically AND the binary value
922       of octet 13 with some other value to preserve the  SYN  bit.   We  know
923       that  we  want  SYN  to  be set in any case, so we'll logically AND the
924       value in the 13th octet with the binary value of a SYN:
925
926                 00010010 SYN-ACK              00000010 SYN
927            AND  00000010 (we want SYN)   AND  00000010 (we want SYN)
928                 --------                      --------
929            =    00000010                 =    00000010
930
931       We see that this AND operation  delivers  the  same  result  regardless
932       whether ACK or another TCP control bit is set.  The decimal representa‐
933       tion of the AND value as well as the result  of  this  operation  is  2
934       (binary 00000010), so we know that for packets with SYN set the follow‐
935       ing relation must hold true:
936
937              ( ( value of octet 13 ) AND ( 2 ) ) == ( 2 )
938
939       This points us to the tcpdump filter expression
940                   tcpdump -i xl0 'tcp[13] & 2 == 2'
941
942       Some offsets and field values may be expressed as names rather than  as
943       numeric values. For example tcp[13] may be replaced with tcp[tcpflags].
944       The following TCP flag field values are also available:  tcp-fin,  tcp-
945       syn, tcp-rst, tcp-push, tcp-act, tcp-urg.
946
947       This can be demonstrated as:
948                   tcpdump -i xl0 'tcp[tcpflags] & tcp-push != 0'
949
950       Note that you should use single quotes or a backslash in the expression
951       to hide the AND ('&') special character from the shell.
952
953       UDP Packets
954
955       UDP format is illustrated by this rwho packet:
956              actinide.who > broadcast.who: udp 84
957       This says that port who on host actinide sent a udp  datagram  to  port
958       who on host broadcast, the Internet broadcast address.  The packet con‐
959       tained 84 bytes of user data.
960
961       Some UDP services are recognized (from the source or  destination  port
962       number) and the higher level protocol information printed.  In particu‐
963       lar, Domain Name service requests (RFC-1034/1035)  and  Sun  RPC  calls
964       (RFC-1050) to NFS.
965
966       UDP Name Server Requests
967
968       (N.B.:The  following  description  assumes  familiarity with the Domain
969       Service protocol described in RFC-1035.  If you are not  familiar  with
970       the  protocol,  the  following description will appear to be written in
971       greek.)
972
973       Name server requests are formatted as
974              src > dst: id op? flags qtype qclass name (len)
975              h2opolo.1538 > helios.domain: 3+ A? ucbvax.berkeley.edu. (37)
976       Host h2opolo asked the domain server on helios for  an  address  record
977       (qtype=A)  associated  with the name ucbvax.berkeley.edu.  The query id
978       was `3'.  The `+' indicates the recursion desired flag  was  set.   The
979       query  length was 37 bytes, not including the UDP and IP protocol head‐
980       ers.  The query operation was the normal one, Query, so  the  op  field
981       was  omitted.   If  the  op  had been anything else, it would have been
982       printed between the `3' and the `+'.  Similarly,  the  qclass  was  the
983       normal  one,  C_IN,  and  omitted.   Any  other  qclass would have been
984       printed immediately after the `A'.
985
986       A few anomalies are checked and may result in extra fields enclosed  in
987       square  brackets:   If a query contains an answer, authority records or
988       additional records section, ancount, nscount, or arcount are printed as
989       `[na]', `[nn]' or  `[nau]' where n is the appropriate count.  If any of
990       the response bits are set (AA, RA or rcode) or  any  of  the  `must  be
991       zero' bits are set in bytes two and three, `[b2&3=x]' is printed, where
992       x is the hex value of header bytes two and three.
993
994       UDP Name Server Responses
995
996       Name server responses are formatted as
997              src > dst:  id op rcode flags a/n/au type class data (len)
998              helios.domain > h2opolo.1538: 3 3/3/7 A 128.32.137.3 (273)
999              helios.domain > h2opolo.1537: 2 NXDomain* 0/1/0 (97)
1000       In the first example, helios responds to query id 3 from h2opolo with 3
1001       answer  records,  3  name server records and 7 additional records.  The
1002       first answer record is type  A  (address)  and  its  data  is  internet
1003       address  128.32.137.3.   The  total size of the response was 273 bytes,
1004       excluding UDP and IP headers.  The op (Query) and response code  (NoEr‐
1005       ror) were omitted, as was the class (C_IN) of the A record.
1006
1007       In  the second example, helios responds to query 2 with a response code
1008       of non-existent domain (NXDomain) with no answers, one name server  and
1009       no  authority records.  The `*' indicates that the authoritative answer
1010       bit was set.  Since there were no answers, no type, class or data  were
1011       printed.
1012
1013       Other  flag  characters that might appear are `-' (recursion available,
1014       RA, not set) and `|' (truncated message, TC, set).  If  the  `question'
1015       section doesn't contain exactly one entry, `[nq]' is printed.
1016
1017       SMB/CIFS decoding
1018
1019       tcpdump now includes fairly extensive SMB/CIFS/NBT decoding for data on
1020       UDP/137, UDP/138 and TCP/139.  Some primitive decoding of IPX and  Net‐
1021       BEUI SMB data is also done.
1022
1023       By  default  a fairly minimal decode is done, with a much more detailed
1024       decode done if -v is used.  Be warned that with -v a single SMB  packet
1025       may  take  up a page or more, so only use -v if you really want all the
1026       gory details.
1027
1028       For information on SMB packet formats and what all the fields mean  see
1029       www.cifs.org   or  the  pub/samba/specs/  directory  on  your  favorite
1030       samba.org mirror site.  The SMB patches were written by Andrew Tridgell
1031       (tridge@samba.org).
1032
1033       NFS Requests and Replies
1034
1035       Sun NFS (Network File System) requests and replies are printed as:
1036              src.sport > dst.nfs: NFS request xid xid len op args
1037              src.nfs > dst.dport: NFS reply xid xid reply stat len op results
1038              sushi.1023 > wrl.nfs: NFS request xid 26377
1039                   112 readlink fh 21,24/10.73165
1040              wrl.nfs > sushi.1023: NFS reply xid 26377
1041                   reply ok 40 readlink "../var"
1042              sushi.1022 > wrl.nfs: NFS request xid 8219
1043                   144 lookup fh 9,74/4096.6878 "xcolors"
1044              wrl.nfs > sushi.1022: NFS reply xid 8219
1045                   reply ok 128 lookup fh 9,74/4134.3150
1046       In the first line, host sushi sends a transaction with id 26377 to wrl.
1047       The request was 112 bytes, excluding the UDP and IP headers.  The oper‐
1048       ation  was  a  readlink  (read  symbolic  link)  on  file  handle  (fh)
1049       21,24/10.731657119.  (If one is lucky, as in this case, the file handle
1050       can be interpreted as a major,minor device number pair, followed by the
1051       inode number and generation number.) In the second  line,  wrl  replies
1052       `ok' with the same transaction id and the contents of the link.
1053
1054       In  the  third  line,  sushi  asks  (using a new transaction id) wrl to
1055       lookup the name `xcolors' in  directory  file  9,74/4096.6878.  In  the
1056       fourth line, wrl sends a reply with the respective transaction id.
1057
1058       Note  that  the data printed depends on the operation type.  The format
1059       is intended to be self explanatory if read in conjunction with  an  NFS
1060       protocol  spec.   Also  note that older versions of tcpdump printed NFS
1061       packets in a slightly different format: the transaction id (xid)  would
1062       be printed instead of the non-NFS port number of the packet.
1063
1064       If  the  -v (verbose) flag is given, additional information is printed.
1065       For example:
1066              sushi.1023 > wrl.nfs: NFS request xid 79658
1067                   148 read fh 21,11/12.195 8192 bytes @ 24576
1068              wrl.nfs > sushi.1023: NFS reply xid 79658
1069                   reply ok 1472 read REG 100664 ids 417/0 sz 29388
1070       (-v also prints the  IP  header  TTL,  ID,  length,  and  fragmentation
1071       fields, which have been omitted from this example.)  In the first line,
1072       sushi asks wrl to read 8192 bytes from file 21,11/12.195, at byte  off‐
1073       set  24576.   Wrl  replies `ok'; the packet shown on the second line is
1074       the first fragment of the reply, and hence is only 1472 bytes long (the
1075       other bytes will follow in subsequent fragments, but these fragments do
1076       not have NFS or even UDP headers and so might not be printed, depending
1077       on  the filter expression used).  Because the -v flag is given, some of
1078       the file attributes (which are returned in addition to the  file  data)
1079       are  printed:  the file type (``REG'', for regular file), the file mode
1080       (in octal), the uid and gid, and the file size.
1081
1082       If the -v flag is given more than once, even more details are printed.
1083
1084       Note that NFS requests are very large and much of the detail  won't  be
1085       printed  unless  snaplen is increased.  Try using `-s 192' to watch NFS
1086       traffic.
1087
1088       NFS reply  packets  do  not  explicitly  identify  the  RPC  operation.
1089       Instead,  tcpdump  keeps track of ``recent'' requests, and matches them
1090       to the replies using the transaction ID.  If a reply does  not  closely
1091       follow the corresponding request, it might not be parsable.
1092
1093       AFS Requests and Replies
1094
1095       Transarc AFS (Andrew File System) requests and replies are printed as:
1096
1097              src.sport > dst.dport: rx packet-type
1098              src.sport > dst.dport: rx packet-type service call call-name args
1099              src.sport > dst.dport: rx packet-type service reply call-name args
1100              elvis.7001 > pike.afsfs:
1101                   rx data fs call rename old fid 536876964/1/1 ".newsrc.new"
1102                   new fid 536876964/1/1 ".newsrc"
1103              pike.afsfs > elvis.7001: rx data fs reply rename
1104       In the first line, host elvis sends a RX packet to pike.  This was a RX
1105       data packet to the fs (fileserver) service, and is the start of an  RPC
1106       call.   The  RPC  call  was a rename, with the old directory file id of
1107       536876964/1/1 and an old filename of `.newsrc.new', and a new directory
1108       file  id  of  536876964/1/1  and a new filename of `.newsrc'.  The host
1109       pike responds with a RPC reply to the rename call (which  was  success‐
1110       ful, because it was a data packet and not an abort packet).
1111
1112       In  general,  all AFS RPCs are decoded at least by RPC call name.  Most
1113       AFS RPCs have at least some of the arguments  decoded  (generally  only
1114       the `interesting' arguments, for some definition of interesting).
1115
1116       The  format is intended to be self-describing, but it will probably not
1117       be useful to people who are not familiar with the workings of  AFS  and
1118       RX.
1119
1120       If  the  -v  (verbose) flag is given twice, acknowledgement packets and
1121       additional header information is printed, such as the RX call ID,  call
1122       number, sequence number, serial number, and the RX packet flags.
1123
1124       If  the -v flag is given twice, additional information is printed, such
1125       as the RX call ID, serial number, and the RX  packet  flags.   The  MTU
1126       negotiation information is also printed from RX ack packets.
1127
1128       If  the -v flag is given three times, the security index and service id
1129       are printed.
1130
1131       Error codes are printed for abort packets, with the exception  of  Ubik
1132       beacon  packets  (because  abort packets are used to signify a yes vote
1133       for the Ubik protocol).
1134
1135       Note that AFS requests are very large and many of the  arguments  won't
1136       be  printed  unless  snaplen is increased.  Try using `-s 256' to watch
1137       AFS traffic.
1138
1139       AFS reply  packets  do  not  explicitly  identify  the  RPC  operation.
1140       Instead,  tcpdump  keeps track of ``recent'' requests, and matches them
1141       to the replies using the call number and service ID.  If a  reply  does
1142       not closely follow the corresponding request, it might not be parsable.
1143
1144
1145       KIP AppleTalk (DDP in UDP)
1146
1147       AppleTalk DDP packets encapsulated in UDP datagrams are de-encapsulated
1148       and dumped as DDP packets (i.e., all the UDP header information is dis‐
1149       carded).   The file /etc/atalk.names is used to translate AppleTalk net
1150       and node numbers to names.  Lines in this file have the form
1151              number    name
1152
1153              1.254          ether
1154              16.1      icsd-net
1155              1.254.110 ace
1156       The first two lines give the names of AppleTalk  networks.   The  third
1157       line  gives the name of a particular host (a host is distinguished from
1158       a net by the 3rd octet in the number -  a  net  number  must  have  two
1159       octets  and a host number must have three octets.)  The number and name
1160       should  be   separated   by   whitespace   (blanks   or   tabs).    The
1161       /etc/atalk.names  file  may contain blank lines or comment lines (lines
1162       starting with a `#').
1163
1164       AppleTalk addresses are printed in the form
1165              net.host.port
1166
1167              144.1.209.2 > icsd-net.112.220
1168              office.2 > icsd-net.112.220
1169              jssmag.149.235 > icsd-net.2
1170       (If the /etc/atalk.names doesn't exist or doesn't contain an entry  for
1171       some AppleTalk host/net number, addresses are printed in numeric form.)
1172       In the first example, NBP (DDP port 2) on net 144.1 node 209 is sending
1173       to  whatever is listening on port 220 of net icsd node 112.  The second
1174       line is the same except the full name  of  the  source  node  is  known
1175       (`office').   The third line is a send from port 235 on net jssmag node
1176       149 to broadcast on the icsd-net NBP  port  (note  that  the  broadcast
1177       address (255) is indicated by a net name with no host number - for this
1178       reason it's a good idea to keep node names and net  names  distinct  in
1179       /etc/atalk.names).
1180
1181       NBP  (name  binding  protocol) and ATP (AppleTalk transaction protocol)
1182       packets have their contents interpreted.  Other protocols just dump the
1183       protocol name (or number if no name is registered for the protocol) and
1184       packet size.
1185
1186       NBP packets are formatted like the following examples:
1187              icsd-net.112.220 > jssmag.2: nbp-lkup 190: "=:LaserWriter@*"
1188              jssmag.209.2 > icsd-net.112.220: nbp-reply 190: "RM1140:LaserWriter@*" 250
1189              techpit.2 > icsd-net.112.220: nbp-reply 190: "techpit:LaserWriter@*" 186
1190       The first line is a name lookup request for laserwriters  sent  by  net
1191       icsd  host  112 and broadcast on net jssmag.  The nbp id for the lookup
1192       is 190.  The second line shows a reply for this request (note  that  it
1193       has  the same id) from host jssmag.209 saying that it has a laserwriter
1194       resource named "RM1140" registered on port  250.   The  third  line  is
1195       another  reply  to the same request saying host techpit has laserwriter
1196       "techpit" registered on port 186.
1197
1198       ATP packet formatting is demonstrated by the following example:
1199              jssmag.209.165 > helios.132: atp-req  12266<0-7> 0xae030001
1200              helios.132 > jssmag.209.165: atp-resp 12266:0 (512) 0xae040000
1201              helios.132 > jssmag.209.165: atp-resp 12266:1 (512) 0xae040000
1202              helios.132 > jssmag.209.165: atp-resp 12266:2 (512) 0xae040000
1203              helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
1204              helios.132 > jssmag.209.165: atp-resp 12266:4 (512) 0xae040000
1205              helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
1206              helios.132 > jssmag.209.165: atp-resp 12266:6 (512) 0xae040000
1207              helios.132 > jssmag.209.165: atp-resp*12266:7 (512) 0xae040000
1208              jssmag.209.165 > helios.132: atp-req  12266<3,5> 0xae030001
1209              helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
1210              helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
1211              jssmag.209.165 > helios.132: atp-rel  12266<0-7> 0xae030001
1212              jssmag.209.133 > helios.132: atp-req* 12267<0-7> 0xae030002
1213       Jssmag.209 initiates transaction id 12266 with host helios by  request‐
1214       ing  up  to  8 packets (the `<0-7>').  The hex number at the end of the
1215       line is the value of the `userdata' field in the request.
1216
1217       Helios responds with 8 512-byte packets.  The  `:digit'  following  the
1218       transaction  id gives the packet sequence number in the transaction and
1219       the number in parens is the amount of data in the packet, excluding the
1220       atp header.  The `*' on packet 7 indicates that the EOM bit was set.
1221
1222       Jssmag.209  then  requests that packets 3 & 5 be retransmitted.  Helios
1223       resends them then jssmag.209 releases the transaction.   Finally,  jss‐
1224       mag.209  initiates  the next request.  The `*' on the request indicates
1225       that XO (`exactly once') was not set.
1226
1227

SEE ALSO

1229       stty(1),  pcap(3PCAP),  bpf(4),  nit(4P),  pcap-savefile(5),  pcap-fil‐
1230       ter(7), pcap-tstamp(7)
1231
1232              http://www.iana.org/assignments/media-types/application/vnd.tcp
1233              dump.pcap
1234

AUTHORS

1236       The original authors are:
1237
1238       Van Jacobson, Craig Leres and  Steven  McCanne,  all  of  the  Lawrence
1239       Berkeley National Laboratory, University of California, Berkeley, CA.
1240
1241       It is currently being maintained by tcpdump.org.
1242
1243       The current version is available via http:
1244
1245              http://www.tcpdump.org/
1246
1247       The original distribution is available via anonymous ftp:
1248
1249              ftp://ftp.ee.lbl.gov/old/tcpdump.tar.Z
1250
1251       IPv6/IPsec  support  is  added by WIDE/KAME project.  This program uses
1252       Eric Young's SSLeay library, under specific configurations.
1253

BUGS

1255       To   report   a   security   issue   please   send   an    e-mail    to
1256       security@tcpdump.org.
1257
1258       To  report  bugs and other problems, contribute patches, request a fea‐
1259       ture, provide generic feedback etc please see the file CONTRIBUTING  in
1260       the tcpdump source tree root.
1261
1262       NIT doesn't let you watch your own outbound traffic, BPF will.  We rec‐
1263       ommend that you use the latter.
1264
1265       On Linux systems with 2.0[.x] kernels:
1266
1267              packets on the loopback device will be seen twice;
1268
1269              packet filtering cannot be done in the kernel, so that all pack‐
1270              ets  must  be  copied from the kernel in order to be filtered in
1271              user mode;
1272
1273              all of a packet, not just the part that's  within  the  snapshot
1274              length,  will be copied from the kernel (the 2.0[.x] packet cap‐
1275              ture mechanism, if asked to copy only part of a packet to  user‐
1276              land,  will not report the true length of the packet; this would
1277              cause most IP packets to get an error from tcpdump);
1278
1279              capturing on some PPP devices won't work correctly.
1280
1281       We recommend that you upgrade to a 2.2 or later kernel.
1282
1283       Some attempt should be made to reassemble IP fragments or, at least  to
1284       compute the right length for the higher level protocol.
1285
1286       Name server inverse queries are not dumped correctly: the (empty) ques‐
1287       tion section is printed rather than real query in the  answer  section.
1288       Some  believe  that  inverse queries are themselves a bug and prefer to
1289       fix the program generating them rather than tcpdump.
1290
1291       A packet trace that crosses a daylight savings time  change  will  give
1292       skewed time stamps (the time change is ignored).
1293
1294       Filter  expressions  on  fields  other than those in Token Ring headers
1295       will not correctly handle source-routed Token Ring packets.
1296
1297       Filter expressions on fields other than those in  802.11  headers  will
1298       not  correctly  handle  802.11 data packets with both To DS and From DS
1299       set.
1300
1301       ip6 proto should chase header chain, but at this moment  it  does  not.
1302       ip6 protochain is supplied for this behavior.
1303
1304       Arithmetic  expression  against  transport  layer headers, like tcp[0],
1305       does not work against IPv6 packets.  It only looks at IPv4 packets.
1306
1307
1308
1309                                2 February 2017                     TCPDUMP(8)
Impressum