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

NAME

6       tcpdump - dump traffic on a network
7

SYNOPSIS

9       tcpdump [ -AdDefIJKlLnNOpqRStuUvxX ] [ -B buffer_size ] [ -c count ]
10               [ -C file_size ] [ -G rotate_seconds ] [ -F file ]
11               [ -i interface ] [ -j tstamp_type ] [ -m module ] [ -M secret ]
12               [ -Q|-P in|out|inout ]
13               [ -r file ] [ -s snaplen ] [ -T type ] [ -w file ]
14               [ -W filecount ]
15               [ -E spi@ipaddr algo:secret,...  ]
16               [ -y datalinktype ] [ -z postrotate-command ] [ -Z user ]
17               [ expression ]
18

DESCRIPTION

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

OPTIONS

71       -A     Print each packet (minus its link level header) in ASCII.  Handy
72              for capturing web pages.
73
74       -B     Set the operating system capture buffer size to buffer_size.
75
76       -c     Exit after receiving count packets.
77
78       -C     Before writing a raw packet to a  savefile,  check  whether  the
79              file  is  currently  larger than file_size and, if so, close the
80              current savefile and open a new one.  Savefiles after the  first
81              savefile  will  have the name specified with the -w flag, with a
82              number after it, starting at 1 and continuing upward.  The units
83              of  file_size  are  millions  of  bytes  (1,000,000  bytes,  not
84              1,048,576 bytes).
85
86              Note that when used with -Z option (enabled by default),  privi‐
87              leges are dropped before opening first savefile.
88
89       -d     Dump  the compiled packet-matching code in a human readable form
90              to standard output and stop.
91
92       -dd    Dump packet-matching code as a C program fragment.
93
94       -ddd   Dump packet-matching code as decimal numbers  (preceded  with  a
95              count).
96
97       -D     Print the list of the network interfaces available on the system
98              and on which tcpdump can  capture  packets.   For  each  network
99              interface,  a number and an interface name, possibly followed by
100              a text description of the interface, is printed.  The  interface
101              name  or the number can be supplied to the -i flag to specify an
102              interface on which to capture.
103
104              This can be useful on systems that don't have a command to  list
105              them  (e.g.,  Windows  systems, or UNIX systems lacking ifconfig
106              -a); the number can be useful on Windows 2000 and later systems,
107              where the interface name is a somewhat complex string.
108
109              The  -D  flag will not be supported if tcpdump was built with an
110              older version of libpcap that lacks the pcap_findalldevs() func‐
111              tion.
112
113       -e     Print the link-level header on each dump line.
114
115       -E     Use spi@ipaddr algo:secret for decrypting IPsec ESP packets that
116              are addressed to addr and contain Security Parameter Index value
117              spi.  This  combination  may  be  repeated with comma or newline
118              seperation.
119
120              Note that setting the secret for IPv4 ESP packets  is  supported
121              at this time.
122
123              Algorithms  may  be  des-cbc,  3des-cbc,  blowfish-cbc, rc3-cbc,
124              cast128-cbc, or none.  The default is des-cbc.  The  ability  to
125              decrypt  packets  is  only  present if tcpdump was compiled with
126              cryptography enabled.
127
128              secret is the ASCII text for ESP secret key.   If  preceeded  by
129              0x, then a hex value will be read.
130
131              The  option assumes RFC2406 ESP, not RFC1827 ESP.  The option is
132              only for debugging purposes, and the use of this option  with  a
133              true  `secret'  key  is discouraged.  By presenting IPsec secret
134              key onto command line you make it visible to others,  via  ps(1)
135              and other occasions.
136
137              In  addition  to  the  above syntax, the syntax file name may be
138              used to have tcpdump read the provided  file  in.  The  file  is
139              opened  upon receiving the first ESP packet, so any special per‐
140              missions that tcpdump may have been given  should  already  have
141              been given up.
142
143       -f     Print  `foreign' IPv4 addresses numerically rather than symboli‐
144              cally (this option is intended to get around serious brain  dam‐
145              age  in  Sun's NIS server — usually it hangs forever translating
146              non-local internet numbers).
147
148              The test for `foreign' IPv4 addresses is  done  using  the  IPv4
149              address  and  netmask of the interface on which capture is being
150              done.  If that address or netmask are not available,  available,
151              either  because the interface on which capture is being done has
152              no address or netmask or because the capture is  being  done  on
153              the  Linux  "any"  interface, which can capture on more than one
154              interface, this option will not work correctly.
155
156       -F     Use file as input for  the  filter  expression.   An  additional
157              expression given on the command line is ignored.
158
159       -G     If specified, rotates the dump file specified with the -w option
160              every rotate_seconds seconds.   Savefiles  will  have  the  name
161              specified by -w which should include a time format as defined by
162              strftime(3).  If no time format is specified, each new file will
163              overwrite the previous.
164
165              If  used  in conjunction with the -C option, filenames will take
166              the form of `file<count>'.
167
168       -i     Listen on interface.  If unspecified, tcpdump searches the  sys‐
169              tem interface list for the lowest numbered, configured up inter‐
170              face (excluding loopback).  Ties are broken by choosing the ear‐
171              liest match.
172
173              On  Linux  systems with 2.2 or later kernels, an interface argu‐
174              ment of ``any'' can be used to capture packets from  all  inter‐
175              faces.   Note  that  captures  on the ``any'' device will not be
176              done in promiscuous mode.
177
178              If the -D flag is supported, an interface number as  printed  by
179              that flag can be used as the interface argument.
180
181       -I     Put  the  interface in "monitor mode"; this is supported only on
182              IEEE 802.11 Wi-Fi interfaces, and supported only on some operat‐
183              ing systems.
184
185              Note  that  in  monitor mode the adapter might disassociate from
186              the network with which it's associated, so that you will not  be
187              able to use any wireless networks with that adapter.  This could
188              prevent accessing files on a network server, or  resolving  host
189              names or network addresses, if you are capturing in monitor mode
190              and are not connected to another network with another adapter.
191
192              This flag will affect the output of the -L flag.   If  -I  isn't
193              specified,  only  those  link-layer  types available when not in
194              monitor mode will be shown; if -I is specified, only those link-
195              layer types available when in monitor mode will be shown.
196
197       -j     Set the time stamp type for the capture to tstamp_type.
198
199       -J     List  the supported time stamp types for the interface and exit.
200              If the time stamp type cannot be set for the interface, no  time
201              stamp types are listed.
202
203       --time-stamp-precision=tstamp_precision
204              When  capturing, set the time stamp precision for the capture to
205              tstamp_precision.  Note that availability of high precision time
206              stamps  (nanoseconds)  and their actual accuracy is platform and
207              hardware dependent.  Also note that when writing  captures  made
208              with  nanosecond  accuracy  to  a  savefile, the time stamps are
209              written with nanosecond resolution, and the file is written with
210              a  different  magic number, to indicate that the time stamps are
211              in seconds and nanoseconds; not  all  programs  that  read  pcap
212              savefiles will be able to read those captures.
213
214              When  reading  a  savefile, convert time stamps to the precision
215              specified by timestamp_precision, and  display  them  with  that
216              resolution.   If the precision specified is less than the preci‐
217              sion of time stamps in the file, the conversion will lose preci‐
218              sion.
219
220              The  supported  values  for  timestamp_precision  are  micro for
221              microsecond resolution and nano for nanosecond resolution.   The
222              default is microsecond resolution.
223
224       -K     Don't attempt to verify IP, TCP, or UDP checksums.  This is use‐
225              ful for interfaces that perform some or all  of  those  checksum
226              calculation  in  hardware; otherwise, all outgoing TCP checksums
227              will be flagged as bad.
228
229       -l     Make stdout line buffered.  Useful if you want to see  the  data
230              while capturing it.  E.g.,
231              ``tcpdump  -l  |  tee     dat''     or     ``tcpdump  -l       >
232              dat  &  tail  -f  dat''.
233
234       -L     List the known data link types for the interface, in the  speci‐
235              fied  mode,  and exit.  The list of known data link types may be
236              dependent on the specified mode; for example, on some platforms,
237              a  Wi-Fi interface might support one set of data link types when
238              not in monitor mode (for example, it  might  support  only  fake
239              Ethernet  headers,  or might support 802.11 headers but not sup‐
240              port 802.11 headers with radio information) and another  set  of
241              data link types when in monitor mode (for example, it might sup‐
242              port 802.11 headers, or 802.11 headers with  radio  information,
243              only in monitor mode).
244
245       -m     Load  SMI  MIB module definitions from file module.  This option
246              can be used several times to load several MIB modules into  tcp‐
247              dump.
248
249       -M     Use  secret  as a shared secret for validating the digests found
250              in TCP segments with the TCP-MD5 option (RFC 2385), if present.
251
252       -n     Don't convert host addresses to names.   This  can  be  used  to
253              avoid DNS lookups.
254
255       -nn    Don't convert protocol and port numbers etc. to names either.
256
257       -N     Don't  print  domain name qualification of host names.  E.g., if
258              you give this flag then tcpdump will print  ``nic''  instead  of
259              ``nic.ddn.mil''.
260
261       -O     Do  not  run the packet-matching code optimizer.  This is useful
262              only if you suspect a bug in the optimizer.
263
264       -p     Don't put the interface into promiscuous mode.   Note  that  the
265              interface  might  be  in promiscuous mode for some other reason;
266              hence, `-p' cannot be used as an abbreviation  for  `ether  host
267              {local-hw-addr} or ether broadcast'.
268
269       -Q|-P  Choose send/receive direction direction for which packets should
270              be captured. Possible values are `in', `out'  and  `inout'.  Not
271              available on all platforms.
272
273       -q     Quick  (quiet?) output.  Print less protocol information so out‐
274              put lines are shorter.
275
276       -R     Assume ESP/AH packets to be based on old specification  (RFC1825
277              to  RFC1829).   If specified, tcpdump will not print replay pre‐
278              vention field.  Since there is  no  protocol  version  field  in
279              ESP/AH  specification,  tcpdump  cannot  deduce  the  version of
280              ESP/AH protocol.
281
282       -r     Read packets from file (which was created with the  -w  option).
283              Standard input is used if file is ``-''.
284
285       -S     Print absolute, rather than relative, TCP sequence numbers.
286
287       -s     Snarf  snaplen  bytes  of  data from each packet rather than the
288              default of 65535 bytes.  Packets truncated because of a  limited
289              snapshot  are  indicated  in the output with ``[|proto]'', where
290              proto is the name of the protocol level at which the  truncation
291              has  occurred.  Note that taking larger snapshots both increases
292              the amount of time it takes to process packets and, effectively,
293              decreases  the amount of packet buffering.  This may cause pack‐
294              ets to be lost.  You should limit snaplen to the smallest number
295              that will capture the protocol information you're interested in.
296              Setting snaplen to 0 sets it to the default of 65535, for  back‐
297              wards compatibility with recent older versions of tcpdump.
298
299       -T     Force  packets  selected  by  "expression" to be interpreted the
300              specified type.  Currently known  types  are  aodv  (Ad-hoc  On-
301              demand Distance Vector protocol), cnfp (Cisco NetFlow protocol),
302              rpc (Remote Procedure Call), rtp (Real-Time Applications  proto‐
303              col), rtcp (Real-Time Applications control protocol), snmp (Sim‐
304              ple Network Management Protocol), tftp  (Trivial  File  Transfer
305              Protocol),  vat  (Visual  Audio Tool), and wb (distributed White
306              Board).
307
308       -t     Don't print a timestamp on each dump line.
309
310       -tt    Print an unformatted timestamp on each dump line.
311
312       -ttt   Print a delta (micro-second resolution) between current and pre‐
313              vious line on each dump line.
314
315       -tttt  Print  a  timestamp  in default format proceeded by date on each
316              dump line.
317
318       -ttttt Print a delta  (micro-second  resolution)  between  current  and
319              first line on each dump line.
320
321       -u     Print undecoded NFS handles.
322
323       -U     Make  output  saved via the -w option ``packet-buffered''; i.e.,
324              as each packet is saved, it will be written to the output  file,
325              rather than being written only when the output buffer fills.
326
327              The  -U  flag will not be supported if tcpdump was built with an
328              older version of libpcap that lacks the pcap_dump_flush()  func‐
329              tion.
330
331       -v     When  parsing and printing, produce (slightly more) verbose out‐
332              put.  For example,  the  time  to  live,  identification,  total
333              length  and  options  in an IP packet are printed.  Also enables
334              additional packet integrity checks such as verifying the IP  and
335              ICMP header checksum.
336
337              When writing to a file with the -w option, report, every 10 sec‐
338              onds, the number of packets captured.
339
340       -vv    Even more verbose output.  For example,  additional  fields  are
341              printed  from  NFS  reply  packets,  and  SMB  packets are fully
342              decoded.
343
344       -vvv   Even more verbose output.  For example, telnet SB ... SE options
345              are  printed in full.  With -X Telnet options are printed in hex
346              as well.
347
348       -w     Write the raw packets to file rather than parsing  and  printing
349              them  out.  They can later be printed with the -r option.  Stan‐
350              dard output is used if file is ``-''.  See pcap-savefile(5)  for
351              a description of the file format.
352
353       -W     Used in conjunction with the -C option, this will limit the num‐
354              ber of files created to the specified number,  and  begin  over‐
355              writing  files  from  the  beginning, thus creating a 'rotating'
356              buffer.  In addition, it will name the files with enough leading
357              0s to support the maximum number of files, allowing them to sort
358              correctly.
359
360              Used in conjunction with the -G option, this will limit the num‐
361              ber  of rotated dump files that get created, exiting with status
362              0 when reaching the limit. If used with -C as well, the behavior
363              will result in cyclical files per timeslice.
364
365       -x     When  parsing  and printing, in addition to printing the headers
366              of each packet, print the data of each packet  (minus  its  link
367              level  header)  in  hex.   The  smaller  of the entire packet or
368              snaplen bytes will be printed.  Note that  this  is  the  entire
369              link-layer  packet, so for link layers that pad (e.g. Ethernet),
370              the padding bytes will also be printed  when  the  higher  layer
371              packet is shorter than the required padding.
372
373       -xx    When  parsing  and printing, in addition to printing the headers
374              of each packet, print the data of  each  packet,  including  its
375              link level header, in hex.
376
377       -X     When  parsing  and printing, in addition to printing the headers
378              of each packet, print the data of each packet  (minus  its  link
379              level  header)  in  hex  and  ASCII.   This  is  very  handy for
380              analysing new protocols.
381
382       -XX    When parsing and printing, in addition to printing  the  headers
383              of  each  packet,  print  the data of each packet, including its
384              link level header, in hex and ASCII.
385
386       -y     Set the data  link  type  to  use  while  capturing  packets  to
387              datalinktype.
388
389       -z     Used  in  conjunction  with the -C or -G options, this will make
390              tcpdump run " command file " where file is  the  savefile  being
391              closed  after  each rotation. For example, specifying -z gzip or
392              -z bzip2 will compress each savefile using gzip or bzip2.
393
394              Note that tcpdump will run the command in parallel to  the  cap‐
395              ture, using the lowest priority so that this doesn't disturb the
396              capture process.
397
398              And in case you would like to use a command  that  itself  takes
399              flags  or  different  arguments,  you  can  always write a shell
400              script that will take the savefile name as  the  only  argument,
401              make  the flags & arguments arrangements and execute the command
402              that you want.
403
404       -Z     Drops privileges (if root) and changes user ID to user  and  the
405              group ID to the primary group of user.
406
407              This  behavior  is  enabled  by default (-Z tcpdump), and can be
408              disabled by -Z root.
409
410
411        expression
412              selects which packets will  be  dumped.   If  no  expression  is
413              given,  all  packets on the net will be dumped.  Otherwise, only
414              packets for which expression is `true' will be dumped.
415
416              For the expression syntax, see pcap-filter(7).
417
418              Expression arguments can be passed to tcpdump as either a single
419              argument or as multiple arguments, whichever is more convenient.
420              Generally, if the expression contains Shell  metacharacters,  it
421              is  easier  to  pass  it as a single, quoted argument.  Multiple
422              arguments are concatenated with spaces before being parsed.
423

EXAMPLES

425       To print all packets arriving at or departing from sundown:
426              tcpdump host sundown
427
428       To print traffic between helios and either hot or ace:
429              tcpdump host helios and \( hot or ace \)
430
431       To print all IP packets between ace and any host except helios:
432              tcpdump ip host ace and not helios
433
434       To print all traffic between local hosts and hosts at Berkeley:
435              tcpdump net ucb-ether
436
437       To print all ftp traffic through internet gateway snup: (note that  the
438       expression  is  quoted to prevent the shell from (mis-)interpreting the
439       parentheses):
440              tcpdump 'gateway snup and (port ftp or ftp-data)'
441
442       To print traffic neither sourced from nor destined for local hosts  (if
443       you gateway to one other net, this stuff should never make it onto your
444       local net).
445              tcpdump ip and not net localnet
446
447       To print the start and end packets (the SYN and FIN  packets)  of  each
448       TCP conversation that involves a non-local host.
449              tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net localnet'
450
451       To  print  all  IPv4  HTTP packets to and from port 80, i.e. print only
452       packets that contain data, not, for example, SYN and  FIN  packets  and
453       ACK-only packets.  (IPv6 is left as an exercise for the reader.)
454              tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
455
456       To print IP packets longer than 576 bytes sent through gateway snup:
457              tcpdump 'gateway snup and ip[2:2] > 576'
458
459       To  print IP broadcast or multicast packets that were not sent via Eth‐
460       ernet broadcast or multicast:
461              tcpdump 'ether[0] & 1 = 0 and ip[16] >= 224'
462
463       To print all ICMP packets that are not echo requests/replies (i.e., not
464       ping packets):
465              tcpdump 'icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply'
466

OUTPUT FORMAT

468       The  output  of  tcpdump  is protocol dependent.  The following gives a
469       brief description and examples of most of the formats.
470
471       Link Level Headers
472
473       If the '-e' option is given, the link level header is printed out.   On
474       Ethernets,  the  source and destination addresses, protocol, and packet
475       length are printed.
476
477       On FDDI networks, the  '-e' option causes tcpdump to print  the  `frame
478       control'  field,   the source and destination addresses, and the packet
479       length.  (The `frame control' field governs the interpretation  of  the
480       rest  of the packet.  Normal packets (such as those containing IP data‐
481       grams) are `async' packets, with a priority value between 0 and 7;  for
482       example,  `async4'.  Such packets are assumed to contain an 802.2 Logi‐
483       cal Link Control (LLC) packet; the LLC header is printed if it  is  not
484       an ISO datagram or a so-called SNAP packet.
485
486       On  Token  Ring  networks,  the '-e' option causes tcpdump to print the
487       `access control' and `frame control' fields, the source and destination
488       addresses,  and  the  packet  length.  As on FDDI networks, packets are
489       assumed to contain an LLC  packet.   Regardless  of  whether  the  '-e'
490       option  is  specified or not, the source routing information is printed
491       for source-routed packets.
492
493       On 802.11 networks, the '-e' option causes tcpdump to print the  `frame
494       control'  fields,  all  of  the addresses in the 802.11 header, and the
495       packet length.  As on FDDI networks, packets are assumed to contain  an
496       LLC packet.
497
498       (N.B.: The following description assumes familiarity with the SLIP com‐
499       pression algorithm described in RFC-1144.)
500
501       On SLIP links, a direction indicator (``I'' for inbound, ``O'' for out‐
502       bound),  packet type, and compression information are printed out.  The
503       packet type is printed first.  The three types are ip, utcp, and  ctcp.
504       No  further  link information is printed for ip packets.  For TCP pack‐
505       ets, the connection identifier is printed following the type.   If  the
506       packet  is  compressed, its encoded header is printed out.  The special
507       cases are printed out as *S+n and *SA+n, where n is the amount by which
508       the sequence number (or sequence number and ack) has changed.  If it is
509       not a special case, zero or more changes  are  printed.   A  change  is
510       indicated  by U (urgent pointer), W (window), A (ack), S (sequence num‐
511       ber), and I (packet ID), followed by a delta (+n or -n), or a new value
512       (=n).   Finally, the amount of data in the packet and compressed header
513       length are printed.
514
515       For example, the  following  line  shows  an  outbound  compressed  TCP
516       packet,  with an implicit connection identifier; the ack has changed by
517       6, the sequence number by 49, and the packet ID by 6; there are 3 bytes
518       of data and 6 bytes of compressed header:
519              O ctcp * A+6 S+49 I+6 3 (6)
520
521       ARP/RARP Packets
522
523       Arp/rarp  output shows the type of request and its arguments.  The for‐
524       mat is intended to be self explanatory.  Here is a short  sample  taken
525       from the start of an `rlogin' from host rtsg to host csam:
526              arp who-has csam tell rtsg
527              arp reply csam is-at CSAM
528       The  first line says that rtsg sent an arp packet asking for the Ether‐
529       net address of internet host csam.   Csam  replies  with  its  Ethernet
530       address  (in  this example, Ethernet addresses are in caps and internet
531       addresses in lower case).
532
533       This would look less redundant if we had done tcpdump -n:
534              arp who-has 128.3.254.6 tell 128.3.254.68
535              arp reply 128.3.254.6 is-at 02:07:01:00:01:c4
536
537       If we had done tcpdump -e, the fact that the first packet is  broadcast
538       and the second is point-to-point would be visible:
539              RTSG Broadcast 0806  64: arp who-has csam tell rtsg
540              CSAM RTSG 0806  64: arp reply csam is-at CSAM
541       For the first packet this says the Ethernet source address is RTSG, the
542       destination is the Ethernet broadcast address, the type field contained
543       hex 0806 (type ETHER_ARP) and the total length was 64 bytes.
544
545       TCP Packets
546
547       (N.B.:The following description assumes familiarity with the TCP proto‐
548       col described in RFC-793.  If you are not familiar with  the  protocol,
549       neither this description nor tcpdump will be of much use to you.)
550
551       The general format of a tcp protocol line is:
552              src > dst: flags data-seqno ack window urgent options
553       Src  and  dst  are  the  source and destination IP addresses and ports.
554       Flags are some combination of S (SYN), F (FIN), P (PUSH),  R  (RST),  W
555       (ECN  CWR)  or  E  (ECN-Echo),  or a single `.' (no flags).  Data-seqno
556       describes the portion of sequence space covered by  the  data  in  this
557       packet  (see  example  below).  Ack is sequence number of the next data
558       expected the other direction on this connection.  Window is the  number
559       of  bytes of receive buffer space available the other direction on this
560       connection.  Urg indicates  there  is  `urgent'  data  in  the  packet.
561       Options are tcp options enclosed in angle brackets (e.g., <mss 1024>).
562
563       Src,  dst and flags are always present.  The other fields depend on the
564       contents of the packet's tcp protocol header and  are  output  only  if
565       appropriate.
566
567       Here is the opening portion of an rlogin from host rtsg to host csam.
568              rtsg.1023 > csam.login: S 768512:768512(0) win 4096 <mss 1024>
569              csam.login > rtsg.1023: S 947648:947648(0) ack 768513 win 4096 <mss 1024>
570              rtsg.1023 > csam.login: . ack 1 win 4096
571              rtsg.1023 > csam.login: P 1:2(1) ack 1 win 4096
572              csam.login > rtsg.1023: . ack 2 win 4096
573              rtsg.1023 > csam.login: P 2:21(19) ack 1 win 4096
574              csam.login > rtsg.1023: P 1:2(1) ack 21 win 4077
575              csam.login > rtsg.1023: P 2:3(1) ack 21 win 4077 urg 1
576              csam.login > rtsg.1023: P 3:4(1) ack 21 win 4077 urg 1
577       The  first  line  says that tcp port 1023 on rtsg sent a packet to port
578       login on csam.  The S indicates that the SYN flag was set.  The  packet
579       sequence  number was 768512 and it contained no data.  (The notation is
580       `first:last(nbytes)' which means `sequence numbers first up to but  not
581       including  last  which  is  nbytes  bytes of user data'.)  There was no
582       piggy-backed ack, the available receive window was 4096 bytes and there
583       was a max-segment-size option requesting an mss of 1024 bytes.
584
585       Csam  replies  with  a similar packet except it includes a piggy-backed
586       ack for rtsg's SYN.  Rtsg then acks csam's SYN.  The `.' means no flags
587       were  set.   The  packet contained no data so there is no data sequence
588       number.  Note that the ack sequence number is a small integer (1).  The
589       first  time  tcpdump  sees a tcp `conversation', it prints the sequence
590       number from the packet.  On subsequent packets of the conversation, the
591       difference  between  the current packet's sequence number and this ini‐
592       tial sequence number is printed.   This  means  that  sequence  numbers
593       after  the  first  can be interpreted as relative byte positions in the
594       conversation's data stream (with the first  data  byte  each  direction
595       being  `1').   `-S'  will  override  this feature, causing the original
596       sequence numbers to be output.
597
598       On the 6th line, rtsg sends csam 19 bytes of data (bytes 2  through  20
599       in  the rtsg → csam side of the conversation).  The PUSH flag is set in
600       the packet.  On the 7th line, csam says it's received data sent by rtsg
601       up  to but not including byte 21.  Most of this data is apparently sit‐
602       ting in the socket buffer since csam's receive  window  has  gotten  19
603       bytes  smaller.   Csam  also  sends  one  byte  of data to rtsg in this
604       packet.  On the 8th and 9th lines, csam  sends  two  bytes  of  urgent,
605       pushed data to rtsg.
606
607       If  the  snapshot was small enough that tcpdump didn't capture the full
608       TCP header, it interprets as much of the header  as  it  can  and  then
609       reports  ``[|tcp]'' to indicate the remainder could not be interpreted.
610       If the header contains a bogus option (one with a length that's  either
611       too  small  or  beyond  the  end  of the header), tcpdump reports it as
612       ``[bad opt]'' and does not interpret any further  options  (since  it's
613       impossible  to  tell where they start).  If the header length indicates
614       options are present but the IP datagram length is not long  enough  for
615       the  options  to  actually  be  there, tcpdump reports it as ``[bad hdr
616       length]''.
617
618       Capturing TCP packets with particular flag combinations (SYN-ACK,  URG-
619       ACK, etc.)
620
621       There are 8 bits in the control bits section of the TCP header:
622
623              CWR | ECE | URG | ACK | PSH | RST | SYN | FIN
624
625       Let's  assume  that we want to watch packets used in establishing a TCP
626       connection.  Recall that TCP uses a 3-way handshake  protocol  when  it
627       initializes  a  new  connection; the connection sequence with regard to
628       the TCP control bits is
629
630              1) Caller sends SYN
631              2) Recipient responds with SYN, ACK
632              3) Caller sends ACK
633
634       Now we're interested in capturing packets that have only  the  SYN  bit
635       set  (Step  1).  Note that we don't want packets from step 2 (SYN-ACK),
636       just a plain initial SYN.  What we need is a correct filter  expression
637       for tcpdump.
638
639       Recall the structure of a TCP header without options:
640
641        0                            15                              31
642       -----------------------------------------------------------------
643       |          source port          |       destination port        |
644       -----------------------------------------------------------------
645       |                        sequence number                        |
646       -----------------------------------------------------------------
647       |                     acknowledgment number                     |
648       -----------------------------------------------------------------
649       |  HL   | rsvd  |C|E|U|A|P|R|S|F|        window size            |
650       -----------------------------------------------------------------
651       |         TCP checksum          |       urgent pointer          |
652       -----------------------------------------------------------------
653
654       A  TCP  header  usually  holds  20  octets  of data, unless options are
655       present.  The first line of the graph contains octets 0 - 3, the second
656       line shows octets 4 - 7 etc.
657
658       Starting  to  count with 0, the relevant TCP control bits are contained
659       in octet 13:
660
661        0             7|             15|             23|             31
662       ----------------|---------------|---------------|----------------
663       |  HL   | rsvd  |C|E|U|A|P|R|S|F|        window size            |
664       ----------------|---------------|---------------|----------------
665       |               |  13th octet   |               |               |
666
667       Let's have a closer look at octet no. 13:
668
669                       |               |
670                       |---------------|
671                       |C|E|U|A|P|R|S|F|
672                       |---------------|
673                       |7   5   3     0|
674
675       These are the TCP control bits we are interested in.  We have  numbered
676       the  bits  in  this octet from 0 to 7, right to left, so the PSH bit is
677       bit number 3, while the URG bit is number 5.
678
679       Recall that we want to capture packets with only SYN  set.   Let's  see
680       what happens to octet 13 if a TCP datagram arrives with the SYN bit set
681       in its header:
682
683                       |C|E|U|A|P|R|S|F|
684                       |---------------|
685                       |0 0 0 0 0 0 1 0|
686                       |---------------|
687                       |7 6 5 4 3 2 1 0|
688
689       Looking at the control bits section we see that only bit number 1 (SYN)
690       is set.
691
692       Assuming  that  octet number 13 is an 8-bit unsigned integer in network
693       byte order, the binary value of this octet is
694
695              00000010
696
697       and its decimal representation is
698
699          7     6     5     4     3     2     1     0
700       0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 1*2 + 0*2  =  2
701
702       We're almost done, because now we know that if only  SYN  is  set,  the
703       value  of the 13th octet in the TCP header, when interpreted as a 8-bit
704       unsigned integer in network byte order, must be exactly 2.
705
706       This relationship can be expressed as
707              tcp[13] == 2
708
709       We can use this expression as the filter for tcpdump in order to  watch
710       packets which have only SYN set:
711              tcpdump -i xl0 tcp[13] == 2
712
713       The expression says "let the 13th octet of a TCP datagram have the dec‐
714       imal value 2", which is exactly what we want.
715
716       Now, let's assume that we need to capture SYN  packets,  but  we  don't
717       care  if  ACK  or  any  other  TCP control bit is set at the same time.
718       Let's see what happens to octet 13 when a TCP datagram with SYN-ACK set
719       arrives:
720
721            |C|E|U|A|P|R|S|F|
722            |---------------|
723            |0 0 0 1 0 0 1 0|
724            |---------------|
725            |7 6 5 4 3 2 1 0|
726
727       Now  bits 1 and 4 are set in the 13th octet.  The binary value of octet
728       13 is
729
730                   00010010
731
732       which translates to decimal
733
734          7     6     5     4     3     2     1     0
735       0*2 + 0*2 + 0*2 + 1*2 + 0*2 + 0*2 + 1*2 + 0*2   = 18
736
737       Now we can't just use 'tcp[13] == 18' in the tcpdump filter expression,
738       because that would select only those packets that have SYN-ACK set, but
739       not those with only SYN set.  Remember that we don't care if ACK or any
740       other control bit is set as long as SYN is set.
741
742       In order to achieve our goal, we need to logically AND the binary value
743       of octet 13 with some other value to preserve the  SYN  bit.   We  know
744       that  we  want  SYN  to  be set in any case, so we'll logically AND the
745       value in the 13th octet with the binary value of a SYN:
746
747                 00010010 SYN-ACK              00000010 SYN
748            AND  00000010 (we want SYN)   AND  00000010 (we want SYN)
749                 --------                      --------
750            =    00000010                 =    00000010
751
752       We see that this AND operation  delivers  the  same  result  regardless
753       whether ACK or another TCP control bit is set.  The decimal representa‐
754       tion of the AND value as well as the result  of  this  operation  is  2
755       (binary 00000010), so we know that for packets with SYN set the follow‐
756       ing relation must hold true:
757
758              ( ( value of octet 13 ) AND ( 2 ) ) == ( 2 )
759
760       This points us to the tcpdump filter expression
761                   tcpdump -i xl0 'tcp[13] & 2 == 2'
762
763       Note that you should use single quotes or a backslash in the expression
764       to hide the AND ('&') special character from the shell.
765
766       UDP Packets
767
768       UDP format is illustrated by this rwho packet:
769              actinide.who > broadcast.who: udp 84
770       This  says  that  port who on host actinide sent a udp datagram to port
771       who on host broadcast, the Internet broadcast address.  The packet con‐
772       tained 84 bytes of user data.
773
774       Some  UDP  services are recognized (from the source or destination port
775       number) and the higher level protocol information printed.  In particu‐
776       lar,  Domain  Name  service  requests (RFC-1034/1035) and Sun RPC calls
777       (RFC-1050) to NFS.
778
779       UDP Name Server Requests
780
781       (N.B.:The following description assumes  familiarity  with  the  Domain
782       Service  protocol  described in RFC-1035.  If you are not familiar with
783       the protocol, the following description will appear to  be  written  in
784       greek.)
785
786       Name server requests are formatted as
787              src > dst: id op? flags qtype qclass name (len)
788              h2opolo.1538 > helios.domain: 3+ A? ucbvax.berkeley.edu. (37)
789       Host  h2opolo  asked  the domain server on helios for an address record
790       (qtype=A) associated with the name ucbvax.berkeley.edu.  The  query  id
791       was  `3'.   The  `+' indicates the recursion desired flag was set.  The
792       query length was 37 bytes, not including the UDP and IP protocol  head‐
793       ers.   The  query  operation was the normal one, Query, so the op field
794       was omitted.  If the op had been anything  else,  it  would  have  been
795       printed  between  the  `3'  and the `+'.  Similarly, the qclass was the
796       normal one, C_IN, and  omitted.   Any  other  qclass  would  have  been
797       printed immediately after the `A'.
798
799       A  few anomalies are checked and may result in extra fields enclosed in
800       square brackets:  If a query contains an answer, authority  records  or
801       additional records section, ancount, nscount, or arcount are printed as
802       `[na]', `[nn]' or  `[nau]' where n is the appropriate count.  If any of
803       the  response  bits  are  set  (AA, RA or rcode) or any of the `must be
804       zero' bits are set in bytes two and three, `[b2&3=x]' is printed, where
805       x is the hex value of header bytes two and three.
806
807       UDP Name Server Responses
808
809       Name server responses are formatted as
810              src > dst:  id op rcode flags a/n/au type class data (len)
811              helios.domain > h2opolo.1538: 3 3/3/7 A 128.32.137.3 (273)
812              helios.domain > h2opolo.1537: 2 NXDomain* 0/1/0 (97)
813       In the first example, helios responds to query id 3 from h2opolo with 3
814       answer records, 3 name server records and 7  additional  records.   The
815       first  answer  record  is  type  A  (address)  and its data is internet
816       address 128.32.137.3.  The total size of the response  was  273  bytes,
817       excluding  UDP and IP headers.  The op (Query) and response code (NoEr‐
818       ror) were omitted, as was the class (C_IN) of the A record.
819
820       In the second example, helios responds to query 2 with a response  code
821       of  non-existent domain (NXDomain) with no answers, one name server and
822       no authority records.  The `*' indicates that the authoritative  answer
823       bit  was set.  Since there were no answers, no type, class or data were
824       printed.
825
826       Other flag characters that might appear are `-'  (recursion  available,
827       RA,  not  set) and `|' (truncated message, TC, set).  If the `question'
828       section doesn't contain exactly one entry, `[nq]' is printed.
829
830
831       SMB/CIFS decoding
832
833       tcpdump now includes fairly extensive SMB/CIFS/NBT decoding for data on
834       UDP/137,  UDP/138 and TCP/139.  Some primitive decoding of IPX and Net‐
835       BEUI SMB data is also done.
836
837       By default a fairly minimal decode is done, with a much  more  detailed
838       decode  done if -v is used.  Be warned that with -v a single SMB packet
839       may take up a page or more, so only use -v if you really want  all  the
840       gory details.
841
842       For  information  on SMB packet formats and what all te fields mean see
843       www.cifs.org  or  the  pub/samba/specs/  directory  on  your   favorite
844       samba.org mirror site.  The SMB patches were written by Andrew Tridgell
845       (tridge@samba.org).
846
847
848       NFS Requests and Replies
849
850       Sun NFS (Network File System) requests and replies are printed as:
851              src.xid > dst.nfs: len op args
852              src.nfs > dst.xid: reply stat len op results
853              sushi.6709 > wrl.nfs: 112 readlink fh 21,24/10.73165
854              wrl.nfs > sushi.6709: reply ok 40 readlink "../var"
855              sushi.201b > wrl.nfs:
856                   144 lookup fh 9,74/4096.6878 "xcolors"
857              wrl.nfs > sushi.201b:
858                   reply ok 128 lookup fh 9,74/4134.3150
859       In the first line, host sushi sends a transaction with id 6709  to  wrl
860       (note  that  the number following the src host is a transaction id, not
861       the source port).  The request was 112 bytes, excluding the UDP and  IP
862       headers.   The  operation  was  a readlink (read symbolic link) on file
863       handle (fh) 21,24/10.731657119.  (If one is lucky, as in this case, the
864       file  handle  can  be  interpreted as a major,minor device number pair,
865       followed by the inode number and generation number.)  Wrl replies  `ok'
866       with the contents of the link.
867
868       In  the  third  line,  sushi  asks  wrl to lookup the name `xcolors' in
869       directory file 9,74/4096.6878.  Note that the data printed  depends  on
870       the  operation  type.  The format is intended to be self explanatory if
871       read in conjunction with an NFS protocol spec.
872
873       If the -v (verbose) flag is given, additional information  is  printed.
874       For example:
875              sushi.1372a > wrl.nfs:
876                   148 read fh 21,11/12.195 8192 bytes @ 24576
877              wrl.nfs > sushi.1372a:
878                   reply ok 1472 read REG 100664 ids 417/0 sz 29388
879       (-v  also  prints  the  IP  header  TTL,  ID, length, and fragmentation
880       fields, which have been omitted from this example.)  In the first line,
881       sushi  asks wrl to read 8192 bytes from file 21,11/12.195, at byte off‐
882       set 24576.  Wrl replies `ok'; the packet shown on the  second  line  is
883       the first fragment of the reply, and hence is only 1472 bytes long (the
884       other bytes will follow in subsequent fragments, but these fragments do
885       not have NFS or even UDP headers and so might not be printed, depending
886       on the filter expression used).  Because the -v flag is given, some  of
887       the  file  attributes (which are returned in addition to the file data)
888       are printed: the file type (``REG'', for regular file), the  file  mode
889       (in octal), the uid and gid, and the file size.
890
891       If the -v flag is given more than once, even more details are printed.
892
893       Note  that  NFS requests are very large and much of the detail won't be
894       printed unless snaplen is increased.  Try using `-s 192' to  watch  NFS
895       traffic.
896
897       NFS  reply  packets  do  not  explicitly  identify  the  RPC operation.
898       Instead, tcpdump keeps track of ``recent'' requests, and  matches  them
899       to  the  replies using the transaction ID.  If a reply does not closely
900       follow the corresponding request, it might not be parsable.
901
902       AFS Requests and Replies
903
904       Transarc AFS (Andrew File System) requests and replies are printed as:
905
906              src.sport > dst.dport: rx packet-type
907              src.sport > dst.dport: rx packet-type service call call-name args
908              src.sport > dst.dport: rx packet-type service reply call-name args
909              elvis.7001 > pike.afsfs:
910                   rx data fs call rename old fid 536876964/1/1 ".newsrc.new"
911                   new fid 536876964/1/1 ".newsrc"
912              pike.afsfs > elvis.7001: rx data fs reply rename
913       In the first line, host elvis sends a RX packet to pike.  This was a RX
914       data  packet to the fs (fileserver) service, and is the start of an RPC
915       call.  The RPC call was a rename, with the old  directory  file  id  of
916       536876964/1/1 and an old filename of `.newsrc.new', and a new directory
917       file id of 536876964/1/1 and a new filename  of  `.newsrc'.   The  host
918       pike  responds  with a RPC reply to the rename call (which was success‐
919       ful, because it was a data packet and not an abort packet).
920
921       In general, all AFS RPCs are decoded at least by RPC call  name.   Most
922       AFS  RPCs  have  at least some of the arguments decoded (generally only
923       the `interesting' arguments, for some definition of interesting).
924
925       The format is intended to be self-describing, but it will probably  not
926       be  useful  to people who are not familiar with the workings of AFS and
927       RX.
928
929       If the -v (verbose) flag is given twice,  acknowledgement  packets  and
930       additional  header  information is printed, such as the the RX call ID,
931       call number, sequence number, serial number, and the RX packet flags.
932
933       If the -v flag is given twice, additional information is printed,  such
934       as the the RX call ID, serial number, and the RX packet flags.  The MTU
935       negotiation information is also printed from RX ack packets.
936
937       If the -v flag is given three times, the security index and service  id
938       are printed.
939
940       Error  codes  are printed for abort packets, with the exception of Ubik
941       beacon packets (because abort packets are used to signify  a  yes  vote
942       for the Ubik protocol).
943
944       Note  that  AFS requests are very large and many of the arguments won't
945       be printed unless snaplen is increased.  Try using `-s  256'  to  watch
946       AFS traffic.
947
948       AFS  reply  packets  do  not  explicitly  identify  the  RPC operation.
949       Instead, tcpdump keeps track of ``recent'' requests, and  matches  them
950       to  the  replies using the call number and service ID.  If a reply does
951       not closely follow the corresponding request, it might not be parsable.
952
953
954       KIP AppleTalk (DDP in UDP)
955
956       AppleTalk DDP packets encapsulated in UDP datagrams are de-encapsulated
957       and dumped as DDP packets (i.e., all the UDP header information is dis‐
958       carded).  The file /etc/atalk.names is used to translate AppleTalk  net
959       and node numbers to names.  Lines in this file have the form
960              number    name
961
962              1.254          ether
963              16.1      icsd-net
964              1.254.110 ace
965       The  first  two  lines give the names of AppleTalk networks.  The third
966       line gives the name of a particular host (a host is distinguished  from
967       a  net  by  the  3rd  octet  in the number - a net number must have two
968       octets and a host number must have three octets.)  The number and  name
969       should   be   separated   by   whitespace   (blanks   or   tabs).   The
970       /etc/atalk.names file may contain blank lines or comment  lines  (lines
971       starting with a `#').
972
973       AppleTalk addresses are printed in the form
974              net.host.port
975
976              144.1.209.2 > icsd-net.112.220
977              office.2 > icsd-net.112.220
978              jssmag.149.235 > icsd-net.2
979       (If  the /etc/atalk.names doesn't exist or doesn't contain an entry for
980       some AppleTalk host/net number, addresses are printed in numeric form.)
981       In the first example, NBP (DDP port 2) on net 144.1 node 209 is sending
982       to whatever is listening on port 220 of net icsd node 112.  The  second
983       line  is  the  same  except  the  full name of the source node is known
984       (`office').  The third line is a send from port 235 on net jssmag  node
985       149  to  broadcast  on  the  icsd-net NBP port (note that the broadcast
986       address (255) is indicated by a net name with no host number - for this
987       reason  it's  a  good idea to keep node names and net names distinct in
988       /etc/atalk.names).
989
990       NBP (name binding protocol) and ATP  (AppleTalk  transaction  protocol)
991       packets have their contents interpreted.  Other protocols just dump the
992       protocol name (or number if no name is registered for the protocol) and
993       packet size.
994
995       NBP packets are formatted like the following examples:
996              icsd-net.112.220 > jssmag.2: nbp-lkup 190: "=:LaserWriter@*"
997              jssmag.209.2 > icsd-net.112.220: nbp-reply 190: "RM1140:LaserWriter@*" 250
998              techpit.2 > icsd-net.112.220: nbp-reply 190: "techpit:LaserWriter@*" 186
999       The  first  line  is a name lookup request for laserwriters sent by net
1000       icsd host 112 and broadcast on net jssmag.  The nbp id for  the  lookup
1001       is  190.   The second line shows a reply for this request (note that it
1002       has the same id) from host jssmag.209 saying that it has a  laserwriter
1003       resource  named  "RM1140"  registered  on  port 250.  The third line is
1004       another reply to the same request saying host techpit  has  laserwriter
1005       "techpit" registered on port 186.
1006
1007       ATP packet formatting is demonstrated by the following example:
1008              jssmag.209.165 > helios.132: atp-req  12266<0-7> 0xae030001
1009              helios.132 > jssmag.209.165: atp-resp 12266:0 (512) 0xae040000
1010              helios.132 > jssmag.209.165: atp-resp 12266:1 (512) 0xae040000
1011              helios.132 > jssmag.209.165: atp-resp 12266:2 (512) 0xae040000
1012              helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
1013              helios.132 > jssmag.209.165: atp-resp 12266:4 (512) 0xae040000
1014              helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
1015              helios.132 > jssmag.209.165: atp-resp 12266:6 (512) 0xae040000
1016              helios.132 > jssmag.209.165: atp-resp*12266:7 (512) 0xae040000
1017              jssmag.209.165 > helios.132: atp-req  12266<3,5> 0xae030001
1018              helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
1019              helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
1020              jssmag.209.165 > helios.132: atp-rel  12266<0-7> 0xae030001
1021              jssmag.209.133 > helios.132: atp-req* 12267<0-7> 0xae030002
1022       Jssmag.209  initiates transaction id 12266 with host helios by request‐
1023       ing up to 8 packets (the `<0-7>').  The hex number at the  end  of  the
1024       line is the value of the `userdata' field in the request.
1025
1026       Helios  responds  with  8 512-byte packets.  The `:digit' following the
1027       transaction id gives the packet sequence number in the transaction  and
1028       the number in parens is the amount of data in the packet, excluding the
1029       atp header.  The `*' on packet 7 indicates that the EOM bit was set.
1030
1031       Jssmag.209 then requests that packets 3 & 5 be  retransmitted.   Helios
1032       resends  them  then jssmag.209 releases the transaction.  Finally, jss‐
1033       mag.209 initiates the next request.  The `*' on the  request  indicates
1034       that XO (`exactly once') was not set.
1035
1036
1037       IP Fragmentation
1038
1039       Fragmented Internet datagrams are printed as
1040              (frag id:size@offset+)
1041              (frag id:size@offset)
1042       (The  first  form indicates there are more fragments.  The second indi‐
1043       cates this is the last fragment.)
1044
1045       Id is the fragment id.  Size is the fragment size (in bytes)  excluding
1046       the  IP  header.   Offset  is  this fragment's offset (in bytes) in the
1047       original datagram.
1048
1049       The fragment information is output for each fragment.  The first  frag‐
1050       ment  contains  the  higher  level protocol header and the frag info is
1051       printed after the protocol info.  Fragments after the first contain  no
1052       higher  level  protocol  header  and the frag info is printed after the
1053       source and destination addresses.  For example, here is part of an  ftp
1054       from  arizona.edu to lbl-rtsg.arpa over a CSNET connection that doesn't
1055       appear to handle 576 byte datagrams:
1056              arizona.ftp-data > rtsg.1170: . 1024:1332(308) ack 1 win 4096 (frag 595a:328@0+)
1057              arizona > rtsg: (frag 595a:204@328)
1058              rtsg.1170 > arizona.ftp-data: . ack 1536 win 2560
1059       There are a couple of things to note here:  First, addresses in the 2nd
1060       line  don't  include  port  numbers.   This is because the TCP protocol
1061       information is all in the first fragment and we have no idea  what  the
1062       port  or  sequence numbers are when we print the later fragments.  Sec‐
1063       ond, the tcp sequence information in the first line is  printed  as  if
1064       there  were  308  bytes of user data when, in fact, there are 512 bytes
1065       (308 in the first frag and 204 in the second).  If you are looking  for
1066       holes  in  the  sequence space or trying to match up acks with packets,
1067       this can fool you.
1068
1069       A packet with the IP don't fragment flag  is  marked  with  a  trailing
1070       (DF).
1071
1072       Timestamps
1073
1074       By  default,  all  output lines are preceded by a timestamp.  The time‐
1075       stamp is the current clock time in the form
1076              hh:mm:ss.frac
1077       and is as accurate as the kernel's clock.  The timestamp  reflects  the
1078       time  the  kernel  first saw the packet.  No attempt is made to account
1079       for the time lag between when the Ethernet interface removed the packet
1080       from the wire and when the kernel serviced the `new packet' interrupt.
1081

SEE ALSO

1083       stty(1), pcap(3PCAP), bpf(4), nit(4P), pcap-savefile(5), pcap-filter(7)
1084

AUTHORS

1086       The original authors are:
1087
1088       Van  Jacobson,  Craig  Leres  and  Steven  McCanne, all of the Lawrence
1089       Berkeley National Laboratory, University of California, Berkeley, CA.
1090
1091       It is currently being maintained by tcpdump.org.
1092
1093       The current version is available via http:
1094
1095              http://www.tcpdump.org/
1096
1097       The original distribution is available via anonymous ftp:
1098
1099              ftp://ftp.ee.lbl.gov/tcpdump.tar.Z
1100
1101       IPv6/IPsec support is added by WIDE/KAME project.   This  program  uses
1102       Eric Young's SSLeay library, under specific configurations.
1103

BUGS

1105       Please  send problems, bugs, questions, desirable enhancements, patches
1106       etc. to:
1107
1108              tcpdump-workers@lists.tcpdump.org
1109
1110       NIT doesn't let you watch your own outbound traffic, BPF will.  We rec‐
1111       ommend that you use the latter.
1112
1113       On Linux systems with 2.0[.x] kernels:
1114
1115              packets on the loopback device will be seen twice;
1116
1117              packet filtering cannot be done in the kernel, so that all pack‐
1118              ets must be copied from the kernel in order to  be  filtered  in
1119              user mode;
1120
1121              all  of  a  packet, not just the part that's within the snapshot
1122              length, will be copied from the kernel (the 2.0[.x] packet  cap‐
1123              ture  mechanism, if asked to copy only part of a packet to user‐
1124              land, will not report the true length of the packet; this  would
1125              cause most IP packets to get an error from tcpdump);
1126
1127              capturing on some PPP devices won't work correctly.
1128
1129       We recommend that you upgrade to a 2.2 or later kernel.
1130
1131       Some  attempt should be made to reassemble IP fragments or, at least to
1132       compute the right length for the higher level protocol.
1133
1134       Name server inverse queries are not dumped correctly: the (empty) ques‐
1135       tion  section  is printed rather than real query in the answer section.
1136       Some believe that inverse queries are themselves a bug  and  prefer  to
1137       fix the program generating them rather than tcpdump.
1138
1139       A  packet  trace  that crosses a daylight savings time change will give
1140       skewed time stamps (the time change is ignored).
1141
1142       Filter expressions on fields other than those  in  Token  Ring  headers
1143       will not correctly handle source-routed Token Ring packets.
1144
1145       Filter  expressions  on  fields other than those in 802.11 headers will
1146       not correctly handle 802.11 data packets with both To DS  and  From  DS
1147       set.
1148
1149       ip6  proto  should  chase header chain, but at this moment it does not.
1150       ip6 protochain is supplied for this behavior.
1151
1152       Arithmetic expression against transport  layer  headers,  like  tcp[0],
1153       does not work against IPv6 packets.  It only looks at IPv4 packets.
1154
1155
1156
1157                                 05 March 2009                      TCPDUMP(8)
Impressum