CSE 480 Lecture Notes January 30, 1996 Interprocess Communication The Client-Server Model - Servers -- a group of cooerating processes that provide OS services - Clients -- user processes To avoid overhead of the connection-oriended protocols, the client server model is based on a simple connectionless request/reply protocol. Shorter protocol stack for efficiency (Fig 2-7) -- no routing, no connection E.g., Fig 2-9 +Addressing 1) Direct Communication send (P,msg) -- send a msg to process P receive (Q, msg) -- receive a msg from process Q or send (P, msg) -- send a msg to process P receive (id, msg) -- receive a msg from any process and set id to the sender - limited modularity since name change requires changes to others - if process id is of the form (machine-id, process-id) pair, then not location transparent 2) Indirect Communication send (A, msg) -- send a msg to mailbox A receive (A, msg) -- receive a msg from mailbox A - mailboxes - can be used for multicasting + Blocking versus Non-blocking Primivitives (Fig. 2-11) 1) blocking privimitives (synchronous primitives) 2) non-blocking primitives (asynchronous primitives) - send blocking send nonblocking send with copy nonblocking send with interrupt - receive blocking receive nonblocking receive + Buffering - problem: what if a msg is sent before receiver is ready 1) zero capacity -- synchronous communication or rendezvous 2) bounded capacity -- queue with lenght n what happen of queue overflows 3) unbounded capacity + Reliable versus Unreliable Primitives - how does a sender knows that its msg is delivered? 1) unreliable send -- up to the user, e.g., post office letter 2) ack by the kernel on the receiving machine (Fig 2-13(a)) 3) ack by the reply (Fig 2-14(b)) + Implementing the Client-Server Model - Fig 2-14 possibilities - Use of acknowledgement -- large msg divided into packets 1) every packet -- more traffice due to ack, faster 2) entire msg -- less traffice due to ack, slow - how long a packet should be kept at the sender side? how many sent but not acked packets should be allowed? e.g., alternative bit protocol - packet types (Fig 2-15) - typical packet exchange senario (Fig 2-16)