📄 tcpdump.1
字号:
19 bytes of data (bytes 2 through 20in the rtsg \(-> csam side of the conversation).The PUSH flag is set in the packet.On the 7th line, .PN csam says it has received data sent by .PN rtsg up tobut not including byte 21. Most of this data is apparently sitting in thesocket buffer since .PN csam 's receive window has gotten 19 bytes smaller..PN Csam also sends one byte of data to .PN rtsg in this packet.On the 8th and 9th lines,.PN csam sends two bytes of urgent, pushed data to .PN rtsg ..sp.sp.B "UDP Packets".PPUDP format is illustrated by this .PN rwho packet:.EX\f(CWactinide.who > broadcast.who: udp 84\fP.EEThis says that port \fIwho\fP on host .PN actinidesent a udpdatagram to port \fIwho\fP on host .PN broadcast , the Internetbroadcast address. The packet contained 84 bytes of user data..PPSome UDP services are recognized (from the source or destinationport number) and the higher level protocol information printed.In particular, Domain Name service requests (RFC-1034/1035) and SunRPC calls (RFC-1050) to NFS..sp.sp.B "UDP Name Server Requests".PP.NTThe following description assumes familiarity withthe Domain Service protocol described in RFC-1035. .NE.PPName server requests are formatted as follows:.EX\fIsrc > dst: id op? flags qtype qclass name (len)\fP.sp\f(CWh2opolo.1538 > helios.domain: 3+ A? ucbvax.berkeley.edu. (37)\fP.EEHost .PN h2opoloasked the domain server on .PN heliosfor anaddress record (qtype=A) associated with the name .PN ucbvax.berkeley.edu .The query id is `3'. The `+' indicates the \fIrecursion desired\fP flagwas set. The query length is 37 bytes, not including the UDP andIP protocol headers. The query operation is the normal one, \fIQuery\fP,so the \fIop\fP field was omitted. If the \fIop\fP had been anything else, it would be printed between the `3' and the `+'.Similarly, the \fIqclass\fP is the normal one,\fIC_IN\fP, and omitted. Any other \fPqclass\fP would be printedimmediately after the `A'..PPA few anomalies are checked and may result in extra fields enclosed insquare brackets. If a query contains an answer, name server orauthority section,.IR ancount ,.IR nscount ,or.I arcountare printed as `[\fIn\fPa]', `[\fIn\fPn]' or `[\fIn\fPau]' where \fIn\fPis 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=\fIx\fP]'is printed, where \fIx\fP is the hex value of header bytes two and three..sp.sp.B "UDP Name Server Responses".PPName server responses are formatted as follows:.EX\fIsrc > dst: id op rcode flags a/n/au type class data (len)\fP.sp\f(CWhelios.domain > h2opolo.1538: 3 3/3/7 A 128.32.137.3 (273)helios.domain > h2opolo.1537: 2 NXDomain* 0/1/0 (97)\fP.EEIn the first example, .PN heliosresponds to query id 3 from .PN h2opolowith 3 answer records, 3 name server records and 7 authority records.The first answer record is type A (address) and its data is internetaddress 128.32.137.3. The total size of the response was 273 bytes,excluding UDP and IP headers. The \fIop\fP (Query) and response code(NoError) were omitted, as was the \fIclass\fP (C_IN) of the A record..PPIn the second example, .PN heliosresponds to query 2 with aresponse code of non-existent domain (NXDomain) with no answers,one name server and no authority records. The `*' indicates thatthe \fIauthoritative answer\fP bit was set. Since there were noanswers, no type, class or data were printed..PPOther flag characters that might appear are `\-' (recursion available,RA, \fInot\fP set) and `|' (truncated message, TC, set). If the`question' section does not contain exactly one entry, `[\fIn\fPq]'is printed..PPNote that name server requests and responses tend to be large and thedefault \fIsnaplen\fP of 96 bytes may not capture enough of the packetto print. Use the \fB\-s\fP flag to increase the snaplen if youneed to seriously investigate name server traffic. For example, `\fB\-s 128\fP' works well..sp.sp.B "NFS Requests".PPSun NFS (Network File System) requests and replies are printed as:.EX\fIsrc.xid > dst.nfs: len op args\fP\fIsrc.nfs > dst.xid: reply stat len\fP.sp\f(CWvs.e2766 > helios.nfs: 136 readdir fh 6.5197 8192 bytes @ 0helios.nfs > vs.e2766: reply ok 384vs.e2767 > helios.nfs: 136 lookup fh 6.5197 `RCS'\fP.EEIn the first line, host .PN vssends a transaction with id \fIe2766\fPto .PN helios (note that the number following the src host is atransaction id, \fInot\fP the source port). The request was 136 bytes,excluding the UDP and IP headers. The operation was a \fIreaddir\fP(read directory) on file handle (\fIfh\fP) 6.5197. 8192 bytes areread, starting at offset 0. .PN Heliosreplies `ok' with 384bytes of data. (The design of Sun's RPC protocol makes it difficult tointerpret replies.).PPIn the third line, .PN vs asks .PN heliosto lookup the name`\fIRCS\fP' in directory file 6.5197. Note that the data printeddepends on the operation type. The format is intended to be selfexplanatory, if read in conjunction withan NFS protocol spec..PPNote that NFS requests are very large and the above will not be printedunless \fIsnaplen\fP is increased. You can use `\fB\-s 192\fP' to watchNFS traffic..sp.sp.B "KIP Appletalk (DDP in UDP)".PPAppletalk DDP packets encapsulated in UDP datagrams are de-encapsulatedand dumped as DDP packets (that is, all the UDP header information isdiscarded). The file.PN /etc/atalk.namesfile is used to translate appletalk net and node numbers to names.Lines in this file have the form.EX\fInumber name\fP.sp\f(CW1.254 ether16.1 icsd-net1.254.110 ace\fP.EEThe first two lines give the names of appletalk networks. The thirdline gives the name of a particular host (a host is distinguishedfrom a net by the 3rd octet in the number \-a net number \fImust\fP have two octets and a host number \fImust\fPhave three octets.) The number and name should be separated bywhitespace (blanks or tabs).The.PN /etc/atalk.namesfile may contain blank lines or comment lines (lines starting witha `#')..PPAppletalk addresses are printed in the form.EX\fInet.host.port\fP.sp\f(CW144.1.209.2 > icsd-net.112.220office.2 > icsd-net.112.220jssmag.149.235 > icsd-net.2\fP.EE(If the.PN /etc/atalk.namesfile does not exist or does not contain an entry for some appletalkhost/net number, addresses are printed in numeric form.)In the first example, NBP (DDP port 2) on net 144.1 node 209is 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 nodeis known (`office'). The third line is a send from port 235 onnet jssmag node 149 to broadcast on the icsd-net NBP port (note thatthe broadcast address (255) is indicated by a net name with no hostnumber \- for this reason it is a good idea to keep node names andnet names distinct in the.PN /etc/atalk.names file)..PPNBP (name binding protocol) and ATP (Appletalk transaction protocol)packets have their contents interpreted. Other protocols just dumpthe protocol name (or number if no name is registered for theprotocol) and packet size..PP\fBNBP packets\fP are formatted like the following examples:.EX\s-2\f(CWicsd-net.112.220 > jssmag.2: nbp-lkup 190: "=:LaserWriter@*"jssmag.209.2 > icsd-net.112.220: nbp-reply 190: "RM1140:LaserWriter@*" 250techpit.2 > icsd-net.112.220: nbp-reply 190: "techpit:LaserWriter@*" 186\fP\s+2.EEThe first line is a name lookup request for laserwriters sent by net .PN icsd host.PN 112 and broadcast on net .PN jssmag .The nbp id for the lookup is 190.The second line shows a reply for this request (note that it has thesame id) from host .PN jssmag.209 saying that it has a laserwriterresource named "RM1140" registered on port 250. The third line isanother reply to the same request saying host .PN techpit has laserwriter"techpit" registered on port 186..PP\fBATP packet\fP formatting is demonstrated by the following example:.EX\s-2\f(CWjssmag.209.165 > helios.132: atp-req 12266<0-7> 0xae030001helios.132 > jssmag.209.165: atp-resp 12266:0 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:1 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:2 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:4 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:6 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp*12266:7 (512) 0xae040000jssmag.209.165 > helios.132: atp-req 12266<3,5> 0xae030001helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000jssmag.209.165 > helios.132: atp-rel 12266<0-7> 0xae030001jssmag.209.133 > helios.132: atp-req* 12267<0-7> 0xae030002\fP\s+2.EE.PN Jssmag.209 initiates transaction id 12266 with host .PN helios by requestingup to 8 packets (the `<0-7>'). The hex number at the end of the lineis the value of the `userdata' field in the request..PP.PN Helios responds with 8 512-byte packets. The `:digit' following thetransaction id gives the packet sequence number in the transactionand the number in parens is the amount of data in the packet,excluding the atp header. The `*' on packet 7 indicates that theEOM bit was set..PP.PN Jssmag.209 then requests that packets 3 & 5 be retransmitted. .PN Heliosresends them and then .PN jssmag.209 releases the transaction. Finally,.PN jssmag.209 initiates the next request. The `*' on the requestindicates that XO (`exactly once') was \fInot\fP set..sp.sp.B "IP Fragmentation".PPFragmented Internet datagrams are printed as.EX\fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB+)\fR\fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB)\fR.EE(The first form indicates there are more fragments. The secondindicates this is the last fragment.).PP\fIId\fP is the fragment id (in hex). \fISize\fP is the fragmentsize (in bytes) excluding the IP header. \fIOffset\fP is thisfragment's offset (in bytes) in the original datagram..PPThe fragment information is output for each fragment. The firstfragment contains the higher level protocol header and the fraginfo is printed after the protocol info. Fragmentsafter the first contain no higher level protocol header and thefrag info is printed after the source and destination addresses.For example, here is part of an ftp from .PN arizona.edu to .PN lbl-rtsg.arpaover a CSNET connection that does not appear to handle 576 byte datagrams:.EX\s-2\f(CWarizona.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\fP\s+2.EEThere are a couple of things to note here: First, addresses in the2nd line do not include port numbers. This is because the TCPprotocol information is all in the first fragment and we have no ideawhat 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 therewere 308 bytes of user data when, in fact, there are 512 bytes (308 inthe first frag and 204 in the second). If you are looking for holesin the sequence space or trying to match up ackswith packets, this can fool you..PPA packet with the IP \fIdon't fragment\fP flag is marked with atrailing \fB(DF)\fP..sp.sp.B "Timestamps".PPBy default, all output lines are preceded by a timestamp. The timestampis the current clock time in the form.EX\fIhh:mm:ss.frac\fP.EEand is as accurate as the kernel's clock (for example, \(+-4ms on anULTRIX RISC workstation).The timestamp reflects the time the kernel first saw the packet. No attemptis made to account for the time lag between when theethernet interface removed the packet from the wire and when the kernelserviced the `new packet' interrupt..SH CopyrightCopyright (c) 1988-1990 The Regents of the University of California.All rights reserved..PPRedistribution and use in source and binary forms, with or withoutmodification, are permitted provided that: (1) source code distributionsretain the above copyright notice and this paragraph in its entirety, (2)distributions including binary code include the above copyright notice andthis paragraph in its entirety in the documentation or other materialsprovided with the distribution, and (3) all advertising materials mentioningfeatures or use of this software display the following acknowledgement:``This product includes software developed by the University of California,Lawrence Berkeley Laboratory and its contributors.'' Neither the name ofthe University nor the names of its contributors may be used to endorseor promote products derived from this software without specific priorwritten permission.THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIEDWARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE..SH See Alsopacketfilter(4), pfconfig(8c), pfstat(8)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -