The assignment explicitly said not to write pseudocode. The following code is included here to illustrate how much more work is involved in formulating pseudocode to solve this problem:
client-call( sl, out-l, in-l, out-p, in-p )
r = create new box
rl = create new link to box r
c = length of list of links in-l
send to sl the link rl with the body [c,out-p]
await message in box r containing link pl
for each link l in the list of links out-l
send to pl the link l
(this loop iterates c iterations)
endloop
--
in-l = empty list of links
await message in box r containing body [c,in-p]
iterate c times
await message in box r containing link l
add link l the list in-l
endloop
server
loop
await message in box s the link rl and body [c,out-p]
p = create new box
pl = creat new link to box p
send to rl the link pl
out-l = empty list of links
iterate c times
wait message in box p containing link l
add link l to the list out-l
endloop
--
call service function ( out-l, in-l, out-p, in-p )
--
c = length of list in-l
send to rl the body [c,in-p]
for each link l in list in-l
send to rl the link l
(this loop iterates c iterations)
endloop
forever
Part B: In the case where the server is a nameserver, the messages that must be exchanged between the client and server for the operations are as follows:
save(l,n)
initiate save message from client to server's public mailbox:
body: ( save, n )
link: reply-link
initial reply from server to client's reply box:
body: none
link: private-link
followup save message, from client to server's private-link:
body: none
link: l
optional final reply from server to client's reply box:
body: none
link: none
lookup(n) returns l
initiate lookup message from client to server's public mailbox:
body: ( lookup, n )
link: reply-link
optional initial reply from server to client's reply box:
body: none
link: private-link
final reply from server to client's reply box:
body: none
link: l
In the above, the optional messages are not, strictly speaking, needed,
but a generic skeleton for the server following the outline of part A
will tend to include them unless it is optimized. Furthermore, in a
fault tolerant system, it is handy to know, in the case of save(), that
the service has been completed, and in the case of lookup(), that the
initial message was delivered.
Part C: The basic interprocess communication primitives of our DEMOS like example are at the transport level in the ISO OSI model protocol hierarchy. They are stateless, so they aren't at or above the session layer, but they clearly address messages to logical recipients (boxes) and not to physical machines.
Part D: In the ISO OSI model protocol hierarchy, what level is represented by The client-server protocol described in part A establishes a temporary connection between client and server using temporary boxes and links, so it is at the session level in the ISO OSI model protocol hierarchy.