• Home
Name Date Size #Lines LOC

..--

lbl/03-May-2024-302205

missing/03-May-2024-1,7531,151

tests/03-May-2024-371,994371,120

win32/03-May-2024-5,1704,860

.gitattributesD03-May-2024573 2723

.gitignoreD03-May-2024179 1918

Android.bpD03-May-20245.1 KiB212207

CHANGESD03-May-202456.8 KiB1,4471,197

CONTRIBUTINGD03-May-20245.9 KiB152113

CREDITSD03-May-202414.6 KiB239233

CleanSpec.mkD03-May-20242.2 KiB500

INSTALL.txtD03-May-20245.2 KiB124115

LICENSED03-May-2024873 2016

MODULE_LICENSE_BSDD03-May-20240

Makefile-devel-addsD03-May-2024614 2318

Makefile.inD03-May-202410 KiB464386

NOTICED03-May-2024873 2016

OWNERSD03-May-202446 21

PLATFORMSD03-May-2024567 1714

READMED03-May-20249 KiB226182

README.mdD03-May-20249 KiB226182

README.versionD03-May-202493 43

Readme.Win32D03-May-20241 KiB2419

VERSIOND03-May-20246 21

aclocal.m4D03-May-202440.4 KiB1,3621,292

addrtoname.cD03-May-202432.8 KiB1,2861,034

addrtoname.hD03-May-20242.8 KiB6330

addrtostr.cD03-May-20245.6 KiB214132

addrtostr.hD03-May-20242 KiB432

af.cD03-May-20242 KiB5938

af.hD03-May-20241.8 KiB5627

ah.hD03-May-20242.3 KiB5816

appletalk.hD03-May-20244.1 KiB167103

ascii_strcasecmp.cD03-May-20243.5 KiB10666

ascii_strcasecmp.hD03-May-20241.5 KiB346

atime.awkD03-May-2024529 199

atm.hD03-May-20241.1 KiB326

bpf_dump.cD03-May-20241.9 KiB6235

chdlc.hD03-May-20241.3 KiB275

checksum.cD03-May-20245.3 KiB190118

config.guessD03-May-202442.3 KiB1,4361,243

config.hD03-May-202412 KiB39670

config.h.inD03-May-202411.5 KiB398271

config.subD03-May-202435.2 KiB1,8081,670

configureD03-May-2024257.9 KiB9,6667,585

configure.inD03-May-202425.7 KiB1,018945

cpack.cD03-May-20243.9 KiB15681

cpack.hD03-May-20242.4 KiB5720

ether.hD03-May-20242.3 KiB588

ethertype.hD03-May-20245.6 KiB204163

extract.hD03-May-202411.5 KiB287137

funcattrs.hD03-May-20244.4 KiB12335

getopt_long.hD03-May-20242.4 KiB6718

gmpls.cD03-May-20245.8 KiB193145

gmpls.hD03-May-20241.4 KiB3417

gmt2local.cD03-May-20242 KiB6728

gmt2local.hD03-May-20241.2 KiB264

in_cksum.cD03-May-20246.4 KiB20190

install-shD03-May-20245.4 KiB251152

interface.hD03-May-20242.3 KiB8042

ip.hD03-May-20245.7 KiB16583

ip6.hD03-May-20247.6 KiB20294

ipproto.cD03-May-202416.5 KiB363300

ipproto.hD03-May-20244.7 KiB14798

l2vpn.cD03-May-20243.4 KiB9663

l2vpn.hD03-May-2024781 182

llc.hD03-May-20243.7 KiB12384

machdep.cD03-May-20242.6 KiB7531

machdep.hD03-May-20241.2 KiB264

makemibD03-May-20246.4 KiB248186

mib.hD03-May-202426.3 KiB1,4611,450

mkdepD03-May-20242.4 KiB11366

mpls.hD03-May-20241.9 KiB4212

nameser.hD03-May-202410.8 KiB301172

netdissect-stdinc.hD03-May-20249.9 KiB410223

netdissect.cD03-May-20243.4 KiB14777

netdissect.hD03-May-202430 KiB658433

nfs.hD03-May-202413.4 KiB439312

nfsfh.hD03-May-20242.6 KiB6713

nlpid.cD03-May-20241.3 KiB4224

nlpid.hD03-May-20241.3 KiB3316

openflow.hD03-May-20242.1 KiB5215

ospf.hD03-May-202410.2 KiB326221

oui.cD03-May-20243.8 KiB10574

oui.hD03-May-20244.1 KiB9264

packetdat.awkD03-May-20241.4 KiB6247

parsenfsfh.cD03-May-202412.9 KiB483296

pcap-missing.hD03-May-20241.8 KiB5016

pcap_dump_ftell.cD03-May-20241.3 KiB328

ppp.hD03-May-20243.1 KiB6945

print-802_11.cD03-May-202491.2 KiB3,3662,369

print-802_15_4.cD03-May-20245.5 KiB224160

print-ah.cD03-May-20242 KiB6530

print-ahcp.cD03-May-202410.7 KiB412327

print-aodv.cD03-May-202416 KiB540437

print-aoe.cD03-May-202411.1 KiB431322

print-ap1394.cD03-May-20244 KiB12670

print-arcnet.cD03-May-20248.8 KiB361217

print-arp.cD03-May-202414.6 KiB481356

print-ascii.cD03-May-20246.2 KiB210142

print-atalk.cD03-May-202416.8 KiB662512

print-atm.cD03-May-202416.8 KiB556361

print-babel.cD03-May-202423.7 KiB718594

print-beep.cD03-May-20241.7 KiB6937

print-bfd.cD03-May-202416.2 KiB407249

print-bgp.cD03-May-202498.5 KiB2,8622,329

print-bootp.cD03-May-202430 KiB1,095864

print-bt.cD03-May-20242.2 KiB7229

print-calm-fast.cD03-May-20241.8 KiB7631

print-carp.cD03-May-20242.4 KiB8440

print-cdp.cD03-May-202411.2 KiB405309

print-cfm.cD03-May-202424.2 KiB765555

print-chdlc.cD03-May-20245.9 KiB211145

print-cip.cD03-May-20242.5 KiB10950

print-cnfp.cD03-May-202413.7 KiB475340

print-dccp.cD03-May-202416.4 KiB660535

print-decnet.cD03-May-202438.3 KiB1,2741,105

print-dhcp6.cD03-May-202423.2 KiB833712

print-domain.cD03-May-202418.3 KiB750636

print-dtp.cD03-May-20243 KiB12976

print-dvmrp.cD03-May-20248.9 KiB368293

print-eap.cD03-May-20249.3 KiB305224

print-egp.cD03-May-20248.7 KiB377319

print-eigrp.cD03-May-202419.3 KiB523421

print-enc.cD03-May-20244.2 KiB13956

print-esp.cD03-May-202420.3 KiB836545

print-ether.cD03-May-202412.9 KiB464312

print-fddi.cD03-May-202410.5 KiB346203

print-forces.cD03-May-202445 KiB1,7611,407

print-fr.cD03-May-202431.7 KiB1,143721

print-frag6.cD03-May-20242.4 KiB7138

print-ftp.cD03-May-2024973 3313

print-geneve.cD03-May-20246.1 KiB238156

print-geonet.cD03-May-20246.7 KiB287204

print-gre.cD03-May-20249.7 KiB423322

print-hncp.cD03-May-202426.2 KiB864715

print-hsrp.cD03-May-20244.6 KiB13673

print-http.cD03-May-20241.5 KiB7854

print-icmp.cD03-May-202422.6 KiB703527

print-icmp6.cD03-May-202459.6 KiB1,9571,627

print-igmp.cD03-May-202410.1 KiB342275

print-igrp.cD03-May-20244.6 KiB156107

print-ip.cD03-May-202416.9 KiB736532

print-ip6.cD03-May-202410.6 KiB424282

print-ip6opts.cD03-May-20245.5 KiB214163

print-ipcomp.cD03-May-20242.3 KiB7025

print-ipfc.cD03-May-20244.4 KiB14665

print-ipnet.cD03-May-20242.5 KiB11880

print-ipx.cD03-May-20246.4 KiB239179

print-isakmp.cD03-May-202481.7 KiB3,1462,487

print-isoclns.cD03-May-2024107.6 KiB3,1852,610

print-juniper.cD03-May-202448.3 KiB1,5091,250

print-krb.cD03-May-20246.3 KiB259195

print-l2tp.cD03-May-202425 KiB881743

print-lane.cD03-May-20243 KiB12569

print-ldp.cD03-May-202423.9 KiB699504

print-lisp.cD03-May-202415.2 KiB450281

print-llc.cD03-May-202416.7 KiB615389

print-lldp.cD03-May-202457.3 KiB1,6621,360

print-lmp.cD03-May-202437.6 KiB1,140926

print-loopback.cD03-May-20243.6 KiB13783

print-lspping.cD03-May-202451.6 KiB1,086689

print-lwapp.cD03-May-202413 KiB350234

print-lwres.cD03-May-202414.1 KiB596412

print-m3ua.cD03-May-202410.9 KiB340239

print-medsa.cD03-May-20245.6 KiB197130

print-mobile.cD03-May-20243.3 KiB10450

print-mobility.cD03-May-20249.7 KiB345260

print-mpcp.cD03-May-20247.9 KiB260196

print-mpls.cD03-May-20245.3 KiB223127

print-mptcp.cD03-May-202413.7 KiB447333

print-msdp.cD03-May-20242.7 KiB10470

print-msnlb.cD03-May-20242.4 KiB6628

print-nflog.cD03-May-20244.4 KiB169103

