These experiments involve Chapters 4, 6.2 and 6.3.
Objectives
·
Study sock as a traffic generating software package, in
terms of its features and command line options
·
Study User Datagram Protocol (UDP)
·
IP fragmentation
·
TCP and UDP in action: File Transfer Protocol (ftp) and
Trivial File Transfer Protocol (tftp)
For these experiments we will be using only two PCs connected via a hub.
Note: the two PCs are to be on the same subnet. Change the IP addresses to reflect this single segment network. host in our notes below refers to the other_machine.
Exercise 1
Using the following commands, observe the basic operation of the sock program:
sock host echo
sock -s 5555
sock -i -n3 -w2048 host 9
Questions #1:
· Explain the operation of each of the above commands.
Study the various options associated with the sock program, become familiar with its operation. (See appendix C in the Stevens textbook or look at the sock man page.)
Exercise 2
While running tethereal –V –fudp, execute the following command with different values of n.
sock -u -i -n1 –wn host discard
-u option is used to generate UDP data instead of TCP data. Increase the value of n (i.e. the size of the datagram) until fragmentation occurs.
Questions #2: Answer the following questions:
· What is the maximum value of n that can be sent without IP fragmentation? Use netstat -in to find out the maximum transmission unit. Justify the above two values.
Exercise 3
Capture the data packets generated by the following command:
sock -u -i -n1 -w10000 host discard
Store the window that contains the tethereal –V –fudp output for further study.
Questions #3:
· Explain the output of tethereal in terms of the IP header’s fields that are used in fragmentation.
The textbook says that all the packets except the first one do not have their UDP headers. How do you verify this fact from your tethereal output?
Exercise 4
While running tethereal –V –fudp, execute the following command with different values for n:
sock -u -i -n1 -wn host discard
in order to find out the maximum size of a UDP datagram that our system in the lab can send or receive, even with fragmentation.
Questions #4:
· What is the maximum size of the user data in a UDP datagram that the network in the lab can send or receive, even with fragmentation.
We will study the performance of ftp and tftp for file transfer between two machines. Two files (large.d and small.d) are provided in the /tftpboot directory. If they are not then do the following to place them there:
mkdir /tftpboot
cp /usr/lib/libstdc++.so.2.7.2.8 /tftpboot/large.d
chmod 777 /tftpboot/large.d
cp /etc/services /tftpboot/small.d
chmod 777 /tftpboot/small.d
Only use the get command for transferring a file. In the case of FTP, specify the absolute path name for the file you want to get (e.g., get /tftpboot/large.d). To use ftp as root, recall that you may have to edit the /etc/ftpusers file, remove the line containing root. For tftp you may have to edit the /etc/inetd.conf file to enable tftp. Uncomment the tftp entry in that file by removing the ‘#’ at the beginning of the line. You will have to restart inetd (type inetd) or reboot the PC. Note you also need to set up a /tftpboot directory on other_machine to copy into.
Exercise 5
Set up either ftp or tftp (note password for root has been set to “ics156”). In order to compare the transfer rates of ftp and tftp, run the following command for each file transfer program:
tethereal –V host your_machine and other_machine > output_file_name
While running tethereal, get the large file from the other machine using ftp. After examining the saved tethereal output file, output_file_name, record the starting and ending time of actual data transfer (look for FTP-DATA packets only). Also, from the file transfer program’s window, record the transfer rate (time) displayed by the ftp program. Note you can also use ethereal for this experiment and all others.
Repeat the same experiment for tftp.
Questions #5:
· Now calculate the transfer rates from each tethereal output. Are they consistent with the values displayed earlier?
· If there exist any significant differences, what might be the reason?
· Which is faster, ftp or tftp, and why?
Exercise 6
Capture the packets that are exchanged during the tftp session for the small file.
tethereal –V host your_machine and other_machine > output_file_name
Observe the protocol in action. See the various sizes of the packets being used. Save your tethereal output.
Questions #6:
· List all the different types of packets that are exchanged during your tftp session (see figure 6.8 in the textbook). Why does the server’s port number change?
· In Exercise 4, we found the maximum size of a UDP datagram on your machine. Using tftp, which uses UDP, we transferred a file larger than the maximum UDP datagram size. How can this be explained?
Exercise 7
Capture a trace of the packets exchanged during ftp of the small file. Save your tethereal –V output. Examine the port numbers used.
Questions #7:
· Which machine uses the well-known port numbers? What are the other machine’s port numbers?
· As you can see from the tethereal output, FTP involved two different connections, ftp-control and ftp-data. Why do you think two different connections are being used instead of one connection?
These experiments cover material in Chapter 4.
Objectives
· Study TCP connection establishment and termination using telnet application
· Study TCP interactive data flow using the rlogin application
· Study TCP flow control
Exercise 9
While tethereal –V -ftcp is running, type the following commands:
telnet other_machine
(Note that password has been set to “ics156” for root.) Then type Ctrl-]. From the telnet> prompt, type quit. Store the tethereal output in a file.
Questions #9:
· Explain the TCP connection establishment and termination protocols based upon the tethereal output that you saved.
· What are the announced maximum segment sizes (MSS) of both hosts? What happens if there is an intermediate network that has an MTU value less than the MSS of each host?
Exercise 10
While tethereal –V –ftcp is capturing the traffic between your machine and another machine, issue the command:
rlogin other_machine
After logging in to the machine, type data and press the Enter key. Now, in order to generate data faster than the round-trip time of a single byte to be sent and echoed, type ls –al and press the Enter key. Save the tethereal output in a file.
Questions #10:
Answer the following questions, based upon the tethereal output obtained from the above exercise:
· What are the initial sequence numbers for the local and remote machines?
· Explain delayed acknowledgments. Why are delayed acknowledgments used?
· Can you see any delayed acknowledgments in your tethereal output? If yes, explain the reason. Mark the lines with delayed acknowledgments, and submit the tethereal output with your report. If no, explain the reason why none were observed.
Exercise 11
While tethereal –V –ftcp is running for the packets between the two machines, execute sock -i –r1460 –v -s 7777 on host_A, which acts as the server, and then sock -i -n8 –w1460 host_A 7777 on the corresponding client.
Repeat this experiment three times. Save all the tethereal outputs in a file.
Questions #11:
· Using one of the three tethereal outputs, explain the operation of TCP in terms of data segments and their acknowledgments. Does the number of data segments differ from that of their acknowledgments? Compare all the tethereal outputs you saved. Discuss any differences among them in terms of data segments and their acknowledgments.
Exercise 12
While tethereal –V -ftcp is running for the packets between two hosts, execute:
sock -i –r1460 –v -s 5555 on the server, host A, and
sock -i -n1 -w17520 host_A 5555 on the other host, acting as the client.
Questions #12:
· What did you expect from the given commands? Explain what happened in the tethereal output.
· If the tethereal output is different from what you expected, give the reason for the disagreement.
Exercise 13
While running tethereal –V for the packets between two machines, invoke the server with the following commands on host A:
sock -i -s -v -r1460 5555
On the corresponding client, execute
sock -i -n1 -w21900 host_A 5555
What is the window size of the receiver (i.e., the server in our case)?
Now, with the -Rn option on the receiver side, we can vary the server’s window size. Can you make a smaller receive window than in the previous case? For example choose: n=2880
Change the receiver’s window size (for example, use n =4680, 14600 and 27520). In each case, record how many data segments are transmitted at once before the sender receives an ACK.
When you change the value of n, how does the number of unacknowledged data segments change as the transfer progresses?
Can you find anything in common among them?
Explain how flow control works in this experiment. Observe that when the window size becomes very small (Note: must be larger than an MSS), flow control kicks in instead of congestion control.
Questions #13:
· Answer the above questions.
Exercise 14
While running tethereal –V -ftcp, execute the following command, which is similar to the command we used to find the maximum size of the UDP datagram:
sock -i -n1 -wn host discard
Let n be larger than the maximum UDP datagram size we found from the previous experiment (Exercise 4). As an example, you may use n = 70080.
Questions #14:
· Do you see any IP fragmentation occur? If IP fragmentation doesn’t occur at this time, how do you explain this compared to the UDP experiment (Exercise 4)?