25-Comp-B10 Distributed Systems · May 2013
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.
(a) Client and server programs. In the client-server model, a server is a program that runs continuously (or on demand), listens on a well-known network address/port, and provides a defined service by responding to requests. A client is a program that initiates communication by sending a request to a server and consuming the reply, typically on behalf of an interactive user. The relationship is asymmetric: the server is passive (waits to be asked) and typically shared by many concurrent clients, while each client instance is usually private to one user or one task and initiates the interaction. The two communicate over a network using a request-reply protocol built on top of transport-layer sockets (TCP or UDP): the client marshals its request into a message, sends it to the server's address, and blocks (or polls asynchronously) until the reply message arrives.
The same skeleton generalizes to email and ftp: an email client speaks SMTP to a mail-submission server and IMAP/POP3 to a mailbox server to fetch messages; an ftp client opens a control connection to negotiate commands and a separate data connection for the actual file transfer. In every case, the server exposes a stable, addressable service and the client is the one that must know where to find it and initiate contact.
(b) Resources shared efficiently in distributed systems. Software resources: (1) a shared database or file-server volume — e.g. a company's order-management database is hosted once and accessed concurrently by many client applications over the network, with the DBMS serializing/coordinating concurrent updates so clients never see a fragmented view; (2) a shared network/print service — a print server maintains one spool queue and one physical printer driver that many client workstations submit jobs to, rather than every desktop needing its own driver and direct cable to a printer. Hardware resources: (1) high-capacity storage (a NAS/SAN array) — many clients mount the same network volume so expensive, high-reliability (RAID-protected) disks are amortized across an organization instead of duplicated per desktop; (2) specialized compute hardware, e.g. a GPU/compute cluster — scientific or rendering jobs are submitted from many client machines to a shared cluster of accelerators, which is far more cost-effective than equipping every workstation with the same capability it uses only occasionally. In each case the resource is efficient to share precisely because individual clients need it only intermittently, while the server keeps it centrally available and multiplexes access across the community of users.