• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

lbl/22-Nov-2023-302205

missing/22-Nov-2023-1,7531,151

tests/22-Nov-2023-371,994371,120

win32/22-Nov-2023-5,1704,860

.gitD01-Jan-19700

.gitattributesD22-Nov-2023573 2723

.gitignoreD22-Nov-2023179 1918

Android.bpD23-Nov-20235.1 KiB212207

CHANGESD22-Nov-202356.8 KiB1,4471,197

CONTRIBUTINGD22-Nov-20235.9 KiB152113

CREDITSD22-Nov-202314.6 KiB239233

CleanSpec.mkD22-Nov-20232.2 KiB500

INSTALL.txtD22-Nov-20235.2 KiB124115

LICENSED22-Nov-2023873 2016

MODULE_LICENSE_BSDD22-Nov-20230

Makefile-devel-addsD22-Nov-2023614 2318

Makefile.inD22-Nov-202310 KiB464386

NOTICED22-Nov-2023873 2016

OWNERSD23-Nov-202346 21

PLATFORMSD22-Nov-2023567 1714

READMED22-Nov-20239 KiB226182

README.mdD22-Nov-20239 KiB226182

README.versionD22-Nov-202393 43

Readme.Win32D22-Nov-20231 KiB2419

VERSIOND22-Nov-20236 21

aclocal.m4D22-Nov-202340.4 KiB1,3621,292

addrtoname.cD22-Nov-202332.8 KiB1,2861,034

addrtoname.hD22-Nov-20232.8 KiB6330

addrtostr.cD22-Nov-20235.6 KiB214132

addrtostr.hD22-Nov-20232 KiB432

af.cD22-Nov-20232 KiB5938

af.hD22-Nov-20231.8 KiB5627

ah.hD22-Nov-20232.3 KiB5816

appletalk.hD22-Nov-20234.1 KiB167103

ascii_strcasecmp.cD22-Nov-20233.5 KiB10666

ascii_strcasecmp.hD22-Nov-20231.5 KiB346

atime.awkD22-Nov-2023529 199

atm.hD22-Nov-20231.1 KiB326

bpf_dump.cD22-Nov-20231.9 KiB6235

chdlc.hD22-Nov-20231.3 KiB275

checksum.cD22-Nov-20235.3 KiB190118

config.guessD22-Nov-202342.3 KiB1,4361,243

config.hD22-Nov-202312 KiB39670

config.h.inD22-Nov-202311.5 KiB398271

config.subD22-Nov-202335.2 KiB1,8081,670

configureD22-Nov-2023257.9 KiB9,6667,585

configure.inD22-Nov-202325.7 KiB1,018945

cpack.cD22-Nov-20233.9 KiB15681

cpack.hD22-Nov-20232.4 KiB5720

ether.hD22-Nov-20232.3 KiB588

ethertype.hD22-Nov-20235.6 KiB204163

extract.hD22-Nov-202311.5 KiB287137

funcattrs.hD22-Nov-20234.4 KiB12335

getopt_long.hD22-Nov-20232.4 KiB6718

gmpls.cD22-Nov-20235.8 KiB193145

gmpls.hD22-Nov-20231.4 KiB3417

gmt2local.cD22-Nov-20232 KiB6728

gmt2local.hD22-Nov-20231.2 KiB264

in_cksum.cD22-Nov-20236.4 KiB20190

install-shD22-Nov-20235.4 KiB251152

interface.hD22-Nov-20232.3 KiB8042

ip.hD22-Nov-20235.7 KiB16583

ip6.hD22-Nov-20237.6 KiB20294

ipproto.cD22-Nov-202316.5 KiB363300

ipproto.hD22-Nov-20234.7 KiB14798

l2vpn.cD22-Nov-20233.4 KiB9663

l2vpn.hD22-Nov-2023781 182

llc.hD22-Nov-20233.7 KiB12384

machdep.cD22-Nov-20232.6 KiB7531

machdep.hD22-Nov-20231.2 KiB264

makemibD22-Nov-20236.4 KiB248186

mib.hD22-Nov-202326.3 KiB1,4611,450

mkdepD22-Nov-20232.4 KiB11366

mpls.hD22-Nov-20231.9 KiB4212

nameser.hD22-Nov-202310.8 KiB301172

netdissect-stdinc.hD22-Nov-20239.9 KiB410223

netdissect.cD22-Nov-20233.4 KiB14777

netdissect.hD22-Nov-202330 KiB658433

nfs.hD22-Nov-202313.4 KiB439312

nfsfh.hD22-Nov-20232.6 KiB6713

nlpid.cD22-Nov-20231.3 KiB4224

nlpid.hD22-Nov-20231.3 KiB3316

openflow.hD22-Nov-20232.1 KiB5215

ospf.hD22-Nov-202310.2 KiB326221

oui.cD22-Nov-20233.8 KiB10574

oui.hD22-Nov-20234.1 KiB9264

packetdat.awkD22-Nov-20231.4 KiB6247

parsenfsfh.cD22-Nov-202312.9 KiB483296

pcap-missing.hD22-Nov-20231.8 KiB5016

pcap_dump_ftell.cD22-Nov-20231.3 KiB328

ppp.hD22-Nov-20233.1 KiB6945

print-802_11.cD22-Nov-202391.2 KiB3,3662,369

print-802_15_4.cD22-Nov-20235.5 KiB224160

print-ah.cD22-Nov-20232 KiB6530

print-ahcp.cD22-Nov-202310.7 KiB412327

print-aodv.cD22-Nov-202316 KiB540437

print-aoe.cD22-Nov-202311.1 KiB431322

print-ap1394.cD22-Nov-20234 KiB12670

print-arcnet.cD22-Nov-20238.8 KiB361217

print-arp.cD22-Nov-202314.6 KiB481356

print-ascii.cD22-Nov-20236.2 KiB210142

print-atalk.cD22-Nov-202316.8 KiB662512

print-atm.cD22-Nov-202316.8 KiB556361

print-babel.cD22-Nov-202323.7 KiB718594

print-beep.cD22-Nov-20231.7 KiB6937

print-bfd.cD22-Nov-202316.2 KiB407249

print-bgp.cD22-Nov-202398.5 KiB2,8622,329

print-bootp.cD22-Nov-202330 KiB1,095864

print-bt.cD22-Nov-20232.2 KiB7229

print-calm-fast.cD22-Nov-20231.8 KiB7631

print-carp.cD22-Nov-20232.4 KiB8440

print-cdp.cD22-Nov-202311.2 KiB405309

print-cfm.cD22-Nov-202324.2 KiB765555

print-chdlc.cD22-Nov-20235.9 KiB211145

print-cip.cD22-Nov-20232.5 KiB10950

print-cnfp.cD22-Nov-202313.7 KiB475340

print-dccp.cD22-Nov-202316.4 KiB660535

print-decnet.cD22-Nov-202338.3 KiB1,2741,105

print-dhcp6.cD22-Nov-202323.2 KiB833712

print-domain.cD22-Nov-202318.3 KiB750636

print-dtp.cD22-Nov-20233 KiB12976

print-dvmrp.cD22-Nov-20238.9 KiB368293

print-eap.cD22-Nov-20239.3 KiB305224

print-egp.cD22-Nov-20238.7 KiB377319

print-eigrp.cD22-Nov-202319.3 KiB523421

print-enc.cD22-Nov-20234.2 KiB13956

print-esp.cD22-Nov-202320.3 KiB836545

print-ether.cD22-Nov-202312.9 KiB464312

print-fddi.cD22-Nov-202310.5 KiB346203

print-forces.cD22-Nov-202345 KiB1,7611,407

print-fr.cD22-Nov-202331.7 KiB1,143721

print-frag6.cD22-Nov-20232.4 KiB7138

print-ftp.cD22-Nov-2023973 3313

print-geneve.cD22-Nov-20236.1 KiB238156

print-geonet.cD22-Nov-20236.7 KiB287204

print-gre.cD22-Nov-20239.7 KiB423322

print-hncp.cD22-Nov-202326.2 KiB864715

print-hsrp.cD22-Nov-20234.6 KiB13673

print-http.cD22-Nov-20231.5 KiB7854

print-icmp.cD22-Nov-202322.6 KiB703527

print-icmp6.cD22-Nov-202359.6 KiB1,9571,627

print-igmp.cD22-Nov-202310.1 KiB342275

print-igrp.cD22-Nov-20234.6 KiB156107

print-ip.cD22-Nov-202316.9 KiB736532

print-ip6.cD22-Nov-202310.6 KiB424282

print-ip6opts.cD22-Nov-20235.5 KiB214163

print-ipcomp.cD22-Nov-20232.3 KiB7025

print-ipfc.cD22-Nov-20234.4 KiB14665

print-ipnet.cD22-Nov-20232.5 KiB11880

print-ipx.cD22-Nov-20236.4 KiB239179

print-isakmp.cD22-Nov-202381.7 KiB3,1462,487

print-isoclns.cD22-Nov-2023107.6 KiB3,1852,610

print-juniper.cD22-Nov-202348.3 KiB1,5091,250

print-krb.cD22-Nov-20236.3 KiB259195

print-l2tp.cD22-Nov-202325 KiB881743

print-lane.cD22-Nov-20233 KiB12569

print-ldp.cD22-Nov-202323.9 KiB699504

print-lisp.cD22-Nov-202315.2 KiB450281

print-llc.cD22-Nov-202316.7 KiB615389

print-lldp.cD22-Nov-202357.3 KiB1,6621,360

print-lmp.cD22-Nov-202337.6 KiB1,140926

print-loopback.cD22-Nov-20233.6 KiB13783

print-lspping.cD22-Nov-202351.6 KiB1,086689

print-lwapp.cD22-Nov-202313 KiB350234

print-lwres.cD22-Nov-202314.1 KiB596412

print-m3ua.cD22-Nov-202310.9 KiB340239

print-medsa.cD22-Nov-20235.6 KiB197130

print-mobile.cD22-Nov-20233.3 KiB10450

print-mobility.cD22-Nov-20239.7 KiB345260

print-mpcp.cD22-Nov-20237.9 KiB260196

print-mpls.cD22-Nov-20235.3 KiB223127

print-mptcp.cD22-Nov-202313.7 KiB447333

print-msdp.cD22-Nov-20232.7 KiB10470

print-msnlb.cD22-Nov-20232.4 KiB6628

print-nflog.cD22-Nov-20234.4 KiB169103

print-nfs.cD22-Nov-202342.8 KiB1,7161,407

print-nsh.cD22-Nov-20235.4 KiB186126

print-ntp.cD22-Nov-202313.3 KiB428262

print-null.cD22-Nov-20234 KiB14866

print-olsr.cD22-Nov-202323.4 KiB720497

print-openflow-1.0.cD22-Nov-202376.6 KiB2,5611,998

print-openflow.cD22-Nov-20234.8 KiB14382

print-ospf.cD22-Nov-202339.5 KiB1,210997

print-ospf6.cD22-Nov-202329.8 KiB1,015802

print-otv.cD22-Nov-20232.1 KiB7330

print-pflog.cD22-Nov-20234.8 KiB186129

print-pgm.cD22-Nov-202322.2 KiB839707

print-pim.cD22-Nov-202332.6 KiB1,196922

print-pktap.cD22-Nov-20235.2 KiB17497

print-ppi.cD22-Nov-20232.6 KiB13087

print-ppp.cD22-Nov-202346.2 KiB1,8771,491

print-pppoe.cD22-Nov-20235.7 KiB202142

print-pptp.cD22-Nov-202325.9 KiB1,007810

print-radius.cD22-Nov-202335.1 KiB994770

print-raw.cD22-Nov-20231.5 KiB4613

print-resp.cD22-Nov-202316.5 KiB543308

print-rip.cD22-Nov-20239.2 KiB274188

print-ripng.cD22-Nov-20236 KiB184119

print-rpki-rtr.cD22-Nov-202310.8 KiB409251

print-rrcp.cD22-Nov-20234.6 KiB13088

print-rsvp.cD22-Nov-202378.5 KiB1,9911,666

print-rt6.cD22-Nov-20232.7 KiB9454

print-rtsp.cD22-Nov-20231.2 KiB4827

print-rx.cD22-Nov-202366.9 KiB2,8942,140

print-sctp.cD22-Nov-202323.1 KiB818571

print-sflow.cD22-Nov-202331.5 KiB992781

print-sip.cD22-Nov-20231.3 KiB5531

print-sl.cD22-Nov-20236.6 KiB277191

print-sll.cD22-Nov-20238.9 KiB311137

print-slow.cD22-Nov-202325.2 KiB745575

print-smb.cD22-Nov-202342.9 KiB1,4991,232

print-smtp.cD22-Nov-2023983 3313

print-snmp.cD22-Nov-202343.2 KiB1,9401,458

print-stp.cD22-Nov-202317.2 KiB511344

print-sunatm.cD22-Nov-20233.3 KiB10950

print-sunrpc.cD22-Nov-20237.8 KiB251123

print-symantec.cD22-Nov-20233.8 KiB11566

print-syslog.cD22-Nov-20234 KiB147101

print-tcp.cD22-Nov-202335.5 KiB921709

print-telnet.cD22-Nov-202315 KiB558413

print-tftp.cD22-Nov-20235.2 KiB204136

print-timed.cD22-Nov-20234.7 KiB151101

print-tipc.cD22-Nov-202311.5 KiB386314

print-token.cD22-Nov-20238 KiB251146

print-udld.cD22-Nov-20235.5 KiB199109

print-udp.cD22-Nov-202321.3 KiB719606

print-usb.cD22-Nov-20234.2 KiB177116

print-vjc.cD22-Nov-20234.4 KiB12142

print-vqp.cD22-Nov-20236.8 KiB212146

print-vrrp.cD22-Nov-20236.3 KiB18495

print-vtp.cD22-Nov-202313.6 KiB404232

print-vxlan-gpe.cD22-Nov-20233.5 KiB11458

print-vxlan.cD22-Nov-20232.2 KiB7528

print-wb.cD22-Nov-202310.9 KiB459338

print-zephyr.cD22-Nov-20238 KiB337258

print-zeromq.cD22-Nov-20237.5 KiB221112

print.cD22-Nov-202311.5 KiB478345

print.hD22-Nov-20231.8 KiB4511

rpc_auth.hD22-Nov-20232.7 KiB7920

rpc_msg.hD22-Nov-20233.2 KiB12856

rpl.hD22-Nov-20234.9 KiB175126

send-ack.awkD22-Nov-20231.6 KiB6957

setsignal.cD22-Nov-20233.3 KiB9132

setsignal.hD22-Nov-20231.2 KiB264

signature.cD22-Nov-20235.6 KiB215105

signature.hD22-Nov-20231.1 KiB308

slcompress.hD22-Nov-20233.6 KiB8614

smb.hD22-Nov-20235.4 KiB12395

smbutil.cD22-Nov-202362.9 KiB1,8941,725

stime.awkD22-Nov-2023567 2010

strtoaddr.cD22-Nov-20235.3 KiB240148

strtoaddr.hD22-Nov-2023992 242

tcp.hD22-Nov-20235 KiB161114

tcpdump.1.inD22-Nov-202360.8 KiB1,9671,937

tcpdump.cD22-Nov-202368.3 KiB2,6451,840

timeval-operations.hD22-Nov-20233.2 KiB7941

udp.hD22-Nov-20238.3 KiB317276

util-print.cD22-Nov-202323.2 KiB952604

version.cD22-Nov-202332 21

vfprintf.cD22-Nov-20231.6 KiB5524

README

