In this homework, we will learn how to log and analyze network packets.
Learn how to use WireShark to log and view wireless packets. You should configure WireShark so that it receives packets not just from your laptop, to your laptop, but also the packets in the neighborhood for which your laptop is neither the source nor the destination.
1. Collect a 2-minute packet trace in two different environments: first one on campus and second at home or a cafe. For each packet trace show some basic statistics about different types of packets captured and their numbers.
2. Show the plot of total (cumulative) number of HTTP packets as a function of time. Your x-range should be from 0 to 120s. Show two lines corresponding to the two traces. Each line must be labeled.
3. Write a simple Python TCP server (server.py) and a TCP client (client.py). The client can send text provided in the command line and a request to the server to send a duplicated or inverted message. Example for duplication on the client and server terminal:
python client.py duplicate hello i am a message Message from the server: hello i am a message hello i am a message python server.py received instruction: duplicate Received from the client: hello i am a message Sending to the client: hello i am a message hello i am a message
Example execution with invert instruction:
python client.py invert i am a message Message from the server: message a am i python server.py received instruction: invert Received from the client: i am a message Sending to the client: message a am i
The client and the server exchange message using a protocol with two types of JSON messages. From client to the server:
{ instruction: "duplicate" or "invert", //pick one message: "my text message." //example }
From server to the client:
{ processedinstruction: "duplicate" or "invert" //depending on the received instruction processedmessage: "message text my" //example }
4. Run WireShark and your client and server on the localhost and capture the packets exchanged between your client and server. Identify those packets on WireShark and capture the screenshot and mark the packets on the screenshots with a circle or rectangle.
5. Modify your client and server to send encrypted messages instead. You can specify the password on the command line as the first argument when you launch the client and the server. Feel free to use any convenient encryption/decryption. Call these programs client-secure.py and server-secure.py. Use the same protocol as above. Now monitor these packets with Wireshark and comment on what you see and also include a screenshot marked with the packets between your client and server.
Please upload your code using git invitation for hw2. Please include a README that describes the author, contact information, a short description of the software, and finally limitations of your implementation. Include responses to the questions above as a single pdf with the name hw2report.pdf.