This is not the current version of the class.

Net 2 Activity

net2-activity

In this activity, you will use tcpdump, a program which prints out the contents of packets in a vaguely human-readable form.

We’d like you to follow these steps.

  1. If you’re using Docker, open two terminal windows, running in the same Docker container (which is indicated by the same prompt, e.g., cs61-user@4bccf0c1538a:). This should happen automatically if your cs61-docker-version is 5. If you’re using a VM, just open two terminal windows.

  2. In window 1, run the sudo tcpdump -vvX -i lo command. This starts the tcpdump program, and asks it to print a ton of data (vv) for packets that are sent over the operating system’s internal “loopback” network (-i lo).

  3. In window 2, run ./server &. Then check what window 1 prints. Then run ./client. Then check what window 1 prints.

Tcpdump prints out a lot of information. Don’t worry! You could figure all of it out if you had to; for now, we want you to look for patterns. Some example questions:

  1. How many messages are sent before the payload (the actual message data written by the applications)?

  2. How many messages are sent after the payload ends?

  3. How far into each packet does the payload begin?

  4. How can you distinguish messages from client to server, from messages sent in the other direction? (Hint: The server is using port 6169.)

  5. How do the sequence numbers (seq) and acknowledgement numbers (ack) change over the course of the connection?

  6. How do the flags (Flags [.]) change over the course of the connection?

  7. What else do you see?