TCPDUMP description

xiaoxiao2021-03-06  178

TCPDUMP (1) TCPDUMP (1) 3 January 2001

Name Tcpdump - Dump Traffic ON A NetWork

Synopsis tcpdump [-deflnnopqrstuvxx] [-c count] [-c file_size] [-f file] [-i interface] [-M module] [-r file] [-s snake] [-t type] [-w file ] [-E algo: secret] [Expression]

DESCRIPTION Tcpdump prints out the headers of packets on a network interface that match the boolean expression It can also be run with the -w flag, which causes it to save the packet data to a file for later analysis, and / or with the. - b flag, which causes it to read from a saved packet file rather than to read packets from a network interface. In all cases, only packets that match expression will be processed by tcpdump. Tcpdump will, if not run with the -c flag, continue capturing packets until it is interrupted by a SIGINT signal (generated, for example, by typing your interrupt character, typically control-C) or a SIGTERM signal (typically generated with the kill (1) command); if run with the -c Flag, IT Will Capture Packets Until It is Interrupted by a Sigint OR Sigterm Signal or the Specified Number of Packets Have Been Processed .hen Tcpdump Finishes Capturing Packets, i T Will Report County of:

packets `` received by filter '' (the meaning of this depends on the OS on which you're running tcpdump, and possibly on the way the OS was configured - if a filter was specified on the command line, on some OSes it counts packets regardless of whether they were matched by the filter expression, and on other OSes it counts only packets that were matched by the filter expression and were processed by tcpdump); packets `` dropped by kernel '' (this is the number of packets that were dropped, due to a lack of buffer space, by the packet capture mechanism in the OS on which tcpdump is running, if the OS reports that information to applications; if not, it will be reported as 0) On platforms that support the. SIGINFO signal, such as most BSDs, it will report those counts when it receives a SIGINFO signal (generated, for example, by typing your `` status '' character, typically control-T) and will continue capturing packet s. Reading Packets from a network interface principal privileges:

Under Sunos 3.x or 4.x with you must have read access to / dev / nit or / dev / bpf *.

Under Solaris with DLPI: You Must Have Read / Write Access To The Network Pseudo Device, E.G. / Dev / Le. On at Least Some Versions of Solaris, However,

- 1 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

This Is Not Sufficient To ALOW TCPDUMP To Capture In Promiscuous Mode; on Those Versions of Solaris, You Must Be root, or Tcpdump Must Be Installed Setuid To root, in Order to Capture In Promiscuous Mode.

Under HP-UX with DLPI: You Must Be Root or Tcpdump Must Be Installed Setuid to Root.under Irix With Snoop: You Must Be Root or Tcpdump Must Be Installed Setuid To Root.

Under Linux: you must be root or tcpdump must be installed setuid to root.

Under Ultrix and Digital UNIX: ONCE The Super-User Has Enabled Promiscuous-Mode Operation Using Pfconfig (8), Any User May Capture Network Traffic with TCPDUMP.

Under BSD: You Must Have Read Access To / dev / bpf *. Reading a Saved Packet File Doesn't Require Special Privileges.

Options -a Attempt to Convert Network and Broadcast Addresses to names.

-C EXIT AFTER Receiving Count Packets.

-C Before writing a raw packet to a savefile, check whether the file is currently larger than file_size and, if so, close the current savefile and open a new one. Savefiles after the first savefile will have the name specified with the -w flag WITH A NUMBER AFTER IT, Starting At 2 and Continuing Upward. The Units of File_Size Are Millions of Bytes (1,000 ,000 Bytes, Not 1,048,576 BYtes).

-d dump the compiled packet-matching code in a human readable form to standard output and stop.

-dd dump packet-matching code as a c program fragment.

-ddd Dump Packet-Matching Code As Decimal NumBers (Preceded with a count).

-e print the link-level header on each dump line.

-E Use Algo: Secret Packets. Algorithms May Be Des-CBC, 3DES-CBC, BlowFish-CBC, RC3-CBC, CAST128-CBC, or None. The default is des-cbc. The Ability to Decrypt Packets .. is only present if tcpdump was compiled with cryptography enabled secret the ascii text for ESP secret key We can not take arbitrary binary value at this moment The option assumes- 2 - Formatted:. August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

RFC2406 ESP, not RFC1827 ESP. The option is only for debugging purposes, and the use of this option with truly `secret 'key is discouraged. By presenting IPsec secret key onto command line you make it visible to others, via ps (1) And other Occasions.

-f Print `foreign 'internet addresses numerically rather than symbolically (this option is intended to get around serious brain damage in Sun's yp server - usually it hangs forever translating non-local internet numbers).

-F use file as infut for the filter expression. An additional expression given on the command line is ignored.

-i listen on interface. if unspecified, tcpdump search searches The system interface list for the lowest number, configured, and excluding loopback. TIES are Broken by Choosing The Earliest Match.

On Linux systems with 2.2 or later kernels, an interface argument of `` any '' can be used to capture packets from all interfaces. Note that captures on the `` any '' device will not be done in promiscuous mode.

-l make stdout line buffered. useful if you want to see the data while capturing it. Eg, `` tcpdump -l | tee dat '' or `` tcpdump -l> DAT & TAIL -F DAT '' '' '' '' '.- m loading SMI MIB Module Definitions from File Module. This Option Can Be Used Several Times To Load Several MIB MIDULES INTO TCPDUMP.

- Don't Convert Addresses (I., Host Addresses, Port Numbers, etc. "To names.

-N don't print domain name Qualification of host names. E.G., if you give this flag the tcpdump will print `` Nic '' instead of `` nic.ddn.mil ''.

-O Do Not Run The Packet-Matching Code Optimizer. This is useful only if you suspect a bug in the optimizer.

