<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Wireshark 101 · Network Doodles</title><link>https://networkdoodles.com/labs/wireshark-101/</link><description>Capture real traffic on a small network and read it in Wireshark: ARP, DHCP through a relay, DNS, a TCP connection from SYN to FIN, what TLS shows without decrypting it, then three broken paths to find from the packets alone. Wireshark runs in your browser, nothing to install.</description><language>en-us</language><managingEditor>David Henderson</managingEditor><lastBuildDate>Mon, 16 Nov 2026 09:00:00 -0500</lastBuildDate><atom:link href="https://networkdoodles.com/labs/wireshark-101/index.xml" rel="self" type="application/rss+xml"/><item><title>The black hole</title><link>https://networkdoodles.com/labs/wireshark-101/task-8-3/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-8-3/</guid><description> new to this? step by stepbeginner make break X=mtu; from the laptop, ping -c 2 web.lab works, curl -m 5 https://web.lab/ doesn’t. make capture AT=laptop:eth1,sw1:eth1 NAME=8.3 X=tls. Filter frame.len &gt; 1514: which interface has them, which doesn’t? Note the frame length. Challenge: who dropped them, and why. make fix, then make check T=8.3. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make break X=mtu</code>; from the laptop, <code>ping -c 2 web.lab</code> works, <code>curl -m 5 https://web.lab/</code> doesn&rsquo;t.</li>
<li><code>make capture AT=laptop:eth1,sw1:eth1 NAME=8.3 X=tls</code>.</li>
<li>Filter <code>frame.len &gt; 1514</code>: which interface has them, which doesn&rsquo;t? Note the frame length.</li>
<li>Challenge: who dropped them, and why. <code>make fix</code>, then <code>make check T=8.3</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>When small packets work and big ones don&rsquo;t</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="mtu">MTU</h3>
<p>Every link has an <strong>MTU</strong> (<em>maximum transmission unit</em>): the biggest packet it can carry in one frame. On
ordinary Ethernet it&rsquo;s <strong>1,500 bytes</strong> of IP packet, which makes a 1,514-byte frame once the Ethernet header is
added. Some networks use <strong>jumbo frames</strong>, often 9,000 bytes, to move data with fewer packets.</p>
<p>At the start of a TCP connection, each side announces its <strong>MSS</strong> (<em>maximum segment size</em>): the biggest chunk of
data it can take, worked out from its own MTU (1,460 bytes for 1,500; 8,960 for 9,000). Each side then sends
segments no bigger than the other&rsquo;s MSS.</p>
<h3 id="the-black-hole">The black hole</h3>
<p>Here&rsquo;s the trap. If two hosts both have jumbo frames, they each announce 8,960, and each happily sends big
segments. But if a link <strong>between</strong> them only takes 1,500, the big frames don&rsquo;t fit. A router would at least be
able to send back an ICMP message saying <em>too big</em> (that&rsquo;s how Path MTU Discovery works). A <strong>switch</strong> can&rsquo;t
send anything: it works at layer 2, has no IP address on the path, and drops the oversized frame without a word.</p>
<p>So small packets (the handshake, ping, DNS) all work, and the first big one disappears. The connection opens and
then hangs. That&rsquo;s called a <strong>black hole</strong>: packets go in and nothing comes out, and nobody&rsquo;s told.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> An MTU mismatch lets small packets through and silently drops big ones: the connection opens, then hangs.</p>
<h3 id="why-tls-finds-it-first">Why TLS finds it first</h3>
<p>Remember task 7.1: the laptop&rsquo;s TLS 1.3 Client Hello is 1,558 bytes, because of its post-quantum key share. On
a normal 1,500-byte link TCP splits it in two, but with the laptop thinking it has 9,000 bytes to play with, it
goes as <strong>one</strong> segment. HTTPS breaks before anything else does, while ping, DNS and plain HTTP requests,
all small, carry on working.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>Sent, sent, sent</h2>
  </header>
  <div class="lab-stage-body">
    <p>Both capture points, TCP only:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">11	laptop:eth1	74	42898 → 443 [SYN] Seq=0 Win=62720 Len=0 MSS=8960 ...
