EE122 Fall 2013 HW3 Instructions Recor your answers in a file calle hw3.pf. Make sure to write your name an SID at the top of your assignment. For each problem, clearly inicate your final answer, bol an unerline. You o not nee to explain your answer unless explicitly tol to o so. Submit your answers via your instructional account using submit hw3. This assignment is ue on Dec 2 n, 5pm. Questions? Post on piazza, or email Rahika (rahika at eecs.berkeley) or Sameer (sa at berkeley)! Q1. DNS Lookup Your EECS instructional machine (@fuji.cs.berkeley.eu) has a utility calle ig that allows you to query Domain Name Service (DNS) servers aroun the Internet. You can simply run ig as follows: $> ig @ns.server.name[optional] recor-type omain-name Here ns.server.name is the hostname of the DNS server you wish to query. The recor-type is the type of DNS recor you wish to retrieve (such as ANY, MX, A, CNAME etc.) an omain-name is the name of the host or omain you seek information on. For more information on how to use ig, please consult the man page an/or RFC1035. As we iscusse in class, there can be 2 types of DNS queries recursive or iterative. For a recursive DNS query, the name server attempts to completely resolve the name by following the naming hierarchy all the way to the authoritative name server. On the other han, for an iterative query, the name server simply gives a referral to another name server in the hierarchy that shoul be contacte next in orer to resolve the name. By efault, ig sets the RD (recursion esire) bit in the DNS query packet to inicate that it woul like to have the query resolve recursively. Not all servers support recursive queries from arbitrary resolvers. a) Basic Usage: Resolve the IP aress of www.google.com using your efault name server. Attach the output of the ig query an explain each fiel of the ANSWER SECTION in the output. b) Iterative DNS Queries: Now, instea of using your efault name server, we woul like you to resolve www.google.com using one of the root DNS servers (e.g., a.rootservers.net). Note that this server oesn t accept a recursive query from you, but it gives you the reference to the next name server that is to be querie in www.google.com s hierarchy. Use ig to execute the sequence of iterative queries by
following the chain of referrals to obtain www.google.com s aress 1. Attach the ig output an write own the sequence of name servers you querie in the process an specify the omain each server was responsible for. c) Recursive DNS Queries: ns1.iitkgp.ac.in an nsl.fujitsu.fr are two name servers in Inia an France that answer recursive DNS queries. Use these DNS servers to resolve www.google.com. Attach the ig output. Now compare the en-to-en latencies between your machine an the sets of IPs for google.com that were returne by these two DNS servers an by your efault DNS server in part (a). Why o we see a ifference in latency? ) DNS Spoofing: As the evil CTO of www.evilsearch.com, Garry realizes that the easiest way to efeat Google woul be to reirect all the users to his website by simply messing with the DNS servers. Having taken EE122, he recalls that servers cache A an NS recors from DNS replies an referrals an he can configure his own DNS server to return incorrect results for arbitrary omains. If the resolver caches Garry s malicious results, it will return ba results to future DNS queries. Help him complete his master plan to hijack Google s omain name by writing own exactly what woul Garry s name server returns upon a DNS query. What must a robust DNS server implementation o to counter this attack? 1 If a query returns multiple servers, just choose one amongst them at ranom. If a particular server times out, just choose an alternate one.
Q2. Content Delivery with HTTP We woul like to ownloa an article on the web. This involves two steps: Step 1: Downloa a master inex page of size B. This page contains links to four images. Step 2: Downloa the four images. Each image is also of size B Assumptions: Ignore all transmission elays Assume that HTTP responses fit in a single TCP packet. i.e., the HTTP response incluing the B bytes an the size of the HTTP heaer is smaller than the MSS of a single TCP packet We on t nee to wait for the HTTP responses to be acknowlege nor for the TCP connections to terminate Calculate the time taken to ownloa the article uner each of the following scenarios a) All files are store at a single origin server S. Our RTT to S is R. We use sequential requests with non-persistent TCP connections. Give your answer in terms of multiples of R. b) All files are store at a single origin server S. Our RTT to S is R. We use sequential requests with persistent TCP connections. Give your answer in terms of multiples of R. c) All files are store at a single origin server S. Our RTT to S is R. We use concurrent requests with non-persistent TCP connections. (Note that the master inex page is ownloae first, followe by concurrent ownloa of the images). Give your answer in terms of multiples of R. ) The content provier now signs up with a CDN for the elivery of its images. The master inex page is still serve from the origin server S with RTT equal to R. Our RTT to the closest CDN server is (R/2). We use sequential requests with nonpersistent TCP connections. Give your answer in terms of multiples of R. e) Repeat part () assuming sequential persistent connections f) Repeat part () assuming concurrent non-persistent connections g) The CDN tries to o some loa balancing an ifferent images are serve by ifferent CDN servers, at istances 3R/4, R/2, R/3 an R/4. The master inex page is still serve from the origin server S. We use sequential requests with non-persistent TCP connections. Give your answer in terms of multiples of R. h) Repeat part (g) assuming sequential persistent connections i) Repeat part (g) assuming concurrent non-persistent connections
Q3. Wireless D A E B C F Consier the above wireless network in which each noe has a raio range of istance. In the figure, two noes are in each-other s range, if there is an ege between them. Consier two collision resolution schemes: CS: This is a pure carrier sense scheme in which a noe oes not sen when it hears someone else transmitting, but otherwise can sen whenever it wants. MACA: No carrier sense. Noes wishing to communicate use an RTS-CTS-Data exchange. Noes overhearing an RTS wait to allow the CTS to be sent. If no CTS is hear, the noe can transmit. If a CTS is hear (even if no earlier RTS is hear), the noe is quiet for the entire uration of the ata transmission. Note: Treat each of the five parts of this question as inepenent scenarios a) Assume noe E is transmitting ata to noe B when a noe, say X ecies to transmit ata to another noe, say Y. You have the following three cases: Case 1: X = A, Y = B Case 2: X = F, Y = C Case 3: X = C, Y = A For each case, answer the following questions: i. If all noes use CS, can X transmit to Y? If NO: explain why. If YES: Is the transmission successful (i.e., will Y correctly receive the ata from X)? Is the original transmission (from E to B) impacte?
ii. If all noes use MACA, can X transmit to Y? If NO: explain why. If YES: is the transmission successful (i.e., will noe B receive the ata)? Is the original transmission (from E to B) impacte? b) Now assume noe B is transmitting ata to noe E when a noe, say X ecies to transmit ata to another noe, say Y. You have the same three cases: Case 1: X = A, Y = B Case 2: X = F, Y = C Case 3: X = C, Y = A For each case, answer the following questions: i. If all noes use CS, can X transmit to Y? If NO: explain why. If YES: Is the transmission successful (i.e., will Y correctly receive the ata from X)? Is the original transmission (from B to E) impacte? ii. If all noes use MACA, can X transmit to Y? If NO: explain why. If YES: is the transmission successful (i.e., will noe B receive the ata)? Is the original transmission (from B to E) impacte? c) Assume A is transmitting to B at the beginning of time. List the pair of noes (if any) that can successfully communicate: i. if all noes use CS ii. if all noes use MACA For this, consier each irection separately. i.e., list the pair (X, Y) if X can successfully sen ata to Y, irrespective of whether Y can successfully sen to X. We say that the ata is sent successfully if the sener is able to transmit it an the receiver is able to successfully receive it, without any interference. ) Noe D woul like to transmit to A, noe E to B an noe F to C. Can noes D, E an F transmit simultaneously using CS? What about with MACA (clearly list your assumptions with respect to the orering an timing of RTS/CTS)? e) Now assume biirectional communication between noe pairs (D, A), (E, B) an (F, C), i.e., for a noe pair (x,y), x has ata to sen y an y has ata to sen to x. In an ieal scenario, which pairs of noes can simultaneously communicate? Will CS allow this ieal scenario? What about MACA (clearly list your assumptions with respect to the orering an timing of RTS/CTS)?
Q4. Spanning Tree Protocol an Learning Switches 0 2 1 3 4 5 Consier the above topology, with each noe representing an Ethernet switch. For simplicity assume that the MAC aress of a switch is represente by a single number as shown. a) Spanning Tree Protocol i. List the root an the eges of the spanning tree obtaine after running the Spanning Tree Protocol for Switche Ethernet on the above network. (You on t have to show how the algorithm procees, simply write the final result.). Ties are broken base on smaller i if multiple shortest paths to the root exist. ii. Suppose noe 0 fails. Ientify the new root an the eges of the new Spanning Tree that is constructe after the failure. b) Learning Switches Consier the original topology (before noe 0 fails) with en-hosts attache to them as shown below. Again, for simplicity, assume the MAC aresses of the en-hosts are represente by a single alphabet. The circular noes in the topology are Learning Switches.
a 0 2 c b g 1 3 e 4 5 f Consier the following packet transmissions occurring between a source-estination pair, in the given orer, one after another. For each packet transmission, list the switches an the en-hosts that receive the packet. Assume that you start with no entries in the forwaring table of any switch. Note: If a switch floos the packet, all the ajacent switches an en-host will receive it an may further floo or unicast it. If a switch unicasts a packet, then only the corresponing en host or switch woul receive the packet, which may further floo or unicast the packet. 1. b to c 2. c to b 3. to c 4. a to b 5. a to g c) Learning Switches with Limite Memory
Consier the case that the switches have a small memory cache with enough space to store only a single entry in the forwaring table an therefore, they store only the most recent entry. Assume that you start with no entries in the forwaring table of any switch. For each of the packet transmissions, in the given orer, write own whether switch 0 floos the packet or unicasts it. 1. b to c 2. a to b 3. c to b 4. b to c 5. a to b 6. c to b 7. b to c 8. a to b 9. c to b 10. b to c 11. a to b 12. c to b i. List for each pair amongst (a to b), (b to c) an (c to b), the fraction of packets that are flooe by the switch an the fraction of packets that are unicast out of the 4 packets transmitte for each pair. ii. How can you re-orer these packet transmissions, such that for all three sourceestination pairs, half of the packets are flooe an half are unicast? (Hint: you nee to make at most 2 swaps in the sequence of packet transmissions).