Skip to content

Commit 6919d37

Browse files
committed
wireshark example
Signed-off-by: Larry Peterson <llp@cs.princeton.edu>
1 parent a81c1e9 commit 6919d37

2 files changed

Lines changed: 46 additions & 8 deletions

File tree

operations/figures/wireshark.png

646 KB
Loading

operations/telemetry.rst

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,54 @@ for the sake of troubleshooting a problem; continually collecting a
9898
packet trace will eventually overflow the available backing store. The
9999
most common tool for doing this is a program called ``tcpdump``,
100100
although it can be configured to capture more than just TCP packets.
101-
The output is a format known as ``pcap`` (for packet capture), where
102-
various graphical tools, most notably *Wireshark*, can then be used to
103-
parse the packet headers and display their fields.
101+
For example, the following command captures and displays all packets
102+
exchanged with any remote web server at port ``443``:
103+
104+
.. code-block:: shell
105+
106+
$ sudo tcpdump -i en0 -n tcp port 443
107+
108+
The command captures packets at the network interface (``en0`` in this
109+
example), which means it needs to be executed with superuser
110+
priviledge (hence the ``sudo``). If you try this on your laptop you
111+
will see a surprising amount of traffic, even if you are not actively
112+
using your web brower. This points to how much background network
113+
activity is always running. An alternative is to specify a particular
114+
web server, and then refresh a page for that site in your browser; for
115+
example:
116+
117+
.. code-block:: shell
118+
119+
$ sudo tcpdump -i en0 -n host book.systemsapproach.org
120+
121+
In this case, you will see TCP and TLS packets, but not the HTTP
122+
payloads they carry. This is because the end-to-end traffic is
123+
encrypted by TLS, which points to a major limit in analyzing network
124+
traffic: much of the packet payloads are not visible.
125+
126+
As a final step in this exploration, note that there are tools to help
127+
capture and filter packets. *Wireshark* is a notable example, with
128+
:numref:`Figure %s <fig-wireshark>` showing an example display. In
129+
this case, we have configured Wireshark to watch for traffic to and
130+
from host ``example.com``, a web server that can be accessed using
131+
HTTP rather than HTTPS. (This server is maintained by IANA for exactly
132+
this purpose.)
133+
134+
.. _fig-wireshark:
135+
.. figure:: operations/figures/wireshark.png
136+
:width: 700px
137+
:align: center
138+
139+
Example packet trace using Wireshark. Because web site example.com
140+
is accessible using HTTP, the GET request and OK response are
141+
visible. The GET packet has been selected in the upper panel, with
142+
its contents summarized in the lower left panel.
143+
104144

105145
.. admonition:: Further Reading
106146

107147
`Wireshark <https://www.wireshark.org/>`__.
108148

109-
.. TODO -- Seems like we should say more about Wireshark and/or
110-
pcap. Maybe include an example or two. An alternative is to include
111-
examples in the "resources" repo, and just reference them here.
112-
113149
Beyond troubleshooting, packet capture is not a practical approach to
114150
analyzing traffic. Simply deciding what flows are currently active,
115151
and which flow a given packet belongs to, is an expensive operation.
@@ -154,6 +190,8 @@ displays of the collected data.
154190
examples (e.g., spike in traffic to UDP port 53), or capacity
155191
planning.
156192
193+
.. TODO -- Candidate "System Thinking" paragraph
194+
157195
One takeaway from this discussion is that packet tracing in intrusive,
158196
and can easily impact the performance of the network data plane. Care
159197
must be taken to limit its duration (it's only activated to
@@ -270,7 +308,7 @@ to determine which flows shared buffer capacity at each switch.
270308
.. _reading_int:
271309
.. admonition:: Further Reading
272310

273-
X. Chen, et. al. `Fine-grained queue measurement in the data plane
311+
X. Chen et al. `Fine-grained queue measurement in the data plane
274312
<https://p4.org/p4/conquest>`__. ACM CoNEXT'19, December 2019.
275313

276314
Similarly, packets can report the decision making process that

0 commit comments

Comments
 (0)