mt2 - CMPSCI653/591H/ECE597 Computer Networks Spring 1995...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CMPSCI653/591H/ECE597: Computer Networks Spring 1995 Prof. Jim Kurose Midterm Exam I Instructions: 1. Put your name and student number on the exam books NOW! 2. The exam is closed book. 3. You have 85 minutes to complete the exam. Be a smart exam taker - if you get stuck on one problem go on to another problem. Also, don't waste your time giving irrelevant (or not requested) details or material. 4. The total number of points for each question is given in parenthesis. There are 100 points total. An approximate amount of time that would be reasonable to spend on each question is also given if you follow the suggested time guidelines, you should nish with 10 minutes to spare. 5. Show all your work. Partial credit is possible for an answer, but only if you show the intermediate steps in obtaining the answer. 6. Good luck. 1. \Quickies" (24 points, 20 minutes) Answer each of the following questions brie y, i.e., in at most a few sentences. (4 points each) 1. List the seven layers in the OSI reference model (you need not explain what each layer does). 2. We have said that ASN.1-encoded data is self-identifying. What does this mean? 3. What are two services provided by the session layer in the ISO protocol stack? 4. Give an example showing that two-dimensional parity checks can correct and detect a single bit error. Show by counterexample that a double bit error can not always be corrected. Show by example that some double bit errors can be detected. 5. What is the di erence between congestion control and ow control? 6. Suppose that in a network the ratio of the propagation delay to transmission time is very small. What form of congestion control would you recommend. Why? 2. An application-level protocol preserving message boundaries (15 points, 10 minutes) We have seen in class that TCP is a byte-stream-oriented protocol which does not preserve the application-determined units of data passed to the socket. Thus, for example, even though the sender application may pass a 4K byte chunk of data into a socket in a single call, a read by the receiver may only initially return 2K bytes of this data. Design and give the pseudocode for two procedures, writefullmsg(sd,buf,n) and readfullmsg(sd,buf) which operate as follows. The rst of these two procedures is called by the sender application whenever it wants to send a message. The argument sd is an already opened socket, buf contains the data to be sent into sd and n is the number of bytes to send. readfullmsg(sd,buf) is called by the receiver sd is an already opened socket and buf contains the data received. writefullmsg(sd,buf,) and readfullmsg(sd,buf) should operate so that every time the receiver returns from a call to readfullmsg(), it returns with a complete \message" (a unit of data that was passed in a single call to writefullmsg() on the sender side). readfullmsg() has as its return value the number of bytes in buf: 3. The Go-Back N protocol (21 points, 15 minutes) Consider the Go-Back-N protocol with a sender window size of 3 and a sequence number range of 1024. Suppose that at time t, the next in-order packet that the receiver is expecting has a sequence number of k. First, assume that the medium does not reorder messages. Answer the following questions: 1 1. What are the possible sets of sequence numbers inside the sender's window at time t? Justify your answer. 2. What are all possible values of the ACK eld in message currently propagating back to the sender at time t: Justify your answer. Now consider the Go-Back-N protocol, but suppose that the channel can reorder messages such that when the nth packet is sent, it can only be bypassed (i.e., reordered) by the packet the was sent immediately before it. 1. Are timers still needed to insure correct operation of the Go-Back-N protocol? Justify your answer. 2. Will the standard Go-Back-N protocol still work in the case, for a sequence number space of 1024 and a window size of 3? Justify your answer. 3. Graduate students only: What is the largest window size that can be used for such a channel under the Go-Back-N protocol in this scenario. What about the selective repeat protocol? 4. Socket-based communication (20 points, 15 minutes) Suppose that 3 processes, A, B, and C want to communicate using connection-oriented sockets via the communication pattern shown below: A B C In this gure, A and C are the sources of data and all communication from A is sent to B, which then relays the data on to C. Similarly, C's data is relayed via B to A. Give a owchart-like description of A, B and C, showing where the connect(), accept() read() write() and any other needed system calls are used. Make sure you supply enough information to show who is connecting/sending to whom. You may assume that the call fromlayer5() returns only when there is data to send. You may make the following assumptions: Undergraduate students only: You may assume that the communication is such that A sends a message and then always waits for a reply before sending another message. Similarly C waits for message from A before sending a message back to A. grad students: your solution should not assume (or enforce) a strict alternation in sending between A and C. 2 5. A NACK-based Protocol (20 points, 15 minutes) Suppose that we want to design a realible data transfer protocol that only uses negative acknowledgments. The sender operates in a selective repeat fashion with an in nite window size (you may assume an in nitely large sequence number space), and only retransmits a packet when it receives a NACK from the receiver. The channel may lose or corrupt messages, and the delays are variable and unknown. 1. Would sequence numbers be necessary in this protocol? Why? 2. Would a timer be necessary or advisable in this protocol? Why? If so, would it be preferable to have the timer at the sender or receiver? Why? 3. Describe (in words or in pseudocide) the operation of a NACK-only receiver that would operate with this sender. If there are scenarios (no matter how unlikely) that your receiver would fail to operate reliably, identify these scenarios. 4. What would be one advantage of a NACK-based protocol? 3 ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online