In this warm-up exercise, you will learn how to compile programs on the Linux operating system, how to edit programs on the Linux, how to use tcpdump to capture and analyze packets, how to use C string functions, and many other skills that are important for this course.
In this mini-program, you will modify the TCP echo client/server programs in Chapter 5 to support the “broadcast echo” function, which is explained below. First, the TCP echo server needs to handle multiple connected TCP echo clients at the same time. Second, when the TCP echo server receives a string from a TCP echo client, it needs to send the string to all connected TCP echo clients. Third, when a TCP echo client receives a string from the TCP echo server, it needs to display the string on its screen. During operation, a TCP echo client may connect/disconnect to/from the TCP echo server at any moment and the TCP echo server should be able to handle such a dynamic situation.
In this mini-program, you will use the UDP sendto() and recvfrom() system calls to transfer a file from a UDP client to a UDP server. You should use an application-level stop-and-wait protocol to implement a reliable file transfer because in the tests the packets sent by your programs will be purposely dropped on the network. You should use each of the three socket timeout techniques (i.e., write three versions of program each using a different technique) presented in Chapter 13 in both your UDP client and server programs to implement a reliable file transfer.
In this mini-program, you will use the
nonblocking techniques presented in the TCP echo client program in Chapter 16.2
to modify and make the TCP echo server program in Chapter