------------------------------------------------------------------------------- Mohamed G. Gouda CS 356 Summer 2008 Midterm 2 ------------------------------------------------------------------------------- 60 minutes Open Book ------------------------------------------------------------------------------- 1. (10 points) Consider an IP header that consists of 20 Bytes and has a checksum that consists of 2 Bytes. Assume that this checksum is computed using the first corruption detection protocol in Section 8.1. a. Can this checksum be used to detect a corruption where every bit in the IP header is corrupted (from 0 to 1 or from 1 to 0)? Explain your answer. b. Can this checksum be used to detect a corruption where every bit, except one, in the IP header is corrupted? Explain your answer. ------------------------------------------------------------------------------- 2. (10 points) A process p has an infinite input array d whose integer elements are to be sent one by one from p to process q. Each sent message from p to q is of the form data(s, t), where s is a sequence number in the range 0..1 and t is a value of an integer element in array d. Assume that the messages sent from p to q can be lost but neither corrupted nor reordered. Assume also that the message loss is 1-bounded. When process q receives a data(s, t) message and checks that this message is the expected one, process q stores t in the next available element in array e. An incomplete specification of processes p and q is as follows. process p inp d : array [integer] of integer var x : integer {index of d; init. 0} begin true --> end process q var e : array [integer] of integer, y : integer, {index of e; init.0} exp, s : 0..1, {init. 0} t : integer begin rcv data(s, t) from p --> end Specify the two statements S.0 and S.1. ------------------------------------------------------------------------------