-p don't put the interface inopppess mode. Note That the interface might be in promiscuous mode for some other reason; hence, `-p 'cannot be used as an abbreviation for` ether host {local-hw-addr} or Ether Broadcast '.

-q Quick (quiet?) Output. Print Less Protocol Information So Output Lines Are Shorter.

- 3 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

-R Assume ESP / AH packets to be based on old specification (RFC1825 to RFC1829). If specified, tcpdump will not print replay prevention field. Since there is no protocol version field in ESP / AH specification, tcpdump can not deduce the version of ESP / AH Protocol.

-r Read Packets from File (Which Was Created with The -w Option). Standard Input Is Used If File IS `` - ''.

-S Print Absolute, Rather Than Relative, TCP Sequence Numbers.

-s Snarf snaplen bytes of data from each packet rather than the default of 68 (with SunOS's NIT, the minimum is actually 96). 68 bytes is adequate for IP, ICMP, TCP and UDP but may truncate protocol information from name server and NFS . packets (see below) packets truncated because of a limited snapshot are indicated in the output with `` [| proto] '', where proto is the name of the protocol level at which the truncation has occurred Note that taking larger snapshots both. increases the amount of time it takes to process packets and, effectively, decreases the amount of packet buffering. This may cause packets to be lost. you should limit snaplen to the smallest number that will capture the protocol information you're interested in. Setting Snaplen to 0 means use the required length to catch whole packets.-t force packets selected by "express" to be interpreted the specified type. currently know TYPE s are cnfp (Cisco NetFlow protocol), rpc (Remote Procedure Call), rtp (Real-Time Applications protocol), rtcp (Real-Time Applications control protocol), snmp (Simple Network Management Protocol), vat (Visual Audio Tool), And WB (Distributed White Board).

-t don't print a TimeStamp on each dump line.

-TT PRINT AN Unformatted TimeStamp On Each Dump Line.

-ttt print a delta (in Micro-Seconds) Between Current and Previous Line on Each Dump Line.

-ttttprint A TimeStamp in Default Format Proceeded by date on each dump line. -u print undecoded NFS Handles.

-v (Slightly more) verbose output. For example, the time to live, identification, total length and options in an IP packet are printed. Also enables additional packet integrity checks such as verifying the IP and ICMP header checksum.-vv Even more Verbose Output. for Example, Additional Fields Are Printed from NFS Reply Packets, And SMB Packets Are Fully Decoded.

- 4 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

-vvv Even More Verbose Output. for Example, Telnet SB ... SE OPTIONS Are Printed In Full. with -x telnet options are printed in hex as well.

-w write the raw packets to file rather Than Parsing and printing Them out. They can laser be printed with the -r Option. Standard Output is buy ing file is `- ''.

-X Print Each Packet in Hex. The Smaller of The Entire Packet OR Snaplen Bytes Will Be Printed.

-X When Printing Hex, Print Ascii Too. Thus IF IS Printed In HEX / ASCII. This is very handy for analysis new protocols. Even if -x is not also set, Some Parts of some Packets May Be Printed in HEX / ASCII.

expression selects which packets will be dumped. If no expression is given, all packets on the net will be dumped. Otherwise, only packets for which expression is `true 'will be dumped. The expression consists of one or more primitives. Primitives usually consist Of an id (name or number) precededed by one or more qualifiers. There Are Three DiffERENT KINDS OF Qualifier:

Type Qualifiers Say What Kind of Thing the ID Name or Number Refers To. Possible Types Are Host, Net and Port. Eg, `Host Foo ',` Net 128.3', `Port 20 '. If The Is No Type Qualifier, Host IS Assumed.dir Qualifiers Specify to and / or from id. Possible Directions Are SRC, DST, SRC OR DST AND SRC AND DST. EG, `Src foo ',` DST NET 128.3', `Src or DST Port FTP -data '. If there is no dir qualifier, src or dst is assumed. For `null' link layers (ie point to point protocols such as slip) the inbound and outbound qualifiers can be used to specify a desired direction.

Proto Qualifiers Restrict The Match To a Particular Protocol. Possible Protos Are: Ether, FDDI, TR, IP, IP6, ARP, RARP, DECNET, TCP AND UDP. EG, `Ether SRC FOO ',` ARP NET 128.3', `TCP Port 21 '. if there is no protocifier, all protocols consistent with the Type Are Assumed. Eg, `src foo' means` (ip or arp or rarp) src foo '(Except the Latter is not legal syntax), `Net Bar 'means `(IP or arp or rarp) net bar' and` port 53 'Means `(TCP OR UDP) Port 53'. [` fddi 'is actually an alias for `Ether'; the Parser Treats theim identically as meaning `` The Data Link Level Used on the specified network interface. '' fddi headers contain Ethernet-like source and destination address addresses, and offen contain Ethernet-like packet type, so you can filter

- 5 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

these FDDI fields just as with the analogous Ethernet fields FDDI headers also contain other fields, but you can not name them explicitly in a filter expression Similarly, `tr 'is an alias for` ether';.. the previous paragraph's statements about FDDI headers also . apply to Token Ring headers] In addition to the above, there are some special `primitive 'keywords that do not follow the pattern:. gateway, broadcast, less, greater and arithmetic expressions All of these are described below More complex filter. Expressions Are Built Up By Using The Words and Nod, or And NOT To Combine Primitives. Eg, `Host Foo and Not Port FTP AND NOT FTP-DATA '. To Save Typing, Identical Qualifier Lists Can Be itted. EG,` TCP DST Port FTP or FTP-DATA or DOMAIN 'IS EXACTLY THE SAME AS `TCP DST Port ftp or TCP DST port ftp-data or tcp dst port Domain'. Allowable Primitives Are: Dst host host true if the ipv4 / v6 destination Field of the packet is host, which may be each estil.

SRC Host Host True IF The IPv4 / V6 Source Field of The Packet Is Host.

host host True if either the IPv4 / v6 source or destination of the packet is host Any of the above host expressions can be prepended with the keywords, ip, arp, rarp, or ip6 as in:. ip host host which is equivalent to: Ether Proto / IP and Host Host IF Host Is A Name with Multiple IP Addresses, Each Address Will Be Checked for a match.

Ether DST EHOST TRUE IF The Ethernet Destination Address Is Ethernet Destination Address Is Ethernet DHOST May Be Either A Name from / etc / Ethers OR A Number (See ethers (3N) for numeric format.

Ether SRC EHOST TRUE IF The Ethernet Source Address Is Ethernet Source Address True IF Either The Ethernet Source OR Destination Address Is Ehost.

gateway host True if the packet used host as a gateway. Ie, the ethernet source or destination address was host but neither the IP source nor the IP destination was host. Host must be a name and must be found both by the machine's host-name -

- 6 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

TO-IP-Address Resolution Mechanism (Host Name File, DNS, NIS, ETC.) and by the machine's host-name-to-ethernet- address resolution mechanism (/ etc / ethers, etc.). (an Equivalent Expression IS Ether Host Ehost And Not Host Host Which Can Be Used with Either Names or Numbers for Host / EHOST.) This Syntax Does Not Work IN IPv6-Enabled Configuration At this moment.

DST NET NET TRUE IF The IPv4 / V6 Destination Address of the Packet Has A Network Number of Net. Net May Be Either A Name from / etc / networks or a network number (see network number).

SRC Net Net True IF The IPv4 / V6 Source Address of The Packet Has A Network Number of Net.

Net Net True if Either The IPv4 / V6 Source OR Destination Address of the Packet Has A Network Number of Net.

Net Net Mask Netmask True IF The IP Address Matches Net with The Specific Netmask. May Be Qualified with Src or Dst. Note That Syntax IS Not Valid for IPv6 Net.

NET NET / LEN TRUE IF The IPv4 / V6 Address Matches Net with a Netmask Len Bits Wide. May Be Qualified with SRC OR DST.

DST Port Port True if The Packet IP / TCP, IP / UDP, IP6 / TCP OR IP6 / UDP AND HAS A DESTINATION Port Value of Port. The Port Can Be A Number OR A Name Used IN / ETC / Services (see TCP (4p) and udp (4p)). IF a name is buy, Both the port number and protocol are checked. If a number or ambiguous name is buy, only the port number is checked (EG, DST port 513 Will Print Both TCP / Login Traffic and Udp / WHO Traffic, AND Port Domain Will Print Both TCP / DOMAIN AND UDP / DOMAIN Traffic) .SRC Port Port True If The Packet Has A Source Port Value of Port.

Port Port True if Either The Source OR Destination Port Of The Packet Is Port. Any of The Above Port Expressions Can Be Prepended with The Keywords, TCP OR UDP, AS in: TCP SRC Port Port

- 7 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

Which matches Only TCP Packets Whose Source Port is Port.

Less Length True If The Packet Has A Length Less Thanles IS Equivalent To: Len <= Length.

Greater Length True If The Packet Has A Length Greater Thanles Equivalent to: Len> = Length.

IP protocol true if the packet is an ip packet (see ip (4p)) of protocol type protocol. Protocol Can Be a number or one of the names ICMP, ICMP6, IGMP, IGRP, PIM, AH, ESP, VRRP, UDP , or tcp. Note that the identifiers tcp, udp, and icmp are also keywords and must be escaped via backslash (/), which is // in the C-shell. Note that this primitive does not chase the protocol header chain.

ip6 proto protocol True if the packet is an IPv6 packet of protocol type protocol. Note that this primitive does not chase the protocol header chain.ip6 protochain protocol True if the packet is IPv6 packet, and contains protocol header with type protocol in its protocol header chain. for example, ip6 protochain 6 matches any IPv6 packet with TCP protocol header in the protocol header chain. The packet may contain, for example, authentication header, routing header, or hop-by-hop option header, between IPv6 header and TCP HEADER. The bpf code emitted by this primitive is complex and cannot be Optimized by BPF Optimizer Code in Tcpdump, So this can becomblewhat solution.

IP Protochain Protocol Equivalent To IP6 Protochain Protocol, But this is for IPv4.

Ether Broadcast True if the packet is an etc. The Ether Keyword is Optional.

IP Broadcast True if The Packet IS An IP BROADCAST Packet. It Checks for Both The All-Zeroes and All-Ones Broadcast Conventions, and Looks Up The Local Subnet Mask.

- 8 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

Ether Multicast True if the packet is an etc. The Ether Keyword IS Optional. This is shorthand for `Ether [0] & 1! = 0 '.

