New Yrk University Cmputer Science Department Curant Institute f Mathematical Sciences Curse Title: Data Cmmunicatin & Netwrks Curse Number:CSCI-GA.2662-00 Instructr: Jean-Claude Franchitti Sessin: 2 Assignment #2 Slutins. Questin : Textbk chapter 2 prblem 7: Suppse within yur Web brwser yu click n a link t btain a Web page. The IP address fr the assciated URL is nt cached in yur lcal hst, s a DNS lkup is necessary t btain the IP address. Suppse that n DNS servers are visited befre yur hst receives the IP address frm DNS; the successive visits incur an RTT f RTT,...,. Further suppse that the Web page assciated with the link cntains exactly ne bject, cnsisting f a small amunt f HTML text. Let RTT 0 dente the RTT between the lcal hst and the server cntaining the bject. Assuming zer transmissin time f the bject, hw much time elapses frm when the client clicks n the link until the client receives the bject? The ttal amunt f time t get the IP address is Once the IP address is knwn, RTT RTT O 2. RTT elapses t set up the TCP cnnectin and anther request and receive the small bject. The ttal respnse time is 2 RTT RTT RTT2 RTT O elapses t 2. Questin 2: Textbk chapter 2 prblem 8: Referring t Prblem P7, suppse the HTML file references eight very small bjects n the same server. Neglecting transmissin times, hw much time elapses with a. Nn-persistent HTTP with n parallel TCP cnnectins? b. Nn-persistent HTTP with the brwser cnfigured fr 5 parallel cnnectins? c. Persistent HTTP?
a. b. c. RTT 2RTT RTTn 2RTT 8 8 RTT RTT. RTT 2RTT RTTn 2RTT 2 6RTT RTT RTT RTT 2RTT RTT n 3. RTT RTT 3. Questin 3: Textbk chapter 2 prblem 0: Cnsider a shrt, 0-meter link, ver which a sender can transmit at a rate f 50 bits/sec in bth directins. Suppse that packets cntaining data are 00,000 bits lng, and packets cntaining nly cntrl (e.g., ACK r handshaking) are 200 bits lng. Assume that N parallel cnnectins each get /N f the link bandwidth. Nw cnsider the HTTP prtcl, and suppse that each dwnladed bject is 00 Kbits lng, and that the initial dwnladed bject cntains 0 referenced bjects frm the same sender. Wuld parallel dwnlads via parallel instances f nn-persistent HTTP make sense in this case? Nw cnsider persistent HTTP. D yu expect significant gains ver the nn-persistent case? Justify and explain yur answer. Nte that each dwnladed bject can be cmpletely put int ne data packet. Let Tp dente the ne-way prpagatin delay between the client and the server. First cnsider parallel dwnlads via nn-persistent cnnectins. Parallel dwnlad wuld allw 0 cnnectins share the 50 bits/sec bandwidth, thus each gets just 5 bits/sec. Thus, the ttal time needed t receive all bjects is given by: (200/50+Tp + 200/50 +Tp + 200/50+Tp + 00,000/50+ Tp ) + (200/(50/0)+Tp + 200/(50/0) +Tp + 200/(50/0)+Tp + 00,000/(50/0)+ Tp ) = 7377 + 8*Tp (secnds) Then cnsider persistent HTTP cnnectin. The ttal time needed is give by: (200/50+Tp + 200/50 +Tp + 200/50+Tp + 00,000/50+ Tp ) + 0*(200/50+Tp + 00,000/50+ Tp ) =735 + 24*Tp (secnds) Assume the speed f light is 300*0 6 m/sec, then Tp=0/(300*0 6 )=0.03 micrsec. Tp is negligible cmpared with transmissin delay.
Thus, we see that the persistent HTTP des nt have significant gain (less than percent) ver the nnpersistent case with parallel dwnlad. 4. Questin 4: Textbk chapter 2 prblem 9: In this prblem, we use the useful dig tl available n Unix and Linux hsts t explre the hierarchy f DNS servers. Recall that in Figure 2.2, a DNS server higher in the DNS hierarchy delegates a DNS query t a DNS server lwer in the hierarchy, by sending back t the DNS client the name f that lwer-level DNS server. First read the man page fr dig, and then answer the fllwing questins. a. Starting with a rt DNS server (frm ne f the rt servers [a-m].rt-servers.net), initiate a sequence f queries fr the IP address fr yur department's Web server by using dig. Shw the list f names f DNS servers in the delegatin chain in answering yur query. b. Repeat part a) fr several ppular Web sites, such as ggle.cm, yah.cm, r amazn.cm a. The fllwing delegatin chain is used fr gaia.cs.umass.edu a.rt-servers.net E.GTLD-SERVERS.NET ns.umass.edu(authritative) First cmmand: dig +nrecurse @a.rt-servers.net any gaia.cs.umass.edu ;; AUTHORITY SECTION: edu. 72800 IN NS E.GTLD-SERVERS.NET. edu. 72800 IN NS A.GTLD-SERVERS.NET. edu. 72800 IN NS G3.NSTLD.COM. edu. 72800 IN NS D.GTLD-SERVERS.NET. edu. 72800 IN NS H3.NSTLD.COM. edu. 72800 IN NS L3.NSTLD.COM. edu. 72800 IN NS M3.NSTLD.COM. edu. 72800 IN NS C.GTLD-SERVERS.NET. Amng all returned edu DNS servers, we send a query t the first ne. dig +nrecurse @E.GTLD-SERVERS.NET any gaia.cs.umass.edu umass.edu. 72800 IN NS ns.umass.edu. umass.edu. 72800 IN NS ns2.umass.edu. umass.edu. 72800 IN NS ns3.umass.edu. Amng all three returned authritative DNS servers, we send a query t the first ne. dig +nrecurse @ns.umass.edu any gaia.cs.umass.edu gaia.cs.umass.edu. 2600 IN A 28.9.245.2 b. The answer fr ggle.cm culd be:
a.rt-servers.net E.GTLD-SERVERS.NET ns.ggle.cm(authritative) 5. Questin 5: Textbk chapter 2 prblem 23: Cnsider distributing a file f F bits t N peers using a client-server architecture. Assume a fluid mdel where the server can simultaneusly transmit t multiple peers, transmitting t each peer at different rates, as lng as the cmbined rate des nt exceed u s. a. Suppse that u s /N d min. Specify a distributin scheme that has a distributin time f NF/u s. b. Suppse that u s /N d min. Specify a distributin scheme that has a distributin time f F/d min. c. Cnclude that the minimum distributin time is in general given by max{nf/u s, F/d min }. a. Cnsider a distributin scheme in which the server sends the file t each client, in parallel, at a rate f a rate f u s /N. Nte that this rate is less than each f the client s dwnlad rate, since by assumptin u s /N d min. Thus each client can als receive at rate u s /N. Since each client receives at rate u s /N, the time fr each client t receive the entire file is F/( u s /N) = NF/ u s. Since all the clients receive the file in NF/ u s, the verall distributin time is als NF/ u s. b. Cnsider a distributin scheme in which the server sends the file t each client, in parallel, at a rate f d min. Nte that the aggregate rate, N d min, is less than the server s link rate u s, since by assumptin u s /N d min. Since each client receives at rate d min, the time fr each client t receive the entire file is F/ d min. Since all the clients receive the file in this time, the verall distributin time is als F/ d min. c. Frm Sectin 2.6 we knw that D CS max {NF/u s, F/d min } (Equatin ) Suppse that u s /N d min. Then frm Equatin we have D CS NF/u s. But frm (a) we have D CS NF/u s. Cmbining these tw gives: D CS = NF/u s when u s /N d min. (Equatin 2) We can similarly shw that: D CS =F/d min when u s /N d min (Equatin 3). Cmbining Equatin 2 and Equatin 3 gives the desired result.
6. Questin 6: Textbk chapter 2 prblem 29: Because an integer in [0, 2 n - ] can be expressed as an n-bit binary number in a DHT, each key can be expressed as k = (k 0, k,...,k n- ), and each peer identifier can be expressed p = (p 0, p,...,p n- ). Let's nw define the XOR distance between a key k and peer p as d(k,p) = Describe hw this metric can be used t assign (key, value) pairs t peers. (T learn abut hw t build an efficient DHT using this natural metric, see [Maymunkv 2002] in which the Kademlia DHT is described.)