print-nfs.cD03-May-202442.8 KiB1,7161,407

print-nsh.cD03-May-20245.4 KiB186126

print-ntp.cD03-May-202413.3 KiB428262

print-null.cD03-May-20244 KiB14866

print-olsr.cD03-May-202423.4 KiB720497

print-openflow-1.0.cD03-May-202476.6 KiB2,5611,998

print-openflow.cD03-May-20244.8 KiB14382

print-ospf.cD03-May-202439.5 KiB1,210997

print-ospf6.cD03-May-202429.8 KiB1,015802

print-otv.cD03-May-20242.1 KiB7330

print-pflog.cD03-May-20244.8 KiB186129

print-pgm.cD03-May-202422.2 KiB839707

print-pim.cD03-May-202432.6 KiB1,196922

print-pktap.cD03-May-20245.2 KiB17497

print-ppi.cD03-May-20242.6 KiB13087

print-ppp.cD03-May-202446.2 KiB1,8771,491

print-pppoe.cD03-May-20245.7 KiB202142

print-pptp.cD03-May-202425.9 KiB1,007810

print-radius.cD03-May-202435.1 KiB994770

print-raw.cD03-May-20241.5 KiB4613

print-resp.cD03-May-202416.5 KiB543308

print-rip.cD03-May-20249.2 KiB274188

print-ripng.cD03-May-20246 KiB184119

print-rpki-rtr.cD03-May-202410.8 KiB409251

print-rrcp.cD03-May-20244.6 KiB13088

print-rsvp.cD03-May-202478.5 KiB1,9911,666

print-rt6.cD03-May-20242.7 KiB9454

print-rtsp.cD03-May-20241.2 KiB4827

print-rx.cD03-May-202466.9 KiB2,8942,140

print-sctp.cD03-May-202423.1 KiB818571

print-sflow.cD03-May-202431.5 KiB992781

print-sip.cD03-May-20241.3 KiB5531

print-sl.cD03-May-20246.6 KiB277191

print-sll.cD03-May-20248.9 KiB311137

print-slow.cD03-May-202425.2 KiB745575

print-smb.cD03-May-202442.9 KiB1,4991,232

print-smtp.cD03-May-2024983 3313

print-snmp.cD03-May-202443.2 KiB1,9401,458

print-stp.cD03-May-202417.2 KiB511344

print-sunatm.cD03-May-20243.3 KiB10950

print-sunrpc.cD03-May-20247.8 KiB251123

print-symantec.cD03-May-20243.8 KiB11566

print-syslog.cD03-May-20244 KiB147101

print-tcp.cD03-May-202435.5 KiB921709

print-telnet.cD03-May-202415 KiB558413

print-tftp.cD03-May-20245.2 KiB204136

print-timed.cD03-May-20244.7 KiB151101

print-tipc.cD03-May-202411.5 KiB386314

print-token.cD03-May-20248 KiB251146

print-udld.cD03-May-20245.5 KiB199109

print-udp.cD03-May-202421.3 KiB719606

print-usb.cD03-May-20244.2 KiB177116

print-vjc.cD03-May-20244.4 KiB12142

print-vqp.cD03-May-20246.8 KiB212146

print-vrrp.cD03-May-20246.3 KiB18495

print-vtp.cD03-May-202413.6 KiB404232

print-vxlan-gpe.cD03-May-20243.5 KiB11458

print-vxlan.cD03-May-20242.2 KiB7528

print-wb.cD03-May-202410.9 KiB459338

print-zephyr.cD03-May-20248 KiB337258

print-zeromq.cD03-May-20247.5 KiB221112

print.cD03-May-202411.5 KiB478345

print.hD03-May-20241.8 KiB4511

rpc_auth.hD03-May-20242.7 KiB7920

rpc_msg.hD03-May-20243.2 KiB12856

rpl.hD03-May-20244.9 KiB175126

send-ack.awkD03-May-20241.6 KiB6957

setsignal.cD03-May-20243.3 KiB9132

setsignal.hD03-May-20241.2 KiB264

signature.cD03-May-20245.6 KiB215105

signature.hD03-May-20241.1 KiB308

slcompress.hD03-May-20243.6 KiB8614

smb.hD03-May-20245.4 KiB12395

smbutil.cD03-May-202462.9 KiB1,8941,725

stime.awkD03-May-2024567 2010

strtoaddr.cD03-May-20245.3 KiB240148

strtoaddr.hD03-May-2024992 242

tcp.hD03-May-20245 KiB161114

tcpdump.1.inD03-May-202460.8 KiB1,9671,937

tcpdump.cD03-May-202468.3 KiB2,6451,840

timeval-operations.hD03-May-20243.2 KiB7941

udp.hD03-May-20248.3 KiB317276

util-print.cD03-May-202423.2 KiB952604

version.cD03-May-202432 21

vfprintf.cD03-May-20241.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.