18
Exploring TCP and UDP by Kurose and Ross (Computer Networking: A Top-Down Approach) May 9, 2017

Exploring TCP and UDP

  • Upload
    vananh

  • View
    233

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Exploring TCP and UDP

Exploring TCP and UDP by Kurose and Ross

(Computer Networking: A Top-Down Approach)

May 9, 2017

Page 2: Exploring TCP and UDP

Exploring TCP

•  Capturing a bulk TCP transfer from your computer to a remote server.

•  In this lab, we’ll investigate the behavior of TCP protocol in detail.

•  We’ll do so by analyzing a trace of the TCP segments sent and received in transferring a 150KB file (containing the text of Lewis Carrol’s Alice’s Adventures in Wonderland) from your computer to a remote server.

•  We’ll also briefly consider TCP connection setup and we’ll investigate the performance of the TCP connection between your computer and the server.

Page 3: Exploring TCP and UDP

Exploring TCP

•  STEPS 1.  Start up your web browser. Go the

http://gaia.cs.umass.edu/wiresharklabs/alice.txt and retrieve an ASCII copy of Alice in Wonderland. Store this file somewhere on your computer. 2.  Next go to http://gaia.cs.umass.edu/wireshark-labs/TCP-wireshark-file1.html 3.  Use the Browse button in this form to enter the name of the

file (full path name) on your computer containing Alice in Wonderland (or do so manually). Don’t yet press the “Upload alice.txt file” button.

Page 4: Exploring TCP and UDP

Exploring TCP

•  STEPS 4.  Now start up Wireshark and begin packet capture (Capture->Start) and then press OK on the Wireshark Packet Capture Options screen (we’ll not need to select any options here). 5.  Returning to your browser, press the “Upload alice.txt file”

button to upload the file to the gaia.cs.umass.edu server. Once the file has been uploaded, a short congratulations message will be displayed in your browser window.

6.  Stop Wireshark packet capture.

Page 5: Exploring TCP and UDP

Exercises

1.  What is the IP address and TCP port number used by your client computer (source) to transfer the file to gaia.cs.umass.edu? What is the IP address and port number used by gaia.cs.umass.edu to receive the file? Fill the gaps.

Client computer (source) IP address: …………………… TCP port number: …………………. Destination computer: gaia.cs.umass.edu IP address: ……………. TCP port number: ……………

Page 6: Exploring TCP and UDP

Exercises

2. What is the sequence number of the TCP SYN segment that is used to initiate the TCP connection between the client computer and gaia.cs.umass.edu? What is it in the segment that identifies the segment as a SYN segment? (Look at flags) Sequence number of TCP SYN = ….

Page 7: Exploring TCP and UDP

Exercises

•  Solution in sample Packet Trace

Page 8: Exploring TCP and UDP

Exercises

3. •  What is the sequence number of the SYNACK segment sent by

gaia.cs.umass.edu to the client computer in reply to the SYN? •  What is the value of the ACKnowledgement field in the SYNACK

segment? How did gaia.cs.umass.edu determine that value? •  What is it in the segment that identifies the segment as a

SYNACK segment? (Check flags) Seq number of SYNACK segment = …. ACKnowledgement field= ……

Page 9: Exploring TCP and UDP

Exercises

4. What is the sequence number of the TCP segment containing the HTTP POST command? Note that in order to find the POST command, you’ll need to dig into the packet content field at the bottom of the Wireshark window, looking for a segment with a “POST” within its DATA field. Sequence number of TCP segment= …..

Page 10: Exploring TCP and UDP

Exercises

•  Solution in sample Packet Trace

Page 11: Exploring TCP and UDP

Exercises

5. Consider the TCP segment containing the HTTP POST as the first segment in the TCP connection. What are the sequence numbers of the first six segments in the TCP connection (including the segment containing the HTTP POST)? At what time was each segment sent? When was the ACK for each segment received? Given the difference between when each TCP segment was sent, and when its acknowledgement was received, what is the RTT value for each of the three segments? What is the EstimatedRTT value after 3rd segment in the TCP connection? Assume that the value of the EstimatedRTT is equal to the measured RTT for the first segment, and then is computed using the EstimatedRTT.

Page 12: Exploring TCP and UDP

Exercises

•  Fill the table based on your packet capturing file Sequence

Number Sent Time

ACK Received Time

RTT (seconds)

Segment #1 Segment #2 Segment #3

Page 13: Exploring TCP and UDP

Exercises

•  Calculate estimatedRTT after 3rd segment reception in your captured packet file

𝑬𝒔𝒕𝒊𝒎𝒂𝒕𝒆𝒅𝑹𝑻𝑻=(𝟏−𝜶)∙𝑬𝒔𝒕𝒊𝒎𝒂𝒕𝒆𝒅𝑹𝑻𝑻+𝜶∙𝑺𝒂𝒎𝒑𝒍𝒆𝑹𝑻𝑻 𝜶=𝟎.𝟖𝟕𝟓 EstimatedRTT=……………..

Page 14: Exploring TCP and UDP

Exercises

7. What are the lengths of TCP segments?

Length of TCP segment Segment #1 Segment #2 Segment #3

Page 15: Exploring TCP and UDP

Exploring UDP

•  Capturing UDP traffic There are many ways to cause your computer to send and receive UDP messages since UDP is widely used as a transport protocol. The easiest options are to: 1.  Do nothing but wait for a while. UDP is used for many “system

protocols” that typically run in the background and produce small amounts of traffic, e.g., DHCP for IP address assignment and NTP for time synchronization.

2.  Use your browser to visit sites. UDP is used by DNS for resolving domain names to IP addresses, so visiting fresh sites will cause DNS traffic to be sent. Be careful not to visit unsafe sites; pick recommended sites or sites you know about but have not visited recently. Simply browsing the web is likely to cause a steady stream of DNS traffic.

3.  Start up a voice-over-IP call with your favorite client. UDP is used by RTP, which is the protocol commonly used to carry media samples in a voice or video call over the Internet.

Page 16: Exploring TCP and UDP

EXERCISES

1.  Select one packet. From this packet, determine how many fields there are in the UDP header. (Do not look in the textbook!

Answer these questions directly from what you observe in the packet trace.) Name these fields.

•  Solution in sample packet trace

Page 17: Exploring TCP and UDP

Exercises

2.  From the packet content field, determine the length (in bytes) of each of the UDP header fields.

3.  The value in the Length field is the length of what? Verify your claim with your captured UDP packet.

Page 18: Exploring TCP and UDP

Exercises

4.  What is the protocol number for UDP? Give your answer in both hexadecimal and decimal notation. (To answer this question, you’ll need to look into the IP header.)