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#5 --- last modified May 05 2023 00:31:05.

Solution set.

Due date: May 15

Files to be submitted:
  Hw5.zip

Purpose:

Related Course Outcomes:

The main course outcomes covered by this assignment are:

CLO8 -- 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.

CLO9 -- Use networking tools including telnet, ping, traceroute, bing, and Ethereal to evaluate simple network characteristics.

CLO10 -- Understand concepts of data compression, network security and protocols.

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 Hw5.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. Exercise 6.10 (modified as follows): Suppose a router has three input flows and one output. It receives the packets listed in table below all at about the same time, in the order listed, during a period in which the output port is busy but all queues are otherwise empty. Give the order in which the packets are transmitted assuming:
    1. fair queuing.
    2. weighted fair queuing, with flow 2 having weight 3 and the other two with weight 1.
    PacketSizeFlow
    1901
    2951
    31151
    41001
    51902
    62002
    71103
    8503
  2. Exercise 6.21 (modified as follows): Suppose that between A and B there is a router R.The A-R bandwidth is infinite (that is, packets are not delayed), but the R-B link introduces a bandwidth delay of one packet per half second (that is, 1 packet takes 2 seconds, etc.). Acknowledgments from B to R, though, are sent instantaneously. A sends data to B over a TCP connection using slow start but with an arbitrarily large window size. R has a queue size of one in addition to the packet it is sending. At each second, the sender first processes any arriving ACKs and then responds to any timeouts.
    1. Assuming a fixed TimeOut period of 2 seconds, what is sent and received for T = 0,1,...,6 seconds? Is the link ever idle due to timeouts?
    2. What changes if TimeOut is 3 seconds instead?
  3. Exercise 6.47 (modified as follows): Suppose a router has accepted flows with the TSpecs shown in table below, described in terms of token bucket filters with token rate `r` packets per second and bucket depth `B` packets. All flows are in the same direction, and the router can forward one packet every 0.15 second.
    1. What is the maximum delay a packet might face?
    2. What is the minimum number of packets from the third flow that the router would send over 2.0 seconds, assuming the flow sent packets at its maximum rate uniformly?
    rB
    18
    25
    42
  4. The xslx format used for Excel makes use of a compressed XML format. Make a small Excel file with two columns and five rows. Each row is a student name and a made up grade between 0-100. Save this in xslx format. Determine the kind of compression that is actually used, uncompress the xslx file into its constituent xml documents. Determine the file that student and grades are stored in. Determine the nearest tags in which each name appears, and do the same for grades.
  5. For this problem, you can write a program to help you compute what is asked. Create an 8x8 version of the Swiss flag with 24-bit RGB color. Include it as a matrix in your HW solution.
    1. Convert it to the YUV color space to the bit precision used by JPEG. Write the resulting matrix in your HW solution (you can output as a sequence of integers for each of three Y U V values). For these integers, if the bit precision was less, the integer should be smaller).
    2. Compute the result of doing the DCT phase of JPEG on the YUV matrix you got above and include the result matrix.
    3. Compute the JPEG Quantization of the result of the previous step and output the result matrix.
    4. Linearize the result a 1d sequence of integers according to the encoding phase.
  6. Conduct some experiments on using a firewall. Make two small programs: Client.java and Server.java. Server.java binds to port 7000 and listens for connections. Client.java takes as command line argument a hostname and connects to that host on port 7000, then every 2 seconds until you stop it, it sends the message hi CR LF, to which the server responds with lo CR LF. With the server running confirm that port 7000 is bound to using netstat -a, lsof -i, and nmap. Then using a such a firewall (pf on a mac, iptables on linux system, or using the GUI on Windows 11), do experiments by adding rules to block incoming, outbound, TCP, UDP, IP traffic to that port. Try different possibilities, not each of these at the same time. Check that the firewall is working by trying to run your client from another machine to that port. Then try to use nmap on the client. See what is happening on the server using netstat, lsof. Write these tests up and submit the code for your program as well in Hw5.pdf.
  7. Use openssl to send me an email from the anime/cartoon character of your choice. Your email should have Subject:, From:, and To: headers. In the body of the mail, the anime/cartoon character should be trying to convince me to give you a good grade. Record the transcript of the SSL communication with my SMTP (pollett.org:587). and submit this as part of your homework solution.

Point Breakdown

Problems 1-4 above (1pt each) 4pts
Problems 5-7 above (2pts each) 6pts
Total10pts