]> The Tcpdump Group git mirrors - tcpdump/blob - tcpdump.1
Note that, although you can, in theory, do captures on Solaris if you're
[tcpdump] / tcpdump.1
1 .\" @(#) $Header: /tcpdump/master/tcpdump/Attic/tcpdump.1,v 1.116 2002-02-08 06:45:05 guy Exp $ (LBL)
2 .\"
3 .\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
4 .\" The Regents of the University of California. All rights reserved.
5 .\" All rights reserved.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that: (1) source code distributions
9 .\" retain the above copyright notice and this paragraph in its entirety, (2)
10 .\" distributions including binary code include the above copyright notice and
11 .\" this paragraph in its entirety in the documentation or other materials
12 .\" provided with the distribution, and (3) all advertising materials mentioning
13 .\" features or use of this software display the following acknowledgement:
14 .\" ``This product includes software developed by the University of California,
15 .\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
16 .\" the University nor the names of its contributors may be used to endorse
17 .\" or promote products derived from this software without specific prior
18 .\" written permission.
19 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
20 .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
21 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 .\"
23 .TH TCPDUMP 1 "3 January 2001"
24 .SH NAME
25 tcpdump \- dump traffic on a network
26 .SH SYNOPSIS
27 .na
28 .B tcpdump
29 [
30 .B \-adeflnNOpqRStuvxX
31 ] [
32 .B \-c
33 .I count
34 ]
35 .br
36 .ti +8
37 [
38 .B \-C
39 .I file_size
40 ] [
41 .B \-F
42 .I file
43 ]
44 .br
45 .ti +8
46 [
47 .B \-i
48 .I interface
49 ]
50 [
51 .B \-m
52 .I module
53 ]
54 [
55 .B \-r
56 .I file
57 ]
58 .br
59 .ti +8
60 [
61 .B \-s
62 .I snaplen
63 ]
64 [
65 .B \-T
66 .I type
67 ]
68 [
69 .B \-w
70 .I file
71 ]
72 .br
73 .ti +8
74 [
75 .B \-E
76 .I algo:secret
77 ]
78 [
79 .I expression
80 ]
81 .br
82 .ad
83 .SH DESCRIPTION
84 .LP
85 \fITcpdump\fP prints out the headers of packets on a network interface
86 that match the boolean \fIexpression\fP. It can also be run with the
87 .B \-w
88 flag, which causes it to save the packet data to a file for later
89 analysis, and/or with the
90 .B \-b
91 flag, which causes it to read from a saved packet file rather than to
92 read packets from a network interface. In all cases, only packets that
93 match
94 .I expression
95 will be processed by
96 .IR tcpdump .
97 .LP
98 .I Tcpdump
99 will, if not run with the
100 .B \-c
101 flag, continue capturing packets until it is interrupted by a SIGINT
102 signal (generated, for example, by typing your interrupt character,
103 typically control-C) or a SIGTERM signal (typically generated with the
104 .BR kill (1)
105 command); if run with the
106 .B \-c
107 flag, it will capture packets until it is interrupted by a SIGINT or
108 SIGTERM signal or the specified number of packets have been processed.
109 .LP
110 When
111 .I tcpdump
112 finishes capturing packets, it will report counts of:
113 .IP
114 packets ``received by filter'' (the meaning of this depends on the OS on
115 which you're running
116 .IR tcpdump ,
117 and possibly on the way the OS was configured - if a filter was
118 specified on the command line, on some OSes it counts packets regardless
119 of whether they were matched by the filter expression, and on other OSes
120 it counts only packets that were matched by the filter expression and
121 were processed by
122 .IR tcpdump );
123 .IP
124 packets ``dropped by kernel'' (this is the number of packets that were
125 dropped, due to a lack of buffer space, by the packet capture mechanism
126 in the OS on which
127 .I tcpdump
128 is running, if the OS reports that information to applications; if not,
129 it will be reported as 0).
130 .LP
131 On platforms that support the SIGINFO signal, such as most BSDs, it will
132 report those counts when it receives a SIGINFO signal (generated, for
133 example, by typing your ``status'' character, typically control-T) and
134 will continue capturing packets.
135 .LP
136 Reading packets from a network interface may require that you have
137 special privileges:
138 .TP
139 .B Under SunOS 3.x or 4.x with NIT or BPF:
140 You must have read access to
141 .I /dev/nit
142 or
143 .IR /dev/bpf* .
144 .TP
145 .B Under Solaris with DLPI:
146 You must have read/write access to the network pseudo device, e.g.
147 .IR /dev/le .
148 On at least some versions of Solaris, however, this is not sufficient to
149 allow
150 .I tcpdump
151 to capture in promiscuous mode; on those versions of Solaris, you must
152 be root, or
153 .I tcpdump
154 must be installed setuid to root, in order to capture in promiscuous
155 mode. Note that, on many (perhaps all) interfaces, if you don't capture
156 in promiscuous mode, you will not see any outgoing packets, so a capture
157 not done in promiscuous mode may not be very useful.
158 .TP
159 .B Under HP-UX with DLPI:
160 You must be root or
161 .I tcpdump
162 must be installed setuid to root.
163 .TP
164 .B Under IRIX with snoop:
165 You must be root or
166 .I tcpdump
167 must be installed setuid to root.
168 .TP
169 .B Under Linux:
170 You must be root or
171 .I tcpdump
172 must be installed setuid to root.
173 .TP
174 .B Under Ultrix and Digital UNIX:
175 Once the super-user has enabled promiscuous-mode operation using
176 .IR pfconfig (8),
177 any user may capture network traffic with
178 .IR tcpdump .
179 .TP
180 .B Under BSD:
181 You must have read access to
182 .IR /dev/bpf* .
183 .LP
184 Reading a saved packet file doesn't require special privileges.
185 .SH OPTIONS
186 .TP
187 .B \-a
188 Attempt to convert network and broadcast addresses to names.
189 .TP
190 .B \-c
191 Exit after receiving \fIcount\fP packets.
192 .TP
193 .B \-C
194 Before writing a raw packet to a savefile, check whether the file is
195 currently larger than \fIfile_size\fP and, if so, close the current
196 savefile and open a new one. Savefiles after the first savefile will
197 have the name specified with the
198 .B \-w
199 flag, with a number after it, starting at 2 and continuing upward.
200 The units of \fIfile_size\fP are millions of bytes (1,000,000 bytes,
201 not 1,048,576 bytes).
202 .TP
203 .B \-d
204 Dump the compiled packet-matching code in a human readable form to
205 standard output and stop.
206 .TP
207 .B \-dd
208 Dump packet-matching code as a
209 .B C
210 program fragment.
211 .TP
212 .B \-ddd
213 Dump packet-matching code as decimal numbers (preceded with a count).
214 .TP
215 .B \-e
216 Print the link-level header on each dump line.
217 .TP
218 .B \-E
219 Use \fIalgo:secret\fP for decrypting IPsec ESP packets.
220 Algorithms may be
221 \fBdes-cbc\fP,
222 \fB3des-cbc\fP,
223 \fBblowfish-cbc\fP,
224 \fBrc3-cbc\fP,
225 \fBcast128-cbc\fP, or
226 \fBnone\fP.
227 The default is \fBdes-cbc\fP.
228 The ability to decrypt packets is only present if \fItcpdump\fP was compiled
229 with cryptography enabled.
230 \fIsecret\fP the ascii text for ESP secret key.
231 We cannot take arbitrary binary value at this moment.
232 The option assumes RFC2406 ESP, not RFC1827 ESP.
233 The option is only for debugging purposes, and
234 the use of this option with truly `secret' key is discouraged.
235 By presenting IPsec secret key onto command line
236 you make it visible to others, via
237 .IR ps (1)
238 and other occasions.
239 .TP
240 .B \-f
241 Print `foreign' internet addresses numerically rather than symbolically
242 (this option is intended to get around serious brain damage in
243 Sun's yp server \(em usually it hangs forever translating non-local
244 internet numbers).
245 .TP
246 .B \-F
247 Use \fIfile\fP as input for the filter expression.
248 An additional expression given on the command line is ignored.
249 .TP
250 .B \-i
251 Listen on \fIinterface\fP.
252 If unspecified, \fItcpdump\fP searches the system interface list for the
253 lowest numbered, configured up interface (excluding loopback).
254 Ties are broken by choosing the earliest match.
255 .IP
256 On Linux systems with 2.2 or later kernels, an
257 .I interface
258 argument of ``any'' can be used to capture packets from all interfaces.
259 Note that captures on the ``any'' device will not be done in promiscuous
260 mode.
261 .TP
262 .B \-l
263 Make stdout line buffered.
264 Useful if you want to see the data
265 while capturing it.
266 E.g.,
267 .br
268 ``tcpdump\ \ \-l\ \ |\ \ tee dat'' or
269 ``tcpdump\ \ \-l \ \ > dat\ \ &\ \ tail\ \ \-f\ \ dat''.
270 .TP
271 .B \-m
272 Load SMI MIB module definitions from file \fImodule\fR.
273 This option
274 can be used several times to load several MIB modules into \fItcpdump\fP.
275 .TP
276 .B \-n
277 Don't convert addresses (i.e., host addresses, port numbers, etc.) to names.
278 .TP
279 .B \-N
280 Don't print domain name qualification of host names.
281 E.g.,
282 if you give this flag then \fItcpdump\fP will print ``nic''
283 instead of ``nic.ddn.mil''.
284 .TP
285 .B \-O
286 Do not run the packet-matching code optimizer.
287 This is useful only
288 if you suspect a bug in the optimizer.
289 .TP
290 .B \-p
291 \fIDon't\fP put the interface
292 into promiscuous mode.
293 Note that the interface might be in promiscuous
294 mode for some other reason; hence, `-p' cannot be used as an abbreviation for
295 `ether host {local-hw-addr} or ether broadcast'.
296 .TP
297 .B \-q
298 Quick (quiet?) output.
299 Print less protocol information so output
300 lines are shorter.
301 .TP
302 .B \-R
303 Assume ESP/AH packets to be based on old specification (RFC1825 to RFC1829).
304 If specified, \fItcpdump\fP will not print replay prevention field.
305 Since there is no protocol version field in ESP/AH specification,
306 \fItcpdump\fP cannot deduce the version of ESP/AH protocol.
307 .TP
308 .B \-r
309 Read packets from \fIfile\fR (which was created with the -w option).
310 Standard input is used if \fIfile\fR is ``-''.
311 .TP
312 .B \-S
313 Print absolute, rather than relative, TCP sequence numbers.
314 .TP
315 .B \-s
316 Snarf \fIsnaplen\fP bytes of data from each packet rather than the
317 default of 68 (with SunOS's NIT, the minimum is actually 96).
318 68 bytes is adequate for IP, ICMP, TCP
319 and UDP but may truncate protocol information from name server and NFS
320 packets (see below).
321 Packets truncated because of a limited snapshot
322 are indicated in the output with ``[|\fIproto\fP]'', where \fIproto\fP
323 is the name of the protocol level at which the truncation has occurred.
324 Note that taking larger snapshots both increases
325 the amount of time it takes to process packets and, effectively,
326 decreases the amount of packet buffering.
327 This may cause packets to be
328 lost.
329 You should limit \fIsnaplen\fP to the smallest number that will
330 capture the protocol information you're interested in.
331 Setting
332 \fIsnaplen\fP to 0 means use the required length to catch whole packets.
333 .TP
334 .B \-T
335 Force packets selected by "\fIexpression\fP" to be interpreted the
336 specified \fItype\fR.
337 Currently known types are
338 \fBcnfp\fR (Cisco NetFlow protocol),
339 \fBrpc\fR (Remote Procedure Call),
340 \fBrtp\fR (Real-Time Applications protocol),
341 \fBrtcp\fR (Real-Time Applications control protocol),
342 \fBsnmp\fR (Simple Network Management Protocol),
343 \fBvat\fR (Visual Audio Tool),
344 and
345 \fBwb\fR (distributed White Board).
346 .TP
347 .B \-t
348 \fIDon't\fP print a timestamp on each dump line.
349 .TP
350 .B \-tt
351 Print an unformatted timestamp on each dump line.
352 .TP
353 .B \-ttt
354 Print a delta (in micro-seconds) between current and previous line
355 on each dump line.
356 .TP
357 .B \-tttt
358 Print a timestamp in default format proceeded by date on each dump line.
359 .B \-u
360 Print undecoded NFS handles.
361 .TP
362 .B \-v
363 (Slightly more) verbose output.
364 For example, the time to live,
365 identification, total length and options in an IP packet are printed.
366 Also enables additional packet integrity checks such as verifying the
367 IP and ICMP header checksum.
368 .TP
369 .B \-vv
370 Even more verbose output.
371 For example, additional fields are
372 printed from NFS reply packets, and SMB packets are fully decoded.
373 .TP
374 .B \-vvv
375 Even more verbose output.
376 For example,
377 telnet \fBSB\fP ... \fBSE\fP options
378 are printed in full.
379 With
380 .B \-X
381 telnet options are printed in hex as well.
382 .TP
383 .B \-w
384 Write the raw packets to \fIfile\fR rather than parsing and printing
385 them out.
386 They can later be printed with the \-r option.
387 Standard output is used if \fIfile\fR is ``-''.
388 .TP
389 .B \-x
390 Print each packet (minus its link level header) in hex.
391 The smaller of the entire packet or
392 .I snaplen
393 bytes will be printed.
394 .TP
395 .B \-X
396 When printing hex, print ascii too.
397 Thus if
398 .B \-x
399 is also set, the packet is printed in hex/ascii.
400 This is very handy for analysing new protocols.
401 Even if
402 .B \-x
403 is not also set, some parts of some packets may be printed
404 in hex/ascii.
405 .IP "\fI expression\fP"
406 .RS
407 selects which packets will be dumped.
408 If no \fIexpression\fP
409 is given, all packets on the net will be dumped.
410 Otherwise,
411 only packets for which \fIexpression\fP is `true' will be dumped.
412 .LP
413 The \fIexpression\fP consists of one or more
414 .I primitives.
415 Primitives usually consist of an
416 .I id
417 (name or number) preceded by one or more qualifiers.
418 There are three
419 different kinds of qualifier:
420 .IP \fItype\fP
421 qualifiers say what kind of thing the id name or number refers to.
422 Possible types are
423 .BR host ,
424 .B net
425 and
426 .BR port .
427 E.g., `host foo', `net 128.3', `port 20'.
428 If there is no type
429 qualifier,
430 .B host
431 is assumed.
432 .IP \fIdir\fP
433 qualifiers specify a particular transfer direction to and/or from
434 .IR id .
435 Possible directions are
436 .BR src ,
437 .BR dst ,
438 .B "src or dst"
439 and
440 .B "src and"
441 .BR dst .
442 E.g., `src foo', `dst net 128.3', `src or dst port ftp-data'.
443 If
444 there is no dir qualifier,
445 .B "src or dst"
446 is assumed.
447 For `null' link layers (i.e. point to point protocols such as slip) the
448 .B inbound
449 and
450 .B outbound
451 qualifiers can be used to specify a desired direction.
452 .IP \fIproto\fP
453 qualifiers restrict the match to a particular protocol.
454 Possible
455 protos are:
456 .BR ether ,
457 .BR fddi ,
458 .BR tr ,
459 .BR ip ,
460 .BR ip6 ,
461 .BR arp ,
462 .BR rarp ,
463 .BR decnet ,
464 .B tcp
465 and
466 .BR udp .
467 E.g., `ether src foo', `arp net 128.3', `tcp port 21'.
468 If there is
469 no proto qualifier, all protocols consistent with the type are
470 assumed.
471 E.g., `src foo' means `(ip or arp or rarp) src foo'
472 (except the latter is not legal syntax), `net bar' means `(ip or
473 arp or rarp) net bar' and `port 53' means `(tcp or udp) port 53'.
474 .LP
475 [`fddi' is actually an alias for `ether'; the parser treats them
476 identically as meaning ``the data link level used on the specified
477 network interface.'' FDDI headers contain Ethernet-like source
478 and destination addresses, and often contain Ethernet-like packet
479 types, so you can filter on these FDDI fields just as with the
480 analogous Ethernet fields.
481 FDDI headers also contain other fields,
482 but you cannot name them explicitly in a filter expression.
483 .LP
484 Similarly, `tr' is an alias for `ether'; the previous paragraph's
485 statements about FDDI headers also apply to Token Ring headers.]
486 .LP
487 In addition to the above, there are some special `primitive' keywords
488 that don't follow the pattern:
489 .BR gateway ,
490 .BR broadcast ,
491 .BR less ,
492 .B greater
493 and arithmetic expressions.
494 All of these are described below.
495 .LP
496 More complex filter expressions are built up by using the words
497 .BR and ,
498 .B or
499 and
500 .B not
501 to combine primitives.
502 E.g., `host foo and not port ftp and not port ftp-data'.
503 To save typing, identical qualifier lists can be omitted.
504 E.g.,
505 `tcp dst port ftp or ftp-data or domain' is exactly the same as
506 `tcp dst port ftp or tcp dst port ftp-data or tcp dst port domain'.
507 .LP
508 Allowable primitives are:
509 .IP "\fBdst host \fIhost\fR"
510 True if the IPv4/v6 destination field of the packet is \fIhost\fP,
511 which may be either an address or a name.
512 .IP "\fBsrc host \fIhost\fR"
513 True if the IPv4/v6 source field of the packet is \fIhost\fP.
514 .IP "\fBhost \fIhost\fP
515 True if either the IPv4/v6 source or destination of the packet is \fIhost\fP.
516 Any of the above host expressions can be prepended with the keywords,
517 \fBip\fP, \fBarp\fP, \fBrarp\fP, or \fBip6\fP as in:
518 .in +.5i
519 .nf
520 \fBip host \fIhost\fR
521 .fi
522 .in -.5i
523 which is equivalent to:
524 .in +.5i
525 .nf
526 \fBether proto \fI\\ip\fB and host \fIhost\fR
527 .fi
528 .in -.5i
529 If \fIhost\fR is a name with multiple IP addresses, each address will
530 be checked for a match.
531 .IP "\fBether dst \fIehost\fP
532 True if the ethernet destination address is \fIehost\fP.
533 \fIEhost\fP
534 may be either a name from /etc/ethers or a number (see
535 .IR ethers (3N)
536 for numeric format).
537 .IP "\fBether src \fIehost\fP
538 True if the ethernet source address is \fIehost\fP.
539 .IP "\fBether host \fIehost\fP
540 True if either the ethernet source or destination address is \fIehost\fP.
541 .IP "\fBgateway\fP \fIhost\fP
542 True if the packet used \fIhost\fP as a gateway.
543 I.e., the ethernet
544 source or destination address was \fIhost\fP but neither the IP source
545 nor the IP destination was \fIhost\fP.
546 \fIHost\fP must be a name and
547 must be found both by the machine's host-name-to-IP-address resolution
548 mechanisms (host name file, DNS, NIS, etc.) and by the machine's
549 host-name-to-Ethernet-address resolution mechanism (/etc/ethers, etc.).
550 (An equivalent expression is
551 .in +.5i
552 .nf
553 \fBether host \fIehost \fBand not host \fIhost\fR
554 .fi
555 .in -.5i
556 which can be used with either names or numbers for \fIhost / ehost\fP.)
557 This syntax does not work in IPv6-enabled configuration at this moment.
558 .IP "\fBdst net \fInet\fR"
559 True if the IPv4/v6 destination address of the packet has a network
560 number of \fInet\fP.
561 \fINet\fP may be either a name from /etc/networks
562 or a network number (see \fInetworks(4)\fP for details).
563 .IP "\fBsrc net \fInet\fR"
564 True if the IPv4/v6 source address of the packet has a network
565 number of \fInet\fP.
566 .IP "\fBnet \fInet\fR"
567 True if either the IPv4/v6 source or destination address of the packet has a network
568 number of \fInet\fP.
569 .IP "\fBnet \fInet\fR \fBmask \fInetmask\fR"
570 True if the IP address matches \fInet\fR with the specific \fInetmask\fR.
571 May be qualified with \fBsrc\fR or \fBdst\fR.
572 Note that this syntax is not valid for IPv6 \fInet\fR.
573 .IP "\fBnet \fInet\fR/\fIlen\fR"
574 True if the IPv4/v6 address matches \fInet\fR with a netmask \fIlen\fR
575 bits wide.
576 May be qualified with \fBsrc\fR or \fBdst\fR.
577 .IP "\fBdst port \fIport\fR"
578 True if the packet is ip/tcp, ip/udp, ip6/tcp or ip6/udp and has a
579 destination port value of \fIport\fP.
580 The \fIport\fP can be a number or a name used in /etc/services (see
581 .IR tcp (4P)
582 and
583 .IR udp (4P)).
584 If a name is used, both the port
585 number and protocol are checked.
586 If a number or ambiguous name is used,
587 only the port number is checked (e.g., \fBdst port 513\fR will print both
588 tcp/login traffic and udp/who traffic, and \fBport domain\fR will print
589 both tcp/domain and udp/domain traffic).
590 .IP "\fBsrc port \fIport\fR"
591 True if the packet has a source port value of \fIport\fP.
592 .IP "\fBport \fIport\fR"
593 True if either the source or destination port of the packet is \fIport\fP.
594 Any of the above port expressions can be prepended with the keywords,
595 \fBtcp\fP or \fBudp\fP, as in:
596 .in +.5i
597 .nf
598 \fBtcp src port \fIport\fR
599 .fi
600 .in -.5i
601 which matches only tcp packets whose source port is \fIport\fP.
602 .IP "\fBless \fIlength\fR"
603 True if the packet has a length less than or equal to \fIlength\fP.
604 This is equivalent to:
605 .in +.5i
606 .nf
607 \fBlen <= \fIlength\fP.
608 .fi
609 .in -.5i
610 .IP "\fBgreater \fIlength\fR"
611 True if the packet has a length greater than or equal to \fIlength\fP.
612 This is equivalent to:
613 .in +.5i
614 .nf
615 \fBlen >= \fIlength\fP.
616 .fi
617 .in -.5i
618 .IP "\fBip proto \fIprotocol\fR"
619 True if the packet is an IP packet (see
620 .IR ip (4P))
621 of protocol type \fIprotocol\fP.
622 \fIProtocol\fP can be a number or one of the names
623 \fIicmp\fP, \fIicmp6\fP, \fIigmp\fP, \fIigrp\fP, \fIpim\fP, \fIah\fP,
624 \fIesp\fP, \fIvrrp\fP, \fIudp\fP, or \fItcp\fP.
625 Note that the identifiers \fItcp\fP, \fIudp\fP, and \fIicmp\fP are also
626 keywords and must be escaped via backslash (\\), which is \\\\ in the C-shell.
627 Note that this primitive does not chase the protocol header chain.
628 .IP "\fBip6 proto \fIprotocol\fR"
629 True if the packet is an IPv6 packet of protocol type \fIprotocol\fP.
630 Note that this primitive does not chase the protocol header chain.
631 .IP "\fBip6 protochain \fIprotocol\fR"
632 True if the packet is IPv6 packet,
633 and contains protocol header with type \fIprotocol\fR
634 in its protocol header chain.
635 For example,
636 .in +.5i
637 .nf
638 \fBip6 protochain 6\fR
639 .fi
640 .in -.5i
641 matches any IPv6 packet with TCP protocol header in the protocol header chain.
642 The packet may contain, for example,
643 authentication header, routing header, or hop-by-hop option header,
644 between IPv6 header and TCP header.
645 The BPF code emitted by this primitive is complex and
646 cannot be optimized by BPF optimizer code in \fItcpdump\fP,
647 so this can be somewhat slow.
648 .IP "\fBip protochain \fIprotocol\fR"
649 Equivalent to \fBip6 protochain \fIprotocol\fR, but this is for IPv4.
650 .IP "\fBether broadcast\fR"
651 True if the packet is an ethernet broadcast packet.
652 The \fIether\fP
653 keyword is optional.
654 .IP "\fBip broadcast\fR"
655 True if the packet is an IP broadcast packet.
656 It checks for both
657 the all-zeroes and all-ones broadcast conventions, and looks up
658 the local subnet mask.
659 .IP "\fBether multicast\fR"
660 True if the packet is an ethernet multicast packet.
661 The \fIether\fP
662 keyword is optional.
663 This is shorthand for `\fBether[0] & 1 != 0\fP'.
664 .IP "\fBip multicast\fR"
665 True if the packet is an IP multicast packet.
666 .IP "\fBip6 multicast\fR"
667 True if the packet is an IPv6 multicast packet.
668 .IP "\fBether proto \fIprotocol\fR"
669 True if the packet is of ether type \fIprotocol\fR.
670 \fIProtocol\fP can be a number or one of the names
671 \fIip\fP, \fIip6\fP, \fIarp\fP, \fIrarp\fP, \fIatalk\fP, \fIaarp\fP,
672 \fIdecnet\fP, \fIsca\fP, \fIlat\fP, \fImopdl\fP, \fImoprc\fP,
673 \fIiso\fP, \fIstp\fP, \fIipx\fP, or \fInetbeui\fP.
674 Note these identifiers are also keywords
675 and must be escaped via backslash (\\).
676 .IP
677 [In the case of FDDI (e.g., `\fBfddi protocol arp\fR') and Token Ring
678 (e.g., `\fBtr protocol arp\fR'), for most of those protocols, the
679 protocol identification comes from the 802.2 Logical Link Control (LLC)
680 header, which is usually layered on top of the FDDI or Token Ring
681 header.
682 .IP
683 When filtering for most protocol identifiers on FDDI or Token Ring,
684 \fItcpdump\fR checks only the protocol ID field of an LLC header in
685 so-called SNAP format with an Organizational Unit Identifier (OUI) of
686 0x000000, for encapsulated Ethernet; it doesn't check whether the packet
687 is in SNAP format with an OUI of 0x000000.
688 .IP
689 The exceptions are \fIiso\fP, for which it checks the DSAP (Destination
690 Service Access Point) and SSAP (Source Service Access Point) fields of
691 the LLC header, \fIstp\fP and \fInetbeui\fP, where it checks the DSAP of
692 the LLC header, and \fIatalk\fP, where it checks for a SNAP-format
693 packet with an OUI of 0x080007 and the Appletalk etype.
694 .IP
695 In the case of Ethernet, \fItcpdump\fR checks the Ethernet type field
696 for most of those protocols; the exceptions are \fIiso\fP, \fIsap\fP,
697 and \fInetbeui\fP, for which it checks for an 802.3 frame and then
698 checks the LLC header as it does for FDDI and Token Ring, \fIatalk\fP,
699 where it checks both for the Appletalk etype in an Ethernet frame and
700 for a SNAP-format packet as it does for FDDI and Token Ring, \fIaarp\fP,
701 where it checks for the Appletalk ARP etype in either an Ethernet frame
702 or an 802.2 SNAP frame with an OUI of 0x000000, and \fIipx\fP, where it
703 checks for the IPX etype in an Ethernet frame, the IPX DSAP in the LLC
704 header, the 802.3 with no LLC header encapsulation of IPX, and the IPX
705 etype in a SNAP frame.]
706 .IP "\fBdecnet src \fIhost\fR"
707 True if the DECNET source address is
708 .IR host ,
709 which may be an address of the form ``10.123'', or a DECNET host
710 name.
711 [DECNET host name support is only available on Ultrix systems
712 that are configured to run DECNET.]
713 .IP "\fBdecnet dst \fIhost\fR"
714 True if the DECNET destination address is
715 .IR host .
716 .IP "\fBdecnet host \fIhost\fR"
717 True if either the DECNET source or destination address is
718 .IR host .
719 .IP "\fBip\fR, \fBip6\fR, \fBarp\fR, \fBrarp\fR, \fBatalk\fR, \fBaarp\fR, \fBdecnet\fR, \fBiso\fR, \fBstp\fR, \fBipx\fR, \fInetbeui\fP"
720 Abbreviations for:
721 .in +.5i
722 .nf
723 \fBether proto \fIp\fR
724 .fi
725 .in -.5i
726 where \fIp\fR is one of the above protocols.
727 .IP "\fBlat\fR, \fBmoprc\fR, \fBmopdl\fR"
728 Abbreviations for:
729 .in +.5i
730 .nf
731 \fBether proto \fIp\fR
732 .fi
733 .in -.5i
734 where \fIp\fR is one of the above protocols.
735 Note that
736 \fItcpdump\fP does not currently know how to parse these protocols.
737 .IP "\fBvlan \fI[vlan_id]\fR"
738 True if the packet is an IEEE 802.1Q VLAN packet.
739 If \fI[vlan_id]\fR is specified, only true is the packet has the specified
740 \fIvlan_id\fR.
741 Note that the first \fBvlan\fR keyword encountered in \fIexpression\fR
742 changes the decoding offsets for the remainder of \fIexpression\fR
743 on the assumption that the packet is a VLAN packet.
744 .IP "\fBtcp\fR, \fBudp\fR, \fBicmp\fR"
745 Abbreviations for:
746 .in +.5i
747 .nf
748 \fBip proto \fIp\fR\fB or ip6 proto \fIp\fR
749 .fi
750 .in -.5i
751 where \fIp\fR is one of the above protocols.
752 .IP "\fBiso proto \fIprotocol\fR"
753 True if the packet is an OSI packet of protocol type \fIprotocol\fP.
754 \fIProtocol\fP can be a number or one of the names
755 \fIclnp\fP, \fIesis\fP, or \fIisis\fP.
756 .IP "\fBclnp\fR, \fBesis\fR, \fBisis\fR"
757 Abbreviations for:
758 .in +.5i
759 .nf
760 \fBiso proto \fIp\fR
761 .fi
762 .in -.5i
763 where \fIp\fR is one of the above protocols.
764 Note that \fItcpdump\fR does an incomplete job of parsing these protocols.
765 .IP "\fIexpr relop expr\fR"
766 True if the relation holds, where \fIrelop\fR is one of >, <, >=, <=, =, !=,
767 and \fIexpr\fR is an arithmetic expression composed of integer constants
768 (expressed in standard C syntax), the normal binary operators
769 [+, -, *, /, &, |], a length operator, and special packet data accessors.
770 To access
771 data inside the packet, use the following syntax:
772 .in +.5i
773 .nf
774 \fIproto\fB [ \fIexpr\fB : \fIsize\fB ]\fR
775 .fi
776 .in -.5i
777 \fIProto\fR is one of \fBether, fddi, tr, ppp, slip, link,
778 ip, arp, rarp, tcp, udp, icmp\fR or \fBip6\fR, and
779 indicates the protocol layer for the index operation.
780 (\fBether, fddi, tr, ppp, slip\fR and \fBlink\fR all refer to the link
781 layer.)
782 Note that \fItcp, udp\fR and other upper-layer protocol types only
783 apply to IPv4, not IPv6 (this will be fixed in the future).
784 The byte offset, relative to the indicated protocol layer, is
785 given by \fIexpr\fR.
786 \fISize\fR is optional and indicates the number of bytes in the
787 field of interest; it can be either one, two, or four, and defaults to one.
788 The length operator, indicated by the keyword \fBlen\fP, gives the
789 length of the packet.
790
791 For example, `\fBether[0] & 1 != 0\fP' catches all multicast traffic.
792 The expression `\fBip[0] & 0xf != 5\fP'
793 catches all IP packets with options.
794 The expression
795 `\fBip[6:2] & 0x1fff = 0\fP'
796 catches only unfragmented datagrams and frag zero of fragmented datagrams.
797 This check is implicitly applied to the \fBtcp\fP and \fBudp\fP
798 index operations.
799 For instance, \fBtcp[0]\fP always means the first
800 byte of the TCP \fIheader\fP, and never means the first byte of an
801 intervening fragment.
802
803 Some offsets and field values may be expressed as names rather than
804 as numeric values.
805 The following protocol header field offsets are
806 available: \fBicmptype\fP (ICMP type field), \fBicmpcode\fP (ICMP
807 code field), and \fBtcpflags\fP (TCP flags field).
808
809 The following ICMP type field values are available: \fBicmp-echoreply\fP,
810 \fBicmp-unreach\fP, \fBicmp-sourcequench\fP, \fBicmp-redirect\fP,
811 \fBicmp-echo\fP, \fBicmp-routeradvert\fP, \fBicmp-routersolicit\fP,
812 \fBicmp-timxceed\fP, \fBicmp-paramprob\fP, \fBicmp-tstamp\fP,
813 \fBicmp-tstampreply\fP, \fBicmp-ireq\fP, \fBicmp-ireqreply\fP,
814 \fBicmp-maskreq\fP, \fBicmp-maskreply\fP.
815
816 The following TCP flags field values are available: \fBtcp-fin\fP,
817 \fBtcp-syn\fP, \fBtcp-rst\fP, \fBtcp-push\fP, \fBtcp-push\fP,
818 \fBtcp-ack\fP, \fBtcp-urg\fP.
819 .LP
820 Primitives may be combined using:
821 .IP
822 A parenthesized group of primitives and operators
823 (parentheses are special to the Shell and must be escaped).
824 .IP
825 Negation (`\fB!\fP' or `\fBnot\fP').
826 .IP
827 Concatenation (`\fB&&\fP' or `\fBand\fP').
828 .IP
829 Alternation (`\fB||\fP' or `\fBor\fP').
830 .LP
831 Negation has highest precedence.
832 Alternation and concatenation have equal precedence and associate
833 left to right.
834 Note that explicit \fBand\fR tokens, not juxtaposition,
835 are now required for concatenation.
836 .LP
837 If an identifier is given without a keyword, the most recent keyword
838 is assumed.
839 For example,
840 .in +.5i
841 .nf
842 \fBnot host vs and ace\fR
843 .fi
844 .in -.5i
845 is short for
846 .in +.5i
847 .nf
848 \fBnot host vs and host ace\fR
849 .fi
850 .in -.5i
851 which should not be confused with
852 .in +.5i
853 .nf
854 \fBnot ( host vs or ace )\fR
855 .fi
856 .in -.5i
857 .LP
858 Expression arguments can be passed to \fItcpdump\fP as either a single
859 argument or as multiple arguments, whichever is more convenient.
860 Generally, if the expression contains Shell metacharacters, it is
861 easier to pass it as a single, quoted argument.
862 Multiple arguments are concatenated with spaces before being parsed.
863 .SH EXAMPLES
864 .LP
865 To print all packets arriving at or departing from \fIsundown\fP:
866 .RS
867 .nf
868 \fBtcpdump host sundown\fP
869 .fi
870 .RE
871 .LP
872 To print traffic between \fIhelios\fR and either \fIhot\fR or \fIace\fR:
873 .RS
874 .nf
875 \fBtcpdump host helios and \\( hot or ace \\)\fP
876 .fi
877 .RE
878 .LP
879 To print all IP packets between \fIace\fR and any host except \fIhelios\fR:
880 .RS
881 .nf
882 \fBtcpdump ip host ace and not helios\fP
883 .fi
884 .RE
885 .LP
886 To print all traffic between local hosts and hosts at Berkeley:
887 .RS
888 .nf
889 .B
890 tcpdump net ucb-ether
891 .fi
892 .RE
893 .LP
894 To print all ftp traffic through internet gateway \fIsnup\fP:
895 (note that the expression is quoted to prevent the shell from
896 (mis-)interpreting the parentheses):
897 .RS
898 .nf
899 .B
900 tcpdump 'gateway snup and (port ftp or ftp-data)'
901 .fi
902 .RE
903 .LP
904 To print traffic neither sourced from nor destined for local hosts
905 (if you gateway to one other net, this stuff should never make it
906 onto your local net).
907 .RS
908 .nf
909 .B
910 tcpdump ip and not net \fIlocalnet\fP
911 .fi
912 .RE
913 .LP
914 To print the start and end packets (the SYN and FIN packets) of each
915 TCP conversation that involves a non-local host.
916 .RS
917 .nf
918 .B
919 tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net \fIlocalnet\fP'
920 .fi
921 .RE
922 .LP
923 To print IP packets longer than 576 bytes sent through gateway \fIsnup\fP:
924 .RS
925 .nf
926 .B
927 tcpdump 'gateway snup and ip[2:2] > 576'
928 .fi
929 .RE
930 .LP
931 To print IP broadcast or multicast packets that were
932 .I not
933 sent via ethernet broadcast or multicast:
934 .RS
935 .nf
936 .B
937 tcpdump 'ether[0] & 1 = 0 and ip[16] >= 224'
938 .fi
939 .RE
940 .LP
941 To print all ICMP packets that are not echo requests/replies (i.e., not
942 ping packets):
943 .RS
944 .nf
945 .B
946 tcpdump 'icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply'
947 .fi
948 .RE
949 .SH OUTPUT FORMAT
950 .LP
951 The output of \fItcpdump\fP is protocol dependent.
952 The following
953 gives a brief description and examples of most of the formats.
954 .de HD
955 .sp 1.5
956 .B
957 ..
958 .HD
959 Link Level Headers
960 .LP
961 If the '-e' option is given, the link level header is printed out.
962 On ethernets, the source and destination addresses, protocol,
963 and packet length are printed.
964 .LP
965 On FDDI networks, the '-e' option causes \fItcpdump\fP to print
966 the `frame control' field, the source and destination addresses,
967 and the packet length.
968 (The `frame control' field governs the
969 interpretation of the rest of the packet.
970 Normal packets (such
971 as those containing IP datagrams) are `async' packets, with a priority
972 value between 0 and 7; for example, `\fBasync4\fR'.
973 Such packets
974 are assumed to contain an 802.2 Logical Link Control (LLC) packet;
975 the LLC header is printed if it is \fInot\fR an ISO datagram or a
976 so-called SNAP packet.
977 .LP
978 On Token Ring networks, the '-e' option causes \fItcpdump\fP to print
979 the `access control' and `frame control' fields, the source and
980 destination addresses, and the packet length.
981 As on FDDI networks,
982 packets are assumed to contain an LLC packet.
983 Regardless of whether
984 the '-e' option is specified or not, the source routing information is
985 printed for source-routed packets.
986 .LP
987 \fI(N.B.: The following description assumes familiarity with
988 the SLIP compression algorithm described in RFC-1144.)\fP
989 .LP
990 On SLIP links, a direction indicator (``I'' for inbound, ``O'' for outbound),
991 packet type, and compression information are printed out.
992 The packet type is printed first.
993 The three types are \fIip\fP, \fIutcp\fP, and \fIctcp\fP.
994 No further link information is printed for \fIip\fR packets.
995 For TCP packets, the connection identifier is printed following the type.
996 If the packet is compressed, its encoded header is printed out.
997 The special cases are printed out as
998 \fB*S+\fIn\fR and \fB*SA+\fIn\fR, where \fIn\fR is the amount by which
999 the sequence number (or sequence number and ack) has changed.
1000 If it is not a special case,
1001 zero or more changes are printed.
1002 A change is indicated by U (urgent pointer), W (window), A (ack),
1003 S (sequence number), and I (packet ID), followed by a delta (+n or -n),
1004 or a new value (=n).
1005 Finally, the amount of data in the packet and compressed header length
1006 are printed.
1007 .LP
1008 For example, the following line shows an outbound compressed TCP packet,
1009 with an implicit connection identifier; the ack has changed by 6,
1010 the sequence number by 49, and the packet ID by 6; there are 3 bytes of
1011 data and 6 bytes of compressed header:
1012 .RS
1013 .nf
1014 \fBO ctcp * A+6 S+49 I+6 3 (6)\fP
1015 .fi
1016 .RE
1017 .HD
1018 ARP/RARP Packets
1019 .LP
1020 Arp/rarp output shows the type of request and its arguments.
1021 The
1022 format is intended to be self explanatory.
1023 Here is a short sample taken from the start of an `rlogin' from
1024 host \fIrtsg\fP to host \fIcsam\fP:
1025 .RS
1026 .nf
1027 .sp .5
1028 \f(CWarp who-has csam tell rtsg
1029 arp reply csam is-at CSAM\fR
1030 .sp .5
1031 .fi
1032 .RE
1033 The first line says that rtsg sent an arp packet asking
1034 for the ethernet address of internet host csam.
1035 Csam
1036 replies with its ethernet address (in this example, ethernet addresses
1037 are in caps and internet addresses in lower case).
1038 .LP
1039 This would look less redundant if we had done \fItcpdump \-n\fP:
1040 .RS
1041 .nf
1042 .sp .5
1043 \f(CWarp who-has 128.3.254.6 tell 128.3.254.68
1044 arp reply 128.3.254.6 is-at 02:07:01:00:01:c4\fP
1045 .fi
1046 .RE
1047 .LP
1048 If we had done \fItcpdump \-e\fP, the fact that the first packet is
1049 broadcast and the second is point-to-point would be visible:
1050 .RS
1051 .nf
1052 .sp .5
1053 \f(CWRTSG Broadcast 0806 64: arp who-has csam tell rtsg
1054 CSAM RTSG 0806 64: arp reply csam is-at CSAM\fR
1055 .sp .5
1056 .fi
1057 .RE
1058 For the first packet this says the ethernet source address is RTSG, the
1059 destination is the ethernet broadcast address, the type field
1060 contained hex 0806 (type ETHER_ARP) and the total length was 64 bytes.
1061 .HD
1062 TCP Packets
1063 .LP
1064 \fI(N.B.:The following description assumes familiarity with
1065 the TCP protocol described in RFC-793.
1066 If you are not familiar
1067 with the protocol, neither this description nor \fItcpdump\fP will
1068 be of much use to you.)\fP
1069 .LP
1070 The general format of a tcp protocol line is:
1071 .RS
1072 .nf
1073 .sp .5
1074 \fIsrc > dst: flags data-seqno ack window urgent options\fP
1075 .sp .5
1076 .fi
1077 .RE
1078 \fISrc\fP and \fIdst\fP are the source and destination IP
1079 addresses and ports.
1080 \fIFlags\fP are some combination of S (SYN),
1081 F (FIN), P (PUSH) or R (RST) or a single `.' (no flags).
1082 \fIData-seqno\fP describes the portion of sequence space covered
1083 by the data in this packet (see example below).
1084 \fIAck\fP is sequence number of the next data expected the other
1085 direction on this connection.
1086 \fIWindow\fP is the number of bytes of receive buffer space available
1087 the other direction on this connection.
1088 \fIUrg\fP indicates there is `urgent' data in the packet.
1089 \fIOptions\fP are tcp options enclosed in angle brackets (e.g., <mss 1024>).
1090 .LP
1091 \fISrc, dst\fP and \fIflags\fP are always present.
1092 The other fields
1093 depend on the contents of the packet's tcp protocol header and
1094 are output only if appropriate.
1095 .LP
1096 Here is the opening portion of an rlogin from host \fIrtsg\fP to
1097 host \fIcsam\fP.
1098 .RS
1099 .nf
1100 .sp .5
1101 \s-2\f(CWrtsg.1023 > csam.login: S 768512:768512(0) win 4096 <mss 1024>
1102 csam.login > rtsg.1023: S 947648:947648(0) ack 768513 win 4096 <mss 1024>
1103 rtsg.1023 > csam.login: . ack 1 win 4096
1104 rtsg.1023 > csam.login: P 1:2(1) ack 1 win 4096
1105 csam.login > rtsg.1023: . ack 2 win 4096
1106 rtsg.1023 > csam.login: P 2:21(19) ack 1 win 4096
1107 csam.login > rtsg.1023: P 1:2(1) ack 21 win 4077
1108 csam.login > rtsg.1023: P 2:3(1) ack 21 win 4077 urg 1
1109 csam.login > rtsg.1023: P 3:4(1) ack 21 win 4077 urg 1\fR\s+2
1110 .sp .5
1111 .fi
1112 .RE
1113 The first line says that tcp port 1023 on rtsg sent a packet
1114 to port \fIlogin\fP
1115 on csam.
1116 The \fBS\fP indicates that the \fISYN\fP flag was set.
1117 The packet sequence number was 768512 and it contained no data.
1118 (The notation is `first:last(nbytes)' which means `sequence
1119 numbers \fIfirst\fP
1120 up to but not including \fIlast\fP which is \fInbytes\fP bytes of user data'.)
1121 There was no piggy-backed ack, the available receive window was 4096
1122 bytes and there was a max-segment-size option requesting an mss of
1123 1024 bytes.
1124 .LP
1125 Csam replies with a similar packet except it includes a piggy-backed
1126 ack for rtsg's SYN.
1127 Rtsg then acks csam's SYN.
1128 The `.' means no
1129 flags were set.
1130 The packet contained no data so there is no data sequence number.
1131 Note that the ack sequence
1132 number is a small integer (1).
1133 The first time \fItcpdump\fP sees a
1134 tcp `conversation', it prints the sequence number from the packet.
1135 On subsequent packets of the conversation, the difference between
1136 the current packet's sequence number and this initial sequence number
1137 is printed.
1138 This means that sequence numbers after the
1139 first can be interpreted
1140 as relative byte positions in the conversation's data stream (with the
1141 first data byte each direction being `1').
1142 `-S' will override this
1143 feature, causing the original sequence numbers to be output.
1144 .LP
1145 On the 6th line, rtsg sends csam 19 bytes of data (bytes 2 through 20
1146 in the rtsg \(-> csam side of the conversation).
1147 The PUSH flag is set in the packet.
1148 On the 7th line, csam says it's received data sent by rtsg up to
1149 but not including byte 21.
1150 Most of this data is apparently sitting in the
1151 socket buffer since csam's receive window has gotten 19 bytes smaller.
1152 Csam also sends one byte of data to rtsg in this packet.
1153 On the 8th and 9th lines,
1154 csam sends two bytes of urgent, pushed data to rtsg.
1155 .LP
1156 If the snapshot was small enough that \fItcpdump\fP didn't capture
1157 the full TCP header, it interprets as much of the header as it can
1158 and then reports ``[|\fItcp\fP]'' to indicate the remainder could not
1159 be interpreted.
1160 If the header contains a bogus option (one with a length
1161 that's either too small or beyond the end of the header), \fItcpdump\fP
1162 reports it as ``[\fIbad opt\fP]'' and does not interpret any further
1163 options (since it's impossible to tell where they start).
1164 If the header
1165 length indicates options are present but the IP datagram length is not
1166 long enough for the options to actually be there, \fItcpdump\fP reports
1167 it as ``[\fIbad hdr length\fP]''.
1168 .HD
1169 .B Capturing TCP packets with particular flag combinations (SYN-ACK, URG-ACK, etc.)
1170 .PP
1171 There are 8 bits in the control bits section of the TCP header:
1172 .IP
1173 .I CWR | ECE | URG | ACK | PSH | RST | SYN | FIN
1174 .PP
1175 Let's assume that we want to watch packets used in establishing
1176 a TCP connection.
1177 Recall that TCP uses a 3-way handshake protocol
1178 when it initializes a new connection; the connection sequence with
1179 regard to the TCP control bits is
1180 .PP
1181 .RS
1182 1) Caller sends SYN
1183 .RE
1184 .RS
1185 2) Recipient responds with SYN, ACK
1186 .RE
1187 .RS
1188 3) Caller sends ACK
1189 .RE
1190 .PP
1191 Now we're interested in capturing packets that have only the
1192 SYN bit set (Step 1).
1193 Note that we don't want packets from step 2
1194 (SYN-ACK), just a plain initial SYN.
1195 What we need is a correct filter
1196 expression for \fItcpdump\fP.
1197 .PP
1198 Recall the structure of a TCP header without options:
1199 .PP
1200 .nf
1201 0 15 31
1202 -----------------------------------------------------------------
1203 | source port | destination port |
1204 -----------------------------------------------------------------
1205 | sequence number |
1206 -----------------------------------------------------------------
1207 | acknowledgment number |
1208 -----------------------------------------------------------------
1209 | HL | rsvd |C|E|U|A|P|R|S|F| window size |
1210 -----------------------------------------------------------------
1211 | TCP checksum | urgent pointer |
1212 -----------------------------------------------------------------
1213 .fi
1214 .PP
1215 A TCP header usually holds 20 octets of data, unless options are
1216 present.
1217 The first line of the graph contains octets 0 - 3, the
1218 second line shows octets 4 - 7 etc.
1219 .PP
1220 Starting to count with 0, the relevant TCP control bits are contained
1221 in octet 13:
1222 .PP
1223 .nf
1224 0 7| 15| 23| 31
1225 ----------------|---------------|---------------|----------------
1226 | HL | rsvd |C|E|U|A|P|R|S|F| window size |
1227 ----------------|---------------|---------------|----------------
1228 | | 13th octet | | |
1229 .fi
1230 .PP
1231 Let's have a closer look at octet no. 13:
1232 .PP
1233 .nf
1234 | |
1235 |---------------|
1236 |C|E|U|A|P|R|S|F|
1237 |---------------|
1238 |7 5 3 0|
1239 .fi
1240 .PP
1241 These are the TCP control bits we are interested
1242 in.
1243 We have numbered the bits in this octet from 0 to 7, right to
1244 left, so the PSH bit is bit number 3, while the URG bit is number 5.
1245 .PP
1246 Recall that we want to capture packets with only SYN set.
1247 Let's see what happens to octet 13 if a TCP datagram arrives
1248 with the SYN bit set in its header:
1249 .PP
1250 .nf
1251 |C|E|U|A|P|R|S|F|
1252 |---------------|
1253 |0 0 0 0 0 0 1 0|
1254 |---------------|
1255 |7 6 5 4 3 2 1 0|
1256 .fi
1257 .PP
1258 Looking at the
1259 control bits section we see that only bit number 1 (SYN) is set.
1260 .PP
1261 Assuming that octet number 13 is an 8-bit unsigned integer in
1262 network byte order, the binary value of this octet is
1263 .IP
1264 00000010
1265 .PP
1266 and its decimal representation is
1267 .PP
1268 .nf
1269 7 6 5 4 3 2 1 0
1270 0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 1*2 + 0*2 = 2
1271 .fi
1272 .PP
1273 We're almost done, because now we know that if only SYN is set,
1274 the value of the 13th octet in the TCP header, when interpreted
1275 as a 8-bit unsigned integer in network byte order, must be exactly 2.
1276 .PP
1277 This relationship can be expressed as
1278 .RS
1279 .B
1280 tcp[13] == 2
1281 .RE
1282 .PP
1283 We can use this expression as the filter for \fItcpdump\fP in order
1284 to watch packets which have only SYN set:
1285 .RS
1286 .B
1287 tcpdump -i xl0 tcp[13] == 2
1288 .RE
1289 .PP
1290 The expression says "let the 13th octet of a TCP datagram have
1291 the decimal value 2", which is exactly what we want.
1292 .PP
1293 Now, let's assume that we need to capture SYN packets, but we
1294 don't care if ACK or any other TCP control bit is set at the
1295 same time.
1296 Let's see what happens to octet 13 when a TCP datagram
1297 with SYN-ACK set arrives:
1298 .PP
1299 .nf
1300 |C|E|U|A|P|R|S|F|
1301 |---------------|
1302 |0 0 0 1 0 0 1 0|
1303 |---------------|
1304 |7 6 5 4 3 2 1 0|
1305 .fi
1306 .PP
1307 Now bits 1 and 4 are set in the 13th octet.
1308 The binary value of
1309 octet 13 is
1310 .IP
1311 00010010
1312 .PP
1313 which translates to decimal
1314 .PP
1315 .nf
1316 7 6 5 4 3 2 1 0
1317 0*2 + 0*2 + 0*2 + 1*2 + 0*2 + 0*2 + 1*2 + 0*2 = 18
1318 .fi
1319 .PP
1320 Now we can't just use 'tcp[13] == 18' in the \fItcpdump\fP filter
1321 expression, because that would select only those packets that have
1322 SYN-ACK set, but not those with only SYN set.
1323 Remember that we don't care
1324 if ACK or any other control bit is set as long as SYN is set.
1325 .PP
1326 In order to achieve our goal, we need to logically AND the
1327 binary value of octet 13 with some other value to preserve
1328 the SYN bit.
1329 We know that we want SYN to be set in any case,
1330 so we'll logically AND the value in the 13th octet with
1331 the binary value of a SYN:
1332 .PP
1333 .nf
1334
1335 00010010 SYN-ACK 00000010 SYN
1336 AND 00000010 (we want SYN) AND 00000010 (we want SYN)
1337 -------- --------
1338 = 00000010 = 00000010
1339 .fi
1340 .PP
1341 We see that this AND operation delivers the same result
1342 regardless whether ACK or another TCP control bit is set.
1343 The decimal representation of the AND value as well as
1344 the result of this operation is 2 (binary 00000010),
1345 so we know that for packets with SYN set the following
1346 relation must hold true:
1347 .IP
1348 ( ( value of octet 13 ) AND ( 2 ) ) == ( 2 )
1349 .PP
1350 This points us to the \fItcpdump\fP filter expression
1351 .RS
1352 .B
1353 tcpdump -i xl0 'tcp[13] & 2 == 2'
1354 .RE
1355 .PP
1356 Note that you should use single quotes or a backslash
1357 in the expression to hide the AND ('&') special character
1358 from the shell.
1359 .HD
1360 .B
1361 UDP Packets
1362 .LP
1363 UDP format is illustrated by this rwho packet:
1364 .RS
1365 .nf
1366 .sp .5
1367 \f(CWactinide.who > broadcast.who: udp 84\fP
1368 .sp .5
1369 .fi
1370 .RE
1371 This says that port \fIwho\fP on host \fIactinide\fP sent a udp
1372 datagram to port \fIwho\fP on host \fIbroadcast\fP, the Internet
1373 broadcast address.
1374 The packet contained 84 bytes of user data.
1375 .LP
1376 Some UDP services are recognized (from the source or destination
1377 port number) and the higher level protocol information printed.
1378 In particular, Domain Name service requests (RFC-1034/1035) and Sun
1379 RPC calls (RFC-1050) to NFS.
1380 .HD
1381 UDP Name Server Requests
1382 .LP
1383 \fI(N.B.:The following description assumes familiarity with
1384 the Domain Service protocol described in RFC-1035.
1385 If you are not familiar
1386 with the protocol, the following description will appear to be written
1387 in greek.)\fP
1388 .LP
1389 Name server requests are formatted as
1390 .RS
1391 .nf
1392 .sp .5
1393 \fIsrc > dst: id op? flags qtype qclass name (len)\fP
1394 .sp .5
1395 \f(CWh2opolo.1538 > helios.domain: 3+ A? ucbvax.berkeley.edu. (37)\fR
1396 .sp .5
1397 .fi
1398 .RE
1399 Host \fIh2opolo\fP asked the domain server on \fIhelios\fP for an
1400 address record (qtype=A) associated with the name \fIucbvax.berkeley.edu.\fP
1401 The query id was `3'.
1402 The `+' indicates the \fIrecursion desired\fP flag
1403 was set.
1404 The query length was 37 bytes, not including the UDP and
1405 IP protocol headers.
1406 The query operation was the normal one, \fIQuery\fP,
1407 so the op field was omitted.
1408 If the op had been anything else, it would
1409 have been printed between the `3' and the `+'.
1410 Similarly, the qclass was the normal one,
1411 \fIC_IN\fP, and omitted.
1412 Any other qclass would have been printed
1413 immediately after the `A'.
1414 .LP
1415 A few anomalies are checked and may result in extra fields enclosed in
1416 square brackets: If a query contains an answer, authority records or
1417 additional records section,
1418 .IR ancount ,
1419 .IR nscount ,
1420 or
1421 .I arcount
1422 are printed as `[\fIn\fPa]', `[\fIn\fPn]' or `[\fIn\fPau]' where \fIn\fP
1423 is the appropriate count.
1424 If any of the response bits are set (AA, RA or rcode) or any of the
1425 `must be zero' bits are set in bytes two and three, `[b2&3=\fIx\fP]'
1426 is printed, where \fIx\fP is the hex value of header bytes two and three.
1427 .HD
1428 UDP Name Server Responses
1429 .LP
1430 Name server responses are formatted as
1431 .RS
1432 .nf
1433 .sp .5
1434 \fIsrc > dst: id op rcode flags a/n/au type class data (len)\fP
1435 .sp .5
1436 \f(CWhelios.domain > h2opolo.1538: 3 3/3/7 A 128.32.137.3 (273)
1437 helios.domain > h2opolo.1537: 2 NXDomain* 0/1/0 (97)\fR
1438 .sp .5
1439 .fi
1440 .RE
1441 In the first example, \fIhelios\fP responds to query id 3 from \fIh2opolo\fP
1442 with 3 answer records, 3 name server records and 7 additional records.
1443 The first answer record is type A (address) and its data is internet
1444 address 128.32.137.3.
1445 The total size of the response was 273 bytes,
1446 excluding UDP and IP headers.
1447 The op (Query) and response code
1448 (NoError) were omitted, as was the class (C_IN) of the A record.
1449 .LP
1450 In the second example, \fIhelios\fP responds to query 2 with a
1451 response code of non-existent domain (NXDomain) with no answers,
1452 one name server and no authority records.
1453 The `*' indicates that
1454 the \fIauthoritative answer\fP bit was set.
1455 Since there were no
1456 answers, no type, class or data were printed.
1457 .LP
1458 Other flag characters that might appear are `\-' (recursion available,
1459 RA, \fInot\fP set) and `|' (truncated message, TC, set).
1460 If the
1461 `question' section doesn't contain exactly one entry, `[\fIn\fPq]'
1462 is printed.
1463 .LP
1464 Note that name server requests and responses tend to be large and the
1465 default \fIsnaplen\fP of 68 bytes may not capture enough of the packet
1466 to print.
1467 Use the \fB\-s\fP flag to increase the snaplen if you
1468 need to seriously investigate name server traffic.
1469 `\fB\-s 128\fP'
1470 has worked well for me.
1471
1472 .HD
1473 SMB/CIFS decoding
1474 .LP
1475 \fItcpdump\fP now includes fairly extensive SMB/CIFS/NBT decoding for data
1476 on UDP/137, UDP/138 and TCP/139.
1477 Some primitive decoding of IPX and
1478 NetBEUI SMB data is also done.
1479
1480 By default a fairly minimal decode is done, with a much more detailed
1481 decode done if -v is used.
1482 Be warned that with -v a single SMB packet
1483 may take up a page or more, so only use -v if you really want all the
1484 gory details.
1485
1486 If you are decoding SMB sessions containing unicode strings then you
1487 may wish to set the environment variable USE_UNICODE to 1.
1488 A patch to
1489 auto-detect unicode srings would be welcome.
1490
1491 For information on SMB packet formats and what all te fields mean see
1492 www.cifs.org or the pub/samba/specs/ directory on your favourite
1493 samba.org mirror site.
1494 The SMB patches were written by Andrew Tridgell
1495 (tridge@samba.org).
1496
1497 .HD
1498 NFS Requests and Replies
1499 .LP
1500 Sun NFS (Network File System) requests and replies are printed as:
1501 .RS
1502 .nf
1503 .sp .5
1504 \fIsrc.xid > dst.nfs: len op args\fP
1505 \fIsrc.nfs > dst.xid: reply stat len op results\fP
1506 .sp .5
1507 \f(CW
1508 sushi.6709 > wrl.nfs: 112 readlink fh 21,24/10.73165
1509 wrl.nfs > sushi.6709: reply ok 40 readlink "../var"
1510 sushi.201b > wrl.nfs:
1511 144 lookup fh 9,74/4096.6878 "xcolors"
1512 wrl.nfs > sushi.201b:
1513 reply ok 128 lookup fh 9,74/4134.3150
1514 \fR
1515 .sp .5
1516 .fi
1517 .RE
1518 In the first line, host \fIsushi\fP sends a transaction with id \fI6709\fP
1519 to \fIwrl\fP (note that the number following the src host is a
1520 transaction id, \fInot\fP the source port).
1521 The request was 112 bytes,
1522 excluding the UDP and IP headers.
1523 The operation was a \fIreadlink\fP
1524 (read symbolic link) on file handle (\fIfh\fP) 21,24/10.731657119.
1525 (If one is lucky, as in this case, the file handle can be interpreted
1526 as a major,minor device number pair, followed by the inode number and
1527 generation number.)
1528 \fIWrl\fP replies `ok' with the contents of the link.
1529 .LP
1530 In the third line, \fIsushi\fP asks \fIwrl\fP to lookup the name
1531 `\fIxcolors\fP' in directory file 9,74/4096.6878.
1532 Note that the data printed
1533 depends on the operation type.
1534 The format is intended to be self
1535 explanatory if read in conjunction with
1536 an NFS protocol spec.
1537 .LP
1538 If the \-v (verbose) flag is given, additional information is printed.
1539 For example:
1540 .RS
1541 .nf
1542 .sp .5
1543 \f(CW
1544 sushi.1372a > wrl.nfs:
1545 148 read fh 21,11/12.195 8192 bytes @ 24576
1546 wrl.nfs > sushi.1372a:
1547 reply ok 1472 read REG 100664 ids 417/0 sz 29388
1548 \fP
1549 .sp .5
1550 .fi
1551 .RE
1552 (\-v also prints the IP header TTL, ID, length, and fragmentation fields,
1553 which have been omitted from this example.) In the first line,
1554 \fIsushi\fP asks \fIwrl\fP to read 8192 bytes from file 21,11/12.195,
1555 at byte offset 24576.
1556 \fIWrl\fP replies `ok'; the packet shown on the
1557 second line is the first fragment of the reply, and hence is only 1472
1558 bytes long (the other bytes will follow in subsequent fragments, but
1559 these fragments do not have NFS or even UDP headers and so might not be
1560 printed, depending on the filter expression used).
1561 Because the \-v flag
1562 is given, some of the file attributes (which are returned in addition
1563 to the file data) are printed: the file type (``REG'', for regular file),
1564 the file mode (in octal), the uid and gid, and the file size.
1565 .LP
1566 If the \-v flag is given more than once, even more details are printed.
1567 .LP
1568 Note that NFS requests are very large and much of the detail won't be printed
1569 unless \fIsnaplen\fP is increased.
1570 Try using `\fB\-s 192\fP' to watch
1571 NFS traffic.
1572 .LP
1573 NFS reply packets do not explicitly identify the RPC operation.
1574 Instead,
1575 \fItcpdump\fP keeps track of ``recent'' requests, and matches them to the
1576 replies using the transaction ID.
1577 If a reply does not closely follow the
1578 corresponding request, it might not be parsable.
1579 .HD
1580 AFS Requests and Replies
1581 .LP
1582 Transarc AFS (Andrew File System) requests and replies are printed
1583 as:
1584 .HD
1585 .RS
1586 .nf
1587 .sp .5
1588 \fIsrc.sport > dst.dport: rx packet-type\fP
1589 \fIsrc.sport > dst.dport: rx packet-type service call call-name args\fP
1590 \fIsrc.sport > dst.dport: rx packet-type service reply call-name args\fP
1591 .sp .5
1592 \f(CW
1593 elvis.7001 > pike.afsfs:
1594 rx data fs call rename old fid 536876964/1/1 ".newsrc.new"
1595 new fid 536876964/1/1 ".newsrc"
1596 pike.afsfs > elvis.7001: rx data fs reply rename
1597 \fR
1598 .sp .5
1599 .fi
1600 .RE
1601 In the first line, host elvis sends a RX packet to pike.
1602 This was
1603 a RX data packet to the fs (fileserver) service, and is the start of
1604 an RPC call.
1605 The RPC call was a rename, with the old directory file id
1606 of 536876964/1/1 and an old filename of `.newsrc.new', and a new directory
1607 file id of 536876964/1/1 and a new filename of `.newsrc'.
1608 The host pike
1609 responds with a RPC reply to the rename call (which was successful, because
1610 it was a data packet and not an abort packet).
1611 .LP
1612 In general, all AFS RPCs are decoded at least by RPC call name.
1613 Most
1614 AFS RPCs have at least some of the arguments decoded (generally only
1615 the `interesting' arguments, for some definition of interesting).
1616 .LP
1617 The format is intended to be self-describing, but it will probably
1618 not be useful to people who are not familiar with the workings of
1619 AFS and RX.
1620 .LP
1621 If the -v (verbose) flag is given twice, acknowledgement packets and
1622 additional header information is printed, such as the the RX call ID,
1623 call number, sequence number, serial number, and the RX packet flags.
1624 .LP
1625 If the -v flag is given twice, additional information is printed,
1626 such as the the RX call ID, serial number, and the RX packet flags.
1627 The MTU negotiation information is also printed from RX ack packets.
1628 .LP
1629 If the -v flag is given three times, the security index and service id
1630 are printed.
1631 .LP
1632 Error codes are printed for abort packets, with the exception of Ubik
1633 beacon packets (because abort packets are used to signify a yes vote
1634 for the Ubik protocol).
1635 .LP
1636 Note that AFS requests are very large and many of the arguments won't
1637 be printed unless \fIsnaplen\fP is increased.
1638 Try using `\fB-s 256\fP'
1639 to watch AFS traffic.
1640 .LP
1641 AFS reply packets do not explicitly identify the RPC operation.
1642 Instead,
1643 \fItcpdump\fP keeps track of ``recent'' requests, and matches them to the
1644 replies using the call number and service ID.
1645 If a reply does not closely
1646 follow the
1647 corresponding request, it might not be parsable.
1648
1649 .HD
1650 KIP Appletalk (DDP in UDP)
1651 .LP
1652 Appletalk DDP packets encapsulated in UDP datagrams are de-encapsulated
1653 and dumped as DDP packets (i.e., all the UDP header information is
1654 discarded).
1655 The file
1656 .I /etc/atalk.names
1657 is used to translate appletalk net and node numbers to names.
1658 Lines in this file have the form
1659 .RS
1660 .nf
1661 .sp .5
1662 \fInumber name\fP
1663
1664 \f(CW1.254 ether
1665 16.1 icsd-net
1666 1.254.110 ace\fR
1667 .sp .5
1668 .fi
1669 .RE
1670 The first two lines give the names of appletalk networks.
1671 The third
1672 line gives the name of a particular host (a host is distinguished
1673 from a net by the 3rd octet in the number \-
1674 a net number \fImust\fP have two octets and a host number \fImust\fP
1675 have three octets.) The number and name should be separated by
1676 whitespace (blanks or tabs).
1677 The
1678 .I /etc/atalk.names
1679 file may contain blank lines or comment lines (lines starting with
1680 a `#').
1681 .LP
1682 Appletalk addresses are printed in the form
1683 .RS
1684 .nf
1685 .sp .5
1686 \fInet.host.port\fP
1687
1688 \f(CW144.1.209.2 > icsd-net.112.220
1689 office.2 > icsd-net.112.220
1690 jssmag.149.235 > icsd-net.2\fR
1691 .sp .5
1692 .fi
1693 .RE
1694 (If the
1695 .I /etc/atalk.names
1696 doesn't exist or doesn't contain an entry for some appletalk
1697 host/net number, addresses are printed in numeric form.)
1698 In the first example, NBP (DDP port 2) on net 144.1 node 209
1699 is sending to whatever is listening on port 220 of net icsd node 112.
1700 The second line is the same except the full name of the source node
1701 is known (`office').
1702 The third line is a send from port 235 on
1703 net jssmag node 149 to broadcast on the icsd-net NBP port (note that
1704 the broadcast address (255) is indicated by a net name with no host
1705 number \- for this reason it's a good idea to keep node names and
1706 net names distinct in /etc/atalk.names).
1707 .LP
1708 NBP (name binding protocol) and ATP (Appletalk transaction protocol)
1709 packets have their contents interpreted.
1710 Other protocols just dump
1711 the protocol name (or number if no name is registered for the
1712 protocol) and packet size.
1713
1714 \fBNBP packets\fP are formatted like the following examples:
1715 .RS
1716 .nf
1717 .sp .5
1718 \s-2\f(CWicsd-net.112.220 > jssmag.2: nbp-lkup 190: "=:LaserWriter@*"
1719 jssmag.209.2 > icsd-net.112.220: nbp-reply 190: "RM1140:LaserWriter@*" 250
1720 techpit.2 > icsd-net.112.220: nbp-reply 190: "techpit:LaserWriter@*" 186\fR\s+2
1721 .sp .5
1722 .fi
1723 .RE
1724 The first line is a name lookup request for laserwriters sent by net icsd host
1725 112 and broadcast on net jssmag.
1726 The nbp id for the lookup is 190.
1727 The second line shows a reply for this request (note that it has the
1728 same id) from host jssmag.209 saying that it has a laserwriter
1729 resource named "RM1140" registered on port 250.
1730 The third line is
1731 another reply to the same request saying host techpit has laserwriter
1732 "techpit" registered on port 186.
1733
1734 \fBATP packet\fP formatting is demonstrated by the following example:
1735 .RS
1736 .nf
1737 .sp .5
1738 \s-2\f(CWjssmag.209.165 > helios.132: atp-req 12266<0-7> 0xae030001
1739 helios.132 > jssmag.209.165: atp-resp 12266:0 (512) 0xae040000
1740 helios.132 > jssmag.209.165: atp-resp 12266:1 (512) 0xae040000
1741 helios.132 > jssmag.209.165: atp-resp 12266:2 (512) 0xae040000
1742 helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
1743 helios.132 > jssmag.209.165: atp-resp 12266:4 (512) 0xae040000
1744 helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
1745 helios.132 > jssmag.209.165: atp-resp 12266:6 (512) 0xae040000
1746 helios.132 > jssmag.209.165: atp-resp*12266:7 (512) 0xae040000
1747 jssmag.209.165 > helios.132: atp-req 12266<3,5> 0xae030001
1748 helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
1749 helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
1750 jssmag.209.165 > helios.132: atp-rel 12266<0-7> 0xae030001
1751 jssmag.209.133 > helios.132: atp-req* 12267<0-7> 0xae030002\fR\s+2
1752 .sp .5
1753 .fi
1754 .RE
1755 Jssmag.209 initiates transaction id 12266 with host helios by requesting
1756 up to 8 packets (the `<0-7>').
1757 The hex number at the end of the line
1758 is the value of the `userdata' field in the request.
1759 .LP
1760 Helios responds with 8 512-byte packets.
1761 The `:digit' following the
1762 transaction id gives the packet sequence number in the transaction
1763 and the number in parens is the amount of data in the packet,
1764 excluding the atp header.
1765 The `*' on packet 7 indicates that the
1766 EOM bit was set.
1767 .LP
1768 Jssmag.209 then requests that packets 3 & 5 be retransmitted.
1769 Helios
1770 resends them then jssmag.209 releases the transaction.
1771 Finally,
1772 jssmag.209 initiates the next request.
1773 The `*' on the request
1774 indicates that XO (`exactly once') was \fInot\fP set.
1775
1776 .HD
1777 IP Fragmentation
1778 .LP
1779 Fragmented Internet datagrams are printed as
1780 .RS
1781 .nf
1782 .sp .5
1783 \fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB+)\fR
1784 \fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB)\fR
1785 .sp .5
1786 .fi
1787 .RE
1788 (The first form indicates there are more fragments.
1789 The second
1790 indicates this is the last fragment.)
1791 .LP
1792 \fIId\fP is the fragment id.
1793 \fISize\fP is the fragment
1794 size (in bytes) excluding the IP header.
1795 \fIOffset\fP is this
1796 fragment's offset (in bytes) in the original datagram.
1797 .LP
1798 The fragment information is output for each fragment.
1799 The first
1800 fragment contains the higher level protocol header and the frag
1801 info is printed after the protocol info.
1802 Fragments
1803 after the first contain no higher level protocol header and the
1804 frag info is printed after the source and destination addresses.
1805 For example, here is part of an ftp from arizona.edu to lbl-rtsg.arpa
1806 over a CSNET connection that doesn't appear to handle 576 byte datagrams:
1807 .RS
1808 .nf
1809 .sp .5
1810 \s-2\f(CWarizona.ftp-data > rtsg.1170: . 1024:1332(308) ack 1 win 4096 (frag 595a:328@0+)
1811 arizona > rtsg: (frag 595a:204@328)
1812 rtsg.1170 > arizona.ftp-data: . ack 1536 win 2560\fP\s+2
1813 .sp .5
1814 .fi
1815 .RE
1816 There are a couple of things to note here: First, addresses in the
1817 2nd line don't include port numbers.
1818 This is because the TCP
1819 protocol information is all in the first fragment and we have no idea
1820 what the port or sequence numbers are when we print the later fragments.
1821 Second, the tcp sequence information in the first line is printed as if there
1822 were 308 bytes of user data when, in fact, there are 512 bytes (308 in
1823 the first frag and 204 in the second).
1824 If you are looking for holes
1825 in the sequence space or trying to match up acks
1826 with packets, this can fool you.
1827 .LP
1828 A packet with the IP \fIdon't fragment\fP flag is marked with a
1829 trailing \fB(DF)\fP.
1830 .HD
1831 Timestamps
1832 .LP
1833 By default, all output lines are preceded by a timestamp.
1834 The timestamp
1835 is the current clock time in the form
1836 .RS
1837 .nf
1838 \fIhh:mm:ss.frac\fP
1839 .fi
1840 .RE
1841 and is as accurate as the kernel's clock.
1842 The timestamp reflects the time the kernel first saw the packet.
1843 No attempt
1844 is made to account for the time lag between when the
1845 ethernet interface removed the packet from the wire and when the kernel
1846 serviced the `new packet' interrupt.
1847 .SH "SEE ALSO"
1848 traffic(1C), nit(4P), bpf(4), pcap(3)
1849 .SH AUTHORS
1850 The original authors are:
1851 .LP
1852 Van Jacobson,
1853 Craig Leres and
1854 Steven McCanne, all of the
1855 Lawrence Berkeley National Laboratory, University of California, Berkeley, CA.
1856 .LP
1857 It is currently being maintained by tcpdump.org.
1858 .LP
1859 The current version is available via http:
1860 .LP
1861 .RS
1862 .I http://www.tcpdump.org/
1863 .RE
1864 .LP
1865 The original distribution is available via anonymous ftp:
1866 .LP
1867 .RS
1868 .I ftp://ftp.ee.lbl.gov/tcpdump.tar.Z
1869 .RE
1870 .LP
1871 IPv6/IPsec support is added by WIDE/KAME project.
1872 This program uses Eric Young's SSLeay library, under specific configuration.
1873 .SH BUGS
1874 Please send problems, bugs, questions, desirable enhancements, etc. to:
1875 .LP
1876 .RS
1877 tcpdump-workers@tcpdump.org
1878 .RE
1879 .LP
1880 Please send source code contributions, etc. to:
1881 .LP
1882 .RS
1883 patches@tcpdump.org
1884 .RE
1885 .LP
1886 NIT doesn't let you watch your own outbound traffic, BPF will.
1887 We recommend that you use the latter.
1888 .LP
1889 On Linux systems with 2.0[.x] kernels:
1890 .IP
1891 packets on the loopback device will be seen twice;
1892 .IP
1893 packet filtering cannot be done in the kernel, so that all packets must
1894 be copied from the kernel in order to be filtered in user mode;
1895 .IP
1896 all of a packet, not just the part that's within the snapshot length,
1897 will be copied from the kernel (the 2.0[.x] packet capture mechanism, if
1898 asked to copy only part of a packet to userland, will not report the
1899 true length of the packet; this would cause most IP packets to get an
1900 error from
1901 .BR tcpdump ).
1902 .LP
1903 We recommend that you upgrade to a 2.2 or later kernel.
1904 .LP
1905 Some attempt should be made to reassemble IP fragments or, at least
1906 to compute the right length for the higher level protocol.
1907 .LP
1908 Name server inverse queries are not dumped correctly: the (empty)
1909 question section is printed rather than real query in the answer
1910 section.
1911 Some believe that inverse queries are themselves a bug and
1912 prefer to fix the program generating them rather than \fItcpdump\fP.
1913 .LP
1914 A packet trace that crosses a daylight savings time change will give
1915 skewed time stamps (the time change is ignored).
1916 .LP
1917 Filter expressions that manipulate FDDI or Token Ring headers assume
1918 that all FDDI and Token Ring packets are SNAP-encapsulated Ethernet
1919 packets.
1920 This is true for IP, ARP, and DECNET Phase IV, but is not true
1921 for protocols such as ISO CLNS.
1922 Therefore, the filter may inadvertently
1923 accept certain packets that do not properly match the filter expression.
1924 .LP
1925 Filter expressions on fields other than those that manipulate Token Ring
1926 headers will not correctly handle source-routed Token Ring packets.
1927 .LP
1928 .BR "ip6 proto"
1929 should chase header chain, but at this moment it does not.
1930 .BR "ip6 protochain"
1931 is supplied for this behavior.
1932 .LP
1933 Arithmetic expression against transport layer headers, like \fBtcp[0]\fP,
1934 does not work against IPv6 packets.
1935 It only looks at IPv4 packets.