IP Multicast True if the packet is an ip multicast packet.

IP6 MULTICAST TRUE IF The Packet IS An IPv6 Multicast Packet.

Ether Proto Protocol True If The Packet Is of Ether Type Protocol. Protocol Can Be A Number OR One of the Names IP, IP6, ARP, RARP, ATALK, AARP, DECNET, SCA, LAT, MOPDL, MOPRC, ISO, STP, IPX , Or netbeui. Note these Identifiers Are Also Keywords and Must Be escaped via backslash (/).[in the case of fddi (eg, `fddi protocol arp ') and token Ring (eg,` TR protocol arp'), for MOST Of Those Protocols, The Protocol Identification Comes from The 802.2 Logical Link Control (LLC) Header, Which IS Usually Layered On Top of the FDDI or Token Ring Header.

When filtering for most protocol identifiers on FDDI or Token Ring, tcpdump checks only the protocol ID field of an LLC header in so-called SNAP format with an Organizational Unit Identifier (OUI) of 0x000000, for encapsulated Ethernet; it does not check whether The Packet Is In Snap Format with an OUI of 0x000000.

The exceptions are iso, for which it checks the DSAP (Destination Service Access Point) and SSAP (Source Service Access Point) fields of the LLC header, stp and netbeui, where it checks the DSAP of the LLC header, and atalk, where it CHECKS for a snap-format packet with an oui of 0x080007 and the appletalk eType.

In the case of Ethernet, tcpdump checks the Ethernet type field for most of those protocols; the exceptions are iso, sap, and netbeui, for which it checks for an 802.3 frame and then checks the LLC header as it does for FDDI and Token Ring , atalk, where it checks both for the Appletalk etype in an Ethernet frame and for a SNAP-format packet as it does for FDDI and Token Ring, aarp, where it checks for the Appletalk ARP etype in either an Ethernet frame or an 802.2 SNAP frame with an OUI of 0x000000, and ipx, where it checks for the IPX etype in an Ethernet frame, the IPX DSAP in the LLC header, the 802.3 with no LLC header encapsulation of IPX, and the IPX etype in a SNAP frame.] - 9 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

decnet src host True if the DECNET source address is host, which may be an address of the form `` 10.123 '', or a DECNET host name. [DECNET host name support is only available on Ultrix systems that are configured to run DECNET. ]

DECN DST HOST TRUE IF The Decnet Destination Address Is Host.

Decnet Host Host True IF Either The Decnet Source OR Destination Address Is Host.

IP, IP6, ARP, RARP, ATALK, AARP, DECNET, ISO, STP, IPX, NetBeui Abbreviations for: Ether Proto P Where P IS One of the Above Protocols.

LAT, MOPRC, MOPDL Abbreviations for: Ether Proto P Where P IS One of the Above Protocols. Note That TCPDUMP DOES NOT CURRENTLY KNOW HOW PARSE THESE Protocols.

vlan [vlan_id] True if the packet is an IEEE 802.1Q VLAN packet. If [vlan_id] is specified, only true is the packet has the specified vlan_id. Note that the first vlan keyword encountered in expression changes the decoding offsets for the remainder of Expression On The Assumption That The Packet Is A VLAN Packet.tcp, UDP, ICMP Abbreviations for: IP Proto P or ip6 Proto P Where P IS One of the Above Protocols.

Iso protocol true if the packet is an osi packet of protocol type protocol. Protocol can be beamber or one of the names clnp, esis, or isis.

CLNP, ESIS, ISIS ABBREVIATIONS for: ISO Proto P Where P IS One of the Above Protocols. Note TCPDUMP DOES An Incomplete Job of Parsing these Protocols.

Expr Relop expr True if the reason Holds, WHERE REROP IS One of>, <,> =, <=, =,! =, and expr is an arithmetic expression composed of

- 10 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

integer constants (expressed in standard C syntax), the normal binary operators [ , -, *, /, &, |], a length operator, and special packet data accessors To access data inside the packet, use the following syntax.: Proto [EXPR: SIZE] Proto IS One of Ether, FDDI, TR, IP, ARP, RARP, TCP, UDP, ICMP OR IP6, AND INDICES The Protocol Layer for The Index Operation. Note Thes, UDP AND Other Upper-Layer protocol types only apply to IPv4, not IPv6 (this will be fixed in the future) The byte offset, relative to the indicated protocol layer, is given by expr Size is optional and indicates the number of bytes in the field of interest..; IT Can Be Either One, Two, Or Four, And Defaults To One. The Length Operator, Indicated by The Keyword Len, Gives The length of the packet.for EXAMPLE, `Ether [0] & 1! = 0 'CATCHER [0] & 1! = 0' Catches All MultiCast Traffic. The Expression `IP [0] & 0xf! = 5 'Catches All IP Packets with options. The Expression `Ip [6: 2].. & 0x1fff = 0 'catches only unfragmented datagrams and frag zero of fragmented datagrams This check is implicitly applied to the tcp and udp index operations For instance, tcp [0] always means the first byte of the TCP header, and never means the first byte of an intervening fragment.

Some offsets and field values ​​may be expressed as names rather than as numeric values ​​The following protocol header field offsets are available:. Icmptype (ICMP type field), icmpcode (ICMP code field), and tcpflags (TCP flags field).

The following ICMP type field values ​​are available: icmp- echoreply, icmp-unreach, icmp-sourcequench, icmp-redirect, icmp-echo, icmp-routeradvert, icmp-routersolicit, icmp- timxceed, icmp-paramprob, icmp-tstamp, icmp -tstampreply, ICMP-IREQ, ICMP-IREQREPLY, ICMP-MASKREQ, ICMP-MASKREPLY.THE FOLLOWING TCP FLAGS FIELD VALUES ARE AVAILABLE: TCP-FIN, TCP-SYN, TCP-RST, TCP-PUSH, TCP-PUSH, TCP- ACK, TCP-URG. Primitives May Be Combined Using:

A Parenthesized Group of Primitives and Operators (PARENTHESES ARE Special To The Shell and Must Be Escaped).

Negation (`! 'Or` NOT').

Concatenation (`&& 'or` and').

Alternation (`|| 'or` or'). Negation HAS HIGHEST Precedency. Alternational and ConcateNation Have Equal Precedency and Associate Left to Right. Note That Explicit

- 11 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

and tokens, not juxtaposition, are now required for concatenation. If an identifier is given without a keyword, the most recent keyword is assumed. For example, not host vs and ace is short for not host vs and host ace which should not be confused with not (host vs or ace) Expression arguments can be passed to tcpdump as either a single argument or as multiple arguments, whichever is more convenient. Generally, if the expression contains Shell metacharacters, it is easier to pass it as a single, quoted Argument. Multiple Arguments Are Concatenated with space

EXAMPLES To print all packets arriving at or departing from sundown: tcpdump host sundown To print traffic between helios and either hot or ace: tcpdump host helios and / (hot or ace /) To print all IP packets between ace and any host except helios: tcpdump ip host ace and not helios to print all traffic between local hosts and hosts at Berkeley: tcpdump net ucb-ether to print all ftp traffic through internet gateway snup: (note that the expression is quoted to prevent the shell from (mis-) interpreting the parentheses): tcpdump 'gateway snup and (port ftp or ftp-data)' to print traffic neither sourced from nor destined for local hosts (if you gateway to one other net, this stuff should never make it onto your local net) . TCPDUMP IP and NOT LOCALNET To Print The Start and End Packets (THE SYN AND FIN Packets) of Each TCP Conversation That Involves A Non-local host. TCPDUMP 'TCP [TCPFLAGS] & (TCP-SYN) | TCP-FIN)! = 0 and not src and dst Net localnet 'to print ip Packets longe Than 576 bytes Sent Through Gateway Snup: Tcpdump' Gateway Snup and IP [2: 2]> 576 'To Print IP Broadcast Or Multicast Packets That Were Not Sent Via Ethernet Broadcast or Multicast: Tcpdump 'Ether [0] & 1 = 0 and IP [16]> = 224' To Print All ICMP Packets That Aren't Echo Requests / Replies (IE, Not ping Packets): TCPDUMP 'icmp [icmptype]! = icmp-echo and icmp [icmptype]! = icmp-echoreply'OUTPUT FORMAT The output of tcpdump is protocol dependent. The following gives a brief description and examples of most of the formats.

Link Level Headers if the '-E' Option IS Given, The Link Level Header Is Printed Out. On ethernets, The Source and Destination Addresses, - 12 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

protocol, and packet length are printed. On FDDI networks, the '-e' option causes tcpdump to print the `frame control 'field, the source and destination addresses, and the packet length. (The` frame control' field governs the interpretation . of the rest of the packet Normal packets (such as those containing IP datagrams) are `async 'packets, with a priority value between 0 and 7; for example,` async4' Such packets are assumed to contain an 802.2 Logical Link Control. (Llc) packet; the llc header isprinted if it is not an iso database on token ring networks, the '-e' option causes tcpdump to print the `access control 'and` frame control' fields, the source and destination addresses, and the packet length. As on FDDI networks, packets are assumed to contain an LLC packet. Regardless of whether the '-e' option is specified or not, the source routing information is printed for source-routed packets. (N.B .: The following description assumes familiarity with the SLIP compression described algorithm in RFC-1144.) On SLIP links, a direction indicator ( `` I '' for inbound, `` O ''

for outbound), packet type, and compression information are printed out. The packet type is printed first. The three types are ip, utcp, and ctcp. No further link information is printed for ip packets. For TCP packets, the connection identifier is printed following the type. If the packet is compressed, its encoded header is printed out. The special cases are printed out as * S n and * SA n, where n is the amount by which the sequence number (or sequence number and ACK) HAS Changed. If IT IS NOT A Special Case, Zero or More Changes Are Printed. a change by u (Urgent Pointer), W (Window), S (SEQUENCE NUMBER), AND i ( Packet ID), FOLLOWED BY A DELTA ( N or-N), OR A New Value (= n). Finally, The Amount of Data IN The Packet and Compressed Header Length Are Printed. for Example, The Following Line Shows An Outbound Compressed TCP Packet, with an Implicit Connection Identi 6; the sequence number by 6; and the packet ID by 6; the sequence number id by 6; the sequence number ID by 6; there is limited 3 bytes of data and 6 bytes of compressed header: o CTCP * a 6 s 49 i 6 3 (6 .) ARP / RARP Packets Arp / rarp output shows the type of request and its arguments The format is intended to be self explanatory Here is a short sample taken from the start of an `rlogin 'from host rtsg to host csam:. arp who -HAS CSAM TELL RTSG ARP Reply CSAM IS-AT CSAM

The first line says that rtsg sent an arp packet asking for the ethernet address of internet host csam. Csam replies with its ethernet address (in this example, ethernet addresses are in caps and internet addresses in lower case). This would look less redundant if We Had done tcpdump -n: ARP WHO-HAS 128.3.254.6 Tell 128.3.254.68 ARP Reply 128.3.254.6 IS-AT 02: 07: 01: 01: 01: 01: 01: C4 IF WE HAD DONE TCPDUMP -E, THE FACT THAT THAT THE FIRST Packet is Broadcast and The Second Is Point-To-Point Would Be Visible: - 13 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

RTSG Broadcast 0806 64: ARP WHO-HAS CSAM TELL RTSG CSAM RTSG 0806 64: ARP Reply Csam IS-AT CSAM

For The First Packet this Says The Ethernet Source Address Is RTSG, The Destination is The Ethernet Broadcast Address, The Type Field Contained Hex 0806 (TYPE Ether_arp) and the Total Length WAS 64 BYTES.

TCP Packets (NB: The following description assumes familiarity with the TCP protocol described in RFC-793 If you are not familiar with the protocol, neither this description nor tcpdump will be of much use to you..) The general format of a tcp protocol LINE IS:

SRC> DST: Flags Data-Seqno Ack Window Urgent Options Src and Dst Are The Source and Destination IP Addresses and Ports. Flags Are Some Combination Of S (SYN), F (PUSH) OR R (RST) OR a single `. '(no flags). Data-seqno describes the portion of sequence space covered by the data in this packet (see example below). Ack is sequence number of the next data expected the other direction on this connection. Window is the number of bytes of receive buffer space available the other direction on this connection. Urg indicates there is `urgent 'data in the packet. Options are tcp options enclosed in angle brackets (eg, ). Src, dst and flags Are Always Present. The Other Fields Depend On The Contents of the Packet's TCP Protocol Header and Are Output Only Appropriate. Here Is The Opening Portion of An Rlogin from Host RTSG to Host Csam.

RTSG.1023> CSAM.Login: s 768512: 768512 (0) WIN 4096 CSAM.Login> RTSG.1023: S 947648: 947648 (0) ACK 768513 WIN 4096 RTSG.1023> CSAM. Login:. ACK 1 WIN 4096 RTSG.1023> CSAM.Login: P 1: 2 (1) ACK 1 WIN 4096 CSAM.Login> RTSG.1023:. ACK 2 WIN 4096 RTSG.1023> CSAM.Login: P 2: 21 (19) ACK 1 WIN 4096 CSAM.Login> RTSG.1023: P 1: 2 (1) ACK 21 WIN 4077 CSAM.Login> RTSG.1023: P 2: 3 (1) ACK 21 WIN 4077 URG 1 CSAM. Login> RTSG.1023: P 3: 4 (1) ACK 21 WIN 4077 URG 1 The First Line SAYS THAT TCP Port 1023 on RTSG SENT A Packet To Port Login on Csam. The S Id. The Syn flag WAS set. The Packet sequence number was 768512 and it contained no data. (The notation is `first: last (nbytes) 'which means` sequence numbers first up to but not including last which is nbytes bytes of user data'.) There was no piggy-backed Ack, The Available Receive Window Was 4096 Bytes and There Was A Max-Segment-Size Option Requ esting an mss of 1024 bytes. Csam replies with a similar packet except it includes a piggy-backed ack for rtsg's SYN. ​​Rtsg then acks csam's SYN. ​​The `. 'means no flags were set. The packet contained no data so there is no data sequence number. Note that the ack sequence number is a small integer (1). The first time tcpdump sees a tcp `conversation ', it prints the sequence number from the packet. On subsequent packets of the conversation, the difference between the current packet '

Siwunce Number IS Printed. THIS THUBER IS Printed. This

TCPDUMP (1) TCPDUMP (1) 3 January 2001

positions in the conversation's data stream (with the first data byte each direction being `1 ').` -S' will override this feature, causing the original sequence numbers to be output. On the 6th line, rtsg sends csam 19 bytes of data (Bytes 2 THROUGH 20 in The RTSG -> Csam Side of the Conversation). The Push Flag Is Set in The Packet. on The 7th Line, Csam Says It's Received Data Sent by rtsg up to but not incoding byte 21. Most of this data is apparently sitting in the socket buffer since csam's receive window has gotten 19 bytes smaller. Csam also sends one byte of data to rtsg in this packet. On the 8th and 9th lines, csam sends two bytes of urgent, pushed data to rtsg. If the snapshot was small enough that tcpdump did not capture the full TCP header, it interprets as much of the header as it can and then reports `` [| tcp]. '' to indicate the remainder could not be interpreted If the header Contain sa bogus option (one with a length that's either too small or beyond the end of the header), tcpdump reports it as `` [bad opt] '' and does not interpret any further options (since it's impossible to tell where they start) . If the header length indicates options are present but the IP datagram length is not long enough for the options to actually be there, tcpdump reports it as `` [bad hdr length] ''. Capturing TCP packets with particular flag

There Are 8 Bits in The Control Bits Section of the TCP header:

CWR | ECE | URG |

Let's assume that we want to watch packets used in establishing a TCP connection Recall that TCP uses a 3-way handshake protocol when it initializes a new connection;. The connection sequence with regard to the TCP control bits is1) Caller sends SYN 2) Recipient Responds with SYN, ACK 3) Caller Sends ACK

Now We're Intested In Capturing Packets That Have Only The Syn Bit Set (Step 1). Note That We Don't Want Packets from Step 2 (SYN-ACK), Just A Plain Initial Syn. What We need is a Correct Filter Expression for tcpdump.

Recall The Structure of A TCP Header WITHOUTOPTIONS:

0 15 31 ----------------------------------------------------------------- ------------------ | Source Port | Destination Port | ------------------------- ---------------------------------------- | Sequence Number | ------ -------------------------------------------------- --------- | ACKNOWLEDGMENT NUMBER |

- 15 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

-------------------------------------------------- --------------- | HL | RSVD | C | E | U | A | P | R | S | f | Window Size | ----------- -------------------------------------------------- ---- | TCP CHECKSUM | Urgent Pointer | --------------------------------------- ----------------------------

A TCP Header USUALLY HOLDS 20 OCTS of Data, Unless Options Are Present. The First Line of The Graph Contains 7 - 7 etc.

Starting to Count with 0, The Relevant TCP Control Bits Are Contained In OcTet 13:

0 7 | 15 | 23 | 31 ------------------------------- ------ | ---------------- | HL | RSVD | C | E | U | A | P | R | S | f | Window Size | ------------- | ------------------------------- | ---- ------------ | | 13th OCTET | | | Let's Have a Closer Look at Octet NO. 13:

| | | --------------- | | C | E | U | A | P | r | s | f | | ------------- - | | 7 5 3 0 |

THESE ARE THE TCP Control Bits We are intended in. We have named from 0 to 7, Right To Left, So The Psh Bit Is Bit Number 3, While The URG Bit Is Number 5.

Recall That We Want to Capture Packets with Only Syn Set. Let's See What Happens To OcTet 13 IF A TCP DataGram Arrives With The SYN Bit Set in ITS Header:

| C | e | u | a | p | r | s | f | | --------------- | | 0 0 0 0 0 0 1 0 | | ----- ---------- | | 7 6 5 4 3 2 1 0 |

Looking at The Control Bits Section We See That Only Bit Number 1 (SYN) IS SET.

Assuming That Oclet Number 13 IS An 8-Bit Unsigned Integer in Network Byte ORDER, The Binary Value of this OcTet IS

00000010

And ITS Decimal Representation IS

- 16 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

7 6 5 4 3 2 1 0 0 * 2 0 * 2 0 * 2 0 * 2 0 * 2 0 * 2 1 * 2 0 * 2 = 2

We're Almost Done, Because ON IS SET, The Value of The 13th Ocxt In The TCP Header, When Interpreted AS A 8-bit Unsigned Integer in Network Byte Order, Must Be Exactly 2.

This Relationship Can Be Expressed AS TCP [13] == 2

We can use this expression as the filter for tcpdump in order to watch packets which have only SYN set: tcpdump -i xl0 tcp [13] == 2The expression says "let the 13th octet of a TCP datagram have the decimal value 2", Which is exactly what wewood.

Now, let's assume that we need to capture SYN packets, but we do not care if ACK or any other TCP control bit is set at the same time. Let's see what happens to octet 13 when a TCP datagram with SYN-ACK set arrives :

| C | e | u | a | p | r | s | f | | --------------- | | 0 0 0 1 0 0 1 0 | ----- ---------- | | 7 6 5 4 3 2 1 0 |

Now Bits 1 and 4 Are Set in the 13th Octet. The binary value of octet 13 is

00010010

Which Translates to Decimal

7 6 5 4 3 2 1 0 0 * 2 0 * 2 0 * 2 1 * 2 0 * 2 0 * 2 1 * 2 0 * 2 = 18

Now We can't just use 'tcp [13] == 18' in the TCPDUMP Filter Expression, Because That Would SELECT Only Those Packets That Have Syn-Ack Set, But Not Those with Only Sy. Remember That We don't Care if Ack or Any Other Control Bit is Set As long as syn is set.

In Order To Logically Our Goal Value of Oclet 13 with Some Other Value To Preserve The Syn Bit. We Know That We Want Syn to Be Set in Any Case, So We'll Logical and The Value in The 13th Oclet with the binary value of a syn:

00010010 SYN-ACK 00000010 SYN and 00000010 (WANT SYN) and 00000010 (WANT SYN) -------- --------

- 17 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

= 00000010 = 00000010

We see that this AND operation delivers the same result regardless whether ACK or another TCP control bit is set. The decimal representation of the AND value as well as the result of this operation is 2 (binary 00000010), so we know that for packets with SYN SET the FOLLOWING RELATION MUST HOLD TRUE:

((Value of OcTet 13) and (2)) == (2)

THIS POINTS US to the TCPDUMP FILTER Expression Tcpdump -i XL0 'TCP [13] & 2 == 2'

Note That You Should Use Single Quotes or A Backslash In The Expression To Hide The And ('&') Special Character from the shell.

UDP Packets Udp Format Is Illustrate by this rwho packet: actinide.Who> Broadcast.Who: UDP 84

This says that port who on host actinide sent a udp datagram to port who on host broadcast, the Internet broadcast address. The packet contained 84 bytes of user data. Some UDP services are recognized (from the source or destination port number) and the higher Level Protocol Information Printed. in Particular, Domain Name Service Requests (RFC-1034/1035) And Sun RPC Calls (RFC-1050) TO NFS.

UDP Name Server Requests (N.B.:The following description assumes familiarity with the Domain Service protocol described in RFC-1035. If you are not familiar with the protocol, the following description will appear to be written in greek.) Name server requests are formatted as

SRC> DST: ID OP? Flags Qtype Qclass Name (LEN) H2OPOLO.1538> Helios.domain: 3 a? ucbvax.berkeley.edu. (37)

Host h2opolo asked the domain server on helios for an address record (qtype = A) associated with the name ucbvax.berkeley.edu. The query id was `3 '. The` ' indicates the recursion desired flag was set. The query length was 37 bytes, not including the UDP and IP protocol headers. The query operation was the normal one, Query, so the op field was omitted. If the op had been anything else, it would have been printed between the `3 'and the . ` '.. Similarly, the qclass was the normal one, C_IN, and omitted Any other qclass would have been printed immediately after the` A' A few anomalies are checked and may result in extra fields enclosed in square brackets: If a query contains an answer, authority records or additional records section, ancount, nscount, or arcount are printed as `[na] ',` [nn]' or `[nau] 'where n is the appropriate count. If any of the response Bits Are Set (AA, Ra Or Rcode ) or any of the `must be zero 'bits are set in bytes two and three,` [b2 & 3 = x]' is printed, where x is The hex value of- 18 - formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

Header Bytes Two and Three.

UDP Name Server Responses Name Server Responses Are Formatted AS SRC> DST: ID OP RCODE FLAGS A / N / AU TYPE CLASS DATA (LEN)

Helios.domain> H2OPOLO.1538: 3 3/3/7 A 128.32.137.3 (273) Helios.domain> H2OPOLO.1537: 2 NXDOMAIN * 0/1/0 (97) in the first example, Helios Responds to query ID 3 from h2opolo with 3 answer records, 3 name server records and 7 additional records. The first answer record is type A (address) and its data is internet address 128.32.137.3. The total size of the response was 273 bytes, excluding UDP and IP Headers. The op (Query) WERE OMITTED, AS WAS THE CLASS (C_IN) Of The a Record. In The Second Example, Helios Responds To Query 2 with a Response Code of Non-EXISTENT DOMAIN (NXDomain) ...) with no answers, one name server and no authority records The `* 'indicates that the authoritative answer bit was set Since there were no answers, no type, class or data were printed Other flag characters that might appear are` - '(Recursion Available, Ra, Not Set) and `|' (Truncated Messag E, TC, SET). IF The `Question 'Section Doesn't Contain Exactly One Entry,` [NQ]' Is Printed. Note That Name Server Requests and Responses TEND to Be Large and The Default Snaplen of 68 Bytes May Not Capture enough of the packet to print. Use the -s flag to increase the snaplen if you need to seriously investigate name server traffic. `-s 128 'has worked well for me.SMB / CIFS decoding tcpdump now includes fairly extensive SMB / CIFS / NBT Decoding for Data On UDP / 137, UDP / 138 and TCP / 139. Some Primitive Decoding of ipx and netbeui smb data is also done.

By Default A Fairly Minimal Decode Is Done, with a Much More Detailed Decode Done IF -V Is Used. Be Warned That with -va Single Smb Packet May Take Up A Page Or More, So Only Use -V If You Really Want All Thae GORY DETAILS.IF You Are Decoding SMB Sessions Containing Unicode STRINGS THEN You May Wish To Set The Environment Variable Use_Unicode to 1. a patch to auto-detect uncode Srings Would Be Welcome.

For information on SMB packet formats and what all te fields mean see www.cifs.org or the pub / samba / specs / directory on your favourite samba.org mirror site. The SMB patches were written by Andrew Tridgell (tridge@samba.org ).

NFS Requests and Replies Sun NFS (Network File System) Requests and Replies Are Printed As:

- 19 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

Src.xID> DST.NFS: LEN OP ARGS SRC.NFS> DST.XID: Reply Stat Len Op Results

Sushi.6709> WRL.NFS: 112 Readlink FH 21, 24 / 10.73165 WRL.NFS> Sushi.6709: Reply OK 40 Readlink "../var" Sushi.201B> WRL.NFS: 144 Lookup FH 9,74 / 4096.6878 "Xcolors" WRL.NFS> Sushi.201b: Reply OK 128 Lookup FH 9,74 / 4134.3150

In the first line, host sushi sends a transaction with id 6709 to wrl (note that the number following the src host is a transaction id, not the source port). The request was 112 bytes, excluding the UDP and IP headers. The operation Was a Readlink (Read Symbolic Link) on File Handle (FH) 21,24 / 10.731657119. (IF One is Lucky, AS in This Case, The File Handle Can Be Interpreted As A Major, Minor Device Number Pair, Followed by the inode number and generation number.) Wrl replies `ok 'with the contents of the link. in the third line, sushi asks wrl to lookup the name` xcolors' in directory file 9,74 / 4096.6878. Note that the data printed depends on the . operation type The format is intended to be self explanatory if read in conjunction with an NFS protocol spec If the -v (verbose) flag is given, additional information is printed For example:.. sushi.1372a> wrl.nfs: 148 read FH 21,11 / 12.195 8192 byte S @ 24576 WRL.NFS> Sushi.1372a: reply ok 1472 read reg 100664 IDS 417/0 SZ 29388

(-V also prints the IP header TTL, ID, length, and fragmentation fields, which have been omitted from this example.) In the first line, sushi asks wrl to read 8192 bytes from file 21,11 / 12.195, at byte offset 24576. Wrl replies `ok '; the packet shown on the second line is the first fragment of the reply, and hence is only 1472 bytes long (the other bytes will follow in subsequent fragments, but these fragments do not have NFS or even UDP . headers and so might not be printed, depending on the filter expression used) Because the -v flag is given, some of the file attributes (which are returned in addition to the file data) are printed: the file type ( `` REG '', for regular file, The file mode (in octal), the Uid and gid, and the file size. if the -v flag is given moreward. Note That NFS Requests Are Very Large And Much of the detail won't beprinte d unless snaplen is increased. Try using `-s 192 'to watch NFS traffic. NFS reply packets do not explicitly identify the RPC operation. Instead, tcpdump keeps track of` `recent' 'requests, and matches them to the replies using the TRANSACTION ID. IF a Reply Does Not Closely Follow The Corresponding Request, IT Might Not Be Parsable.- 20 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

AFS Requests and Replies Transarc AFS (Andrew File System) Requests and Replies Are Printed As:

Src.Sport> Dst.dport: RX Packet-Type Src.Sport> DST.DPORT: RX Packet-Type Service Call Call-Name Args Src.Sport> Dst.dport: RX Packet-Type Service Reply Call-Name Argselvis.7001 > Pike.afsfs: RX Data FS Call Rename Old Fid 536876964/1 ".newsrc.new" New FID 536876964/1 ".newsrc" Pike.afsfs> Elvis.7001: RX Data FS Reply Rename

In The First Line, Host Elvis Sends A RX Packet To Pike. This Was A RX Data Packet To The FS (FileServer) Service, And is The Start of An RPC Call. The RPC Call Was A Rename, with the Old Directory File ID Of 536876964/1/1 and an old filename of `.newsrc.new ', and a new directory file id of 536876964/1/1 and a new filename of` .newsrc'. The host pike responds with a rpc reply to the rename call (which was successful, because it was a data packet and not an abort packet). In general, all AFS RPCs are decoded at least by RPC call name. Most AFS RPCs have at least some of the arguments decoded (generally only the `interesting 'arguments, for some definition of interesting). The format is intended to be self-describing, but it will probably not be useful to people who are not familiar with the workings of AFS and RX. If the -v (verbose) Flag is Given TWICE, ACKNOWEDGEMENT PACKETS AND ADDITIONAL HE ader information is printed, such as the the RX call ID, call number, sequence number, serial number, and the RX packet flags. If the -v flag is given twice, additional information is printed, such as the the RX call ID, serial number, and the RX packet flags. The MTU negotiation information is also printed from RX ack packets. If the -v flag is given three times, the security index and service id are printed. Error codes are printed for abort packets, with the Exception of Ubik Beacon Packets (Because ABORT PACKETS Are Used to Signify A Yes vote for the ubik protocol). Note That AFS Requests Are Very Large and Many of The Arguments Won '

t be printed unless snaplen is increased. Try using `-s 256 'to watch AFS traffic. AFS reply packets do not explicitly identify the RPC operation. Instead, tcpdump keeps track of` `recent' 'requests, and matches them to the replies using the call number and service ID. If a reply does not closely follow the corresponding request, it might not be parsable.KIP Appletalk (DDP in UDP) Appletalk DDP packets encapsulated in UDP datagrams are de-encapsulated and dumped as DDP packets (ie All the udp header information is discarded. The file /etc/atique appletalk net and node numbers to names. Lines in this file hame the form number name

- 21 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

1.254 Ether 16.1 ICSD-NET 1.254.110 ACE

The first two lines give the names of appletalk networks The third line gives the name of a particular host (a host is distinguished from a net by the 3rd octet in the number -. A net number must have two octets and a host number must have three octets.) The number and name should be separated by whitespace (blanks or tabs). The /etc/atalk.names file may contain blank lines or comment lines (lines starting with a `# '). Appletalk addresses are printed in the Form net.host.port

144.1.209.2> ICSD-NET.112.220 Office.2> ICSD-NET.112.220 JSSMAG.149.235> ICSD-NET.2

(If the /etc/atalk.names doesn't exist or doesn't contain An entry for some appletalk host / net number node 209 is sending to whatever is listening on port 220 of net icsd node 112. The second line is the same except the full name of the source node is known ( `office '). The third line is a send from port 235 on net jssmag node 149 to broadcast on the icsd-net NBP port (note that the broadcast address (255) is indicated by a net name with no host number - for this reason it's a good idea to keep node names and net names distinct in / etc /atalk.names). NBP (name binding protocol) and ATP (Appletalk transaction protocol) packets have their contents interpreted. Other protocols just dump the protocol name (or number if no name is registered for the protocol) and packet size.NBP packets Are Formatted Like T He FOLLOWING EXAMPLES: ICSD-NET.112.220> JSSMag.2: NBP-LKUP 190: "=: LaserWriter @ *" jssmag.209.2> ICSD-NET.112.220: NBP-Reply 190: "RM1140: LaserWriter @ *" 250 Techpit .2> ICSD-NET.112.220: NBP-Reply 190: "Techpit: LaserWriter @ *" 186

The first line is a name lookup request for laserwriters sent by net icsd host 112 and broadcast on net jssmag. The nbp id for the lookup is 190. The second line shows a reply for this request (note that it has the same id) from host jssmag.209 saying that it has a laserwriter resource named "RM1140" registered on port 250. The third line is another reply to the same request saying host techpit has laserwriter "techpit" registered on port 186.ATP packet formatting is demonstrated by the FOLLOWING EXAMPLE: JSSMAG.209.165> Helios.132: ATP-REQ 12266 <0-7> 0xae030001 Helios.132> JSSMag.209.165: ATP-RESP 12266: 0 (512) 0xae040000 Helios.132> JSSMAG.209.165: ATP-RESP 12266: 1 (512) 0xae040000 Helios.132> JSSMag.209.165: ATP-RESP 12266: 2 (512) 0xae040000 Helios.132> JSSMag.209.165: ATP-RESP 12266: 3 (512) 0xae040000 Helios.132> JSSMAG.209.165 : ATP-RESP 12266: 4 (512) 0xae040000

- 22 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

Helios.132> JSSMag.209.165: ATP-RESP 12266: 5 (512) 0xae040000 Helios.132> JSSMAG.209.165: ATP-RESP 12266: 6 (512) 0xae040000 Helios.132> JSSMAG.209.165: ATP-RESP * 12266: 7 (512) 0xae040000 JSSMAG.209.165> Helios.132: ATP-REQ 12266 <3, 5> 0xae030001 Helios.132> JSSMAG.209.165: ATP-RESP 12266: 3 (512) 0xae040000 Helios.132> JSSMAG.209.165: ATP -resp 12266: 5 (512) 0xae040000 JSSMag.209.165> Helios.132: ATP-REL 12266 <0-7> 0xae030001 jssmag.209.133> Helios.132: ATP-REQ * 12267 <0-7> 0xae030002

JSSMag.209 Initiates Transaction ID 12266 with host helios by Requesting Up to 8 packets (the `<0-7> '). The hex number at the end of the line is the value of the` Userdata' Field in The Request. Helios responds with 8 512-byte packets The `:. digit 'following the transaction id gives the packet sequence number in the transaction and the number in parens is the amount of data in the packet, excluding the atp header The` *.' on packet 7 indicates that the EOM bit was set. jssmag.209 then requests that packets 3 & 5 be retransmitted. Helios resends them then jssmag.209 releases the transaction. Finally, jssmag.209 initiates the next request. The `* 'on the request INDICES THAT XO (`exactly overce ') WAS NOT SET.IP Fragmentation Fragment DataGrams Are Printed AS

(Frag id: size @ offset ) (frag id: size @ offset) (The first form indicates there are more fragments The second indicates this is the last fragment..) Id is the fragment id Size is the fragment size (in bytes. ) excluding the IP header. offset is this fragment's offset (in bytes) in the original datagram. The fragment information is output for each fragment. The first fragment contains the higher level protocol header and the frag info is printed after the protocol info. Fragments after the first contain no higher level protocol header and the frag info is printed after the source and destination addresses. For example, here is part of an ftp from arizona.edu to lbl-rtsg.arpa over a CSNET connection that does not appear To Handle 576 byte DataGrams:

Arizona.ftp-data> RTSG.1170:. 1024: 1332 (308) ACK 1 WIN 4096 (FRAG 595A: 328 @ 0 ) ARIZONA> RTSG: (FRAG 595A: 204 @ 328) RTSG.1170> arizona.ftp- data:. ack 1536 win 2560 There are a couple of things to note here: First, addresses in the 2nd line do not include port numbers This is because the TCP protocol information is all in the first fragment and we have no idea what. the port or sequence numbers are when we print the later fragments. Second, the tcp sequence information in the first line is printed as if there were 308 bytes of user data when, in fact, there are 512 bytes (308 in the first frag and 204 in the second. IF you are looking for holls in the sequence space or tryings, this can fool you. A packet with the ip don't fragment flag is marg is marked with a trailing (df). 23 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

Timestamps By default, all output lines are preceded by a timestamp The timestamp is the current clock time in the form hh:. Mm:. Ss.frac and is as accurate as the kernel's clock The timestamp reflects the time the kernel first saw the packet . No attempt is name to account for the time lag between when The ethernet interface removed the packet from the wire and when the kernel serviced The `new packet 'interrupt. 0000-00-00 0000-00-00...

See Also Traffic (1C), Nit (4P), BPF (4), PCAP (3)

AUTHORS The original authors are: Van Jacobson, Craig Leres and Steven McCanne, all of the Lawrence Berkeley National Laboratory, University of California, Berkeley, CA. It is currently being maintained by tcpdump.org The current version is available via http:. Http : //www.tcpdump.org/ The Original Distribution Is Available Via Anonymous FTP: ftp://ftp.e.lbl.gov/tcpdump.tar.z IPv6 / IPsec Support Is Added by Wide / Kame Project. This Program Uses eric Young's SSLeay library, under specific configuration.BUGS Please send problems, bugs, questions, desirable enhancements, etc. to: tcpdump-workers@tcpdump.org Please send source code contributions, etc. to: patches@tcpdump.org NIT doesn ' T Let You Watch your owmbune. WE Recommend That You Use the latter. on Linux Systems with 2.0 [.x] kernels:

Packets on the loopback device will be seen twice;

Packet Filtering Cannot Be Done in The Kernel, So That All Packets Must Be copied from the kernel in Order To Be Filtered

all of a packet, not just the part that's within the snapshot length, will be copied from the kernel (the 2.0 [.x] packet capture mechanism, if asked to copy only part of a packet to userland, will not report the true length of the packet; this would cause most IP packets to get an error from tcpdump) We recommend that you upgrade to a 2.2 or later kernel Some attempt should be made to reassemble IP fragments or, at least to compute the right length for the.. . higher level protocol Name server inverse queries are not dumped correctly: the (empty) question section is printed rather than real query in the answer section Some believe that inverse queries are themselves a bug and prefer to fix the program generating them rather than-. 24 - Formatted: August 11, 2004

TCPDUMP (1) TCPDUMP (1) 3 January 2001

tcpdump. A packet trace that crosses a daylight savings time change will give skewed time stamps (the time change is ignored). Filter expressions that manipulate FDDI or Token Ring headers assume that all FDDI and Token Ring packets are SNAP-encapsulated Ethernet packets. This is true for IP, ARP, and DECNET Phase IV, but is not true for protocols such as ISO CLNS. Therefore, the filter may inadvertently accept certain packets that do not properly match the filter expression. filter expressions on fields other than those that manipulate Token Ring headers will not correctly handle source-routed Token Ring packets. ip6 proto should chase header chain, but at this moment it does not. ip6 protochain is supplied for this behavior. Arithmetic expression against transport layer headers, like tcp [0], Does Not Work Against IPv6 Packets. It Only Looks At IPv4 Packets.- 25 - Formatted: August 11, 2004

转载请注明原文地址:https://www.9cbs.com/read-128378.html

New Post(0)