Testing with Wireshark
One of the best ways to test your work is to examine your packets in Wireshark. This can help you make sure your packets are formatted properly, and make sure you are forwarding packets as you expect. Moreover, looking at your traffic in Wireshark is how we will grade your work, so it is in your best interest to check your work this way!
To get started using wireshark for the IP-TCP project for the first time, we recommend the IP Implementation guide, which provides a general walkthrough of how to set up everything.
After you have started using Wireshark, we have various resources to help you test your work in Wireshark, for various components of the project:
General testing resources
- How to make wireshark view virtual IP packets (Also known as Decode as rules)
- Understanding virtual links describes how to examine IP forwarding and UDP packets
For IP
To get started: IP implementation guide for a conceptual overview of how to think about IP-in-UDP encapsulation, and a tutorial on how to configure your UDP sockets, format packets, and examine them
Once you have Wireshark set up, here’s how you can use it to test various components:
- How to debug test packets
- How to test forwarding
- How to make sure your checksum is correct
- How to examine RIP messages
For TCP
To get started: The TCP getting started guide demonstrates how to set up wireshark to capture TCP traffic on our virtual network.
Warning: do not skip this step: The TCP project requires you to start Wireshark in a slightly different way than you did for IP (ie, with a different capture filter). If you don’t follow the setup in the getting started guide, Wireshark won’t be able to analyze TCP traffic correctly, and everything will look wrong! (Specifically, you’ll see the error
segment out-of-order
for nearly every packet!
Once you have wireshark set up, here are some general resources for using it to help debug TCP:
- For checking the TCP checksum: See this guide (about checking the IP checksum), but click on the TCP header instead (the steps to turn on checksum validation are the same)
- More resources coming soon!
We highly recommend using these techniques to help you debug your work! If you come to us with a debugging problem, one of the first things we’ll ask is “what does it look like in wireshark?”, as it’s one of the best and most objective ways to see what’s happening.