Practice Exam 1-Solutions
Practice Exam 1-Solutions
SOLUTIONS
Time: 80 minutes
Instructions: This is a closed book exam, you are allowed to have one sheet of notes (no photocopies or print-outs, both sides) and a calculator There are 6 problems on this exam, all of them with multiple parts Total is 100 points
GOOD LUCK!
_____________________________________________________________________
Name (2 points)
Student ID (2 points)
Page 1 of 10
Problem 1: Estimating the RTT In this problem, we investigate the way TCP estimates the RTT. Assume that x= 0.1, and let SampleRTTy, y=1 denote the most recent sample RTT, y=2 be the next most recent sample RTT, etc. (a) (10 pts) For a given TCP connection, suppose four acknowledgments have been returned with corresponding sample RTTs SampleRTT1, SampleRTT2, SampleRTT3, and SampleRTT4. Find the EstimatedRTTy for y=1,2,3 and 4 in terms of the four sample RTTs. (b) (10pts) Generalize your formula for n sample round-trip times. (c) (10pts) For the formula in part (b) let n approach infinity. Comment on why this averaging procedure is called an exponential moving average.
Solution: (a) Denote EstimatedRRT(n) for the estimate after the nth sample EstimatedRRT(1) EstimatedRRT(2) EstimatedRRT(3) = SampleRRT1 = (1-x)EstimatedRRT(1) + xSampleRRT1 = (1-x)SampleRRT2 + xSampleRRT1 = (1-x)EstimatedRRT(2) + xSampleRRT1 = (1-x)2SampleRRT3 + x(1-x)SampleRRT2 + xSampleRRT1 = (1-x)EstimatedRRT(3) + xSampleRRT1 = (1-x)3SampleRRT4 + x(1-x)2SampleRRT3 + x(1-x)SampleRRT2 + xSampleRRT1
EstimatedRRT(4)
Page 2 of 10
(b)
n"1
EstimatedRTT
(n)
(c)
EstimatedRTT
( ")
Page 3 of 10
Problem 2: Packet versus Circuit Switching (a) (5 pts) Explain circuit switching (b) (5pts) Explain packet switching (c) (5 pts) What are the differences between packet and circuit switching? (d) (10 pts) Compare the total delay in sending x bits of user data over a k-hop path in a circuit-switched network and a packet-switched network. Here, the total delay is defined to be the time from the data starts to be delivered to the network till all the data bits have been received at the end of the path. For the packet-switched network, it is assumed that the network is lightly loaded and the queuing delay at each switching node is ignored, and in addition, the packet header size is ignored. For both networks, there is no loss. The circuit setup time is s second, the propagation delay is d second per hop, each packet contains p data bits, and the bit rate of the line on each hop is b bps. 1) What is the total delay, if the message is sent over the circuitswitched network? 2) What is the total delay, if the message is sent over the packetswitched network? 3) Under what condition does the packet-switched network have a lower delay?
Page 4 of 10
Solution: (a) Circuit switching is a switching technique for communication networks. Circuit switching creates a direct physical connection/path between two devices. The transmission capacity on the path is exclusively reserved for the connection. (b) Packet switching is a switching technique for communication networks. In packet switching, each packet has a header providing an address to identify the destination. In the network, packets are switched in the store-and-forward manner, i.e., at each node,packets are received and stored, before being forwarded to the next hop. (c) Circuit switching requires a connection setup, while packet switching may not have the setup process. (ii) Packet switching uses store-andforward transmission, while with circuit switching, the bits just flow through the path continuously. (iii) Circuit switching is completely transparent to the sender and receiver, and they can use any bit format or framing method they want to. But, with packet switching, packets have special formats in assembling bits or frames. (iv) In circuit switching, the transmission capacity on a path is dedicated to the corresponding connection, while in packet switching, the transmission capacity on a link is shared by packets from different connections. 1) Over the circuit-switched network, the total delay is due to three parts: the setup time s, the total propagation delay kd, and the transmission time x/b. So, the total delay = s + kd + x/b. 2) Over the packet-switched network, the total delay includes two parts: the total propagation delay kd, and the transmission time at each hop. For the transmission time, the x-bit user data is split into (x/p) packets. These packets are pipelined during the transmission. It can be seen from the following illustration that the transmission time part = x/b + (k-1)p/b. So, the total delay = kd + x/b + (k-1)p/b. (Note: In the following illustration, the propagation delay is ignored for simplicity.)
Page 5 of 10
3) With results above, when s > (k-1)p/b, the packet-switched network has a lower total delay.
Page 6 of 10
Problem 3: The OSI model 1) (5 pts) Explain the functionality of Layer 2. 2) (5 pts) Explain the functionality of Layer 3. 3) (5 pts) Explain the functionality of Layer 4. Solution: 1) Layer 2 is the Data Link Layer. Its main function is to enhance a physical channel with a raw stream of bits to a (hopefully) error-free, flow-controlled, frame-oriented information channel. Detailed functions include framing, error control, flow control, etc. Medium access control is also done in this layer. 2) Layer 3 is the Network Layer. It is concerned with getting user data from the source to the destination. Routing is the most important function of Layer 3. Other functions include addressing, congestion control, 3) Layer 4 is the Transport Layer. It enhances the network service to an appropriate end-to-end service. Important functions of Layer 4 include flow control, error control, addressing, etc.
Page 7 of 10
Problem 4 (1 pt each): True or false? 1) A Layer offering a connectionless service must use a connectionless protocol. 2) A Layer offering a connection-oriented service must use a connectionoriented protocol. 3) The Network Layer directly provides information to the user of an Application Layer service. 4) A protocol architecture with a network layer using a connectionless network protocol must use a connection-oriented transport protocol. 5) A protocol is the set of rules that determine the behavior between entities on adjacent layers, i.e. between entities on (N+1)-layer and (N)layer. 6) The physical layer is the layer closest to the transmission medium. Solution: 1) False 2) True 3) False 4) False 5) False 6) True
Page 8 of 10
Problem 5: Queuing Delay with Random Arrivals (10 pts) Consider a link of rate R=1 Mbps. Suppose packets of size L=1250 bytes arrive randomly to the link. Assume that the behavior of the queue can be modeled as M/M/1. Find the average queuing delay for a=30, 60, 90 and 99 packets/s. Solution: a 30 60 90 99 I 0.3 0.6 0.9 0.99 dqueue (0.3/0.7)*10 ms=4.3 ms (0.6)/(0.4)*10 ms=15 ms (0.9)/(0.1)*10 ms=90 ms (0.99)/(0.01)*10 ms=990 ms
Page 9 of 10
Problem 6 (5 pts each): Protocol Efficiency Calculate the efficiency of a Stop-and-Wait transport protocol with packets that are 1000 bits long, transmitting over a 1 Mbps link, when the RTT is a) 1 ms b) 100 ms Solution: a) U=(L/R)/(RTT+L/R)=0.5 b) U=(L/R)/(RTT+L/R)=0.0099
Page 10 of 10