------------------------------------------------------------------------------- Mohamed G. Gouda CS 356 Fall 2005 Homework 2 ------------------------------------------------------------------------------- 1. A network consists of a process array p[i:0..n-1] and process q. Each process p[i] can estabilish a connection, using the identifier protocol in Section 6.2, to process q such that the following condition holds. At each instant, process q is involved in at most one connection. Desigon processes p[i:0..n-1] and q. (Hint: Process q has five variables. Four of those variables are conq, sq, x, y as in the original process q. The fifth variable is named "with" and its value is in the range 0..n-1.) ------------------------------------------------------------------------------- 2. Consider a protocol where process p continuously sends data(i) messages to process q, where the sequence number of each message i is in the range 0..r. Assume that the sent data message can be lost but neither corrupted nor reordered, and assume also that no more than r consecutive data messages can be lost. Process q has the following array var rcvd : array[integer] of boolean {initially, every rcvd[k]=false} When process q receives a data(i) message, it computes the order k of the received message and assign rcvd[k] the value true. Process p in this protocol is specified as follows: process p const r var i : 0..r {initially, 0} begin true -> {send next data message} send data(i) to q; i := i + 1 mod (r+1) end Specify process q in this protocol. ------------------------------------------------------------------------------- 3. Problem 6 in Chapter 8. ------------------------------------------------------------------------------- 4. Problem 2 in Chapter 9. -------------------------------------------------------------------------------