</span></span><span class="line"><span class="cl">12	sw1:eth1	74	[TCP Retransmission] 42898 → 443 [SYN] Seq=0 ... MSS=8960 ...
</span></span><span class="line"><span class="cl">13	sw1:eth1	74	443 → 42898 [SYN, ACK] Seq=0 Ack=1 ... MSS=8960 ...
</span></span><span class="line"><span class="cl">14	laptop:eth1	74	[TCP Retransmission] 443 → 42898 [SYN, ACK] Seq=0 Ack=1 ... MSS=8960 ...
</span></span><span class="line"><span class="cl">15	laptop:eth1	66	42898 → 443 [ACK] Seq=1 Ack=1 ...
</span></span><span class="line"><span class="cl">16	sw1:eth1	66	[TCP Dup ACK 15#1] 42898 → 443 [ACK] Seq=1 Ack=1 ...
</span></span><span class="line"><span class="cl">17	laptop:eth1	1624	Client Hello (SNI=web.lab)
</span></span><span class="line"><span class="cl">18	laptop:eth1	1624	[TCP Retransmission] 42898 → 443 [PSH, ACK] Seq=1 Ack=1 ... Len=1558
</span></span><span class="line"><span class="cl">19	laptop:eth1	1624	[TCP Retransmission] 42898 → 443 [PSH, ACK] Seq=1 Ack=1 ... Len=1558
</span></span><span class="line"><span class="cl">...
</span></span></code></pre></div><p>The third column is the frame length. The handshake crosses both points (the <em>Retransmission</em> and <em>Dup ACK</em>
labels on frames 12 to 16 are the same packets seen twice: task 8.2 explains why to ignore them here). Both sides announced <strong>MSS=8960</strong>. Then
the Client Hello, 1,624 bytes, goes out on the laptop&rsquo;s cable again and again, and never once shows up on
<code>sw1:eth1</code>.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Reproduce it, then capture it</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Break it, in the VS Code tab&rsquo;s terminal:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make <span class="nb">break</span> <span class="nv">X</span><span class="o">=</span>mtu
</span></span></code></pre></div><p>Then see the symptom from the laptop: click <strong>laptop</strong> on the <strong>Topology</strong> tab, and in the <strong>laptop</strong> tab:</p>
<div class="lab-file lab-file-tab mono">
  <span class="lab-file-kind">run in the laptop tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ping -c <span class="m">2</span> web.lab
</span></span><span class="line"><span class="cl">curl -m <span class="m">5</span> https://web.lab/
</span></span><span class="line"><span class="cl">ip link show eth1
</span></span></code></pre></div><p>Ping answers. curl gives up after five seconds. <code>ip link</code> shows <code>mtu 9000</code>.</p>
</li>
<li>
<p>Capture the laptop&rsquo;s cable and the switch&rsquo;s port towards r1 together, while the laptop tries HTTPS:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1,sw1:eth1 <span class="nv">NAME</span><span class="o">=</span>8.3 <span class="nv">X</span><span class="o">=</span>tls
</span></span></code></pre></div></li>
<li>
<p>Open <code>/captures/8.3.pcapng</code> and filter the frames too big for a normal cable:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">frame.len &gt; 1514
</span></span></code></pre></div><p>Note their length, and which interface they&rsquo;re on. Then add <code>&amp;&amp; frame.interface_name == &quot;sw1:eth1&quot;</code>.</p>
</li>
<li>
<p>Fill in the follow-along lines:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/8.3.yml</code><span class="lab-file-how">Ctrl+P → 8.3.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">stuck_frame_bytes</span><span class="p">:</span><span class="w"> </span><span class="m">1624</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">big_frames_past_switch</span><span class="p">:</span><span class="w"> </span><span class="m">0</span><span class="w">
</span></span></span></code></pre></div></li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Who, and why</h2>
  </header>
  <div class="lab-stage-body">
    <ul>
<li><code>dropped_by</code>: the box that dropped the frames;</li>
<li><code>laptop_mtu</code>: the laptop&rsquo;s MTU, the cause.</li>
</ul>
<p>Then put it right with <code>make fix</code>, and try the curl again.</p>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>The frames are on the laptop&rsquo;s cable and not on the far side of the switch. Only one box is in between.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Why didn&rsquo;t anything tell the laptop? Which kinds of device can send ICMP <em>too big</em>?</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/8.3.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=8.3</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">dropped_by</span><span class="p">:</span><span class="w"> </span><span class="l">sw1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">laptop_mtu</span><span class="p">:</span><span class="w"> </span><span class="m">9000</span><span class="w">
</span></span></span></code></pre></div><p>sw1&rsquo;s ports take 1,500-byte packets. A 1,624-byte frame arrived from the laptop, didn&rsquo;t fit, and was dropped.
A switch has no way to say so, so the laptop kept retransmitting into the hole until curl gave up.</p>
<p>The fix is to make every device on a network agree on the MTU: either jumbo frames everywhere on the path, or
nowhere. And the habit to keep: when <em>ping works but the application doesn&rsquo;t</em>, filter <code>frame.len &gt; 1514</code> and
look for frames that are sent over and over and never acknowledged.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>The mystery fault</title><link>https://networkdoodles.com/labs/wireshark-101/task-8-2/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-8-2/</guid><description> new to this? step by stepbeginner make break X=mystery, then make capture AT=laptop:eth1,r1:eth2,r2:eth2 NAME=8.2 X=webip. Filter tcp &amp;&amp; frame.interface_name == "..." for each point in turn. Where does the SYN stop appearing? Does a SYN-ACK appear anywhere? Answer the router and the cause, then make fix and make check T=8.2. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make break X=mystery</code>, then <code>make capture AT=laptop:eth1,r1:eth2,r2:eth2 NAME=8.2 X=webip</code>.</li>
<li>Filter <code>tcp &amp;&amp; frame.interface_name == &quot;...&quot;</code> for each point in turn. Where does the SYN stop appearing? Does a SYN-ACK appear anywhere?</li>
<li>Answer the router and the cause, then <code>make fix</code> and <code>make check T=8.2</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>Divide the path</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="silence-is-a-clue-if-you-know-where-it-starts">Silence is a clue, if you know where it starts</h3>
<p>When a connection to a server <em>just hangs</em>, the client&rsquo;s capture shows one thing: SYNs going out, again and
again, and nothing coming back (task 6.2 told you why that&rsquo;s different from a refusal). The client can&rsquo;t tell
you any more than that. The packets went somewhere, and stopped.</p>
<p>The method is the one you&rsquo;d use for a dead string of Christmas lights: check halfway along. Capture at several
points on the path <strong>at the same time</strong>, then follow one packet from point to point. The fault is between the
last place you see it and the first place you don&rsquo;t.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> Capture at several points at once and follow one packet: the fault is between the last point that saw it and the first that didn&rsquo;t.</p>
<h3 id="two-kinds-of-silence">Two kinds of silence</h3>
<p>On this path, two very different faults look the same from the laptop:</p>
<table>
  <thead>
      <tr>
          <th>Cause</th>
          <th>What happens</th>
          <th>What the captures show</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>acl</strong>: an access list on a router drops the traffic</td>
          <td>the SYN reaches the router and goes no further</td>
          <td>the SYN on the points <em>before</em> the router, on none after it</td>
      </tr>
      <tr>
          <td><strong>route</strong>: a router has no route back to the laptop</td>
          <td>the SYN gets all the way to web; web answers; the answer dies on the way back</td>
          <td>the SYN everywhere, a SYN-ACK leaving web that never reaches the laptop, and an ICMP <em>Network unreachable</em> from that router back to web</td>
      </tr>
  </tbody>
</table>
<p>An <strong>access list</strong> (ACL) is a router&rsquo;s list of <em>permit</em> and <em>deny</em> rules for packets. A router that denies a
packet can tell the sender, with an ICMP <em>administratively prohibited</em> message, or drop it silently. The lab&rsquo;s
fault is set up with <code>no ip unreachables</code>, so it drops silently: the most common setting on real networks, and
the hardest to debug.</p>
<h3 id="a-warning-about-one-file-three-cables">A warning about one file, three cables</h3>
<p>When one packet is captured at three points, it&rsquo;s in your file three times. Wireshark&rsquo;s TCP analysis doesn&rsquo;t
know they&rsquo;re the same packet seen in three places: it marks the second and third copies as
<em>Retransmission</em> or <em>Dup ACK</em>. Filtering the display to one interface doesn&rsquo;t help: the flags were worked
out over the whole file, before the filter. So use <code>frame.interface_name</code> to see <em>where</em> a packet got to, and
don&rsquo;t trust the <code>tcp.analysis</code> flags in a file with several capture points. If you need them, save one
interface&rsquo;s frames to a file of their own (<strong>File › Export Specified Packets</strong>, with that interface&rsquo;s filter
applied) and open that.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>Three points on the path</h2>
  </header>
  <div class="lab-stage-body">
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">  laptop ──[laptop:eth1]── sw1 ── r1 ──[r1:eth2]── r2 ──[r2:eth2]── web
</span></span></code></pre></div><p>The capture points, from the laptop outwards:</p>
<table>
  <thead>
      <tr>
          <th>Point</th>
          <th>What it tells you</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>laptop:eth1</code></td>
          <td>what the laptop sent and received</td>
      </tr>
      <tr>
          <td><code>r1:eth2</code></td>
          <td>what got through r1, heading to r2 (and what came back from r2)</td>
      </tr>
      <tr>
          <td><code>r2:eth2</code></td>
          <td>what got through r2 and reached web&rsquo;s cable (and what web sent)</td>
      </tr>
  </tbody>
</table>
<p>The traffic is <code>X=webip</code>: the laptop opens <code>http://192.168.2.10/</code> by its address, so a DNS problem can&rsquo;t get in
the way. A good capture plan always takes away the things you aren&rsquo;t testing.</p>
<p>Here&rsquo;s how one of the three faults begins, all three points in one listing:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"> 2	laptop:eth1	39608 → 80 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 ...
</span></span><span class="line"><span class="cl"> 3	r1:eth2	[TCP Retransmission] 39608 → 80 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 ...
</span></span><span class="line"><span class="cl"> 4	r2:eth2	[TCP Retransmission] 39608 → 80 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 ...
</span></span><span class="line"><span class="cl"> 5	r2:eth2	80 → 39608 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 ...
</span></span><span class="line"><span class="cl"> 7	laptop:eth1	[TCP Retransmission] 39608 → 80 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 ...
</span></span></code></pre></div><p>Frames 3 and 4 aren&rsquo;t retransmissions: they&rsquo;re frame 2, seen further along.</p>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Find it</h2>
  </header>
  <div class="lab-stage-body">
    <p>There&rsquo;s no follow-along this time: this is the whole chapter in one task.</p>
<ol>
<li>
<p>Break it, and don&rsquo;t read the commands it prints:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make <span class="nb">break</span> <span class="nv">X</span><span class="o">=</span>mystery
</span></span><span class="line"><span class="cl">clear
</span></span></code></pre></div></li>
<li>
<p>Capture at all three points while the laptop tries to open the page:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1,r1:eth2,r2:eth2 <span class="nv">NAME</span><span class="o">=</span>8.2 <span class="nv">X</span><span class="o">=</span>webip
</span></span></code></pre></div></li>
<li>
<p>Open <code>/captures/8.2.pcapng</code>, and for each point in turn filter:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">tcp &amp;&amp; frame.interface_name == &#34;laptop:eth1&#34;
</span></span></code></pre></div><p>(then <code>&quot;r1:eth2&quot;</code>, then <code>&quot;r2:eth2&quot;</code>). Where does the SYN stop? Is there a SYN-ACK anywhere?</p>
</li>
<li>
<p>Write your verdict, then undo the fault:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/8.2.yml</code><span class="lab-file-how">Ctrl+P → 8.2.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">broken_router</span><span class="p">:</span><span class="w"> </span><span class="l">r?     </span><span class="w"> </span><span class="c"># r1 or r2</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">cause</span><span class="p">:</span><span class="w"> </span><span class="p">?</span><span class="w">               </span><span class="c"># acl or route</span><span class="w">
</span></span></span></code></pre></div><div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make fix
</span></span></code></pre></div><p><code>make check T=8.2</code> still knows which fault it was after the fix. Want another go? <code>make break X=mystery</code>
again picks a new one at random (there are three).</p>
</li>
</ol>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>SYN on <code>laptop:eth1</code> only: it didn&rsquo;t get through r1. On <code>laptop:eth1</code> and <code>r1:eth2</code> but not <code>r2:eth2</code>: it
didn&rsquo;t get through r2.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>A SYN-ACK on <code>r2:eth2</code> means web got the SYN and answered. Then the problem is on the way back. Filter <code>icmp</code>:
did a router say anything about it?</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Prove it on the router: click <strong>r2</strong> on the <strong>Topology</strong> tab, then in the <strong>r2</strong> tab <code>show ip route</code> and <code>show access-lists</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/8.2.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=8.2</code>, then <code>git diff --staged</code> shows what changed</p>
    <p>It depends on the fault you got:</p>
<table>
  <thead>
      <tr>
          <th>What you saw</th>
          <th>broken_router</th>
          <th>cause</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>SYN on <code>laptop:eth1</code> only</td>
          <td><code>r1</code></td>
          <td><code>acl</code></td>
      </tr>
      <tr>
          <td>SYN on <code>laptop:eth1</code> and <code>r1:eth2</code>, nowhere on <code>r2:eth2</code></td>
          <td><code>r2</code></td>
          <td><code>acl</code></td>
      </tr>
      <tr>
          <td>SYN on all three, SYN-ACK and an ICMP <em>Network unreachable</em> on <code>r2:eth2</code> only</td>
          <td><code>r2</code></td>
          <td><code>route</code></td>
      </tr>
  </tbody>
</table>
<p>In the last case, r2 has lost its route back to <code>192.168.1.0/24</code>, so web&rsquo;s answer never gets back to r1. r2
says so, but to web, not to you: the ICMP <em>Network unreachable</em> goes to the sender of the packet it couldn&rsquo;t
route, which is web. The laptop never hears about it. Notice
what <em>doesn&rsquo;t</em> help: from the laptop, all three look identical, and <code>ping</code> from web to r2 works fine. Only the
captures at the right points tell them apart.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Loss</title><link>https://networkdoodles.com/labs/wireshark-101/task-8-1/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-8-1/</guid><description> new to this? step by stepbeginner make break X=loss, then make capture AT=laptop:eth1 NAME=8.1 X=big, then make fix. Filter tcp.analysis.retransmission: count them, and see who sent them. Challenge: filter tcp.analysis.duplicate_ack and count. Open Analyze › Expert Information. Fill in answers/8.1.yml, then make check T=8.1. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make break X=loss</code>, then <code>make capture AT=laptop:eth1 NAME=8.1 X=big</code>, then <code>make fix</code>.</li>
<li>Filter <code>tcp.analysis.retransmission</code>: count them, and see who sent them.</li>
<li>Challenge: filter <code>tcp.analysis.duplicate_ack</code> and count. Open Analyze › Expert Information.</li>
<li>Fill in answers/8.1.yml, then <code>make check T=8.1</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>How TCP repairs a gap</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="a-lossy-link-still-works">A lossy link still works</h3>
<p>A link that loses a few percent of its packets doesn&rsquo;t look broken. Pages load, downloads finish, ping mostly
answers. Everything is just slower, and nobody can say why. It&rsquo;s one of the most common network complaints, and
one of the hardest to see from a show command. A capture shows it plainly, because TCP has to <em>do</em> something
about every lost packet, and that something is on the wire.</p>
<h3 id="what-tcp-does-about-it">What TCP does about it</h3>
<p>web sends the download as a stream of numbered segments (chapter 6). Say one goes missing:</p>
<ol>
<li>The laptop receives the segments after it, but not the missing one. It can only acknowledge everything
<strong>up to the gap</strong>, so it sends the same ACK again, and again, for every segment that arrives after it:
<strong>duplicate ACKs</strong>.</li>
<li>After three duplicate ACKs, web concludes the segment was lost (not just late) and sends it again at once,
without waiting for a timeout: a <strong>fast retransmission</strong>.</li>
<li>The laptop fills the gap and acknowledges everything it has: the ACK number jumps forward.</li>
</ol>
<p>Modern TCP also uses <strong>SACK</strong> (<em>selective acknowledgement</em>): each duplicate ACK lists the blocks the laptop <em>did</em>
receive past the gap, so web only resends what&rsquo;s really missing.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> Loss shows up as a burst of duplicate ACKs from the receiver, then a retransmission from the sender.</p>
<h3 id="wireshark-keeps-score">Wireshark keeps score</h3>
<p>Wireshark tracks every TCP stream and flags what it notices, under <code>tcp.analysis</code>:</p>
<table>
  <thead>
      <tr>
          <th>Flag</th>
          <th>Meaning</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>tcp.analysis.lost_segment</code></td>
          <td><em>Previous segment not captured</em>: a gap in the sequence numbers</td>
      </tr>
      <tr>
          <td><code>tcp.analysis.duplicate_ack</code></td>
          <td>an ACK the receiver already sent</td>
      </tr>
      <tr>
          <td><code>tcp.analysis.retransmission</code></td>
          <td>data sent again (fast retransmissions included)</td>
      </tr>
      <tr>
          <td><code>tcp.analysis.fast_retransmission</code></td>
          <td>resent after duplicate ACKs, not a timeout</td>
      </tr>
      <tr>
          <td><code>tcp.analysis.out_of_order</code></td>
          <td>data that arrived after data with higher numbers</td>
      </tr>
  </tbody>
</table>
<p><code>tcp.analysis.flags</code> matches all of them at once. They&rsquo;re also summed up in <strong>Analyze › Expert Information</strong>.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>One lost segment</h2>
  </header>
  <div class="lab-stage-body">
    <p>From the reference capture, one gap and its repair:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">   35	192.168.2.10	[TCP Previous segment not captured] 80 → 56336 [ACK] Seq=17623 Ack=79 Win=65152 Len=1448
</span></span><span class="line"><span class="cl">   36	192.168.1.175	[TCP Dup ACK 34#1] 56336 → 80 [ACK] Seq=79 Ack=16175 ... SLE=17623 SRE=19071
</span></span><span class="line"><span class="cl">   38	192.168.1.175	[TCP Dup ACK 34#2] 56336 → 80 [ACK] Seq=79 Ack=16175 ... SLE=17623 SRE=20519
</span></span><span class="line"><span class="cl">   40	192.168.1.175	[TCP Dup ACK 34#3] 56336 → 80 [ACK] Seq=79 Ack=16175 ... SLE=17623 SRE=21967
</span></span><span class="line"><span class="cl">   ...
</span></span><span class="line"><span class="cl">   58	192.168.2.10	[TCP Fast Retransmission] 80 → 56336 [ACK] Seq=16175 Ack=79 Win=65152 Len=1448
</span></span></code></pre></div><p>Read it: frame 35 jumps from 16,175 to 17,623, so 1,448 bytes are missing. The laptop keeps saying <em>Ack=16175: I
still need byte 16,175</em>, and its SACK block (<code>SLE</code> to <code>SRE</code>) grows as later segments arrive. Then web resends
Seq=16175.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Break it, capture, count</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Turn the loss on:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make <span class="nb">break</span> <span class="nv">X</span><span class="o">=</span>loss
</span></span></code></pre></div><p>It uses containerlab&rsquo;s link impairments (<code>containerlab tools netem</code>) on r2&rsquo;s port towards r1.</p>
</li>
<li>
<p>Capture the laptop downloading a 2 MB file from web:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1 <span class="nv">NAME</span><span class="o">=</span>8.1 <span class="nv">X</span><span class="o">=</span>big
</span></span></code></pre></div><p>It still works: curl prints how many bytes it got, and how long it took.</p>
</li>
<li>
<p>Turn the loss off again:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make fix
</span></span></code></pre></div></li>
<li>
<p>Open <code>/captures/8.1.pcapng</code>, filter <code>tcp.analysis.retransmission</code>, and read the <strong>Displayed</strong> count and the
source address.</p>
</li>
<li>
<p>Fill in the follow-along lines:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/8.1.yml</code><span class="lab-file-how">Ctrl+P → 8.1.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">retransmissions: 26      # count yours</span><span class="p">:</span><span class="w"> </span><span class="l">the loss is random</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">retransmitted_by</span><span class="p">:</span><span class="w"> </span><span class="m">192.168.2.10</span><span class="w">
</span></span></span></code></pre></div></li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>The receiver&rsquo;s side</h2>
  </header>
  <div class="lab-stage-body">
    <ul>
<li><code>dup_acks</code>: how many duplicate ACKs the laptop sent.</li>
</ul>
<p>Then open <strong>Analyze › Expert Information</strong> and compare its counts with your filters. And one question to think
about: you captured on the laptop&rsquo;s cable, but the loss was between r2 and r1. How could you prove <em>where</em> the
packets went missing?</p>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Filter <code>tcp.analysis.duplicate_ack</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/8.1.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=8.1</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">dup_acks</span><span class="p">:</span><span class="w"> </span><span class="m">142</span><span class="w">      </span><span class="c"># count yours</span><span class="w">
</span></span></span></code></pre></div><p>About five duplicate ACKs for every retransmission in the reference capture. The receiver is noisy about loss; the sender is quiet and
efficient.</p>
<p>To find <em>where</em>: capture on both sides of each link at once, the way you did with r1 in task 4.2. A segment
that&rsquo;s on <code>r2:eth2</code> but not on <code>r1:eth2</code> went missing in between. That&rsquo;s task 8.2.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Decrypt your own</title><link>https://networkdoodles.com/labs/wireshark-101/task-7-2/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-7-2/</guid><description> new to this? step by stepbeginner make capture AT=laptop:eth1 NAME=7.2 X=tls12, open it, filter tls.handshake.type == 11. Open the Certificate: subject and issuer names. Challenge: point Wireshark at /captures/7.2.keys, filter http, read secret.txt. Fill in answers/7.2.yml, then make check T=7.2. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make capture AT=laptop:eth1 NAME=7.2 X=tls12</code>, open it, filter <code>tls.handshake.type == 11</code>.</li>
<li>Open the Certificate: subject and issuer names.</li>
<li>Challenge: point Wireshark at /captures/7.2.keys, filter <code>http</code>, read secret.txt.</li>
<li>Fill in answers/7.2.yml, then <code>make check T=7.2</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>Certificates, and keys you&rsquo;re allowed to have</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="the-certificate">The certificate</h3>
<p>When the laptop connects, web proves it really is <code>web.lab</code> with a <strong>certificate</strong>: a small signed document
that says <em>this key belongs to these names</em>, signed by someone the laptop already trusts, a <strong>certificate
authority</strong> (CA). On the internet that&rsquo;s one of a few dozen companies your operating system trusts. In this lab
it&rsquo;s the lab&rsquo;s own CA, made when the hosts&rsquo; image was built, which every host trusts.</p>
<p>In TLS 1.2 the certificate is sent in the clear, so a capture shows exactly which names it covers and who
signed it. That&rsquo;s useful: <em>certificate name mismatch</em> and <em>untrusted issuer</em> errors can be read straight off
the wire. In TLS 1.3 it&rsquo;s encrypted (task 7.1), so you&rsquo;d need the keys.</p>
<h3 id="decrypting-your-own-traffic">Decrypting your own traffic</h3>
<p>You can&rsquo;t decrypt someone else&rsquo;s TLS from a capture; that&rsquo;s the whole point of it. But <strong>you can decrypt your
own</strong>. Most TLS libraries can write their session secrets to a <strong>key log file</strong> if you set the environment
variable <code>SSLKEYLOGFILE</code> to a filename. curl does, and so do Firefox and Chrome. Give that file to Wireshark and
it decrypts the captured session as if it were plain text.</p>
<p>That&rsquo;s how developers debug HTTPS apps. It&rsquo;s also the reason to treat a key log file like a password: anyone
with it and the capture can read the traffic.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> TLS 1.2 shows the certificate in the clear; the session keys your own browser or curl saves let Wireshark decrypt the rest.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>TLS 1.2, and its keys</h2>
  </header>
  <div class="lab-stage-body">
    <p>The handshake, with curl told to use TLS 1.2 at most (<code>curl --tls-max 1.2</code>):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    9 0.788865417 192.168.1.175 → 192.168.2.10 TLSv1 292 Client Hello (SNI=intranet.lab)
</span></span><span class="line"><span class="cl">   11 0.790268084 192.168.2.10 → 192.168.1.175 TLSv1.2 1402 Server Hello, Certificate, Server Key Exchange, Server Hello Done
</span></span><span class="line"><span class="cl">   13 0.796043667 192.168.1.175 → 192.168.2.10 TLSv1.2 159 Client Key Exchange, Change Cipher Spec, Encrypted Handshake Message
</span></span><span class="line"><span class="cl">   14 0.796326375 192.168.2.10 → 192.168.1.175 TLSv1.2 117 Change Cipher Spec, Encrypted Handshake Message
</span></span><span class="line"><span class="cl">   15 0.796470875 192.168.1.175 → 192.168.2.10 TLSv1.2 181 Application Data
</span></span><span class="line"><span class="cl">   16 0.796773500 192.168.2.10 → 192.168.1.175 TLSv1.2 442 Application Data
</span></span></code></pre></div><p>Frame 11 carries the <strong>Certificate</strong>, in the clear. This Client Hello is only 292 bytes: offering at most
TLS 1.2, curl leaves out the big TLS 1.3 key share.</p>
<p>The key log file is a few lines of text: a label, the session&rsquo;s random number, and the secret:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">CLIENT_RANDOM 3c1f... 9a0b...
</span></span></code></pre></div><p>With it, the same two Application Data frames become:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">   15 0.796470875 192.168.1.175 → 192.168.2.10 HTTP 181 GET /secret.txt HTTP/1.1
</span></span><span class="line"><span class="cl">   16 0.796773500 192.168.2.10 → 192.168.1.175 HTTP 442 HTTP/1.1 200 OK  (text/plain)
</span></span></code></pre></div>
  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Read the certificate</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Capture the laptop fetching a page over TLS 1.2, saving its keys:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1 <span class="nv">NAME</span><span class="o">=</span>7.2 <span class="nv">X</span><span class="o">=</span>tls12
</span></span></code></pre></div><p>It saves two files: <code>captures/7.2.pcapng</code> and <code>captures/7.2.keys</code>.</p>
</li>
<li>
<p>Open <code>/captures/7.2.pcapng</code>, filter <code>tls.handshake.type == 11</code> (the Certificate), and open the certificate.
Under <strong>subject</strong> find the name it&rsquo;s for (<strong>dNSName</strong> under the subjectAltName extension lists every name),
and under <strong>issuer</strong> who signed it.</p>
</li>
<li>
<p>Check the Server Hello&rsquo;s version too: no <code>supported_versions</code> extension this time.</p>
</li>
<li>
<p>Fill in the follow-along lines:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/7.2.yml</code><span class="lab-file-how">Ctrl+P → 7.2.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">tls_version</span><span class="p">:</span><span class="w"> </span><span class="m">1.2</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">cert_cn</span><span class="p">:</span><span class="w"> </span><span class="l">web.lab</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">cert_issuer</span><span class="p">:</span><span class="w"> </span><span class="l">Network Doodles Lab CA</span><span class="w">
</span></span></span></code></pre></div></li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Read the secret</h2>
  </header>
  <div class="lab-stage-body">
    <p>The page the laptop fetched, <code>https://intranet.lab/secret.txt</code>, has a line in it with <em>the answer is &hellip;</em>. It&rsquo;s
encrypted in the capture. Decrypt it with the keys, and write down the answer:</p>
<ul>
<li><code>secret</code>: the word after <em>the answer is</em>.</li>
</ul>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>In Wireshark: <strong>Edit › Preferences › Protocols › TLS</strong>, and set <strong>(Pre)-Master-Secret log filename</strong> to
<code>/captures/7.2.keys</code>. Click OK and the Application Data turns into HTTP.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Right-click the HTTP response › <strong>Follow › HTTP Stream</strong>. Or in the terminal:
<code>tshark -r captures/7.2.pcapng -o tls.keylog_file:captures/7.2.keys -Y http -V</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/7.2.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=7.2</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">secret</span><span class="p">:</span><span class="w"> </span><span class="l">gentoo-penguin</span><span class="w">
</span></span></span></code></pre></div><p>Without the keys, frames 15 and 16 were <em>Application Data</em> and a length. With them, Wireshark showed the
request, the response and the page. Nothing about the capture changed: the keys are what make it readable.
That&rsquo;s why <code>SSLKEYLOGFILE</code> is a debugging tool for your own machine only.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>What TLS shows</title><link>https://networkdoodles.com/labs/wireshark-101/task-7-1/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-7-1/</guid><description> new to this? step by stepbeginner make capture AT=laptop:eth1 NAME=7.1 X=tls, open it, filter tls.handshake. Each Client Hello’s server_name extension; the Server Hello’s supported_versions extension. Challenge: the Server Hello’s Cipher Suite; the Client Hello’s ALPN list. Fill in answers/7.1.yml, then make check T=7.1. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make capture AT=laptop:eth1 NAME=7.1 X=tls</code>, open it, filter <code>tls.handshake</code>.</li>
<li>Each Client Hello&rsquo;s server_name extension; the Server Hello&rsquo;s supported_versions extension.</li>
<li>Challenge: the Server Hello&rsquo;s Cipher Suite; the Client Hello&rsquo;s ALPN list.</li>
<li>Fill in answers/7.1.yml, then <code>make check T=7.1</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>Encrypted, but not invisible</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="what-tls-hides-and-what-it-cant">What TLS hides, and what it can&rsquo;t</h3>
<p><strong>TLS</strong> (<em>Transport Layer Security</em>, the S in HTTPS) encrypts the conversation between the laptop and web: the
page, the address you typed after the name, cookies, passwords. A capture of HTTPS shows none of that. It&rsquo;s
just <em>Application Data</em>.</p>
<p>But the two sides have to agree on how to encrypt before they can encrypt anything, so the start of the
conversation, the <strong>handshake</strong>, is partly in the clear. And a few things in it are worth a lot to someone
troubleshooting:</p>
<table>
  <thead>
      <tr>
          <th>In the clear</th>
          <th>Where</th>
          <th>Why it&rsquo;s there</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>SNI</strong> (<em>server name indication</em>)</td>
          <td>Client Hello</td>
          <td>one server can host many names (web.lab and intranet.lab are the same box). The client says which one it wants, so the server can pick the right certificate</td>
      </tr>
      <tr>
          <td>versions <strong>offered</strong></td>
          <td>Client Hello, <code>supported_versions</code></td>
          <td>so the two can pick one they both know</td>
      </tr>
      <tr>
          <td>version <strong>chosen</strong></td>
          <td>Server Hello, <code>supported_versions</code></td>
          <td></td>
      </tr>
      <tr>
          <td>cipher suites offered, and the one <strong>chosen</strong></td>
          <td>Client Hello, Server Hello</td>
          <td>the encryption method they&rsquo;ll use</td>
      </tr>
      <tr>
          <td><strong>ALPN</strong> (<em>application-layer protocol negotiation</em>) offered</td>
          <td>Client Hello</td>
          <td>which protocol will run inside: <code>h2</code> (HTTP/2) or <code>http/1.1</code></td>
      </tr>
  </tbody>
</table>
<p>The IP addresses and ports are in the clear too, of course: TLS rides on an ordinary TCP connection.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> TLS hides the content, but the handshake still shows which name you asked for and how the two ends agreed to talk.</p>
<h3 id="the-version-that-lies">The version that lies</h3>
<p>TLS 1.3 kept a trap for old middleboxes. The <strong>record</strong> and <strong>handshake</strong> headers still say TLS 1.0 and 1.2,
because some old firewalls dropped anything that said 1.3. The real version is negotiated in an extension,
<code>supported_versions</code>. So Wireshark&rsquo;s Protocol column shows the Client Hello as <em>TLSv1.2</em>, and you have to open
the Server Hello to see the truth.</p>
<h3 id="what-13-hides-that-12-didnt">What 1.3 hides that 1.2 didn&rsquo;t</h3>
<p>In TLS 1.3, everything after the Server Hello is encrypted, the server&rsquo;s <strong>certificate</strong> included, and so is
the ALPN the server picks. In TLS 1.2 the certificate went in the clear. Task 7.2 shows the difference.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>A Client Hello in two pieces</h2>
  </header>
  <div class="lab-stage-body">
    <p>The TLS frames of the first connection:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    8 0.004050375 192.168.1.175 → 192.168.2.10 SSL 1514
</span></span><span class="line"><span class="cl">    9 0.004052292 192.168.1.175 → 192.168.2.10 TLSv1.2 176 Client Hello (SNI=web.lab)
</span></span><span class="line"><span class="cl">   12 0.005881292 192.168.2.10 → 192.168.1.175 TLSv1.3 1514 Server Hello, Change Cipher Spec, Application Data
</span></span><span class="line"><span class="cl">   14 0.005905250 192.168.2.10 → 192.168.1.175 TLSv1.3 1171 Application Data, Application Data, Application Data
</span></span><span class="line"><span class="cl">   ...
</span></span></code></pre></div><p>The Client Hello is <strong>1,558 bytes</strong>: too big for one packet on a 1,500-byte network, so TCP split it in two.
Frame 8 is the first piece (Wireshark can&rsquo;t decode it alone, so it says <em>SSL</em>), and frame 9 completes it. It&rsquo;s
that big because of its <strong>key share</strong>: the laptop&rsquo;s curl offers <code>X25519MLKEM768</code>, a newer key exchange designed
to stay safe against future quantum computers, and its key alone is over a kilobyte. Keep that size in mind for
chapter 8.</p>
<p>The Server Hello, opened (<code>...</code> marks lines left out):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Transport Layer Security
</span></span><span class="line"><span class="cl">    TLSv1.3 Record Layer: Handshake Protocol: Server Hello
</span></span><span class="line"><span class="cl">        Version: TLS 1.2 (0x0303)
</span></span><span class="line"><span class="cl">        Handshake Protocol: Server Hello
</span></span><span class="line"><span class="cl">            Version: TLS 1.2 (0x0303)
</span></span><span class="line"><span class="cl">            ...
</span></span><span class="line"><span class="cl">            Cipher Suite: TLS_AES_256_GCM_SHA384 (0x1302)
</span></span><span class="line"><span class="cl">            ...
</span></span><span class="line"><span class="cl">            Extension: supported_versions (len=2) TLS 1.3
</span></span><span class="line"><span class="cl">                Supported Version: TLS 1.3 (0x0304)
</span></span><span class="line"><span class="cl">            Extension: key_share (len=1124) X25519MLKEM768
</span></span></code></pre></div><p>Twice it says <em>TLS 1.2</em>. The extension says 1.3, and that&rsquo;s the one that counts.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Names and the version</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Capture the laptop opening two HTTPS pages:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1 <span class="nv">NAME</span><span class="o">=</span>7.1 <span class="nv">X</span><span class="o">=</span>tls
</span></span></code></pre></div></li>
<li>
<p>Open <code>/captures/7.1.pcapng</code> and filter <code>tls.handshake.type == 1</code> (Client Hellos only). The <strong>Info</strong> column
shows each SNI. To see it in the details: <strong>Extension: server_name</strong>.</p>
</li>
<li>
<p>Now filter <code>tls.handshake.type == 2</code> (Server Hellos) and open <strong>Extension: supported_versions</strong>.</p>
</li>
<li>
<p>Fill in the follow-along lines:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/7.1.yml</code><span class="lab-file-how">Ctrl+P → 7.1.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">sni</span><span class="p">:</span><span class="w"> </span><span class="l">web.lab, intranet.lab</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">tls_version</span><span class="p">:</span><span class="w"> </span><span class="m">1.3</span><span class="w">
</span></span></span></code></pre></div></li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>The cipher and ALPN</h2>
  </header>
  <div class="lab-stage-body">
    <ul>
<li><code>cipher</code>: the cipher suite the server chose, by name or by number;</li>
<li><code>offered_alpn</code>: the application protocols the laptop offered, comma separated.</li>
</ul>
<p>Then look for the protocol the server <em>chose</em> from that list. Where is it?</p>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>The cipher is in the Server Hello. ALPN is an extension in the Client Hello:
<strong>Extension: application_layer_protocol_negotiation</strong>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/7.1.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=7.1</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">cipher</span><span class="p">:</span><span class="w"> </span><span class="l">TLS_AES_256_GCM_SHA384</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">offered_alpn</span><span class="p">:</span><span class="w"> </span><span class="l">h2, http/1.1</span><span class="w">
</span></span></span></code></pre></div><p>The server&rsquo;s choice isn&rsquo;t in the Server Hello: in TLS 1.3 it travels in the <em>Encrypted Extensions</em>, after the
encryption starts. (The lab&rsquo;s web server doesn&rsquo;t do HTTP/2, so it picked <code>http/1.1</code>. You can&rsquo;t see that here.
In task 7.2&rsquo;s TLS 1.2 handshake, the Server Hello carries it in the clear.)</p>
<p>This is what firewalls and monitoring tools that <em>don&rsquo;t</em> decrypt rely on: the SNI tells them which site, the
handshake tells them how it&rsquo;s protected, and that&rsquo;s all they get.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Refused</title><link>https://networkdoodles.com/labs/wireshark-101/task-6-2/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-6-2/</guid><description> new to this? step by stepbeginner make capture AT=laptop:eth1 NAME=6.2 X=refused, open it, filter tcp.flags.reset == 1. Read the RST: its source address and source port. Challenge: its tcp.stream index; then filter tcp.stream == &lt;that&gt; to see the whole connection. Fill in answers/6.2.yml, then make check T=6.2. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make capture AT=laptop:eth1 NAME=6.2 X=refused</code>, open it, filter <code>tcp.flags.reset == 1</code>.</li>
<li>Read the RST: its source address and source port.</li>
<li>Challenge: its <code>tcp.stream</code> index; then filter <code>tcp.stream == &lt;that&gt;</code> to see the whole connection.</li>
<li>Fill in answers/6.2.yml, then <code>make check T=6.2</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>No, straight away</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="nothing-listening">Nothing listening</h3>
<p>A server only accepts connections on the ports a program is listening on. web runs a web server on ports 80
and 443, and nothing on 8080. When a SYN arrives for a port nobody listens on, the server&rsquo;s operating system
answers at once with a <strong>RST</strong> (<em>reset</em>): <em>no, and stop</em>. The client gives up immediately; curl prints
<em>Connection refused</em>.</p>
<p>That <em>immediately</em> matters. A refused connection is fast and clear: the server is there, the network works, the
program isn&rsquo;t. Compare that with a SYN that gets <strong>no answer at all</strong> (chapter 8): the client waits and tries
again, for seconds, and you learn nothing until it gives up.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> SYN answered by RST means <em>the host is there, but nothing listens on that port</em>. SYN with no answer means something on the way dropped it.</p>
<h3 id="streams">Streams</h3>
<p>A busy capture has many connections. Wireshark numbers them in the order it sees them, starting at 0, as
<code>tcp.stream</code>. Filter <code>tcp.stream == 1</code> and you see one connection and nothing else, from SYN to the end.
That&rsquo;s the quickest way to pull one conversation out of a crowd.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>Two packets</h2>
  </header>
  <div class="lab-stage-body">
    <p>The refused connection, in a capture like yours:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">   22 0.878940500 192.168.1.175 → 192.168.2.10 TCP 74 60980 → 8080 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 ...
</span></span><span class="line"><span class="cl">   23 0.879012584 192.168.2.10 → 192.168.1.175 TCP 54 8080 → 60980 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0
</span></span></code></pre></div><p>Two frames, and the connection&rsquo;s over. The working connections before and after it each take a dozen or more.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Find the reset</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Capture three connections, the middle one to port 8080:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1 <span class="nv">NAME</span><span class="o">=</span>6.2 <span class="nv">X</span><span class="o">=</span>refused
</span></span></code></pre></div><p>The output shows curl&rsquo;s three attempts; the middle one prints nothing.</p>
</li>
<li>
<p>Open <code>/captures/6.2.pcapng</code> and filter the resets:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">tcp.flags.reset == 1
</span></span></code></pre></div></li>
<li>
<p>Read the RST&rsquo;s source address and its source port: the port that said no.</p>
</li>
<li>
<p>Fill in the follow-along lines:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/6.2.yml</code><span class="lab-file-how">Ctrl+P → 6.2.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">refused_port</span><span class="p">:</span><span class="w"> </span><span class="m">8080</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">rst_from</span><span class="p">:</span><span class="w"> </span><span class="m">192.168.2.10</span><span class="w">
</span></span></span></code></pre></div></li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Its stream</h2>
  </header>
  <div class="lab-stage-body">
    <ul>
<li><code>refused_stream</code>: the refused connection&rsquo;s <code>tcp.stream</code> index.</li>
</ul>
<p>Then filter on that stream to see the whole of it, and on the streams either side to compare.</p>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Open the RST&rsquo;s TCP layer: <strong>[Stream index: &hellip;]</strong> is near the top. Or add it as a column.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/6.2.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=6.2</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">refused_stream</span><span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
</span></span></span></code></pre></div><p>Stream 0 is the first page, stream 1 the refused attempt, stream 2 the page again. DNS lookups don&rsquo;t count:
they&rsquo;re UDP, which has streams of its own (<code>udp.stream</code>).</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>A whole connection</title><link>https://networkdoodles.com/labs/wireshark-101/task-6-1/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-6-1/</guid><description> new to this? step by stepbeginner make capture AT=laptop:eth1 NAME=6.1 X=web, open it, filter tcp. Find the SYN, SYN-ACK, ACK. Note the laptop’s port and the SYN-ACK’s frame number. Challenge: the HTTP status code, and who sent the first FIN. Fill in answers/6.1.yml, then make check T=6.1. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make capture AT=laptop:eth1 NAME=6.1 X=web</code>, open it, filter <code>tcp</code>.</li>
<li>Find the SYN, SYN-ACK, ACK. Note the laptop&rsquo;s port and the SYN-ACK&rsquo;s frame number.</li>
<li>Challenge: the HTTP status code, and who sent the first FIN.</li>
<li>Fill in answers/6.1.yml, then <code>make check T=6.1</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>A conversation with a beginning and an end</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="why-tcp-is-different">Why TCP is different</h3>
<p>Every protocol so far (ARP, DHCP, DNS) has been a question and an answer, and if an answer goes missing, the
asker just asks again. A web page can be megabytes: thousands of packets that must all arrive, in order, with
none missing. <strong>TCP</strong> does that. It turns a stream of packets into a reliable <strong>connection</strong>, and on the wire
you can watch every part of it.</p>
<h3 id="the-handshake">The handshake</h3>
<p>Before any data, the two ends agree to talk, in three packets:</p>
<ol>
<li><strong>SYN</strong>: the laptop, <em>I&rsquo;d like to connect, and I&rsquo;ll number my bytes starting from here</em>;</li>
<li><strong>SYN, ACK</strong>: the server, <em>fine, and I&rsquo;ll number mine from here; I&rsquo;ve got yours</em>;</li>
<li><strong>ACK</strong>: the laptop, <em>got yours too</em>.</li>
</ol>
<p>A <strong>port</strong> says which program each end is: web serves on port <strong>80</strong> (HTTP); the laptop picks a random high
port for its side, different for every connection.</p>
<h3 id="sequence-and-acknowledgement-numbers">Sequence and acknowledgement numbers</h3>
<p>TCP numbers every <strong>byte</strong> it sends. Each packet carries <strong>Seq</strong> (the number of its first byte) and <strong>Ack</strong> (the
next byte it expects from the other end: <em>I&rsquo;ve got everything before this</em>). The real numbers start at a random
value; Wireshark subtracts it and shows <strong>relative</strong> numbers starting at 0, which are far easier to read.</p>
<p>Follow them and you can see exactly what arrived: when the laptop sends 71 bytes of request starting at Seq=1,
the server&rsquo;s next packet says Ack=72.</p>
<h3 id="closing">Closing</h3>
<p>Each side closes its own half with a <strong>FIN</strong> (<em>I&rsquo;m done sending</em>), and the other side ACKs it. Whoever sends the
first FIN chose to end the conversation.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> TCP opens with SYN, SYN-ACK, ACK, numbers every byte with Seq and Ack, and closes each direction with a FIN.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>One page, twelve TCP frames</h2>
  </header>
  <div class="lab-stage-body">
    <p>The TCP frames of a capture like yours (DNS for web.lab comes first, and isn&rsquo;t shown):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    6 1.202682209 192.168.1.175 → 192.168.2.10 TCP 74 41648 → 80 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 ...
</span></span><span class="line"><span class="cl">    7 1.202864792 192.168.2.10 → 192.168.1.175 TCP 74 80 → 41648 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 ...
</span></span><span class="line"><span class="cl">    8 1.202878042 192.168.1.175 → 192.168.2.10 TCP 66 41648 → 80 [ACK] Seq=1 Ack=1 Win=64256 Len=0 ...
</span></span><span class="line"><span class="cl">    9 1.202973209 192.168.1.175 → 192.168.2.10 HTTP 137 GET / HTTP/1.1
</span></span><span class="line"><span class="cl">   10 1.202988167 192.168.2.10 → 192.168.1.175 TCP 66 80 → 41648 [ACK] Seq=1 Ack=72 Win=65152 Len=0 ...
</span></span><span class="line"><span class="cl">   11 1.203743875 192.168.2.10 → 192.168.1.175 TCP 302 HTTP/1.1 200 OK
</span></span><span class="line"><span class="cl">   12 1.203754125 192.168.1.175 → 192.168.2.10 TCP 66 41648 → 80 [ACK] Seq=72 Ack=237 Win=64128 Len=0 ...
</span></span><span class="line"><span class="cl">   13 1.203837084 192.168.2.10 → 192.168.1.175 HTTP 99 HTTP/1.1 200 OK  (text/html)
</span></span><span class="line"><span class="cl">   14 1.203842500 192.168.1.175 → 192.168.2.10 TCP 66 41648 → 80 [ACK] Seq=72 Ack=270 Win=64128 Len=0 ...
</span></span><span class="line"><span class="cl">   15 1.203980584 192.168.1.175 → 192.168.2.10 TCP 66 41648 → 80 [FIN, ACK] Seq=72 Ack=270 Win=64128 Len=0 ...
</span></span><span class="line"><span class="cl">   16 1.204308750 192.168.2.10 → 192.168.1.175 TCP 66 80 → 41648 [FIN, ACK] Seq=270 Ack=73 Win=65152 Len=0 ...
</span></span><span class="line"><span class="cl">   17 1.204333000 192.168.1.175 → 192.168.2.10 TCP 66 41648 → 80 [ACK] Seq=73 Ack=271 Win=64128 Len=0 ...
</span></span></code></pre></div><table>
  <thead>
      <tr>
          <th>Part</th>
          <th>What it means</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>41648 → 80</code></td>
          <td>from the laptop&rsquo;s port to web&rsquo;s</td>
      </tr>
      <tr>
          <td><code>[SYN, ACK]</code></td>
          <td>the TCP flags set in this packet</td>
      </tr>
      <tr>
          <td><code>Seq=1 Ack=72</code></td>
          <td>relative sequence and acknowledgement numbers</td>
      </tr>
      <tr>
          <td><code>Win=65152</code></td>
          <td>the receive <strong>window</strong>: how many more bytes this side can take right now</td>
      </tr>
      <tr>
          <td><code>Len=0</code></td>
          <td>bytes of data in this packet. Handshake and ACK packets carry none</td>
      </tr>
      <tr>
          <td><code>MSS=1460</code></td>
          <td>the biggest chunk of data this side can receive in one packet (chapter 8)</td>
      </tr>
  </tbody>
</table>
<p>web sent its answer in two pieces: the headers in frame 11, the page in frame 13. Wireshark glued them back
together and shows the whole HTTP response on frame 13.</p>
<p>Two views make a connection easier to read: <strong>Statistics › Conversations › TCP</strong> lists every connection with
its ports and byte counts, and right-click any frame › <strong>Follow › TCP Stream</strong> shows just the text the two
sides sent each other.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>The handshake</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Capture the laptop opening the web page:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1 <span class="nv">NAME</span><span class="o">=</span>6.1 <span class="nv">X</span><span class="o">=</span>web
</span></span></code></pre></div></li>
<li>
<p>Open <code>/captures/6.1.pcapng</code> and filter <code>tcp</code>. Find the <strong>[SYN]</strong>, the <strong>[SYN, ACK]</strong> and the <strong>[ACK]</strong>.</p>
</li>
<li>
<p>Note the laptop&rsquo;s port (the source port of the SYN) and the SYN-ACK&rsquo;s frame number (the <strong>No.</strong> column).</p>
</li>
<li>
<p>Right-click any of the frames › <strong>Follow › TCP Stream</strong> and read the request and the answer as text. Close it
with <strong>Back</strong>.</p>
</li>
<li>
<p>Fill in the follow-along lines:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/6.1.yml</code><span class="lab-file-how">Ctrl+P → 6.1.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">client_port</span><span class="p">:</span><span class="w"> </span><span class="m">41648</span><span class="w">      </span><span class="c"># yours is different</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">syn_ack_frame</span><span class="p">:</span><span class="w"> </span><span class="m">7</span><span class="w">        </span><span class="c"># yours may be different</span><span class="w">
</span></span></span></code></pre></div></li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>The answer and the end</h2>
  </header>
  <div class="lab-stage-body">
    <ul>
<li><code>http_status</code>: the status code web answered with;</li>
<li><code>first_fin_from</code>: the IP address that sent the first FIN.</li>
</ul>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Filter <code>http.response</code>. The code is in the first line of the HTTP layer.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Filter <code>tcp.flags.fin == 1</code>. The first one is the answer.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/6.1.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=6.1</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">http_status</span><span class="p">:</span><span class="w"> </span><span class="m">200</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">first_fin_from: 192.168.1.175      # the laptop&#39;s address</span><span class="p">:</span><span class="w"> </span><span class="l">yours may be different</span><span class="w">
</span></span></span></code></pre></div><p>200 means <em>OK, here&rsquo;s the page</em>. The laptop (curl) closed first, as soon as it had the whole page: the browser
side usually decides when it&rsquo;s done. Count the frames: three to open, three carrying data (the request and the
answer&rsquo;s two pieces), each with an ACK, and three to close. For a 33-byte page, most of the packets are TCP keeping its promises.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>The search domain</title><link>https://networkdoodles.com/labs/wireshark-101/task-5-2/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-5-2/</guid><description> new to this? step by stepbeginner make capture AT=laptop:eth1 NAME=5.2 X=search, open it, filter dns. Read the queries in order: which name came first? Filter dns.flags.response == 0 and count. Challenge: the response code for plain nas. Fill in answers/5.2.yml, then make check T=5.2. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make capture AT=laptop:eth1 NAME=5.2 X=search</code>, open it, filter <code>dns</code>.</li>
<li>Read the queries in order: which name came first? Filter <code>dns.flags.response == 0</code> and count.</li>
<li>Challenge: the response code for plain <code>nas</code>.</li>
<li>Fill in answers/5.2.yml, then <code>make check T=5.2</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>What the resolver adds</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="you-type-a-name-the-computer-asks-for-others">You type a name; the computer asks for others</h3>
<p>In task 5.1, <code>dig</code> asked for exactly the name you gave it. Most programs don&rsquo;t use dig. They ask the
computer&rsquo;s <strong>resolver</strong>, the part of the operating system that does lookups, and the resolver has opinions.</p>
<p>The laptop&rsquo;s resolver reads <code>/etc/resolv.conf</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">search lab
</span></span><span class="line"><span class="cl">nameserver 192.168.2.53
</span></span></code></pre></div><p><code>nameserver</code> is the DNS server to ask, from DHCP option 6. <code>search lab</code> is the <strong>search domain</strong>, from DHCP
option 15: when you type a short name, try it with <code>.lab</code> on the end. So <code>ping nas</code> asks for <code>nas.lab</code>. That&rsquo;s
handy at home and at work (type <code>printer</code>, get <code>printer.lab</code>), and it&rsquo;s also why one typo can cause several
lookups.</p>
<h3 id="a-and-aaaa-together">A and AAAA, together</h3>
<p>The resolver doesn&rsquo;t know whether you want IPv4 or IPv6, so it asks for both at once: an <strong>A</strong> query and an
<strong>AAAA</strong> query for every name it tries. That&rsquo;s two queries before anything else happens, even here, where the
hosts have IPv6 switched off.</p>
<h3 id="refused">Refused</h3>
<p>A DNS server can also refuse to answer. <strong>REFUSED</strong> (rcode 5) means <em>I won&rsquo;t look that up for you</em>: here, the
lab&rsquo;s server only answers for names under <code>lab</code>, and <code>nas</code> on its own isn&rsquo;t one. It&rsquo;s a different answer from
NXDOMAIN (<em>that name doesn&rsquo;t exist</em>), and in a capture the difference tells you where to look next: NXDOMAIN is
about the name, REFUSED is about the server.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> A short name goes through the search list first; each try is an A and an AAAA query; and every answer has a code that says why.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>One ping, many queries</h2>
  </header>
  <div class="lab-stage-body">
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# ping -c 1 -W 1 nas
</span></span><span class="line"><span class="cl">ping: nas: Try again
</span></span></code></pre></div><p>That&rsquo;s all <code>ping</code> says. The capture says a lot more:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    4 1.446020376 192.168.1.175 → 192.168.2.53 DNS 67 Standard query 0xf1f9 A nas.lab
</span></span><span class="line"><span class="cl">    5 1.446262459 192.168.1.175 → 192.168.2.53 DNS 67 Standard query 0xf24d AAAA nas.lab
</span></span><span class="line"><span class="cl">    6 1.447611459 192.168.2.53 → 192.168.1.175 DNS 67 Standard query response 0xf1f9 No such name A nas.lab
</span></span><span class="line"><span class="cl">    7 1.447791543 192.168.2.53 → 192.168.1.175 DNS 67 Standard query response 0xf24d No such name AAAA nas.lab
</span></span><span class="line"><span class="cl">    8 1.447853501 192.168.1.175 → 192.168.2.53 DNS 63 Standard query 0xc69f A nas
</span></span><span class="line"><span class="cl">    9 1.447934876 192.168.1.175 → 192.168.2.53 DNS 63 Standard query 0xc7c9 AAAA nas
</span></span><span class="line"><span class="cl">   10 1.447985418 192.168.2.53 → 192.168.1.175 DNS 63 Standard query response 0xc69f Refused A nas
</span></span><span class="line"><span class="cl">   11 1.448006501 192.168.2.53 → 192.168.1.175 DNS 63 Standard query response 0xc7c9 Refused AAAA nas
</span></span><span class="line"><span class="cl">   13 3.955044002 192.168.1.175 → 192.168.2.53 DNS 63 Standard query 0xc69f A nas
</span></span><span class="line"><span class="cl">   ...
</span></span></code></pre></div><p><em>Try again</em> is the resolver&rsquo;s way of reporting the REFUSED: it isn&rsquo;t sure the name doesn&rsquo;t exist, only that it
got no answer.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Count the queries</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Capture the laptop pinging a short name:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1 <span class="nv">NAME</span><span class="o">=</span>5.2 <span class="nv">X</span><span class="o">=</span>search
</span></span></code></pre></div></li>
<li>
<p>Open <code>/captures/5.2.pcapng</code> and filter only the questions:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">dns.flags.response == 0
</span></span></code></pre></div><p>Read the first query&rsquo;s name, then the <strong>Displayed</strong> count in the status bar.</p>
</li>
<li>
<p>Fill in the follow-along lines:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/5.2.yml</code><span class="lab-file-how">Ctrl+P → 5.2.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">first_name</span><span class="p">:</span><span class="w"> </span><span class="l">nas.lab</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">queries</span><span class="p">:</span><span class="w"> </span><span class="m">6</span><span class="w">
</span></span></span></code></pre></div><p>(Count yours: the checker counts the queries in your file.)</p>
</li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Why it gave up</h2>
  </header>
  <div class="lab-stage-body">
    <ul>
<li><code>bare_name_rcode</code>: the response code the server gave for plain <code>nas</code>. A name (<code>NXDOMAIN</code>, <code>REFUSED</code>, &hellip;) or
the number is fine.</li>
</ul>
<p>Then look at the timing: after the server refused the plain name, what did the laptop do, and how long did it
wait first?</p>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Filter <code>dns.qry.name == &quot;nas&quot; &amp;&amp; dns.flags.response == 1</code>, and open the Flags line.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/5.2.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=5.2</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">bare_name_rcode</span><span class="p">:</span><span class="w"> </span><span class="l">REFUSED</span><span class="w">
</span></span></span></code></pre></div><p>The lab&rsquo;s DNS server only answers for names under <code>lab</code> (it&rsquo;s set up with no upstream server to ask), so it
refused plain <code>nas</code>. The laptop&rsquo;s resolver asked the same two questions again, with the same transaction IDs,
two and a half seconds later, got refused again, and gave up: <code>Try again</code>.</p>
<p>One short name, six queries and two and a half seconds. When an application <em>takes a few seconds to say a
host can&rsquo;t be found</em>, this is usually what&rsquo;s going on.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Names and answers</title><link>https://networkdoodles.com/labs/wireshark-101/task-5-1/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-5-1/</guid><description> new to this? step by stepbeginner make capture AT=laptop:eth1 NAME=5.1 X=dns, open it, filter dns. Open web.lab’s response: the address and its Time to live. Challenge: intranet.lab’s response (two answers), and the response that says No such name. Fill in answers/5.1.yml, then make check T=5.1. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make capture AT=laptop:eth1 NAME=5.1 X=dns</code>, open it, filter <code>dns</code>.</li>
<li>Open web.lab&rsquo;s response: the address and its Time to live.</li>
<li>Challenge: intranet.lab&rsquo;s response (two answers), and the response that says <em>No such name</em>.</li>
<li>Fill in answers/5.1.yml, then <code>make check T=5.1</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>A question, an answer, and how long to trust it</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="dns-on-the-wire">DNS on the wire</h3>
<p>Networking 101 described DNS as the network&rsquo;s phone book: you give it a name, it gives you an address. On the
wire that&rsquo;s exactly two packets, usually <strong>UDP</strong> to port <strong>53</strong>: a <strong>query</strong> with the question in it, and a
<strong>response</strong> with the question copied back and the answers added.</p>
<p>UDP doesn&rsquo;t keep a conversation going the way TCP does (chapter 6), so how does the laptop know which response
answers which question? Each query carries a random 16-bit <strong>transaction ID</strong>, and the server copies it into
its response. Wireshark pairs them up for you and notes the frame number of the other half.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> A DNS lookup is one query and one response, matched by a transaction ID.</p>
<h3 id="whats-in-an-answer">What&rsquo;s in an answer</h3>
<p>Each answer is a <strong>record</strong>: a name, a type, a value, and a <strong>TTL</strong>.</p>
<table>
  <thead>
      <tr>
          <th>Record type</th>
          <th>Value</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>A</strong></td>
          <td>an IPv4 address</td>
      </tr>
      <tr>
          <td><strong>AAAA</strong></td>
          <td>an IPv6 address</td>
      </tr>
      <tr>
          <td><strong>CNAME</strong></td>
          <td>another name: <em>this name is an alias, look up that one instead</em></td>
      </tr>
  </tbody>
</table>
<p>The <strong>TTL</strong> (<em>time to live</em>, again, but not the IP header&rsquo;s) says how many seconds the answer may be kept and
reused before asking again. Low TTLs mean changes spread fast; high ones mean fewer lookups.</p>
<h3 id="when-the-answer-is-no">When the answer is <em>no</em></h3>
<p>A response always has a <strong>reply code</strong> (<em>rcode</em>). <code>No error</code> (0) means here&rsquo;s your answer. <strong>NXDOMAIN</strong>
(3), which Wireshark shows as <em>No such name</em>, means the name doesn&rsquo;t exist. That&rsquo;s an answer too, not a failure
to answer: the server is sure.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>dig, and the same thing in Wireshark</h2>
  </header>
  <div class="lab-stage-body">
    <p><code>dig</code> is the tool for asking DNS directly. Its answer section is the record, TTL included:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">laptop:~# dig web.lab
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 30408
</span></span><span class="line"><span class="cl">;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">;; ANSWER SECTION:
</span></span><span class="line"><span class="cl">web.lab.		60	IN	A	192.168.2.10
</span></span></code></pre></div><p><code>id: 30408</code> is the transaction ID, in decimal. The three lookups the lab makes, in Wireshark:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    2 0.177191250 192.168.1.175 → 192.168.2.53 DNS 90 Standard query 0x4ed9 A web.lab OPT
</span></span><span class="line"><span class="cl">    3 0.177997208 192.168.2.53 → 192.168.1.175 DNS 94 Standard query response 0x4ed9 A web.lab A 192.168.2.10 OPT
</span></span><span class="line"><span class="cl">    4 0.214206625 192.168.1.175 → 192.168.2.53 DNS 95 Standard query 0x0e93 A intranet.lab OPT
</span></span><span class="line"><span class="cl">    5 0.214420333 192.168.2.53 → 192.168.1.175 DNS 120 Standard query response 0x0e93 A intranet.lab CNAME web.lab A 192.168.2.10 OPT
</span></span><span class="line"><span class="cl">    6 0.249419875 192.168.1.175 → 192.168.2.53 DNS 90 Standard query 0x0ef2 A nas.lab OPT
</span></span><span class="line"><span class="cl">    7 0.249925583 192.168.2.53 → 192.168.1.175 DNS 78 Standard query response 0x0ef2 No such name A nas.lab OPT
</span></span></code></pre></div><p>Frame 5 opened, answers only (<code>...</code> marks lines left out):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Domain Name System (response)
</span></span><span class="line"><span class="cl">    Transaction ID: 0x0e93
</span></span><span class="line"><span class="cl">    Flags: 0x8580 Standard query response, No error
</span></span><span class="line"><span class="cl">    ...
</span></span><span class="line"><span class="cl">    Answers
</span></span><span class="line"><span class="cl">        intranet.lab: type CNAME, class IN, cname web.lab
</span></span><span class="line"><span class="cl">            ...
</span></span><span class="line"><span class="cl">            Time to live: 60 (1 minute)
</span></span><span class="line"><span class="cl">            CNAME: web.lab
</span></span><span class="line"><span class="cl">        web.lab: type A, class IN, addr 192.168.2.10
</span></span><span class="line"><span class="cl">            ...
</span></span><span class="line"><span class="cl">            Time to live: 60 (1 minute)
</span></span><span class="line"><span class="cl">            Address: 192.168.2.10
</span></span></code></pre></div><p><code>OPT</code> on the end of each line is <strong>EDNS</strong>, a small extension record dig adds to say it can take bigger
answers. It isn&rsquo;t part of the answer.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>The first lookup</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Capture the laptop looking up three names:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1 <span class="nv">NAME</span><span class="o">=</span>5.1 <span class="nv">X</span><span class="o">=</span>dns
</span></span></code></pre></div></li>
<li>
<p>Open <code>/captures/5.1.pcapng</code> and filter <code>dns</code>. Check each query&rsquo;s transaction ID against the response below
it.</p>
</li>
<li>
<p>Click the response for <strong>web.lab</strong> and open <strong>Answers</strong>. Read the address and the <strong>Time to live</strong>.</p>
</li>
<li>
<p>Fill in the follow-along lines:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/5.1.yml</code><span class="lab-file-how">Ctrl+P → 5.1.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">web_ip</span><span class="p">:</span><span class="w"> </span><span class="m">192.168.2.10</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">ttl</span><span class="p">:</span><span class="w"> </span><span class="m">60</span><span class="w">
</span></span></span></code></pre></div></li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>An alias and a no</h2>
  </header>
  <div class="lab-stage-body">
    <ul>
<li><code>cname_target</code>: the name <strong>intranet.lab</strong> is an alias for;</li>
<li><code>nxdomain_name</code>: the name that doesn&rsquo;t exist.</li>
</ul>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>intranet.lab&rsquo;s response has two answers. The first one is the CNAME.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Filter <code>dns.flags.rcode == 3</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/5.1.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=5.1</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">cname_target</span><span class="p">:</span><span class="w"> </span><span class="l">web.lab</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">nxdomain_name</span><span class="p">:</span><span class="w"> </span><span class="l">nas.lab</span><span class="w">
</span></span></span></code></pre></div><p>The server answered intranet.lab with <em>it&rsquo;s really web.lab, and web.lab is 192.168.2.10</em>, both in one
response, so the laptop didn&rsquo;t have to ask twice. Websites do this all the time: <code>www.example.com</code> is often a
CNAME for a content delivery network&rsquo;s name.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>The relay</title><link>https://networkdoodles.com/labs/wireshark-101/task-4-2/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-4-2/</guid><description> new to this? step by stepbeginner make capture AT=sw1:eth1,r1:eth2 NAME=4.2 X=dhcp, open it, filter dhcp, add an Interface name column. Compare the Discover on sw1:eth1 with the copy on r1:eth2: their IP destinations. Challenge: the Relay agent IP address in r1’s copy, and the Offer’s source on sw1:eth1. Fill in answers/4.2.yml, then make check T=4.2. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make capture AT=sw1:eth1,r1:eth2 NAME=4.2 X=dhcp</code>, open it, filter <code>dhcp</code>, add an Interface name column.</li>
<li>Compare the Discover on <code>sw1:eth1</code> with the copy on <code>r1:eth2</code>: their IP destinations.</li>
<li>Challenge: the Relay agent IP address in r1&rsquo;s copy, and the Offer&rsquo;s source on <code>sw1:eth1</code>.</li>
<li>Fill in answers/4.2.yml, then <code>make check T=4.2</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>Broadcasts stop at the router. DHCP needs to get past.</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="the-problem">The problem</h3>
<p>The laptop&rsquo;s Discover goes to <code>255.255.255.255</code>: everyone on <em>this</em> network. Routers don&rsquo;t forward broadcasts
(that&rsquo;s the point of a router, from Networking 101&rsquo;s lesson on broadcast domains). So a DHCP server has to be
on the same network as every client.</p>
<p>Real networks don&rsquo;t work like that. A company with fifty offices has one or two DHCP servers in a data center,
not fifty. What makes that possible is the <strong>DHCP relay</strong>.</p>
<h3 id="how-a-relay-works">How a relay works</h3>
<p>The router on the client&rsquo;s network listens for DHCP broadcasts, and passes each one on to a server it&rsquo;s been
told about, as an ordinary <strong>unicast</strong> packet that can be routed anywhere. On Cisco-style routers, CapeOS
included, one line on the client-facing port does it:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">interface GigabitEthernet1
</span></span><span class="line"><span class="cl"> ip address 192.168.1.1 255.255.255.0
</span></span><span class="line"><span class="cl"> ip helper-address 192.168.2.53
</span></span></code></pre></div><p>On the way, the router writes its own address on that port into the message&rsquo;s <strong>Relay agent IP address</strong>
field (called <strong>giaddr</strong> in the DHCP standard, for <em>gateway IP address</em>). That&rsquo;s how the server knows which
network the client is on, and so which pool to give it an address from: the server can&rsquo;t tell from the packet&rsquo;s
source, because the client has no address yet.</p>
<p>The server sends its answer back to the relay, and the relay passes it to the client on the home network.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> A DHCP relay turns the client&rsquo;s broadcast into a unicast to the server, and writes its own address in giaddr so the server knows which network to serve.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>Both sides of r1</h2>
  </header>
  <div class="lab-stage-body">
    <p>Capturing <code>sw1:eth1</code> (the home network side of r1) and <code>r1:eth2</code> (the side towards r2) at once:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"> 6	sw1:eth1	0.0.0.0	255.255.255.255	DHCP Discover - Transaction ID 0x38985e54	0.0.0.0
</span></span><span class="line"><span class="cl"> 7	r1:eth2	192.168.1.1	192.168.2.53	DHCP Discover - Transaction ID 0x38985e54	192.168.1.1
</span></span><span class="line"><span class="cl"> 8	r1:eth2	192.168.2.53	192.168.1.1	DHCP Offer    - Transaction ID 0x38985e54	192.168.1.1
</span></span><span class="line"><span class="cl"> 9	sw1:eth1	192.168.1.1	192.168.1.175	DHCP Offer    - Transaction ID 0x38985e54	192.168.1.1
</span></span></code></pre></div><p>The columns are frame number, interface, IP source, IP destination, summary, and the Relay agent IP address.
Same transaction ID throughout: it&rsquo;s one conversation, carried in two hops.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Watch the Discover change</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Look at r1&rsquo;s config first. On the <strong>Topology</strong> tab, click <strong>r1</strong>. In the <strong>r1</strong> tab it opens:</p>
<div class="lab-file lab-file-tab mono">
  <span class="lab-file-kind">run in the r1 tab</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">show running-config interface GigabitEthernet1
</span></span></code></pre></div><p>Then go back to the <strong>VS Code</strong> tab for the capture.</p>
</li>
<li>
<p>Capture both sides of r1 while the laptop asks for an address again:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>sw1:eth1,r1:eth2 <span class="nv">NAME</span><span class="o">=</span>4.2 <span class="nv">X</span><span class="o">=</span>dhcp
</span></span></code></pre></div></li>
<li>
<p>Open <code>/captures/4.2.pcapng</code>, filter <code>dhcp</code>, and add the <strong>Interface name</strong> column (right-click it in a
frame&rsquo;s first details line › <strong>Apply as Column</strong>).</p>
</li>
<li>
<p>Find the <strong>Discover</strong> on <code>sw1:eth1</code> and its copy on <code>r1:eth2</code>. Compare their IP destinations.</p>
</li>
<li>
<p>Fill in the follow-along lines:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/4.2.yml</code><span class="lab-file-how">Ctrl+P → 4.2.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">lan_dst</span><span class="p">:</span><span class="w"> </span><span class="m">255.255.255.255</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">relay_dst</span><span class="p">:</span><span class="w"> </span><span class="m">192.168.2.53</span><span class="w">
</span></span></span></code></pre></div></li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>What r1 wrote</h2>
  </header>
  <div class="lab-stage-body">
    <ul>
<li><code>giaddr</code>: the <strong>Relay agent IP address</strong> in r1&rsquo;s copy of the Discover, on <code>r1:eth2</code>;</li>
<li><code>offer_from</code>: the IP source of the Offer the laptop received, on <code>sw1:eth1</code>.</li>
</ul>
<p>Then think about this: why does the dns server, at <code>192.168.2.53</code>, hand out addresses in <code>192.168.1.0/24</code>, a
network it isn&rsquo;t on?</p>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Open r1&rsquo;s copy of the Discover. The Relay agent IP address is a few lines into the DHCP layer.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/4.2.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=4.2</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">giaddr</span><span class="p">:</span><span class="w"> </span><span class="m">192.168.1.1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">offer_from</span><span class="p">:</span><span class="w"> </span><span class="m">192.168.1.1</span><span class="w">
</span></span></span></code></pre></div><p>r1 wrote <code>192.168.1.1</code>, its address on the home network, into the Discover. The dns server matched that to its
range for <code>192.168.1.0/24</code> and offered an address from it. The laptop only ever talks to r1: the Offer reaches
it from <code>192.168.1.1</code>, even though option 54 names the real server.</p>
<p>If DHCP ever <em>stops working on one network only</em>, capture both sides of the relay. No copy on the server side
means the router isn&rsquo;t relaying (a missing <code>ip helper-address</code>, or the wrong port). A copy with no answer
means the server has no range for that giaddr.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>DORA</title><link>https://networkdoodles.com/labs/wireshark-101/task-4-1/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-4-1/</guid><description> new to this? step by stepbeginner make capture AT=laptop:eth1 NAME=4.1 X=dhcp, open it, filter dhcp. Find Discover, Offer, Request, ACK. Open the Offer’s DHCP layer: Your (client) IP address, options 54 and 51. Challenge: options 3 and 6 in the same Offer. Fill in answers/4.1.yml, then make check T=4.1. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make capture AT=laptop:eth1 NAME=4.1 X=dhcp</code>, open it, filter <code>dhcp</code>.</li>
<li>Find Discover, Offer, Request, ACK. Open the Offer&rsquo;s DHCP layer: Your (client) IP address, options 54 and 51.</li>
<li>Challenge: options 3 and 6 in the same Offer.</li>
<li>Fill in answers/4.1.yml, then <code>make check T=4.1</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>Four messages and a lease</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="dora-on-the-wire">DORA, on the wire</h3>
<p>Networking 101&rsquo;s <a href="/lessons/networking-101/">DHCP lesson</a> walked through <strong>DORA</strong>, the four messages a host
uses to get an address:</p>
<table>
  <thead>
      <tr>
          <th></th>
          <th>Message</th>
          <th>From → to</th>
          <th>Says</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>D</strong></td>
          <td>Discover</td>
          <td>laptop → everyone</td>
          <td><em>I need an address. Is there a DHCP server?</em></td>
      </tr>
      <tr>
          <td><strong>O</strong></td>
          <td>Offer</td>
          <td>server → laptop</td>
          <td><em>You can have this one, with these settings</em></td>
      </tr>
      <tr>
          <td><strong>R</strong></td>
          <td>Request</td>
          <td>laptop → everyone</td>
          <td><em>I&rsquo;ll take that one, from that server</em></td>
      </tr>
      <tr>
          <td><strong>A</strong></td>
          <td>ACK</td>
          <td>server → laptop</td>
          <td><em>It&rsquo;s yours, for this long</em></td>
      </tr>
  </tbody>
</table>
<p>The laptop has no IP address yet when it sends the Discover, so it sends it from <code>0.0.0.0</code> to
<code>255.255.255.255</code>: <em>from nobody, to everybody</em>. All four messages carry the same <strong>transaction ID</strong>, a random
number the laptop picked, so it can tell the answers to its own question from anyone else&rsquo;s.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> DORA is four messages with one transaction ID. The first is sent from 0.0.0.0, because the laptop has no address yet.</p>
<h3 id="options-everything-besides-the-address">Options: everything besides the address</h3>
<p>The address itself is in a fixed field, <strong>Your (client) IP address</strong>. Everything else the server hands out is
an <strong>option</strong>, each with a number:</p>
<table>
  <thead>
      <tr>
          <th>Option</th>
          <th>What it is</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>53</strong> DHCP Message Type</td>
          <td>which of the four messages this is</td>
      </tr>
      <tr>
          <td><strong>54</strong> DHCP Server Identifier</td>
          <td>the server&rsquo;s own address: the one the Request names</td>
      </tr>
      <tr>
          <td><strong>51</strong> IP Address Lease Time</td>
          <td>how long the address is lent for, in seconds</td>
      </tr>
      <tr>
          <td><strong>1</strong> Subnet Mask</td>
          <td>the network&rsquo;s mask</td>
      </tr>
      <tr>
          <td><strong>3</strong> Router</td>
          <td>the default gateway</td>
      </tr>
      <tr>
          <td><strong>6</strong> Domain Name Server</td>
          <td>the DNS server(s)</td>
      </tr>
      <tr>
          <td><strong>15</strong> Domain Name</td>
          <td>the name added to short names (chapter 5)</td>
      </tr>
  </tbody>
</table>
<h3 id="leases-end">Leases end</h3>
<p>An address is never given for good, only <strong>leased</strong>. Halfway through the lease (option 58, the <em>renewal time</em>)
the host asks to keep it, directly and only to the server that gave it. That&rsquo;s why there&rsquo;s a fifth message in
your capture: before asking again, the lab makes the laptop hand its address back with a <strong>Release</strong>, also sent
straight to the server.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>The Offer, opened</h2>
  </header>
  <div class="lab-stage-body">
    <p>The DHCP frames of a capture like yours:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    6 1.364004043 192.168.1.175 → 192.168.2.53 DHCP 342 DHCP Release  - Transaction ID 0xf279e1f
</span></span><span class="line"><span class="cl">    8 3.030021335      0.0.0.0 → 255.255.255.255 DHCP 342 DHCP Discover - Transaction ID 0x80ad2423
</span></span><span class="line"><span class="cl">    9 3.030979710  192.168.1.1 → 192.168.1.175 DHCP 342 DHCP Offer    - Transaction ID 0x80ad2423
</span></span><span class="line"><span class="cl">   10 3.066369002      0.0.0.0 → 255.255.255.255 DHCP 342 DHCP Request  - Transaction ID 0x80ad2423
</span></span><span class="line"><span class="cl">   11 3.067947294  192.168.1.1 → 192.168.1.175 DHCP 347 DHCP ACK      - Transaction ID 0x80ad2423
</span></span></code></pre></div><p>And the start of the Offer&rsquo;s DHCP layer (<code>...</code> marks lines left out):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Dynamic Host Configuration Protocol (Offer)
</span></span><span class="line"><span class="cl">    Message type: Boot Reply (2)
</span></span><span class="line"><span class="cl">    Hops: 1
</span></span><span class="line"><span class="cl">    Transaction ID: 0x80ad2423
</span></span><span class="line"><span class="cl">    ...
</span></span><span class="line"><span class="cl">    Client IP address: 0.0.0.0
</span></span><span class="line"><span class="cl">    Your (client) IP address: 192.168.1.175
</span></span><span class="line"><span class="cl">    Next server IP address: 192.168.2.53
</span></span><span class="line"><span class="cl">    Relay agent IP address: 192.168.1.1
</span></span><span class="line"><span class="cl">    Client MAC address: aa:aa:aa:11:11:11 (aa:aa:aa:11:11:11)
</span></span><span class="line"><span class="cl">    ...
</span></span><span class="line"><span class="cl">    Option: (53) DHCP Message Type (Offer)
</span></span><span class="line"><span class="cl">    Option: (54) DHCP Server Identifier (192.168.2.53)
</span></span><span class="line"><span class="cl">    Option: (51) IP Address Lease Time
</span></span><span class="line"><span class="cl">        IP Address Lease Time: 10 minutes (600)
</span></span><span class="line"><span class="cl">    Option: (58) Renewal Time Value
</span></span><span class="line"><span class="cl">    ...
</span></span></code></pre></div><p>Something&rsquo;s odd already: the Offer comes <strong>from 192.168.1.1</strong>, which is r1, but the server identifier says
<strong>192.168.2.53</strong>, the dns server, two hops away. And there&rsquo;s a <strong>Relay agent IP address</strong>. That&rsquo;s task 4.2.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Read the Offer</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Capture the laptop releasing its address and asking for a new one:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1 <span class="nv">NAME</span><span class="o">=</span>4.1 <span class="nv">X</span><span class="o">=</span>dhcp
</span></span></code></pre></div></li>
<li>
<p>Open <code>/captures/4.1.pcapng</code> and filter <code>dhcp</code>. Find the four DORA messages, and check their transaction
IDs match.</p>
</li>
<li>
<p>Click the <strong>Offer</strong> and open its <strong>Dynamic Host Configuration Protocol</strong> layer. Find <strong>Your (client) IP
address</strong>, then option <strong>54</strong> and option <strong>51</strong>.</p>
</li>
<li>
<p>Fill in the follow-along lines:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/4.1.yml</code><span class="lab-file-how">Ctrl+P → 4.1.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">offered_ip</span><span class="p">:</span><span class="w"> </span><span class="m">192.168.1.175</span><span class="w">      </span><span class="c"># yours may be different</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">server_id</span><span class="p">:</span><span class="w"> </span><span class="m">192.168.2.53</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">lease_seconds</span><span class="p">:</span><span class="w"> </span><span class="m">600</span><span class="w">
</span></span></span></code></pre></div><p>Ten minutes is short; home routers usually give a day. Short leases suit networks where devices come and
go, and labs where you want to watch a renewal.</p>
</li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>The settings</h2>
  </header>
  <div class="lab-stage-body">
    <p>From the same Offer:</p>
<ul>
<li><code>router</code>: the default gateway it hands out (option 3);</li>
<li><code>dns_server</code>: the DNS server it hands out (option 6).</li>
</ul>
<p>Then check the laptop actually uses them: click <strong>laptop</strong> on the <strong>Topology</strong> tab, then in the <strong>laptop</strong> tab <code>ip route</code> and <code>cat /etc/resolv.conf</code>.</p>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Scroll down the options list in the details pane, or filter <code>dhcp.option.router</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/4.1.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=4.1</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">router</span><span class="p">:</span><span class="w"> </span><span class="m">192.168.1.1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">dns_server</span><span class="p">:</span><span class="w"> </span><span class="m">192.168.2.53</span><span class="w">
</span></span></span></code></pre></div><p>Every setting the laptop has, apart from its MAC address, came from those few bytes: its address, its mask, its
gateway, its DNS server, its domain name, and how long it may keep them. When a host <em>has an address but can&rsquo;t
reach anything</em>, the Offer and the ACK are the first place to look.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Two answers</title><link>https://networkdoodles.com/labs/wireshark-101/task-3-2/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-3-2/</guid><description> new to this? step by stepbeginner make capture AT=laptop:eth1 NAME=3.2 X=dupip, open it, filter arp. Find the question that got two answers. Which MAC isn’t the printer’s? Challenge: one ARP frame wasn’t an answer to anything. Who sent it? Fill in answers/3.2.yml, then make check T=3.2. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make capture AT=laptop:eth1 NAME=3.2 X=dupip</code>, open it, filter <code>arp</code>.</li>
<li>Find the question that got two answers. Which MAC isn&rsquo;t the printer&rsquo;s?</li>
<li>Challenge: one ARP frame wasn&rsquo;t an answer to anything. Who sent it?</li>
<li>Fill in answers/3.2.yml, then <code>make check T=3.2</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>When two hosts have one address</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="a-duplicate-ip-address">A duplicate IP address</h3>
<p>Every host on a network needs its own IP address. When two have the same one (someone typed an address by hand
that DHCP had already given out, a cloned virtual machine, a misconfigured printer) the network doesn&rsquo;t refuse.
Both hosts carry on, and both answer ARP for that address. Which answer the asker keeps depends on its
operating system (in this lab&rsquo;s reference capture, the laptop went with the first one), and it can change the
next time it asks. So the traffic can flip between the two, and the symptom is maddening: it works, then it
doesn&rsquo;t, then it does.</p>
<p>On the wire it&rsquo;s easy to see: <strong>one question, two different answers</strong>.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> A duplicate IP address shows up as two ARP replies with different MAC addresses for the same IP address.</p>
<h3 id="gratuitous-arp">Gratuitous ARP</h3>
<p>A host can also send ARP nobody asked for: a <strong>gratuitous ARP</strong>, announcing <em>192.168.1.20 is me, at this MAC
address</em>. Hosts send one when they bring an address up, or when an address moves to a new box (a failover), so
everyone else updates their tables straight away. Wireshark labels it in the packet list. It&rsquo;s sent as a
broadcast, so every host on the network hears it.</p>
<h3 id="expert-info">Expert info</h3>
<p>Wireshark doesn&rsquo;t only decode packets; it also notices things across them, and flags them as <strong>expert info</strong>:
a retransmission, a reply with no request, a duplicate address. They show in the packet list as colored
rows and in <strong>Analyze › Expert Information</strong>, and you can filter on them with <code>_ws.expert</code>.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>Same question, two answers</h2>
  </header>
  <div class="lab-stage-body">
    <p>The ARP frames of the reference capture:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    1 0.000000000 aa:aa:aa:33:33:33 → Broadcast    ARP 42 Gratuitous ARP for 192.168.1.20 (Request)
</span></span><span class="line"><span class="cl">    3 0.584692875 aa:aa:aa:11:11:11 → Broadcast    ARP 42 Who has 192.168.1.20? Tell 192.168.1.175
</span></span><span class="line"><span class="cl">    4 0.584883875 aa:aa:aa:33:33:33 → aa:aa:aa:11:11:11 ARP 42 192.168.1.20 is at aa:aa:aa:33:33:33
</span></span><span class="line"><span class="cl">    5 0.584884584 aa:aa:aa:22:22:22 → aa:aa:aa:11:11:11 ARP 42 192.168.1.20 is at aa:aa:aa:22:22:22
</span></span></code></pre></div><p>Wireshark flags the duplicate on frame 5, the second MAC address it saw claim <code>192.168.1.20</code> in this file.
Click it and the details pane ends with the expert info line:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">[Duplicate IP address detected for 192.168.1.20 (aa:aa:aa:22:22:22) - also in use by aa:aa:aa:33:33:33 (frame 4)]
</span></span></code></pre></div><p>Expert info only knows what&rsquo;s in the file. If your capture happens to start with a frame from the printer,
the warning lands on a different frame, even on the gratuitous ARP itself. You may also see hosts ARPing for
each other at the very start: hosts re-check the entries in their tables every so often, and a capture catches
whatever happens to be going on.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Find the duplicate</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Capture it. The lab gives broken-pc the printer&rsquo;s address for a few seconds, has it announce that, has the
laptop look for the printer, then takes the address away again:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1 <span class="nv">NAME</span><span class="o">=</span>3.2 <span class="nv">X</span><span class="o">=</span>dupip
</span></span></code></pre></div></li>
<li>
<p>Open <code>/captures/3.2.pcapng</code> and filter <code>arp</code>. Find the <strong>Who has 192.168.1.20?</strong> with two <strong>is at</strong> lines
after it.</p>
</li>
<li>
<p>One of those MAC addresses is the printer&rsquo;s: you found it in task 3.1. The other one isn&rsquo;t.</p>
</li>
<li>
<p>Open <strong>Analyze › Expert Information</strong> and look for the warning about a duplicate address.</p>
</li>
<li>
<p>Fill in the follow-along lines:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/3.2.yml</code><span class="lab-file-how">Ctrl+P → 3.2.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">duplicate_ip</span><span class="p">:</span><span class="w"> </span><span class="m">192.168.1.20</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">impostor_mac</span><span class="p">:</span><span class="w"> </span><span class="l">aa:aa:aa:33:33:33</span><span class="w">
</span></span></span></code></pre></div></li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>The announcement</h2>
  </header>
  <div class="lab-stage-body">
    <p>One ARP frame wasn&rsquo;t an answer to any question. Who sent it?</p>
<ul>
<li><code>gratuitous_mac</code>: the MAC address that sent the gratuitous ARP.</li>
</ul>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Filter <code>arp.isgratuitous == 1</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/3.2.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=3.2</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">gratuitous_mac</span><span class="p">:</span><span class="w"> </span><span class="l">aa:aa:aa:33:33:33</span><span class="w">
</span></span></span></code></pre></div><p>broken-pc announced itself as <code>192.168.1.20</code> before anyone asked. Hosts that hear a gratuitous ARP may update
the entry they already have for that address (whether they do depends on the operating system and its
settings), and from then on send the printer&rsquo;s traffic to broken-pc. Nothing on those hosts would say so. The
capture does.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Who has?</title><link>https://networkdoodles.com/labs/wireshark-101/task-3-1/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-3-1/</guid><description> new to this? step by stepbeginner make capture AT=laptop:eth1 NAME=3.1 X=arp, open it, filter arp. Open the first request and its reply: the printer’s MAC, and where the request was sent. Challenge: the second request, made to reach web. Which IP address did it ask about? Whose MAC came back? Fill in answers/3.1.yml, then make check T=3.1. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make capture AT=laptop:eth1 NAME=3.1 X=arp</code>, open it, filter <code>arp</code>.</li>
<li>Open the first request and its reply: the printer&rsquo;s MAC, and where the request was sent.</li>
<li>Challenge: the second request, made to reach web. Which IP address did it ask about? Whose MAC came back?</li>
<li>Fill in answers/3.1.yml, then <code>make check T=3.1</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>A question to everyone, an answer to one</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="what-arp-is-for">What ARP is for</h3>
<p>You met ARP in task 1.1: before the laptop could ping the printer, it had to learn the printer&rsquo;s MAC address.
Networking 101 explained why. An IP packet travels inside an Ethernet frame, and the frame needs a <strong>to</strong> MAC
address. The laptop knows the printer&rsquo;s IP address but not its MAC address, so it asks the whole network.</p>
<p>ARP has two messages:</p>
<ul>
<li>the <strong>request</strong>, sent to everyone (the broadcast MAC address, <code>ff:ff:ff:ff:ff:ff</code>): <em>who has 192.168.1.20?
Tell 192.168.1.175</em>;</li>
<li>the <strong>reply</strong>, sent only to the one that asked: <em>192.168.1.20 is at aa:aa:aa:22:22:22</em>.</li>
</ul>
<p class="lab-recap"><span class="mono">in one sentence</span> ARP asks everyone <em>who has this IP address?</em>; only the owner answers, and only to the asker.</p>
<h3 id="two-pairs-of-addresses">Two pairs of addresses</h3>
<p>An ARP message carries four addresses, and Wireshark labels them like this:</p>
<table>
  <thead>
      <tr>
          <th>Field</th>
          <th>In the request</th>
          <th>In the reply</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>Sender MAC address</strong></td>
          <td>the laptop&rsquo;s MAC</td>
          <td>the printer&rsquo;s MAC: the answer</td>
      </tr>
      <tr>
          <td><strong>Sender IP address</strong></td>
          <td>the laptop&rsquo;s IP</td>
          <td>the printer&rsquo;s IP</td>
      </tr>
      <tr>
          <td><strong>Target MAC address</strong></td>
          <td><code>00:00:00:00:00:00</code>: unknown, that&rsquo;s the question</td>
          <td>the laptop&rsquo;s MAC</td>
      </tr>
      <tr>
          <td><strong>Target IP address</strong></td>
          <td>the IP being asked about</td>
          <td>the laptop&rsquo;s IP</td>
      </tr>
  </tbody>
</table>
<p>The <strong>Opcode</strong> says which one it is: <code>request (1)</code> or <code>reply (2)</code>.</p>
<h3 id="only-for-your-own-network">Only for your own network</h3>
<p>ARP is a broadcast, and broadcasts stop at the router. So a host only ever ARPs for addresses <strong>on its own
network</strong>. For anything further away, it sends the packet to its <strong>default gateway</strong>, and so it ARPs for the
gateway instead. The IP packet still says <em>to web</em>; the Ethernet frame says <em>to r1</em>.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>A request and a reply</h2>
  </header>
  <div class="lab-stage-body">
    <p>Filtered to <code>arp</code>, a capture like yours:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    2 1.263625709 aa:aa:aa:11:11:11 → Broadcast    ARP 42 Who has 192.168.1.20? Tell 192.168.1.175
</span></span><span class="line"><span class="cl">    3 1.264371584 aa:aa:aa:22:22:22 → aa:aa:aa:11:11:11 ARP 42 192.168.1.20 is at aa:aa:aa:22:22:22
</span></span><span class="line"><span class="cl">    8 1.629981209 aa:aa:aa:11:11:11 → Broadcast    ARP 42 Who has 192.168.1.1? Tell 192.168.1.175
</span></span><span class="line"><span class="cl">    9 1.630064376 aa:c1:ab:fd:00:84 → aa:aa:aa:11:11:11 ARP 42 192.168.1.1 is at aa:c1:ab:fd:00:84
</span></span></code></pre></div><p>And frame 2 in the details pane:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Ethernet II, Src: aa:aa:aa:11:11:11 (aa:aa:aa:11:11:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
</span></span><span class="line"><span class="cl">Address Resolution Protocol (request)
</span></span><span class="line"><span class="cl">    Hardware type: Ethernet (1)
</span></span><span class="line"><span class="cl">    Protocol type: IPv4 (0x0800)
</span></span><span class="line"><span class="cl">    Hardware size: 6
</span></span><span class="line"><span class="cl">    Protocol size: 4
</span></span><span class="line"><span class="cl">    Opcode: request (1)
</span></span><span class="line"><span class="cl">    Sender MAC address: aa:aa:aa:11:11:11 (aa:aa:aa:11:11:11)
</span></span><span class="line"><span class="cl">    Sender IP address: 192.168.1.175
</span></span><span class="line"><span class="cl">    Target MAC address: 00:00:00_00:00:00 (00:00:00:00:00:00)
</span></span><span class="line"><span class="cl">    Target IP address: 192.168.1.20
</span></span></code></pre></div><p><code>Broadcast</code> is Wireshark&rsquo;s name for <code>ff:ff:ff:ff:ff:ff</code>. The laptop&rsquo;s own IP address is whatever DHCP gave it
(<code>192.168.1.175</code> here); yours may be different. r1&rsquo;s MAC address is made up when the lab starts, so yours
will differ from <code>aa:c1:ab:fd:00:84</code>.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>The printer&rsquo;s answer</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Capture the laptop pinging the printer and then web. The lab empties the laptop&rsquo;s ARP table first, so it
has to ask:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1 <span class="nv">NAME</span><span class="o">=</span>3.1 <span class="nv">X</span><span class="o">=</span>arp
</span></span></code></pre></div></li>
<li>
<p>Open <code>/captures/3.1.pcapng</code> in Wireshark and filter <code>arp</code>.</p>
</li>
<li>
<p>Click the first <strong>Who has 192.168.1.20?</strong> and open its Ethernet and ARP layers. Note the Ethernet <strong>Dst</strong>.
Then click the reply below it and read its <strong>Sender MAC address</strong>.</p>
</li>
<li>
<p>Fill in the follow-along lines:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/3.1.yml</code><span class="lab-file-how">Ctrl+P → 3.1.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">printer_mac</span><span class="p">:</span><span class="w"> </span><span class="l">aa:aa:aa:22:22:22</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">request_dst_mac</span><span class="p">:</span><span class="w"> </span><span class="l">ff:ff:ff:ff:ff:ff</span><span class="w">
</span></span></span></code></pre></div><p>(<code>broadcast</code> is accepted too.)</p>
</li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Reaching further</h2>
  </header>
  <div class="lab-stage-body">
    <p>The laptop&rsquo;s second ARP request was made so it could ping <strong>web</strong>, <code>192.168.2.10</code>. Look at it:</p>
<ul>
<li><code>asked_for_web</code>: the IP address it asked about;</li>
<li><code>gateway_mac</code>: the MAC address that came back.</li>
</ul>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>The second request isn&rsquo;t <em>Who has 192.168.2.10?</em>. Why not?</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Read the reply&rsquo;s <strong>Sender MAC address</strong>. To be sure whose it is, click <strong>r1</strong> on the <strong>Topology</strong> tab, then in the <strong>r1</strong> tab <code>show interfaces GigabitEthernet1</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/3.1.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=3.1</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">asked_for_web</span><span class="p">:</span><span class="w"> </span><span class="m">192.168.1.1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">gateway_mac: aa:c1:ab:fd:00:84      # yours is different</span><span class="p">:</span><span class="w"> </span><span class="l">r1&#39;s MAC address</span><span class="w">
</span></span></span></code></pre></div><p>web is on another network, so the laptop never ARPs for it. It ARPs for its gateway, r1, and sends every frame
for web to r1&rsquo;s MAC address. Now look at a ping to web in the capture: IP destination <code>192.168.2.10</code>, Ethernet
destination r1. That one frame is the whole of Networking 101&rsquo;s routing lesson.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Capture filters</title><link>https://networkdoodles.com/labs/wireshark-101/task-2-2/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-2-2/</guid><description> new to this? step by stepbeginner make capture AT=laptop:eth1 NAME=2.2 X=mixed F="udp port 53"; open it; count the frames. Challenge: write two BPF filters; try each with tcpdump -r pcaps/mixed.pcapng '&lt;filter&gt;'. Fill in answers/2.2.yml, then make check T=2.2. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make capture AT=laptop:eth1 NAME=2.2 X=mixed F=&quot;udp port 53&quot;</code>; open it; count the frames.</li>
<li>Challenge: write two BPF filters; try each with <code>tcpdump -r pcaps/mixed.pcapng '&lt;filter&gt;'</code>.</li>
<li>Fill in answers/2.2.yml, then <code>make check T=2.2</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>Deciding what gets saved at all</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="two-kinds-of-filter">Two kinds of filter</h3>
<p>A display filter (task 2.1) works on a capture you already have: it hides frames, and you can always clear it.
A <strong>capture filter</strong> works <em>while</em> you capture: it decides which frames get written down in the first place.
Whatever it rejects is never saved. There&rsquo;s no clearing it afterwards.</p>
<p>Why would you ever want that? Because real networks are busy. Capture everything on a server&rsquo;s uplink for an
hour and you may have gigabytes, most of it irrelevant, and some of it data you&rsquo;d rather not keep (other
people&rsquo;s traffic). A capture filter keeps the file small and keeps only what you&rsquo;re allowed and need to see.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> A capture filter decides what&rsquo;s saved at all; a display filter decides what&rsquo;s shown. One is final, the other isn&rsquo;t.</p>
<h3 id="a-different-language">A different language</h3>
<p>Capture filters aren&rsquo;t written in Wireshark&rsquo;s display filter language. They use <strong>BPF</strong> (the <em>Berkeley Packet
Filter</em>), the language of <code>tcpdump</code> and of the operating system&rsquo;s capture code, which is simpler and much older:</p>
<table>
  <thead>
      <tr>
          <th>BPF capture filter</th>
          <th>Display filter that means the same</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>host 192.168.2.10</code></td>
          <td><code>ip.addr == 192.168.2.10</code></td>
      </tr>
      <tr>
          <td><code>src host 192.168.1.20</code></td>
          <td><code>ip.src == 192.168.1.20</code></td>
      </tr>
      <tr>
          <td><code>udp port 53</code></td>
          <td><code>udp.port == 53</code></td>
      </tr>
      <tr>
          <td><code>tcp port 443</code></td>
          <td><code>tcp.port == 443</code></td>
      </tr>
      <tr>
          <td><code>ether host aa:aa:aa:11:11:11</code></td>
          <td><code>eth.addr == aa:aa:aa:11:11:11</code></td>
      </tr>
      <tr>
          <td><code>arp</code> · <code>not arp</code></td>
          <td><code>arp</code> · <code>!arp</code></td>
      </tr>
      <tr>
          <td><code>host 192.168.2.10 and tcp port 80</code></td>
          <td><code>ip.addr == 192.168.2.10 &amp;&amp; tcp.port == 80</code></td>
      </tr>
  </tbody>
</table>
<p>BPF only knows about headers: addresses, ports, protocol numbers. It can&rsquo;t say <em>DNS</em>; it can only say <em>port
53</em>, and trust that whatever uses port 53 is DNS. That&rsquo;s the trade: fast and simple, but blind to what&rsquo;s
inside.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> Capture filters are BPF, tcpdump&rsquo;s language: addresses, ports and protocols, and the words host, port, and, or, not.</p>
<h3 id="capture-wide-filter-narrow">Capture wide, filter narrow</h3>
<p>The usual advice: unless you have to, <strong>capture with no filter, or a loose one, and narrow it down with display
filters afterwards</strong>. You can&rsquo;t add back what a capture filter threw away, and the clue you didn&rsquo;t expect is
usually in the traffic you&rsquo;d have filtered out. In this lab files are tiny, so you&rsquo;ll capture everything from
here on. The capture filter is for when you can&rsquo;t.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>F= and tcpdump -r</h2>
  </header>
  <div class="lab-stage-body">
    <p><code>make capture</code> takes a capture filter as <code>F=</code>. The lab applies it with tcpdump, exactly as a filter on the
wire would, and only what passes is written to the file:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">$ make capture AT=laptop:eth1 NAME=2.2 X=mixed F=&#34;udp port 53&#34;
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">  capturing on laptop:eth1, keeping only: udp port 53  →  captures/2.2.pcapng
</span></span><span class="line"><span class="cl">  ...
</span></span><span class="line"><span class="cl">  saved 10 frames to captures/2.2.pcapng
</span></span></code></pre></div><p>To test a capture filter without capturing, run tcpdump on a file you already have: <code>-r</code> reads it, and the
filter goes last, in quotes. It prints one line per packet that passes:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">$ tcpdump -nn -r pcaps/mixed.pcapng &#39;host 192.168.2.10 and tcp port 80&#39;
</span></span><span class="line"><span class="cl">reading from file pcaps/mixed.pcapng, link-type EN10MB (Ethernet), snapshot length 262144
</span></span><span class="line"><span class="cl">01:46:14.809114 IP 192.168.1.175.50124 &gt; 192.168.2.10.80: Flags [S], seq 2744843428, win 64240, options [...], length 0
</span></span><span class="line"><span class="cl">01:46:14.809350 IP 192.168.2.10.80 &gt; 192.168.1.175.50124: Flags [S.], seq 3313393487, ack 2744843429, win 65160, ...
</span></span><span class="line"><span class="cl">...
</span></span></code></pre></div><p><code>-nn</code> keeps addresses and ports as numbers instead of looking up names. tcpdump comes with the dev container.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Keep only DNS</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Capture the laptop&rsquo;s mixed traffic, keeping only port 53:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1 <span class="nv">NAME</span><span class="o">=</span>2.2 <span class="nv">X</span><span class="o">=</span>mixed <span class="nv">F</span><span class="o">=</span><span class="s2">&#34;udp port 53&#34;</span>
</span></span></code></pre></div><p>The traffic had pings, ARP, HTTP and HTTPS in it too. None of it was saved.</p>
</li>
<li>
<p>Open <code>/captures/2.2.pcapng</code> in Wireshark (or <code>tshark -r captures/2.2.pcapng</code>). Every frame is DNS. Count them.</p>
</li>
<li>
<p>Fill in the follow-along line:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/2.2.yml</code><span class="lab-file-how">Ctrl+P → 2.2.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">dns_frames</span><span class="p">:</span><span class="w"> </span><span class="m">10</span><span class="w">
</span></span></span></code></pre></div><p>(Yours may differ by a frame or two. The checker counts the frames in <em>your</em> file.)</p>
</li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Two capture filters</h2>
  </header>
  <div class="lab-stage-body">
    <p>Write two capture filters in BPF. Test each on the reference capture with <code>tcpdump -nn -r pcaps/mixed.pcapng '...'</code> until it keeps exactly what&rsquo;s asked, then put them in <strong>answers/2.2.yml</strong>:</p>
<ul>
<li><code>bpf_https_web</code>: HTTPS (TCP port 443) to or from web, <code>192.168.2.10</code>;</li>
<li><code>bpf_laptop_not_arp</code>: every frame to or from the laptop&rsquo;s network card, except ARP.</li>
</ul>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Join conditions with <code>and</code>. A host match is <code>host 192.168.2.10</code>; a port is <code>tcp port 443</code>.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>The laptop&rsquo;s IP address isn&rsquo;t in ARP frames or DHCP&rsquo;s first messages; its MAC address is in every frame it
sends or receives: <code>ether host ...</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/2.2.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=2.2</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">bpf_https_web</span><span class="p">:</span><span class="w"> </span><span class="l">host 192.168.2.10 and tcp port 443</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">bpf_laptop_not_arp</span><span class="p">:</span><span class="w"> </span><span class="l">ether host aa:aa:aa:11:11:11 and not arp</span><span class="w">
</span></span></span></code></pre></div><p>The checker runs both through tcpdump on <code>pcaps/mixed.pcapng</code> and compares the packets they keep with ours,
so <code>tcp port 443 and host 192.168.2.10</code> passes as well. Order doesn&rsquo;t matter in an <code>and</code>.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Display filters</title><link>https://networkdoodles.com/labs/wireshark-101/task-2-1/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-2-1/</guid><description> new to this? step by stepbeginner Open /pcaps/mixed.pcapng in Wireshark. Try dns, ip.addr == 192.168.1.20 and !(ip.addr == 192.168.2.10) in the filter bar; note how many frames each displays. Challenge: DNS or ARP sent by the laptop; the first packet of each TCP connection. One filter per line in answers/2.1.yml, then make check T=2.1. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li>Open <code>/pcaps/mixed.pcapng</code> in Wireshark.</li>
<li>Try <code>dns</code>, <code>ip.addr == 192.168.1.20</code> and <code>!(ip.addr == 192.168.2.10)</code> in the filter bar; note how many frames each displays.</li>
<li>Challenge: DNS or ARP sent by the laptop; the first packet of each TCP connection.</li>
<li>One filter per line in answers/2.1.yml, then <code>make check T=2.1</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>Hiding what you don&rsquo;t need</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="a-filter-is-a-question-about-each-frame">A filter is a question about each frame</h3>
<p>Real captures are busy. The one for this task has DNS, ARP, pings, web pages and the switch&rsquo;s STP messages
all mixed together, and that&rsquo;s from 15 seconds on a quiet network. A <strong>display filter</strong> is a question Wireshark
asks about every frame: <em>is this DNS?</em>, <em>is this from the printer?</em>. Frames that answer yes are shown; the
rest are hidden, not deleted. Clear the filter and they&rsquo;re all back.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> A display filter hides the frames you don&rsquo;t want to look at. It never changes the file.</p>
<h3 id="the-words-a-filter-is-made-of">The words a filter is made of</h3>
<p>Every line in the packet details pane is a <strong>field</strong> with a name. Click one and its name appears in the
status bar: <code>ip.src</code>, <code>dns.qry.name</code>, <code>tcp.flags.syn</code>. A filter is built from those names:</p>
<table>
  <thead>
      <tr>
          <th>Filter</th>
          <th>Shows</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>dns</code></td>
          <td>frames that have a DNS layer at all</td>
      </tr>
      <tr>
          <td><code>ip.src == 192.168.1.20</code></td>
          <td>frames whose IP source is the printer</td>
      </tr>
      <tr>
          <td><code>ip.addr == 192.168.1.20</code></td>
          <td>frames where the printer is the source <strong>or</strong> the destination</td>
      </tr>
      <tr>
          <td><code>eth.src == aa:aa:aa:11:11:11</code></td>
          <td>frames sent by the laptop&rsquo;s network card</td>
      </tr>
      <tr>
          <td><code>dns &amp;&amp; ip.src == 192.168.1.175</code></td>
          <td>both must be true (<code>&amp;&amp;</code> or <code>and</code>)</td>
      </tr>
      <tr>
          <td><code>arp || dns</code></td>
          <td>either one (<code>||</code> or <code>or</code>)</td>
      </tr>
      <tr>
          <td><code>!(arp)</code></td>
          <td>not ARP (<code>!</code> or <code>not</code>)</td>
      </tr>
  </tbody>
</table>
<p><code>ip.addr</code> is a shortcut field that matches <em>either</em> address. <code>eth.addr</code> and <code>tcp.port</code> work the same way.</p>
<h3 id="the--trap-and-how-it-changed">The <code>!=</code> trap, and how it changed</h3>
<p>Older guides warn you never to write <code>ip.addr != 192.168.2.10</code>, because in old versions of Wireshark it matched
frames where <em>either</em> address was different, which is nearly all of them. <strong>Wireshark 3.6 changed that</strong>.
Now <code>!=</code> means <em>every</em> address is different, which is what you&rsquo;d expect. The old meaning is still there
if you ever need it, spelled <code>!==</code>.</p>
<p>There&rsquo;s still one difference left, and it&rsquo;s the one this task tests. <code>ip.addr != 192.168.2.10</code> only matches
frames that <strong>have an IP address</strong>. ARP and STP frames have none, so they&rsquo;re left out too. If you want
<em>everything except web&rsquo;s traffic</em>, write the negation of the positive question:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">!(ip.addr == 192.168.2.10)
</span></span></code></pre></div><p><em>Not (web is in it)</em> is true for ARP and STP as well, so they stay.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> <code>x != y</code> needs the field to exist; <code>!(x == y)</code> doesn&rsquo;t. When in doubt, filter for what you want to hide, then put <code>!( )</code> round it.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>The filter bar</h2>
  </header>
  <div class="lab-stage-body">
    <p>The filter bar is the long box above the packet list, labeled <em>Apply a display filter</em>. It turns
<strong>green</strong> when the filter makes sense, <strong>red</strong> when it doesn&rsquo;t (a typo in a field name, <code>=</code> instead of <code>==</code>),
and <strong>yellow</strong> when it works but might not mean what you think. Press Enter to apply it.</p>
<p>In the terminal, <code>-Y</code> takes the same filter:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">$ tshark -r pcaps/mixed.pcapng -Y &#39;ip.addr == 192.168.1.20&#39;
</span></span><span class="line"><span class="cl">   12 1.940422085 192.168.1.20 → 192.168.2.53 ICMP 98 Echo (ping) request  id=0x0924, seq=1/256, ttl=64
</span></span><span class="line"><span class="cl">   13 1.940563251 192.168.2.53 → 192.168.1.20 ICMP 98 Echo (ping) reply    id=0x0924, seq=1/256, ttl=62 (request in 12)
</span></span><span class="line"><span class="cl">   15 2.248244168 192.168.1.20 → 192.168.2.53 ICMP 98 Echo (ping) request  id=0x0924, seq=2/512, ttl=64
</span></span><span class="line"><span class="cl">   ...
</span></span></code></pre></div><p>A quick way to build one: right-click any field in the details pane, then <strong>Apply as Filter › Selected</strong>.
Wireshark writes the filter for you.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Three filters</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>In Wireshark, open <code>/pcaps/mixed.pcapng</code> (the reference captures are in <code>/pcaps</code>).</p>
</li>
<li>
<p>Try each of these in the filter bar. After each, read <strong>Displayed</strong> in the status bar:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">dns
</span></span><span class="line"><span class="cl">ip.addr == 192.168.1.20
</span></span><span class="line"><span class="cl">ip.addr != 192.168.2.10
</span></span><span class="line"><span class="cl">!(ip.addr == 192.168.2.10)
</span></span></code></pre></div><p>The last two look the same, but they display different numbers of frames. Clear the filter, then find the
frames that only the last one shows: they&rsquo;re ARP and STP.</p>
</li>
<li>
<p>Write the three that answer the follow-along questions, one per line:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/2.1.yml</code><span class="lab-file-how">Ctrl+P → 2.1.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">dns</span><span class="p">:</span><span class="w"> </span><span class="l">dns</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">printer</span><span class="p">:</span><span class="w"> </span><span class="l">ip.addr == 192.168.1.20</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">not_web</span><span class="p">:</span><span class="w"> </span>!<span class="l">(ip.addr == 192.168.2.10)</span><span class="w">
</span></span></span></code></pre></div><p>No quotes are needed around the filters. The checker tries each one on <code>pcaps/mixed.pcapng</code> and compares the
frames it picks with the right ones, so a different filter that picks exactly the same frames passes too.</p>
</li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Two of your own</h2>
  </header>
  <div class="lab-stage-body">
    <ul>
<li><code>laptop_dns_or_arp</code>: DNS or ARP frames <strong>sent by the laptop</strong>. Careful: the laptop&rsquo;s IP address can change
(DHCP), and ARP frames have no IP layer anyway. What&rsquo;s the one address that&rsquo;s in every frame the laptop sends?</li>
<li><code>syn_only</code>: the <strong>first packet of each TCP connection</strong>. It&rsquo;s the one with the SYN flag set and the ACK
flag not set (chapter 6 explains why).</li>
</ul>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>The laptop&rsquo;s MAC address is <code>aa:aa:aa:11:11:11</code>, in <code>eth.src</code>.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Group with parentheses: <code>(dns || arp) &amp;&amp; ...</code>. Flags are fields of their own: <code>tcp.flags.syn == 1</code>.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/2.1.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=2.1</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">laptop_dns_or_arp</span><span class="p">:</span><span class="w"> </span><span class="l">(dns || arp) &amp;&amp; eth.src == aa:aa:aa:11:11:11</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">syn_only</span><span class="p">:</span><span class="w"> </span><span class="l">tcp.flags.syn == 1 &amp;&amp; tcp.flags.ack == 0</span><span class="w">
</span></span></span></code></pre></div><p>Without the parentheses, <code>dns || arp &amp;&amp; eth.src == ...</code> means <em>DNS from anyone, or ARP from the laptop</em> (13
frames, not 6): <code>&amp;&amp;</code> binds tighter than <code>||</code>, as × does before + in arithmetic. That&rsquo;s been the rule since
Wireshark 4.0, so a filter written for an older version can behave differently. Parentheses make it the same in every version.</p>
<p><code>tcp.flags.syn == 1</code> alone would also match the server&rsquo;s SYN-ACK, which has both flags set.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Where you capture</title><link>https://networkdoodles.com/labs/wireshark-101/task-1-2/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-1-2/</guid><description> new to this? step by stepbeginner make ports: find the switch ports that lead to r1 and to the printer. make capture AT=sw1:eth1,sw1:eth3 NAME=1.2 X=crossping. In Wireshark, filter frame.interface_name == "sw1:eth1", then "sw1:eth3". Count ICMP and ARP on each. Fill in answers/1.2.yml, then make check T=1.2. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make ports</code>: find the switch ports that lead to r1 and to the printer.</li>
<li><code>make capture AT=sw1:eth1,sw1:eth3 NAME=1.2 X=crossping</code>.</li>
<li>In Wireshark, filter <code>frame.interface_name == &quot;sw1:eth1&quot;</code>, then <code>&quot;sw1:eth3&quot;</code>. Count ICMP and ARP on each.</li>
<li>Fill in answers/1.2.yml, then <code>make check T=1.2</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>A capture only sees its own cable</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="the-question-every-capture-starts-with">The question every capture starts with</h3>
<p>In task 1.1 you listened on the laptop&rsquo;s cable, and saw everything the laptop said. That was easy, because the
laptop was one end of every conversation. Usually it isn&rsquo;t that simple: the problem is between two other
computers, and you have to pick <strong>where to listen</strong>. Pick the wrong cable and you see nothing, and <em>nothing</em>
looks exactly like <em>the traffic never happened</em>.</p>
<h3 id="what-a-switch-sends-where">What a switch sends where</h3>
<p>Networking 101&rsquo;s <a href="/lessons/networking-101/">lesson on hubs, switches and routers</a> gave you the rule:</p>
<ul>
<li>a frame to one <strong>MAC address</strong> goes out of <strong>one port</strong>: the one the switch learned that address on;</li>
<li>a <strong>broadcast</strong> (to <code>ff:ff:ff:ff:ff:ff</code>) goes out of <strong>every port</strong> except the one it came in on.</li>
</ul>
<p>So a capture on a switch port sees the traffic of whatever is plugged into that port, plus every broadcast on
the network. Nothing else.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> On a switch, each port only carries its own host&rsquo;s frames and the network&rsquo;s broadcasts.</p>
<h3 id="two-ports-one-file">Two ports, one file</h3>
<p><code>make capture</code> can listen on several ports at once and write them into one file. pcapng records which port
each frame came from, and Wireshark shows it in the frame&rsquo;s first line (<code>on interface sw1:eth1</code>) and lets you
filter on it: <code>frame.interface_name == &quot;sw1:eth1&quot;</code>. You&rsquo;ll use that in every chapter from here on.</p>
<p>Here, <code>sw1:eth1</code> is the switch&rsquo;s port towards r1, and <code>sw1:eth3</code> is the switch&rsquo;s port towards the printer.
The laptop pings <strong>web</strong>, which is two routers away, so every ping goes laptop → switch → r1.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>The same moment, from two ports</h2>
  </header>
  <div class="lab-stage-body">
    <p><code>make ports</code> prints every port you can capture on:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">│ sw1       │ eth1      │ N/A   │ r1        │ eth1           │
</span></span><span class="line"><span class="cl">│           │ eth2      │ N/A   │ laptop    │ eth1           │
</span></span><span class="line"><span class="cl">│           │ eth3      │ N/A   │ printer   │ eth1           │
</span></span><span class="line"><span class="cl">│           │ eth4      │ N/A   │ broken-pc │ eth1           │
</span></span></code></pre></div><p>And here&rsquo;s a capture of both ports, with the port in the second column:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"> 3	sw1:eth3	ARP	Who has 192.168.1.1? Tell 192.168.1.175
</span></span><span class="line"><span class="cl"> 4	sw1:eth1	ARP	Who has 192.168.1.1? Tell 192.168.1.175
</span></span><span class="line"><span class="cl"> 5	sw1:eth1	ARP	192.168.1.1 is at aa:c1:ab:fd:00:84
</span></span><span class="line"><span class="cl"> 6	sw1:eth1	ICMP	Echo (ping) request  id=0x07a1, seq=1/256, ttl=64
</span></span><span class="line"><span class="cl"> 7	sw1:eth1	ICMP	Echo (ping) reply    id=0x07a1, seq=1/256, ttl=62 (request in 6)
</span></span></code></pre></div><p>That&rsquo;s <code>tshark</code> with a column for the interface name. In Wireshark, add it yourself: right-click
<code>Interface name</code> in a frame&rsquo;s first line in the details pane, then <strong>Apply as Column</strong>.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Capture two ports</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>See which ports lead where:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make ports
</span></span></code></pre></div></li>
<li>
<p>Capture r1&rsquo;s port and the printer&rsquo;s port while the laptop pings web three times:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>sw1:eth1,sw1:eth3 <span class="nv">NAME</span><span class="o">=</span>1.2 <span class="nv">X</span><span class="o">=</span>crossping
</span></span></code></pre></div></li>
<li>
<p>Open <code>/captures/1.2.pcapng</code> in Wireshark. Type this in the display filter bar at the top and press Enter:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">frame.interface_name == &#34;sw1:eth1&#34; &amp;&amp; icmp
</span></span></code></pre></div><p>The status bar at the bottom says how many frames are <strong>Displayed</strong>. Those are the pings and the replies,
on r1&rsquo;s port.</p>
</li>
<li>
<p>Fill in the follow-along line:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/1.2.yml</code><span class="lab-file-how">Ctrl+P → 1.2.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">icmp_on_r1_port</span><span class="p">:</span><span class="w"> </span><span class="m">6</span><span class="w">
</span></span></span></code></pre></div><p>(Three requests and three replies. Look at the replies&rsquo; TTL: 62. They were sent at 64 by web, and two
routers took one off each.)</p>
</li>
</ol>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>The printer&rsquo;s port</h2>
  </header>
  <div class="lab-stage-body">
    <p>Now look at the printer&rsquo;s port, <code>sw1:eth3</code>. Before you filter, guess: how much of the laptop&rsquo;s ping
conversation reached the printer&rsquo;s cable?</p>
<ul>
<li><code>icmp_on_printer_port</code>: ICMP packets on <code>sw1:eth3</code>;</li>
<li><code>arp_on_printer_port</code>: ARP packets on <code>sw1:eth3</code>.</li>
</ul>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Change the filter to <code>frame.interface_name == &quot;sw1:eth3&quot;</code>, with and without <code>&amp;&amp; icmp</code>.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Which of the laptop&rsquo;s frames were addressed to <em>everyone</em>?</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/1.2.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=1.2</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">icmp_on_printer_port</span><span class="p">:</span><span class="w"> </span><span class="m">0</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">arp_on_printer_port</span><span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
</span></span></span></code></pre></div><p>The pings were addressed to r1&rsquo;s MAC address, so the switch sent them out of r1&rsquo;s port only. The one frame
the printer&rsquo;s cable did carry is the laptop&rsquo;s ARP <strong>request</strong>: a broadcast, so the switch sent it everywhere.
r1&rsquo;s <strong>reply</strong> was addressed to the laptop alone, so it isn&rsquo;t there either.</p>
<p>That&rsquo;s the rule for the rest of the course: before you capture, ask <em>which cable does this conversation
actually cross?</em>. A capture on the printer&rsquo;s port would never show you a problem with the laptop&rsquo;s web traffic.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item><item><title>Your first capture</title><link>https://networkdoodles.com/labs/wireshark-101/task-1-1/</link><pubDate>Mon, 16 Nov 2026 09:00:00 -0500</pubDate><dc:creator>David Henderson</dc:creator><guid>https://networkdoodles.com/labs/wireshark-101/task-1-1/</guid><description> new to this? step by stepbeginner make capture AT=laptop:eth1 NAME=1.1 X=ping. The lab app’s Wireshark tab, Start Wireshark, then File › Open › /captures/1.1.pcapng. Read the packet list: what came before the first ping? Count the echo requests. Challenge: click a reply. Its Ethernet layer has the printer’s MAC address, its IP layer the TTL. Fill in answers/1.1.yml, then make check T=1.1. more in meet the lab</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<details class="lab-basics">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-6 8-6s8 2 8 6"/></svg>
 <span>new to this? step by step</span><em>beginner</em></summary>
  <div class="lab-basics-body">
    <ol>
<li><code>make capture AT=laptop:eth1 NAME=1.1 X=ping</code>.</li>
<li>The lab app&rsquo;s <strong>Wireshark</strong> tab, <strong>Start Wireshark</strong>, then File › Open › <code>/captures/1.1.pcapng</code>.</li>
<li>Read the packet list: what came before the first ping? Count the echo requests.</li>
<li>Challenge: click a reply. Its Ethernet layer has the printer&rsquo;s MAC address, its IP layer the TTL.</li>
<li>Fill in answers/1.1.yml, then <code>make check T=1.1</code>.</li>
</ol>

    <p class="lab-basics-more mono">more in <a href="/labs/basics/">meet the lab</a></p>
  </div>
</details>


<section class="lab-stage lab-stage-explain" id="explain">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">1</span>
    <span class="lab-stage-kind mono">explain</span><h2>A recording of one cable</h2>
  </header>
  <div class="lab-stage-body">
    <h3 id="what-a-capture-is">What a capture is</h3>
<p>A <strong>packet capture</strong> is a recording of every frame that crossed one place in the network, while the
recording ran. Each one is written down exactly as it was, bit for bit, with the time it was seen. Nothing
is summarized and nothing is left out.</p>
<p>That&rsquo;s what makes it different from everything else you&rsquo;ve used so far. <code>ip neigh</code> tells you what the laptop
<em>concluded</em>. <code>show mac address-table</code> tells you what the switch <em>learned</em>. A capture shows you what was
<em>actually sent</em>, and in what order. When those disagree, the capture wins.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> A capture is a word-for-word recording of the frames that crossed one point, with the time of each.</p>
<h3 id="where-this-one-is-taken">Where this one is taken</h3>
<p><code>make capture AT=laptop:eth1</code> records the laptop&rsquo;s only network card, <code>eth1</code>: the cable between the laptop
and the switch. It&rsquo;s like clipping a listening device onto that one cable. You&rsquo;ll see everything the laptop
sends and everything that&rsquo;s sent to it, and nothing else.</p>
<p>The lab does the recording from <em>outside</em> the laptop, with <code>containerlab capture</code>, so nothing on the laptop
knows it&rsquo;s being watched. The file lands in <code>captures/1.1.pcapng</code>. <strong>pcapng</strong> (<em>packet capture, next
generation</em>) is the file format Wireshark saves by default. It holds the frames, and also the name of the
port each one was captured on, which matters in task 1.2.</p>
<p class="lab-recap"><span class="mono">in one sentence</span> <code>AT=</code> names the cable you&rsquo;re listening on; the frames go into a <code>.pcapng</code> file.</p>
<h3 id="wiresharks-three-panes">Wireshark&rsquo;s three panes</h3>
<p>Open a capture and Wireshark shows three panes, top to bottom:</p>
<table>
  <thead>
      <tr>
          <th>Pane</th>
          <th>What it shows</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>Packet list</strong></td>
          <td>one line per frame: its number, the time, from, to, the protocol and a one-line summary</td>
      </tr>
      <tr>
          <td><strong>Packet details</strong></td>
          <td>the frame you clicked, layer by layer, each one a line you can open: Ethernet, then IP, then ICMP</td>
      </tr>
      <tr>
          <td><strong>Packet bytes</strong></td>
          <td>the same frame as raw bytes, in hex. Click a field in the details and its bytes light up</td>
      </tr>
  </tbody>
</table>
<p>The details pane is the layers from Networking 101, stacked the way they&rsquo;re stacked on the wire: the outermost
envelope first.</p>

  </div>
</section>


<section class="lab-stage lab-stage-show" id="show">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">2</span>
    <span class="lab-stage-kind mono">show</span><h2>One ping, layer by layer</h2>
  </header>
  <div class="lab-stage-body">
    <p>Here&rsquo;s the packet list of a capture like yours, as <code>tshark</code> prints it in the terminal (Wireshark shows the same
columns):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">    1 0.000000000 aa:aa:aa:11:11:11 → Broadcast    ARP 42 Who has 192.168.1.20? Tell 192.168.1.175
</span></span><span class="line"><span class="cl">    2 0.000113458 aa:aa:aa:22:22:22 → aa:aa:aa:11:11:11 ARP 42 192.168.1.20 is at aa:aa:aa:22:22:22
</span></span><span class="line"><span class="cl">    3 0.000115250 192.168.1.175 → 192.168.1.20 ICMP 98 Echo (ping) request  id=0x07a0, seq=1/256, ttl=64
</span></span><span class="line"><span class="cl">    4 0.000193416 192.168.1.20 → 192.168.1.175 ICMP 98 Echo (ping) reply    id=0x07a0, seq=1/256, ttl=64 (request in 3)
</span></span></code></pre></div><table>
  <thead>
      <tr>
          <th>Column</th>
          <th>What it means</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>1</code></td>
          <td>the frame number, counted from the start of the capture</td>
      </tr>
      <tr>
          <td><code>0.000113458</code></td>
          <td>seconds since the first frame</td>
      </tr>
      <tr>
          <td><code>aa:aa:aa:11:11:11 → Broadcast</code></td>
          <td>from and to. For frames with no IP layer Wireshark shows MAC addresses</td>
      </tr>
      <tr>
          <td><code>ARP</code> · <code>ICMP</code></td>
          <td>the highest layer Wireshark recognized in the frame</td>
      </tr>
      <tr>
          <td><code>42</code> · <code>98</code></td>
          <td>the frame&rsquo;s length in bytes</td>
      </tr>
      <tr>
          <td><code>Who has ...</code></td>
          <td>Wireshark&rsquo;s one-line summary of it</td>
      </tr>
  </tbody>
</table>
<p>Click frame 4 and open its layers in the details pane (<code>...</code> marks lines left out here):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Frame 4: Packet, 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface laptop:eth1, id 0
</span></span><span class="line"><span class="cl">Ethernet II, Src: aa:aa:aa:22:22:22 (aa:aa:aa:22:22:22), Dst: aa:aa:aa:11:11:11 (aa:aa:aa:11:11:11)
</span></span><span class="line"><span class="cl">Internet Protocol Version 4, Src: 192.168.1.20, Dst: 192.168.1.175
</span></span><span class="line"><span class="cl">    ...
</span></span><span class="line"><span class="cl">    Time to Live: 64
</span></span><span class="line"><span class="cl">    Protocol: ICMP (1)
</span></span><span class="line"><span class="cl">    ...
</span></span><span class="line"><span class="cl">Internet Control Message Protocol
</span></span><span class="line"><span class="cl">    Type: Echo (ping) reply (0)
</span></span><span class="line"><span class="cl">    ...
</span></span></code></pre></div><p><strong>Frame</strong> is Wireshark&rsquo;s own line: when and where the frame was captured. Then come the layers: Ethernet
(MAC addresses), IP (IP addresses, TTL), ICMP (the ping itself). The <strong>TTL</strong> (<em>time to live</em>) is a number every
IP packet carries. Each router on the way takes one off, and a packet that reaches zero is thrown away, so lost
packets can&rsquo;t loop forever.</p>
<p>You may also see a frame from a MAC address you don&rsquo;t know, with the protocol <strong>STP</strong>. That&rsquo;s the switch: it
sends a <em>spanning tree</em> message out of every port every two seconds, to check there are no loops in the
cabling. Real switches do it too. Ignore it for now.</p>

  </div>
</section>


<section class="lab-stage lab-stage-follow" id="follow">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">3</span>
    <span class="lab-stage-kind mono">follow along</span><h2>Capture, open, read</h2>
  </header>
  <div class="lab-stage-body">
    <ol>
<li>
<p>Capture the laptop&rsquo;s cable while the lab sends four pings to the printer:</p>
<div class="lab-file lab-file-run mono">
  <span class="lab-file-kind">run in the terminal</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">make capture <span class="nv">AT</span><span class="o">=</span>laptop:eth1 <span class="nv">NAME</span><span class="o">=</span>1.1 <span class="nv">X</span><span class="o">=</span>ping
</span></span></code></pre></div><p>It prints each command it runs on the laptop, then <code>saved 11 frames to captures/1.1.pcapng</code> (your number may
be a frame or two different: an STP message lands in the middle now and then).</p>
</li>
<li>
<p>Click the <strong>Wireshark</strong> tab at the top of the lab app, then <strong>Start Wireshark</strong>. The first start takes about
half a minute (it fetches Wireshark once), then Wireshark fills the tab. <code>make wireshark</code> in the terminal
does the same.</p>
</li>
<li>
<p>In Wireshark, <strong>File › Open</strong>, go to <code>/captures</code>, and open <code>1.1.pcapng</code>. (Prefer the terminal? <code>tshark -r captures/1.1.pcapng</code> prints the same packet list.)</p>
</li>
<li>
<p>Look at the <strong>first frame the laptop sent</strong>: the first one <em>from</em> <code>aa:aa:aa:11:11:11</code>. It isn&rsquo;t a ping.
Before the laptop could send anything to <code>192.168.1.20</code>, it needed the printer&rsquo;s MAC address, so it asked.
That&rsquo;s ARP, from Networking 101&rsquo;s <a href="/lessons/networking-101/">lesson on ARP</a>, on the wire.</p>
</li>
<li>
<p>Count the <strong>Echo (ping) request</strong> frames. Then fill in the follow-along lines:</p>
<div class="lab-file lab-file-edit mono">
  <span class="lab-file-kind">edit</span><code>answers/1.1.yml</code><span class="lab-file-how">Ctrl+P → 1.1.yml</span>
</div>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">first_protocol</span><span class="p">:</span><span class="w"> </span><span class="l">ARP</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">echo_requests</span><span class="p">:</span><span class="w"> </span><span class="m">4</span><span class="w">
</span></span></span></code></pre></div></li>
</ol>
<p class="lab-recap"><span class="mono">in one sentence</span> The laptop&rsquo;s first frame was a question, not a ping: it had to learn the printer&rsquo;s MAC address before it could send to it.</p>

  </div>
</section>


<section class="lab-stage lab-stage-challenge" id="challenge">
  <header class="lab-stage-head">
    <span class="lab-stage-n mono">4</span>
    <span class="lab-stage-kind mono">challenge</span><h2>Read a reply</h2>
  </header>
  <div class="lab-stage-body">
    <p>Click one of the <strong>Echo (ping) reply</strong> frames, and find two things in the packet details:</p>
<ul>
<li><code>printer_mac</code>: the printer&rsquo;s MAC address, from the Ethernet layer;</li>
<li><code>reply_ttl</code>: the TTL in the printer&rsquo;s reply, from the IP layer.</li>
</ul>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>The reply comes <em>from</em> the printer, so its MAC address is the Ethernet layer&rsquo;s <strong>Src</strong>.</p>
</div>
</details>
<details class="lab-hint">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></svg>
 <span>hint</span></summary>
  <div class="lab-hint-body"><p>Open the <strong>Internet Protocol Version 4</strong> line with its arrow. <strong>Time to Live</strong> is about halfway down.</p>
</div>
</details>
<details class="lab-solution">
  <summary class="mono"><svg class="ico" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
 <span>show the solution</span><em>answers/1.1.yml</em></summary>
  <div class="lab-solution-body">
    <p class="mono lab-solution-tip">or pull it into your lab: <code>make solve T=1.1</code>, then <code>git diff --staged</code> shows what changed</p>
    <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">printer_mac</span><span class="p">:</span><span class="w"> </span><span class="l">aa:aa:aa:22:22:22</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">reply_ttl</span><span class="p">:</span><span class="w"> </span><span class="m">64</span><span class="w">
</span></span></span></code></pre></div><p>The printer is a Linux computer, and Linux starts every packet at a TTL of 64. It arrived at 64 because the
printer is on the laptop&rsquo;s own network: no router in between took anything off. Hold on to that: in task 1.2
the replies come from further away.</p>
  </div>
</details>

  </div>
</section>

]]></content:encoded></item></channel></rss>