



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Group Number: ________ Member Names: _________________________ _________________________ _________________________ _________________________ Date Issued: Tuesday September 6, 2005 Date Due: Tuesday September 13, 2005 Last Edited: 9/28/
Finish a TCP sockets programs to transmit and receive TCP datagrams. Analyze TCP network traffic using tcpdump and ethereal Linux network utilities.
These questions pertain to the tcp_gen.c and tcp_sink.c code. They are designed to help you understand the presented code as well as the differences between our code and Steven’s example code from the lecture slides. The code for these files should be attached to your handout, or you can get it from the NAS as described in Section I. P1. In both our and Stevens’ tcp client programs, the IP address of the sink is read in from the command line when the program is started. However, in Stevens’ example the IP address is always the first argument passed to the program, and so is always in the same place within argv[]. In our code, however, we have a variable number of command line arguments, so we cannot guarantee that the IP address and port number will always be in the same place. How is this handled in our code (i.e. how and where are the IP address and port number of the sink stored for future access?)
Before you start this lab, make sure that you can access NAS (refer to ECE4110 Lab 1). After you are sure that NAS is mounted and ready for access, perform the following steps to copy and extract the source code that you will need to understand, comment, and modify: $cd /mnt/nas/Lab2
You may find that some declared variables are not needed, so make sure that you fully understand the data flow within the programs. Also add some code to print out the number of MBITS PER SECOND that were sent as well as received. This statistic should be written to the screen after the <CTRL+C> key sequence is used to stop the program.
At this point you programs should finished and ready to perform data transmission. The scenario to execute these programs should be as follows: To run under X Windows:
1. startx
Put IA measured on sender in this box Debug OFF at both sink and gen. Enter the maximum Mbps for the sink and gen.
Question: Show the math equation and answer to how many Mbits/sec you expect if you were to input a packet size of 500 bytes, zero variance and an inter-arrival time of 0.01 seconds When you have completed Sections I and II, demonstrate to the TA the maximum number of Mbits/sec you can generate with a packet size of 1,000 bytes, and a packet size variance of zero. Make sure the TA records the maximum number of Mbits/sec that you demonstrated. Look in the Turn-in list for any deliverables at this point in the lab.
Q2. Which do you like better? Look at the protocol detail available in ethereal. With the mouse, select one of your TCP datagrams. In the lower window, expand ‘Ethernet II’ by clicking on the plus sign. Answer the following questions: Q3. What is the value of your Ethernet MAC address of the machine you are using? Q4. What is the value in the ‘Differentiated Services Field’ (correctly called Type of Service field) in the IP header of this TCP datagram? Q5. What does the value mean? (Don’t ask TA for the answer) Q6. What was the source port number? Q7. Where does the source port number come from? (e.g., ports up to 1024 are called reserved ports) (Don’t ask TA for the answer) (To see the source port number, expand the field named Transport Control Protocol) Fill in the following table (for at least 5 of the TCP packets from your tcp_gen run) with the information obtained from your tcp_gen ( with debug mode ON) and the ethereal : As seen on your PC by tcp_gen As observed by ethereal Packet size (bytes) Inter-arrival time(sec) TCP segment size (bytes) Inter-arrival time(sec) of TCP segments Q8. What seems to match and what does not match? Why? Q9. In Ethereal, identify the TCP three-way handshake and connection termination frame sequences. Copy them in the space below. (Include the Source, Destination, Protocol and Info columns)
a) TCP three-way handshake Source Destination Protocol Info b) Connection Termination Source Destination Protocol Info Q10. In Ethereal, look at the first 200 frames and describe what is going on. Refer to your lecture notes and class books (you can also use the internet). Keywords: three-way handshake, ACK, sequence numbers, SYN, etc. Q11 Looking at ethereal , there is one line of additional data between each of your TCP datagrams you sent out. What is this? Explain.