------------------------------------------------------------------------------ Mohamed G. Gouda CS 356 Spring 2014 Midterm 3 ------------------------------------------------------------------------------ (Hierarchical Routing Protocol) Consider a network whose processes are partitioned into two regions. The processes in region 0 are p[i:0..m-1], and the processes in region 1 are p[i:m..n-1], where m is strictly less than n. Process p[m-1] in region 0 is connected to process p[m] in region 1 by two opposite-direction channels. Otherwise, there are no other channels between the processes in region 0 and those in region 1. The processes in region 0 are specified as follows: process p[i:0..m-1] { processes in region 0 } const n inp N: set{g | p[g] is a neighbor of p[i]} up: array[N] of boolean rtb: array[0..m-1] of N { routing table of p[i] } var d: 0..n-1 { ult. dest. of a data msg } par g: N begin true --> d:=any; RTMSG [] rcv data(d) from p[g] --> RTMSG end (1) (10 points) Specify statement RTMSG in process p[i:0..m-1] in region 0. (2) (5 points) Specify the inputs, variables, and parameters of the processes in region 1. (3) (5 points) Consider the case where m = 128 and n = 256. How many entries are there in the flat routing table in each process in the network? Also, how many entries are there in the hierarchical routing table in each process in the network. Solution: (1) if d = i --> {arrived} skip [] d != i ^ d =< m-1 ^ up[rtb[d]] --> send data(d) to p[rtb[d]] [] d != i ^ d =< m-1 ^ ~up[rtb[d]] --> {unreachable dst.} skip [] d != i ^ d >= m ^ i != m-1 ^ up[rtb[m-1]] --> send data(d) to p[rtb[m-1]] [] d != i ^ d >= m ^ i != m-1 ^ ~up[rtb[m-1]] --> {unreachable dst.} skip [] d != i ^ d >= m ^ i = m-1 ^ up[m] --> send data(d) to p[m] [] d != i ^ d >= m ^ i = m-1 ^ ~up[m] --> {unreachable dst.} skip fi (2) process p[i:m..n-1] {processes in region 1} inp N: set{g | p[g] is a neighbor of p[i]} up: array[N] of boolean rtb: array[m..n-1] of N { routing table of p[i] } var d: 0..n-1 { ult. dest. of a data msg } par g: N (3) There are 256 entries in the flat routing table in each process in the network. There are 128 entries in the hierarchical routing table in each process in the network.