Question: For problems 4 and 5, it may be useful to run wireshark or tcpdump. For example, tcpdump -i lo -X 'tcp port 8080' will show

 For problems 4 and 5, it may be useful to run

For problems 4 and 5, it may be useful to run wireshark or tcpdump. For example, tcpdump -i lo -X 'tcp port 8080' will show all the TCP packets going to and from port 8080 on the local machine's loopback interface. Different values for the "i" argument will change the interface it listens on. Change tcp to udp above to monitor UDP traffic instead. Set up a basic UDP server on port 8080 of your local machine using nc - l -u 8080 a. Create some client code to create a UDP socket and use connect () using your local server's address and port. Monitor your connection using tcpdump, wireshark, or another traffic analysis program. Are any bytes sent to the server when your UDP socket is created or connected? Why or why not? b. Now send a few bytes to the server using send (). Call it repeatedly, alternating the values you send, so you can see the different values in your monitoring software easily. How many UDP packets are created for each call to send ()? Now switch your local server to use TCP instead of UDP by using nc - l 8080. Make sure your monitoring software is now showing TCP as well. a. Create some client code to create a TCP socket and connect to it. Are any bytes sent to the server when your TCP socket is created or connected? Why or why not? b. Now send a few bytes to the server using send (). Call it repeatedly, alternating the values you send, so you can see multiple packets in your monitoring software and view the data. How many TCP packets are created for each call to send ()? If this is different from the UDP case, briefly explain why

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!