EE 122 Fall 2010 Discussion Section VI 13th October 2010 GSI: Sameer Agarwal http://www.cs.berkeley.edu/~sameerag/ee122/fa10/ Question 1: HTTP a. Describe the process of loading the following web page: http://www-inst.eecs.berkeley.edu/~ee122/fa10/class.html 1) Resolves the server IP address of www-inst.eecs.berkeley.edu through DNS 2) Makes a TCP connection with the server b. Specify the first line of each HTTP header. Assume the IP address is unknown; that we are using HTTP 1.1, and that the web page is available. 3) Sends an HTTP Request GET /~ee122/fa10/class.html HTTP/1.1 4) Receives an HTTP Response HTTP/1.1 200 OK c. Explain how stateless HTTP can implement a stateful user session such as a shopping cart application at amazon.com. Name one security vulnerability of your answered approach. HTTP relies on cookies to implement session. That it, the server stores state in the form of cookie at the client, then it restores the state by receiving HTTP requests with cookie from the client. This implies that malice can impersonate the client if it can access the cookie. In reality, many cross-site scripting (XSS) attacks base on this. d. Your web site prospers but your ISP starts to complain about your web traffic. Where would you put a web cache to handle this problem? Forward proxy (put the cache close to clients.) or Caching at the client. e. Can any web content be cached? If so, justify it. Otherwise, describe what kind of content cannot be cached. Only static content can be cached. For an obvious example, dynamic share prices from NYSE cannot be cached. Moreover, we direct your browser to not cache the announcement, lecture and project page of the ee122 website. Question 2: Ethernet and Multiple Access a. What is the expected backoff time in a 10 Mbps Ethernet for a host that has just experienced three collisions in a row? b. Suppose two hosts are connected via a CSMA/CD network, where the medium transmits at 1 Gbps. If the minimum frame length is fixed to 1000 bits and the propagation speed is 2 × 108 m/s, how far can the hosts be apart? c. If the network mentioned in the previous question is Ethernet, what is the approximate efficiency of the network when the hosts are the maximum distance apart? What about if the distance is reduced to 1 m? d. Suppose there are n hosts sharing a broadcast link. Each host has a frame to send with a probability p. Which multiple access protocol would you use if p is low? What about if p is high? If p is low, there's little chance to experience collisions. Thus, a random access protocol (e.g., CSMA/CD) is desirable. Otherwise, a channel partitioning protocol (e.g., TDMA, FDMA) is more efficient. (Taking-turns protocols are less desirable than channel partitioning protocols because of their latency overhead.) Question 3: Hubs and Switches Assume the topology in Figure 1, where A, B, and C are end hosts that have not C yet sent a packet and whose network interfaces are in promiscuous mode. Initially, the link between U and V is disabled. Figure 1 a. What is the process of sending a request message from A to B and getting a reply back from B to A, if U, V, X, and Y are hubs? Can C see any messages? If so, which messages? 1) X receives a request message from A and floods it to Y and U. 2) Then Y receives the flooded message and again floods to V, B and C. 3) The reply also triggers flooding at Y and then X. C can see both the request and the reply. b. Repeat the same question assuming U, V, X, and Y are now switches. 1) X receives a request message from A. 2) Since X has no idea where B is, it floods to Y and U. At the same time, X learns about A and remembers its location. 3) Y receives the flooded message. Like X, Y also floods to V, B and C since it does not know about B. U and Y now learn about A and remember its location (i.e., link to X). V also learns about the A's location (i.e, link to Y). 4) When the B's reply hits the switch Y, Y now learns about B. Since Y already knows where A is, it directly sends to X rather than floods. 5) X now learns about B and stores its location (i.e., link to Y). Since X knows where A is, it directly sends out to A. C can see the request message from A to B, but cannot see the reply message from B to A. c. Imagine the U-V link is now enabled. Can we always guarantee communication between A and B if U, V, X, and Y are hubs? What about if they are switches? In both cases the squares constitute a forwarding loop, and thus A and B finally become unable to communicate each other. d. If any case in the previous question prevents communication, how would you solve the problem? We cannot solve the hub case. For the switch case, build a spanning tree of switches and disable non-tree links e. Suppose we disabled the U-V link again and that B has moved and is now connected to U. Can A and B communicate if the squares U, V, X, and Y are hubs? What about if they are switches? If they are hubs, A and B can communicate because hubs always flood packets. If they are switches, X and U have remembered B is reachable through Y and X, respectively. Thus, A cannot send a packet to B until X and U expire the B's location information or until they update the information when B sends a packet to somewhere. On the other hand, B can communicate with A because A hasn't moved and U and X remember where A is. f. If any case in the previous question prevents communication, how would you solve the problem? The location information in each switch must expire after short time period. (soft-state) Question4: Bridge Spanning Tree Algorithm “Algorhyme” I think that I shall never see A graph more lovely than a tree. A tree whose crucial property Is loop-free connectivity. A tree which must be sure to span. So packets can reach every LAN. First the Root must be selected By ID it is elected. Least cost paths from Root are traced In the tree these paths are placed. A mesh is made by folks like me Then bridges find a spanning tree. Radia Perlman, inventor of the spanning tree algorithm a. Given the extended LAN shown in Figure 2, indicate which ports does the spanning tree algorithm not select. The LANs in the figure are labeled A – J, and the bridges are labeled B1 – B7. For a hub Bi, i is the hub ID. b. Now assume that bridge B1 fails. Indicate which ports does the spanning tree algorithm not select after the recovery process completes and a new tree has been formed.