DOC PREVIEW
Princeton COS 461 - Midterm Exam

This preview shows page 1-2-3-4 out of 13 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

QUESTION 1: Transporting a file (15 POINTS)QUESTION 2: Sockets (16 POINTS)NAME:Login name: Computer Science 461Midterm ExamMarch 30, 20091:30-2:50pmThis test has six (6) questions. Put your name on every page, and write out and sign the Honor Code pledge before turning in the test. Please look through all of the questions at the beginning to help in pacing yourself for the exam. The exam has 100 points and lasts for 80 minutes, so the number of minutes spent per question should be less than its point value. You should spend no more than 10-12 minutes per question. Show your work for all problems. Partial credit will often be given."I pledge my honor that I have not violated the Honor Code during this examination.'' Question Score1 / 152 / 163 / 174 / 145 / 16 6 / 22Total / 1001QUESTION 1: Transporting a file (15 POINTS)Suppose your boss calls you up while visiting a client and says he left a 250,000 byte file on a server at the office, and he needs you to send it to him. The connection between the office and his current site is 2 million bits/second.1A. [2 points] Assuming that all bandwidth is consumed by your data (e.g., there aren’t any packet headers, there’s no other traffic on the link, etc.) and that you can immediately start sending data at the maximum rate, how long will it take to transmit the file? (Easy)1B. [5 points] Now assume that you are sending the file via TCP, with a maximum segment size of 1000 bytes. You have to follow TCP’s transport algorithm, so you start transmitting the file at a low rate. How many network round trip times (RTTs) will it take to transmit the entire file? Again assume that all bandwidth is consumed by your data.21C. [4 points] Let’s now consider how TCP reacts when it encounters packet loss (the “basic” variant we learned in class). Your boss now wants you to transmit a much larger file (say, 1 GB).This time around, after TCP reaches an instantaneously transmission rate of 32,000 bytes per second, you notice that a single packet is lost. Assuming that you don’t currently have any other packets in transmission, what is the instantaneous rate TCP will send at after noticing that loss? How long (in terms of RTTs) will it take to reach 32,000 bytes per second again?1D. [4 points] In the previous example of 1c, would anything be different if all packets were lost after you reached 32,000 bytes per second, instead of just a single packet? If so, what is the next instantaneous rate TCP will send at in this example, and how long (in terms of RTTs) would it now take to reach 32,000 bytes per second again?3QUESTION 2: Sockets (16 POINTS)2A. [10 points] In the first assignment, you used the socket API to write a simple client/server. For this question, there is a single client communicating with a single server using TCP. The client sends a very small amount of data using the send() function, and the server receives the data with a recv() call. Each of the following scenarios shows a different order in which the socket calls are called on both the client and the server. Assume all system calls are blocking, and there may be some latency between the client and server. We write the system call when it is initiated by the client and/or server; it returns sometime between then and when the next local system call is executed. For each scenario, answer the following: Can the server ever get the data sent by the client? (Yes or No). If not, explain why not.i)Client Serversocket()connect()send()close()socket()bind()listen()accept()recv()close()ii)Client Serversocket()connect()send()close()socket()bind()listen()accept()recv()close()4iii)Client Serversocket()connect()send()close()socket()bind()listen()accept()recv()close()iv)Client Serversocket()connect()send()close()socket()bind()listen()accept()recv()close()v)Client Serversocket()connect()send()close()socket()bind()listen()accept()recv()close()52B. [3 points] Suppose application A is using a stream (TCP) socket to transfer data to application B on a remote host. Suppose application A writes (sends()) data into the socket buffer ten times.i) Can the underlying network stack transmit more than ten data packets? If so, why?ii) Can the underlying network stack transmit fewer than ten data packets? If so, why?2C. [3 points] Suppose application A is using a datagram (UDP) socket to transfer data to application B on a remote host. Suppose application A calls sendto() ten times.i) Can the underlying network stack transmit more than ten data packets? If so, why?ii) Can the underlying network stack transmit fewer than ten data packets? If so, why?6QUESTION 3: Your Web Browser in action (17 POINTS)In the topology shown below, machine A is a desktop client, D is a local DHCP server, R is A's gateway router, S is a Web server, and C is a Web cache. NL is C's local nameserver, while NA is the nameserver authoritative for S. Client A is configured to use Web cache C for all requests (assume that the Web cache resolves the name for any Web server and that the client is configured with the IP address of the cache). All wires/links are Ethernet segments. Assume the following: - All the machines were just booted and their associated caches (ARP, DNS, Web, persistent connections) are all empty - http://S/index.html fits in a single packet - Persistent HTTP connections are used among A, C, and S (i.e. you should assume that onceany connection between these hosts is established it is never closed) - Web caches respond to TCP requests that look like packet two in table 1 below (e.g., GET http://foo/bar/). They reply with the normal web cache contents.73A. [12 points] The user on machine A, requests the web page http://S/index.html. The table below shows a number of messages sent/received in servicing this request (this is not necessarily a complete list of all packets). In addition, there are a few bogus packets that are never sent/received. The packets are not listed in temporal order. ID SRC DST SRC Port DST Port Protocol Contents1 C DNS root DNS UDP Query for S2 A C Web cache TCP GET http://S/index.html3 NLDNS root DNS UDP Query for S4 C S HTTP TCP SYN5 C S HTTP TCP GET index.html6 S A HTTP TCP index.html7 A Broadcast ARP Who is R8 C A Web cache TCP index.html9 NLC DNS UDP Address for S10 S C HTTP TCP index.html11 A Broadcast DHCP UDP DHCP Request from A12 NLNADNS UDP Query for SList the proper order of packets (in terms of their


View Full Document

Princeton COS 461 - Midterm Exam

Documents in this Course
Links

Links

39 pages

Lecture

Lecture

76 pages

Switches

Switches

35 pages

Lecture

Lecture

42 pages

Links

Links

39 pages

Lecture

Lecture

34 pages

Topology

Topology

42 pages

Lecture

Lecture

42 pages

Overview

Overview

42 pages

Sockets

Sockets

45 pages

Load more
Download Midterm Exam
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Midterm Exam and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Midterm Exam 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?