1# tcpdump
2
3[![Build
4Status](https://travis-ci.org/the-tcpdump-group/tcpdump.png)](https://travis-ci.org/the-tcpdump-group/tcpdump)
5
6To report a security issue please send an e-mail to security@tcpdump.org.
7
8To report bugs and other problems, contribute patches, request a
9feature, provide generic feedback etc please see the file
10CONTRIBUTING in the tcpdump source tree root.
11
12TCPDUMP 4.x.y
13Now maintained by "The Tcpdump Group"
14See 		www.tcpdump.org
15
16Anonymous Git is available via:
17
18	git clone git://bpf.tcpdump.org/tcpdump
19
20formerly from 	Lawrence Berkeley National Laboratory
21		Network Research Group <tcpdump@ee.lbl.gov>
22		ftp://ftp.ee.lbl.gov/old/tcpdump.tar.Z (3.4)
23
24This directory contains source code for tcpdump, a tool for network
25monitoring and data acquisition.  This software was originally
26developed by the Network Research Group at the Lawrence Berkeley
27National Laboratory.  The original distribution is available via
28anonymous ftp to `ftp.ee.lbl.gov`, in `tcpdump.tar.Z`.  More recent
29development is performed at tcpdump.org, http://www.tcpdump.org/
30
31Tcpdump uses libpcap, a system-independent interface for user-level
32packet capture.  Before building tcpdump, you must first retrieve and
33build libpcap, also originally from LBL and now being maintained by
34tcpdump.org; see http://www.tcpdump.org/ .
35
36Once libpcap is built (either install it or make sure it's in
37`../libpcap`), you can build tcpdump using the procedure in the `INSTALL.txt`
38file.
39
40The program is loosely based on SMI's "etherfind" although none of the
41etherfind code remains.  It was originally written by Van Jacobson as
42part of an ongoing research project to investigate and improve tcp and
43internet gateway performance.  The parts of the program originally
44taken from Sun's etherfind were later re-written by Steven McCanne of
45LBL.  To insure that there would be no vestige of proprietary code in
46tcpdump, Steve wrote these pieces from the specification given by the
47manual entry, with no access to the source of tcpdump or etherfind.
48
49Over the past few years, tcpdump has been steadily improved by the
50excellent contributions from the Internet community (just browse
51through the `CHANGES` file).  We are grateful for all the input.
52
53Richard Stevens gives an excellent treatment of the Internet protocols
54in his book *"TCP/IP Illustrated, Volume 1"*. If you want to learn more
55about tcpdump and how to interpret its output, pick up this book.
56
57Some tools for viewing and analyzing tcpdump trace files are available
58from the Internet Traffic Archive:
59
60* http://www.sigcomm.org/ITA/
61
62Another tool that tcpdump users might find useful is tcpslice:
63
64* https://github.com/the-tcpdump-group/tcpslice
65
66It is a program that can be used to extract portions of tcpdump binary
67trace files. See the above distribution for further details and
68documentation.
69
70Current versions can be found at www.tcpdump.org.
71
72 - The TCPdump team
73
74original text by: Steve McCanne, Craig Leres, Van Jacobson
75
76-------------------------------------
77```
78This directory also contains some short awk programs intended as
79examples of ways to reduce tcpdump data when you're tracking
80particular network problems:
81
82send-ack.awk
83	Simplifies the tcpdump trace for an ftp (or other unidirectional
84	tcp transfer).  Since we assume that one host only sends and
85	the other only acks, all address information is left off and
86	we just note if the packet is a "send" or an "ack".
87
88	There is one output line per line of the original trace.
89	Field 1 is the packet time in decimal seconds, relative
90	to the start of the conversation.  Field 2 is delta-time
91	from last packet.  Field 3 is packet type/direction.
92	"Send" means data going from sender to receiver, "ack"
93	means an ack going from the receiver to the sender.  A
94	preceding "*" indicates that the data is a retransmission.
95	A preceding "-" indicates a hole in the sequence space
96	(i.e., missing packet(s)), a "#" means an odd-size (not max
97	seg size) packet.  Field 4 has the packet flags
98	(same format as raw trace).  Field 5 is the sequence
99	number (start seq. num for sender, next expected seq number
100	for acks).  The number in parens following an ack is
101	the delta-time from the first send of the packet to the
102	ack.  A number in parens following a send is the
103	delta-time from the first send of the packet to the
104	current send (on duplicate packets only).  Duplicate
105	sends or acks have a number in square brackets showing
106	the number of duplicates so far.
107
108	Here is a short sample from near the start of an ftp:
109		3.00    0.20   send . 512
110		3.20    0.20    ack . 1024  (0.20)
111		3.20    0.00   send P 1024
112		3.40    0.20    ack . 1536  (0.20)
113		3.80    0.40 * send . 0  (3.80) [2]
114		3.82    0.02 *  ack . 1536  (0.62) [2]
115	Three seconds into the conversation, bytes 512 through 1023
116	were sent.  200ms later they were acked.  Shortly thereafter
117	bytes 1024-1535 were sent and again acked after 200ms.
118	Then, for no apparent reason, 0-511 is retransmitted, 3.8
119	seconds after its initial send (the round trip time for this
120	ftp was 1sec, +-500ms).  Since the receiver is expecting
121	1536, 1536 is re-acked when 0 arrives.
122
123packetdat.awk
124	Computes chunk summary data for an ftp (or similar
125	unidirectional tcp transfer). [A "chunk" refers to
126	a chunk of the sequence space -- essentially the packet
127	sequence number divided by the max segment size.]
128
129	A summary line is printed showing the number of chunks,
130	the number of packets it took to send that many chunks
131	(if there are no lost or duplicated packets, the number
132	of packets should equal the number of chunks) and the
133	number of acks.
134
135	Following the summary line is one line of information
136	per chunk.  The line contains eight fields:
137	   1 - the chunk number
138	   2 - the start sequence number for this chunk
139	   3 - time of first send
140	   4 - time of last send
141	   5 - time of first ack
142	   6 - time of last ack
143	   7 - number of times chunk was sent
144	   8 - number of times chunk was acked
145	(all times are in decimal seconds, relative to the start
146	of the conversation.)
147
148	As an example, here is the first part of the output for
149	an ftp trace:
150
151	# 134 chunks.  536 packets sent.  508 acks.
152	1       1       0.00    5.80    0.20    0.20    4       1
153	2       513     0.28    6.20    0.40    0.40    4       1
154	3       1025    1.16    6.32    1.20    1.20    4       1
155	4       1561    1.86    15.00   2.00    2.00    6       1
156	5       2049    2.16    15.44   2.20    2.20    5       1
157	6       2585    2.64    16.44   2.80    2.80    5       1
158	7       3073    3.00    16.66   3.20    3.20    4       1
159	8       3609    3.20    17.24   3.40    5.82    4       11
160	9       4097    6.02    6.58    6.20    6.80    2       5
161
162	This says that 134 chunks were transferred (about 70K
163	since the average packet size was 512 bytes).  It took
164	536 packets to transfer the data (i.e., on the average
165	each chunk was transmitted four times).  Looking at,
166	say, chunk 4, we see it represents the 512 bytes of
167	sequence space from 1561 to 2048.  It was first sent
168	1.86 seconds into the conversation.  It was last
169	sent 15 seconds into the conversation and was sent
170	a total of 6 times (i.e., it was retransmitted every
171	2 seconds on the average).  It was acked once, 140ms
172	after it first arrived.
173
174stime.awk
175atime.awk
176	Output one line per send or ack, respectively, in the form
177		<time> <seq. number>
178	where <time> is the time in seconds since the start of the
179	transfer and <seq. number> is the sequence number being sent
180	or acked.  I typically plot this data looking for suspicious
181	patterns.
182
183
184The problem I was looking at was the bulk-data-transfer
185throughput of medium delay network paths (1-6 sec.  round trip
186time) under typical DARPA Internet conditions.  The trace of the
187ftp transfer of a large file was used as the raw data source.
188The method was:
189
190  - On a local host (but not the Sun running tcpdump), connect to
191    the remote ftp.
192
193  - On the monitor Sun, start the trace going.  E.g.,
194      tcpdump host local-host and remote-host and port ftp-data >tracefile
195
196  - On local, do either a get or put of a large file (~500KB),
197    preferably to the null device (to minimize effects like
198    closing the receive window while waiting for a disk write).
199
200  - When transfer is finished, stop tcpdump.  Use awk to make up
201    two files of summary data (maxsize is the maximum packet size,
202    tracedata is the file of tcpdump tracedata):
203      awk -f send-ack.awk packetsize=avgsize tracedata >sa
204      awk -f packetdat.awk packetsize=avgsize tracedata >pd
205
206  - While the summary data files are printing, take a look at
207    how the transfer behaved:
208      awk -f stime.awk tracedata | xgraph
209    (90% of what you learn seems to happen in this step).
210
211  - Do all of the above steps several times, both directions,
212    at different times of day, with different protocol
213    implementations on the other end.
214
215  - Using one of the Unix data analysis packages (in my case,
216    S and Gary Perlman's Unix|Stat), spend a few months staring
217    at the data.
218
219  - Change something in the local protocol implementation and
220    redo the steps above.
221
222  - Once a week, tell your funding agent that you're discovering
223    wonderful things and you'll write up that research report
224    "real soon now".
225```
226

README.md

1# tcpdump
2
3[![Build
4Status](https://travis-ci.org/the-tcpdump-group/tcpdump.png)](https://travis-ci.org/the-tcpdump-group/tcpdump)
5
6To report a security issue please send an e-mail to security@tcpdump.org.
7
8To report bugs and other problems, contribute patches, request a
9feature, provide generic feedback etc please see the file
10CONTRIBUTING in the tcpdump source tree root.
11
12TCPDUMP 4.x.y
13Now maintained by "The Tcpdump Group"
14See 		www.tcpdump.org
15
16Anonymous Git is available via:
17
18	git clone git://bpf.tcpdump.org/tcpdump
19
20formerly from 	Lawrence Berkeley National Laboratory
21		Network Research Group <tcpdump@ee.lbl.gov>
22		ftp://ftp.ee.lbl.gov/old/tcpdump.tar.Z (3.4)
23
24This directory contains source code for tcpdump, a tool for network
25monitoring and data acquisition.  This software was originally
26developed by the Network Research Group at the Lawrence Berkeley
27National Laboratory.  The original distribution is available via
28anonymous ftp to `ftp.ee.lbl.gov`, in `tcpdump.tar.Z`.  More recent
29development is performed at tcpdump.org, http://www.tcpdump.org/
30
31Tcpdump uses libpcap, a system-independent interface for user-level
32packet capture.  Before building tcpdump, you must first retrieve and
33build libpcap, also originally from LBL and now being maintained by
34tcpdump.org; see http://www.tcpdump.org/ .
35
36Once libpcap is built (either install it or make sure it's in
37`../libpcap`), you can build tcpdump using the procedure in the `INSTALL.txt`
38file.
39
40The program is loosely based on SMI's "etherfind" although none of the
41etherfind code remains.  It was originally written by Van Jacobson as
42part of an ongoing research project to investigate and improve tcp and
43internet gateway performance.  The parts of the program originally
44taken from Sun's etherfind were later re-written by Steven McCanne of
45LBL.  To insure that there would be no vestige of proprietary code in
46tcpdump, Steve wrote these pieces from the specification given by the
47manual entry, with no access to the source of tcpdump or etherfind.
48
49Over the past few years, tcpdump has been steadily improved by the
50excellent contributions from the Internet community (just browse
51through the `CHANGES` file).  We are grateful for all the input.
52
53Richard Stevens gives an excellent treatment of the Internet protocols
54in his book *"TCP/IP Illustrated, Volume 1"*. If you want to learn more
55about tcpdump and how to interpret its output, pick up this book.
56
57Some tools for viewing and analyzing tcpdump trace files are available
58from the Internet Traffic Archive:
59
60* http://www.sigcomm.org/ITA/
61
62Another tool that tcpdump users might find useful is tcpslice:
63
64* https://github.com/the-tcpdump-group/tcpslice
65
66It is a program that can be used to extract portions of tcpdump binary
67trace files. See the above distribution for further details and
68documentation.
69
70Current versions can be found at www.tcpdump.org.
71
72 - The TCPdump team
73
74original text by: Steve McCanne, Craig Leres, Van Jacobson
75
76-------------------------------------
77```
78This directory also contains some short awk programs intended as
79examples of ways to reduce tcpdump data when you're tracking
80particular network problems:
81
82send-ack.awk
83	Simplifies the tcpdump trace for an ftp (or other unidirectional
84	tcp transfer).  Since we assume that one host only sends and
85	the other only acks, all address information is left off and
86	we just note if the packet is a "send" or an "ack".
87
88	There is one output line per line of the original trace.
89	Field 1 is the packet time in decimal seconds, relative
90	to the start of the conversation.  Field 2 is delta-time
91	from last packet.  Field 3 is packet type/direction.
92	"Send" means data going from sender to receiver, "ack"
93	means an ack going from the receiver to the sender.  A
94	preceding "*" indicates that the data is a retransmission.
95	A preceding "-" indicates a hole in the sequence space
96	(i.e., missing packet(s)), a "#" means an odd-size (not max
97	seg size) packet.  Field 4 has the packet flags
98	(same format as raw trace).  Field 5 is the sequence
99	number (start seq. num for sender, next expected seq number
100	for acks).  The number in parens following an ack is
101	the delta-time from the first send of the packet to the
102	ack.  A number in parens following a send is the
103	delta-time from the first send of the packet to the
104	current send (on duplicate packets only).  Duplicate
105	sends or acks have a number in square brackets showing
106	the number of duplicates so far.
107
108	Here is a short sample from near the start of an ftp:
109		3.00    0.20   send . 512
110		3.20    0.20    ack . 1024  (0.20)
111		3.20    0.00   send P 1024
112		3.40    0.20    ack . 1536  (0.20)
113		3.80    0.40 * send . 0  (3.80) [2]
114		3.82    0.02 *  ack . 1536  (0.62) [2]
115	Three seconds into the conversation, bytes 512 through 1023
116	were sent.  200ms later they were acked.  Shortly thereafter
117	bytes 1024-1535 were sent and again acked after 200ms.
118	Then, for no apparent reason, 0-511 is retransmitted, 3.8
119	seconds after its initial send (the round trip time for this
120	ftp was 1sec, +-500ms).  Since the receiver is expecting
121	1536, 1536 is re-acked when 0 arrives.
122
123packetdat.awk
124	Computes chunk summary data for an ftp (or similar
125	unidirectional tcp transfer). [A "chunk" refers to
126	a chunk of the sequence space -- essentially the packet
127	sequence number divided by the max segment size.]
128
129	A summary line is printed showing the number of chunks,
130	the number of packets it took to send that many chunks
131	(if there are no lost or duplicated packets, the number
132	of packets should equal the number of chunks) and the
133	number of acks.
134
135	Following the summary line is one line of information
136	per chunk.  The line contains eight fields:
137	   1 - the chunk number
138	   2 - the start sequence number for this chunk
139	   3 - time of first send
140	   4 - time of last send
141	   5 - time of first ack
142	   6 - time of last ack
143	   7 - number of times chunk was sent
144	   8 - number of times chunk was acked
145	(all times are in decimal seconds, relative to the start
146	of the conversation.)
147
148	As an example, here is the first part of the output for
149	an ftp trace:
150
151	# 134 chunks.  536 packets sent.  508 acks.
152	1       1       0.00    5.80    0.20    0.20    4       1
153	2       513     0.28    6.20    0.40    0.40    4       1
154	3       1025    1.16    6.32    1.20    1.20    4       1
155	4       1561    1.86    15.00   2.00    2.00    6       1
156	5       2049    2.16    15.44   2.20    2.20    5       1
157	6       2585    2.64    16.44   2.80    2.80    5       1
158	7       3073    3.00    16.66   3.20    3.20    4       1
159	8       3609    3.20    17.24   3.40    5.82    4       11
160	9       4097    6.02    6.58    6.20    6.80    2       5
161
162	This says that 134 chunks were transferred (about 70K
163	since the average packet size was 512 bytes).  It took
164	536 packets to transfer the data (i.e., on the average
165	each chunk was transmitted four times).  Looking at,
166	say, chunk 4, we see it represents the 512 bytes of
167	sequence space from 1561 to 2048.  It was first sent
168	1.86 seconds into the conversation.  It was last
169	sent 15 seconds into the conversation and was sent
170	a total of 6 times (i.e., it was retransmitted every
171	2 seconds on the average).  It was acked once, 140ms
172	after it first arrived.
173
174stime.awk
175atime.awk
176	Output one line per send or ack, respectively, in the form
177		<time> <seq. number>
178	where <time> is the time in seconds since the start of the
179	transfer and <seq. number> is the sequence number being sent
180	or acked.  I typically plot this data looking for suspicious
181	patterns.
182
183
184The problem I was looking at was the bulk-data-transfer
185throughput of medium delay network paths (1-6 sec.  round trip
186time) under typical DARPA Internet conditions.  The trace of the
187ftp transfer of a large file was used as the raw data source.
188The method was:
189
190  - On a local host (but not the Sun running tcpdump), connect to
191    the remote ftp.
192
193  - On the monitor Sun, start the trace going.  E.g.,
194      tcpdump host local-host and remote-host and port ftp-data >tracefile
195
196  - On local, do either a get or put of a large file (~500KB),
197    preferably to the null device (to minimize effects like
198    closing the receive window while waiting for a disk write).
199
200  - When transfer is finished, stop tcpdump.  Use awk to make up
201    two files of summary data (maxsize is the maximum packet size,
202    tracedata is the file of tcpdump tracedata):
203      awk -f send-ack.awk packetsize=avgsize tracedata >sa
204      awk -f packetdat.awk packetsize=avgsize tracedata >pd
205
206  - While the summary data files are printing, take a look at
207    how the transfer behaved:
208      awk -f stime.awk tracedata | xgraph
209    (90% of what you learn seems to happen in this step).
210
211  - Do all of the above steps several times, both directions,
212    at different times of day, with different protocol
213    implementations on the other end.
214
215  - Using one of the Unix data analysis packages (in my case,
216    S and Gary Perlman's Unix|Stat), spend a few months staring
217    at the data.
218
219  - Change something in the local protocol implementation and
220    redo the steps above.
221
222  - Once a week, tell your funding agent that you're discovering
223    wonderful things and you'll write up that research report
224    "real soon now".
225```
226

README.version

1URL: http://www.tcpdump.org/release/tcpdump-4.9.2.tar.gz
2Version: 4.9.2
3BugComponent: 119452
4

Readme.Win32

1To build tcpdump under Windows, you need:
2
3- version 6 (or higher) of Microsoft Visual Studio or the Cygnus gnu
4C compiler.
5- The November 2001 (or later) edition of Microsoft Platform
6Software Development Kit (SDK), that contains some necessary includes
7for IPv6 support. You can download it from http://www.microsoft.com/sdk
8- the WinPcap source code, that includes libpcap for win32. Download it
9from http://winpcap.polito.it or download libpcap sources from
10http://www.tcpdump.org and follow the instructions in the README.Win32
11file.
12
13First, extract tcpdump and WinPcap in the same folder, and build WinPcap.
14
15The Visual Studio project and the cygwin makefile are in the Win32\prj
16folder.
17
18From Visual Studio, open windump.dsw and build the program. The release
19version of the WinDump.exe executable file will be created in the
20windump\win32\prj\release directory . The debug version will be generated
21in windump\win32\prj\debug.
22
23From cygnus, go to windump\win32\prj\ and type "make". WinDump.exe will be
24created in the same directory.