------------------------------------------------------------------------------ Mohamed G. Gouda Midterm 2 CS 356: Computer Networks Spring 2007 ------------------------------------------------------------------------------ Open Book 75 Minutes ------------------------------------------------------------------------------ 1. (7 points) At each instant, process p can establish at most one (simplex) connection to any process in the process array q[i:0..n-1], according to the connection protocol that uses timeouts in Section 6.1. Specify process p in this protocol. ------------------------------------------------------------------------------ 2. (7 points) A corruption burst is called n-bracketed if and only if it satisfies the following four conditions: i. The length of the burst is at least n bits. ii. The first n bits in the burst are all corrupted. iii. The last n bits in the burst are all corrupted. iv. None of the bits between the first n bits and the last n bits, if any, is corrupted. Assume that the corruption detection protocol in Section 8.1 is used to detect n-bracketed corruption bursts in blocks that consist of m*n data bits plus n parity bits each. What is the length of the shortest n-bracketed corruption burst that can be detected by this protocol? What is the length of the longest n-bracketed corruption burst that can be detected by this protocol? Briefly explain your answers. ------------------------------------------------------------------------------ 3. (6 points) Process p sends data messages to the two processes q[i:0..1] and receives ack messages from both of them according to the cumulative acknowledgement protocol in Section 9.3. Process p has the following data structure: process p const w var na : array[0..1] of integer, {init. 0} ns : array[0..1] of integer, {init. 0} i : integer, par j : 0..1 The following protocol invariant holds at each instant during the execution of the protocol. (ns[0]-na[0]) + (ns[1]-na[1]) =< w Specify process p in this protocol. ------------------------------------------------------------------------------