CPS 706 Computer Networks (all 2011) Midterm Exam 1 Solutions Date: October 21, 2011, ime: 14:00 16:00pm, Instructor: Dr. J. Misic Name: Student ID: Email: Instructions: 1. his is a closed book exam 2. his exam paper consists of 8 pages and 8 questions 3. Please write your name, student ID, and Email address on this page. 4. or each subsequent page, please write your student ID at the top of the page in the space provided. 5. Please answer all questions within the space provided on the exam paper. 6. Please read each question very carefully and answer the question clearly and to the point. Make sure that your answers are neatly written, readable and legible. 7. Show all the steps you use in deriving your answer, wherever appropriate. 8. or each of the questions assume that the concepts are known to the graders. Concentrate on answering to the point what is asked. Do not define or describe the concepts. Question Points Score 1 15 2 8 3 13 4 10 5 14 6 10 7 15 8 15 OAL 100 CPS 706 (all 2011) Midterm Exam 1 1 of 8
1. Answer the following true/false questions by circling either or (15 points) (a) he DNS query and reply messages are transmitted using CP on the Internet. (b) HC is a shared broadcast medium, and in the upstream a distributed multiple access protocol is needed to avoid collisions. (c) Queuing delay experiences large increase when traffic intensity changes from 0.5 to 0.9. (d) P is sending control information over the same connection as the one that is used for sending data. (e) If a name server is authoritative for a particular hostname, it will contain a ype A record for the hostname. (f) In P2P application every party must contain both the client and server side. (g) Cookies are used to add some state to web application since HP is stateless protocols. (h) Every packet in a datagram network must contain a source host address and a destination host address. (i) P uses persistent CP connection to transfer multiple files. (j) Source SMP server acts as a client when it contacts the destination SMP server. (k) Propagation delay between U of Manitoba and U of Winnipeg is larger than 5ms. (l) Internet backbone is comprised only of ier 3 and ier 2 ISPs. (m) Base 64 encoding is used by Multipurpose Internet Mail Extensions to convert multimedia mail attachments to ASCII text. (n) Hotmail uses IMAP to download mail to user s browser. (o) In peer to peer networking file distribution time grow linearly with the number of peers. 2. Answer the following questions: a)which elements are needed to define UDP socket? b) Which elements are needed to define CP socket? c) If you are writing to UDP socket in response to just received segment do you need to specify return IP address and protocol port? d)if you are writing to CP socket in response to just received segment do you need to specify return IP address and protocol port? (8points) Answer: a) or UDP socket we need destination IP address and destination protocol port number. (2 points). b) or CP socket we need source IP address, destination IP address, source protocol port number and destination protocol port number. (2 points) c) Yes, return address (IP + protocol port have to be specified).2 points d) No. since they will be added by CP layer. 2 points CPS 706 (all 2011) Midterm Exam 1 2 of 8
3. Consider the institution s network without the proxy web server as shown in igure below? Web clients in the institutional network are retrieving HML pages from origin servers in public internet. Each retrieved file has 50,000 bits. Clients are generating requests with the rate of 30 requests per second. Delay D3 between router R2 and origin server is approximately equal to 2s. a) Estimate delay D1 between any web client and router R1 and delay D2 between R1 and R2 by calculating traffic intensities. Compare D1 and D2 with D3. Which delay will dominate in the sum D=D3+D2+D1? (6 points) b) If institutional cache is added to the institutional network with hit rate of 0.7, discuss how would D3, D2 and D1 change and say how to calculate total delay D.(7 points) Origin servers Public public Internet R2 1.5 Mbps access link institutional network R1 10 Mbps LAN You also have space on the next page for this question. Answer: a) raffic intensity between computer on the local area network and R1 is equal to: (30request/s)*(50,000bits/request)/10Mbps=0.15 raffic intensity between R1 and R2 is equal to (30request/s)*(50,000bits/request)/1.5Mbps=1 D1 will be in order of tens of milliseconds. D2 will be of order of minutes. herefore, D2 will dominate in sum D. b) When cache is added traffic intensity in the local area network will not change significantly, but traffic intensity between R1 and R2 will become: 0.3*(30request/s)*(50,000bits/request)/1.5Mbps =0.3. his traffic intensity will produce small delay D2, say tens of milliseconds. otal delay D becomes D= 0.7*(0.01s) + 0.3*(2.01s) CPS 706 (all 2011) Midterm Exam 1 3 of 8
4. When institutional web cache (proxy server) is added in the network from previous problem, state the necessary addition to the GE request which proxy server sends to origin web server (the target of the query). What are the possible answers from the origin server? (10 points) Answer: Addition is the line: If-modified-since: Date and time (5 points) If the file was indeed modified after specified date and time the origin server will send the whole file in the reply to the GE request from the proxy server.. If the file was not modified, origin server will send Not Modified message without the file. (5 points) CPS 706 (all 2011) Midterm Exam 1 4 of 8
5. Consider P2P file sharing application like Bitorrent. or the figure below say: a) What is the purpose of tracker machine? How is it different from Napster s directory server? (3 points) b) How are directed lines on the igure below implemented? (3 points) c) How does peer run by user Alice decide which file chunks to request from her peers? (3 points) d) How does Alice select peers with whom she will trade file chunks? How does she keeps this list dynamic? (3 points) e) How is free-riding eliminated in Bitorent? (2 points) tracker Answer: a) tracker contains only IP addresses of peers. Directory server contains IP addresses and information about the contents which each peer is willing to share. b) peers are interconnected by CP connections c) Alice uses technique called rarest first in order to equalize the number of file copies in the torrent d) Alice will start sending file chunks to 4 peers who are currently supplying her data at the highest rate. She periodically re-calculates the rates and also periodically adds fifths member to this list. e) In order for Alice to download files from Bob at respectable rate for extended period of time she must upload files to Bob at a respectable rate. CPS 706 (all 2011) Midterm Exam 1 5 of 8
6. Suppose within your Web browser you click on a link to obtain a Web page. Assume that the IP address for the associated URL is not cached in your local host, so that a DNS look-up is necessary to obtain the IP address. Suppose that n DNS servers are visited before your host receives the IP address from DNS; the successive visits incur a R of R 1,..., R n. urther suppose that the Web page associated with the link contains a small HML file which references three very small objects on the same server. Let R 0 denote the R between the local host and the server containing the objects. Assuming zero transmission time of the object, how much time elapses from when the client clicks on the link until the client receives all the objects using: (a) Non-persistent HP with no parallel CP connections? (10 points) Answer: Please see the problem 2 from the sample problems for midterm 1. Also please see problems 6 and 7 from section 2 R 2R 1 Rn 2Ro 3 8 Ro R1 R n. o CPS 706 (all 2011) Midterm Exam 1 6 of 8
7. Bob and Alice are two users of a file-sharing application. heir first-hop routers are R1 and R2 respectively (see figure below). Assume transmission rate achieved is 1Mbps downstream for Bob, 1Mbps upstream for Alice, and 1Mbps between R1 and R2. he end-to-end path is of 2000Km distance, the propagation speed is 2*10 8 m/sec. he initial handshake has been completed. Bob s P2P application starts to download a 3,000,000 byte MP3 file from Alice s machine. Ignore packet header and processing delays. Packet size is 60,000 byte and packets are sent from Alice s machine to the network back-toback. (a) If all links are lightly loaded (i.e., there is no queuing delay), how long does it take to download the file? (15 points) 1Mbps R1 1Mbps R2 1Mbps Answer: - End-to-end propagation delay is 2000Km / 2*10 8 m/sec = 10 ms. (a) 3Mbyte / 1Mbps + 60000 byte / 1Mbps + 60000 byte / 1Mbps + 10ms = 24 + 0.48 + 0.48 + 0.01 = 24.522 sec.. CPS 706 (all 2011) Midterm Exam 1 7 of 8
8. You are making up the DNS database for your domain networkutopia.com. he machines in this domain, together with their machine type and their IP addresses are: nickname Machine type IP address bear UNIX server 147.91.31.1 bison UNIX server 147.91.31.2 wolf UNIX server 147.91.31.3 You wish to map alias Networkutopia.com to both your web server machine and your mail server machine: Networkutopia.com Networkutopia.com he mail server he web server You need to send resource records (RRs) to the LD DNS server for com domain containing information about authoritative name servers for your domain. Assume that you only designate one authoritative name server for your domain. Specify the RRs which have to be sent to the LD server as well as the necessary content of your authoritative name server. You don t need to specify L field in resource records. In order to achieve load balancing you can assign equal number of applications to each server machine. Please write your answer in the tables provided below. Answer: Please note that answer to this question is not unique. Here is one of the answers: You will send to the LD server the following records in the format of (name, value, type) for each record: 7 points Networkutopia.com Dns.networkutopia.com NS Dns.networkutopia.com 147.91.31.1 A You need also the following table in your authoritative name server 8 points: Networkutopia.com Bison.networkutopia.com MX Bison.networkutopia.com 147.91.31.2 A Networkutopia.com Wolf.networkutopia.com CNAME Wolf.networkutopia.com 147.91.31.3 A CPS 706 (all 2011) Midterm Exam 1 8 of 8