>

Using the Wireshark Packet Dissector

#Overview

We’ve written 2 Lua script plugin for Wireshark that helps dissect packets defined in the Project 1 spec and Project 2 spec. They are useful for:

#Installation

#Update the Helper Script

Note: this is not needed for Project 2; the capture code is already in the main branch.

First, pull the capture branch. If you cannot pull it, just copy the helper script instead.

This version of the helper script has a new command that can run a test case while performing packet capture.

#Install Wireshark

Download and install Wireshark by following the instructions here.

#Install the Lua Script Plugin

Once Wireshark is installed, follow these steps to install the dissector plugin:

  1. Download the Project 1 Lua script or the Project 2 Lua script.
  2. Open Wireshark.
  3. Open the “About Wireshark” dialog:
    • On Linux/Windows: Go to Help → About Wireshark.
    • On macOS: Go to Wireshark → About Wireshark.
  4. Navigate to the Folders tab.
  5. Double-click the entry for Personal Lua Plugins.
  6. Copy the downloaded script into this folder.
  7. Press Ctrl+Shift+L to refresh the plugins.

For reference, see the original instructions here.

#Usage Example

  1. Run the autograder using the helper script with the capture command. capture command takes the same argument as the test command. For example, run ./helper capture handshake all to run all handshake tests.
  2. After execution, in your dumps folder, you should have a file named file-xxxx-testcase-name.pcap.
  3. Open this file with wireshark and you can look at the capture of your packets.

Each test case typically uses a new port. To filter packets for individual tests, use the following Wireshark filter:

!dns && (udp.srcport == 8081 || udp.dstport == 8081)

This will exclude DNS traffic and focus on packets relevant to your tests.