Chris Pollett> CS158a
( Print View )

Student Corner:
[Lecture Notes]
[Discussion Board]

Course Info:
[Texts & Links]
[Description]
[Course Outcomes]
[Outcomes Matrix]
[Course Schedule]
[Grading]
[Requirements/HW/Quizzes]
[Class Protocols]
[Exam Info]
[Regrades]
[University Policies]
[Announcements]

HW Assignments:
[Hw1] [Hw2] [Hw3]
[Hw4] [Hw5] [Quizzes]

Practice Exams:
[Midterm] [Final]

HW#4 --- last modified May 04 2023 15:42:00.

Solution set.

Due date: Apr 26

Files to be submitted:
  Hw4.zip

Purpose: To gain familiarity with Transport Layer protocols.

Related Course Outcomes:

The main course outcomes covered by this assignment are:

CLO 8 -- Understand TCP and UDP, and develop software for servers and clients of socket programming, and use them to measure the performance (including throughput and bandwidth) of real networks.

CLO 9 -- Use networking tools including telnet, ping, traceroute, bing, and Wireshark to evaluate simple network characteristics.

Specification:

This homework will consist of following exercises, some of which involve experiments and coding. All of the written exercises and question answers should be in a file Hw4.pdf. Short programs and screen captures should also be included in your ZIP folder. In what you turn in, make sure to write the names and student ids for each group member. For each problem, first copy and paste the question, then write your solution to it beneath it.

  1. Ch 5 #1 (slightly modified) If a UDP datagram is sent from host A, port P to host B,port Q, but at host B there is no process listening to port Q, then B is to send back an ICMP Port Unreachable message to A. Like all ICMP messages, this is addressed to A as a whole, not to port P on A.
    1. Give an example of when an application might want to receive such ICMP messages.
    2. Find out what an application has to do, on Windows, MacOS, and Linux, to receive such messages.
    3. Why might it not be a good idea to send such messages directly back to the originating port P on A?
  2. Ch 5 #4 This book explains three sequences of state transitions during TCP connection teardown. There is a fourth possible sequence, which tra- verses an additional arc (not shown in Figure 5.7) from FIN_WAIT_1 to TIME_WAIT and labeled FIN + ACK/ACK. Explain the circumstances that result in this fourth teardown sequence.
  3. Use Wireshark to capture TCP and DNS traffic while you download the webpage http://www.cs.sjsu.edu/faculty/pollett. Provide screenshots. Identify at least a couple of the contents for the packet with DNS information about the IP address. Identify the segments establishing the connection to the department web server, and those for the teardown. For at least one of the TCP segments determine the advertised window size. How many segments were needed to send the page? Was a separate connection used to send my photo?
  4. Ch 5 #9 (modified) You are hired to design a reliable byte-stream protocol that uses a sliding window (like TCP). This protocol will run over a 150-Mbps network. The RTT of the network is 130 ms, and the maximum segment lifetime is 45 seconds.
    1. How many bits would you include in the AdvertisedWindow and SequenceNum fields of your protocol header?
    2. How would you determine the numbers given above, and which values might be less certain?
  5. Ch 5 #20 (modified) The Nagle algorithm, built into most TCP implementations, requires the sender to hold a partial segment's worth of data (even if PUSHed) until either a full segment accumulates or the most recent outstanding ACK arrives.
    1. Suppose the letters abcdefghi are sent, one per second, over a TCP connection with an RTT of 3.8 seconds. Draw a timeline indicating when each packet is sent and what it contains.
    2. If the above were typed over a full-duplex Telnet connection, what would the user see?
    3. Suppose that mouse position changes are being sent over the connection. Assuming that multiple position changes are sent each RTT, how would a user perceive the mouse motion with and without the Nagle algorithm?
  6. Ch 5 #26 (modified) Suppose, in TCP's adaptive retransmission mechanism, that EstimatedRTT is 5.0 at some point and subsequent measured RTTs all are 1.0. How long does it take before the TimeOut value, as calculated by the Jacobson/Karels algorithm, falls below 5.0? Assume a plausible initial value of Deviation; how sensitive is your answer to this choice? Use &delta = 1/8.
  7. Ch 5 #46 Consider a SunRPC client sending a request to a server.
    1. Under what circumstances can the client be sure its request has executed exactly once?
    2. Suppose we wished to add at-most-once semantics to SunRPC. What changes would have to be made? Explain why adding one or more fields to the existing headers would not be sufficient.
  8. Ch 5 # 48 (modified) Write a test Java program TCPTester.java (make sure to include it in your ZIP file along with any instructions for its use) that uses the socket interface to send messages between a pair of machines running the same OS of hopefully comparable speed connected by some LAN. This program should be runnable from the command line using the syntax:
    java TCPTester port_number
    #or
    java TCPTester machine_to_connect port_number
    
    When run with just a port number it binds to the port provided and listens for connections, when run with a host to connect to and a port number it operates in client mode and initiates the experiments described below. Use this test program to perform the following experiments.
    1. Measure the round-trip latency of TCP and UDP for different message sizes (e.g., 1 byte, 100 bytes, 200 bytes,. . . , 1000 bytes).
    2. Measure the throughput of TCP and UDP for 1-kB, 2-kB, 3- kB,..., 32-kB messages. Plot the measured throughput as a function of message size.
    3. Measure the throughput of TCP by sending 1 MB of data from one host to another. Do this in a loop that sends a message of some size, for example, 1024 iterations of a loop that sends 1-kB messages. Repeat the experiment with different message sizes and plot the results.
  9. Ch 5 #51 (modified) Suppose we want returning RTCP reports from receivers to amount to no more than 5% of the outgoing primary RTP stream. If each report is 84 bytes, the RTP traffic is 30 kBps, and there are 700 recipients, how often do individual receivers get to report? What if there are 7,000 recipients?

Point Breakdown

Exercise except 8 (1pt each)8pts
Exercise 82pts
Total10pts