The Exam
Everything about the final exam itself: its format and how to spend its 180 minutes, what staff have confirmed, how each kind of question is marked, two real papers worked question by question, the questions your assignments invite, the lists to know by heart, and a plan for the days that are left.
- You willknow the paper's shape and budget your time at three minutes a mark.
- You willrecognise each question type and the answer shape that earns its marks.
- You willhave worked through the 2026 practice exam and the 2016 paper, question by question.
- You willhave a day-by-day plan for the final week before the exam on Tuesday 10 November.
The Exam at a Glance exam
Before you can plan revision or pace yourself in the room, you need the hard facts: when the exam is, what you may bring, how the 60 marks are split and how long each mark is worth spending. Everything in this section comes from the Week 12 "final exam preparation" lecture and the cover page of the official 2026 practice exam, plus three posts from staff on Ed, the subject's discussion forum.
| Item | Detail |
|---|---|
| Date | Tuesday 10 November, 8:30 AM AEDT, on campus. Double-check the time and the venue in your own exam timetable. |
| Format | Written on paper: 15 minutes of reading time, then 3 hours of writing. Each answer goes in its question's answer box; there are overflow boxes at the back, and you may draw figures by hand. |
| Materials | Closed book, meaning no notes and no reading material of any kind, and no calculators. You may bring photo ID, pens (answers must be in blue or black ballpoint), pencils, erasers, highlighters and an unlabelled bottle of water. |
| Weight | 60% of the subject. The assignments make up the rest: A1 is worth 15% and A2 25%. |
| Hurdle | A hurdle is a minimum you must reach in one component regardless of your total. Here you must pass the exam itself (30 out of 60) as well as the subject overall. |
| Questions | 11 questions, 60 marks: ten questions worth 5 marks each, of which Q1 is ten multiple-choice questions (MCQs) at 0.5 marks each, plus one 10-mark coding question (Q11 in the practice exam). |
| Scope | All material from Weeks 1–12 unless stated otherwise: lectures L1–L10 and the tutorials, which this site covers in Parts I–X. Guest lectures are excluded. |
| Time budget | 180 minutes ÷ 60 marks = 3 minutes per mark. |
The last row is the one to carry into the room. At three minutes a mark, a 5-mark question deserves about 15 minutes including thinking time, one 0.5-mark multiple-choice item a minute or two, and the 10-mark coding question about 30 minutes. The figure lays the whole paper out on one time line, so you can see where each block of minutes goes.
The lecturer asked for answers that are clear, concise and to the point. Bullet points are an acceptable format, but any part of an answer that cannot be read is marked as incorrect. You may not write anything during the reading time. These timings apply to the main exam; students with special consideration follow their own allocated time.
The 2016 paper put two more rules on its cover that are worth keeping in mind: "No materials are authorized", and candidates should attempt all questions, because partial credit is available. According to the slide in the admin lecture (L0), the guest lectures and the advanced topics (content delivery networks, cloud, blockchain and the Internet of Things) are not examinable.
What staff have confirmed on Ed
The lecture left a few questions open, and three posts from staff settle them. Together they tell you what counts as examinable, how much to trust the worked answers on this page, and where to get an official opinion. The time line places them, and the other dates that matter, between the release of the practice exam and the exam itself.
- Both lecture and tutorial content are in scope (30 October). The tutorial answers marked official on this site, including the revision tutorial's answers in 11.11, are therefore examinable material in their own right, not just practice.
- No solutions will be released for the practice exam (27 October), so that students can test their readiness honestly, and because many of its questions have more than one correct approach. The worked answers in 11.9 and 11.10 are therefore the study guide's own reference answers, not official ones: read each as one good answer rather than the only one. The same post invites you to post a specific question with your draft answer on Ed, and staff will review it. That is the way to get an official view on any practice-exam answer you are unsure of.
- An exam consultation on Zoom was announced on 2 November for 3:00–5:00 PM on Tuesday 3 November, with the advice to bring the questions where your own draft and the worked answers disagree. That session took place on 3 November; for anything still unresolved, Ed is the channel that remains.
Until Week 12 the only past paper available was the 2016 final, which had 8 questions, all short-answer or scenario questions. Lectures L5–L10 are now taught by a different lecturer (Dr Tawfiq Islam), and the official 2026 practice final exam shows a different style: a page of multiple-choice questions, short definitions, explain-and-discuss questions, a diagram to draw, and a 10-mark Java RMI program to write.
So use each source for what it is good for. The 2026 practice exam is the main evidence of how questions are asked. The 2016 paper is extra practice on scenario and design questions. The Week 12 study points below, together with the learning outcomes at the start of each lecture deck, are the evidence of what is asked.
What to study, according to the Week 12 lecture
The lecturer gave a list of suggested study points for each lecture, together with the textbook reading. He described it as "not an exhaustive list, nor is it a list of exam questions": everything from Weeks 1–12 is examinable unless stated otherwise. He also said to study each lecture together with its tutorial, which was usually held the following week, and to attempt the practice final exam. The table maps each lecture's study points onto the Part of this site that teaches them. The textbook throughout is CDK: Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design, 5th edition.
| Lecture | Study points (Week 12 lecture) | CDK reading | Where on this site |
|---|---|---|---|
| L1 Introduction | Defining distributed systems · their characteristics · their challenges | §1.1, 1.2, 1.4–1.6 | Part I |
| L2 Sockets | Networking basics · ports and sockets · Java sockets | §3.4, §4.1–4.4 | Part III |
| L3 Threads | Thread applications · defining threads · Java threads · multithreaded server architectures · thread synchronisation | §7.4 | Part IV |
| L4 System models | Physical models · architectural models · fundamental models: interaction (performance, and the difficulty of setting time limits), failure (the faults processes can exhibit) and security (threats to processes and channels) | §2.1–2.4 | Part II |
| L5 OS architectures | Monolithic, layered and microkernel architectures, with the monolithic-vs-microkernel figure | §7.6 | Part V |
| L6 Remote invocation | Request-reply protocol · invocation semantics · RMI architecture · RMI programming on the server and client sides | §5.1–5.5 | Part VI |
| L7 Indirect communication | Space and time uncoupling · group communication · publish-subscribe · message queues · distributed shared memory · tuple spaces | §6.1–6.5 | Part VII |
| L8 Distributed file systems | Why DFSs are needed · UNIX file system basics · DFS requirements · file service architecture · Sun NFS | §12.1–12.3 | Part VIII |
| L9 Name services | Why naming is needed · design requirements (structure, management, operations) · DNS | §13.1–13.3, §13.5 | Part IX |
| L10 Security | Threats and attacks · cryptography basics · secrecy and integrity, digital signatures, certificates · Kerberos and TLS | §11.1–11.4, §11.6 | Part X |
Notice that the lecture order and the Part order differ: sockets (L2) and threads (L3) were taught before system models (L4), but system models come first on this site (Part II) because they give you the vocabulary for everything else.
What to read last
The lecturer added that some concepts are only in the slides, and that you can safely skip textbook content the slides don't mention. That makes a handful of brief topics, which sit outside both the study points and the reading list, the lowest priority. Read them only once everything else is solid:
- overlay networks and MPI (CDK §4.5–4.6), in Part III;
- invocation performance and OS-level virtualization (CDK §7.5 and §7.7), in Part V;
- AFS and later developments in distributed file systems (CDK §12.4–12.5), in Part VIII;
- the Global Name Service (CDK §13.4), in Part IX;
- cryptography pragmatics (CDK §11.5), in Part X.
The 2016 paper did ask a 1-mark question on virtualization, but that was under a different lecturer.
Check yourselfYou reach the exam's Q7, a 5-mark question, after 100 minutes of writing. Are you ahead of or behind schedule?
Q1 to Q6 are 30 marks, which at 3 minutes a mark should take 90 minutes, so Q7 should start at minute 90. Starting at minute 100 you are 10 minutes behind. You still have 80 minutes for 30 marks (Q7–Q11), which is under 3 minutes a mark, so shorten each remaining answer to its essentials rather than skipping a question: partial credit is available.
Check yourselfWhich of these is examinable?
- A guest lecture from Week 11
- The blockchain material from the advanced topics
- An official tutorial answer posted on Ed
- Nothing outside the lecture slides
C. Staff confirmed on Ed on 30 October that both lecture and tutorial content are in scope. Guest lectures (A) and the advanced topics (B) are explicitly not examinable, and D is wrong because the tutorials are examinable too.
Check yourselfYour answer to a practice-exam question takes a different route from the worked answer on this page. What should you conclude?
Nothing yet. The practice exam has no official solutions, the worked answers here are the study guide's, and staff pointed out that many questions have more than one correct approach. Check your points against the Part that teaches the topic, and if you are still unsure, post the question with your draft on Ed for staff to review.
- Tue 10 Nov, 8:30 AM: 15 min reading, then 3 h of writing, on paper, closed book, no calculator; 60 marks, 60% of the subject, with a hurdle of 30/60.
- Ten 5-mark questions (Q1 is ten 0.5-mark MCQs) plus one 10-mark coding question. Budget 3 minutes per mark.
- Lectures and tutorials are both examinable; guest lectures and advanced topics are not. The practice exam has no official answers.
What the Questions Look Like exam
Knowing the material is only half of scoring well; the other half is giving each question the shape of answer its marker is looking for. A "compare" question wants matched differences, a "design" question wants a diagram and a message flow, and a definition wants one precise sentence and an example. This section names the six question types of the 2016 paper, the four extra types the 2026 practice exam adds, and the technique that scores on all of them.
The six types of the 2016 paper
Every question on the 2016 paper falls into one of six types, and each type has a typical answer shape worth learning. The table summarises them; the figure then draws each answer shape as a chain of moves, and the notes after it give the 2016 wording.
| Type | 2016 example | What earns the marks |
|---|---|---|
| Apply a list to a scenario | Q1(a): five DS challenges, applied to a university computer lab | Per item: name it → define it in one clause → apply it to the scenario |
| Classify + justify | Q1(b): the model for a browser-based cloud spreadsheet, reasons, an unsuitable application | A precise model; the exact number of reasons; a counter-example that says why |
| Define / explain a concept | Q3(b) timing failure; Q7(b) challenge-response | A crisp textbook definition + a concrete example in a distributed system |
| Compare | Q4(a) UDP vs TCP; Q4(b) XML vs JSON; Q6(a) worker pool vs thread-per-connection | A mini-table or paired bullets; name the dimension of each difference |
| Design with a paradigm | Q5(a) music-popularity app; Q5(b) DSM middleware; Q8(c) name space | Choice → diagram → message flow → justification → one trade-off |
| Your project | Q2: what breaks, the fix, the failure model assumed | Precise reasoning about your own design |
Applying a list to a scenario
2016 Q1(a) read "List and briefly explain, with respect to this example [a university computer lab], five challenges of DS". Write one line per item: name the item, define it in one clause, and apply it to the scenario. The words "with respect to this example" are where most marks are lost, because a textbook definition with no lab in it answers a different question.
Classifying and justifying
Q1(b) asked which architectural model best describes a browser-based cloud spreadsheet, to give three reasons that support it, and to give an application for which it is not suitable. Name the model precisely, then give the exact number of reasons asked, each as a separate bullet. The counter-example must explain why the model fails for it, not just name an application.
Defining or explaining a concept
Examples are Q3(b), "What is meant by a timing failure?", and Q7(b), "What is challenge-response? Give an example". Give a crisp definition in textbook wording, then a concrete example in a distributed system.
Comparing
Q4(a) asked for three differences between UDP and TCP, Q4(b) for the benefit of XML over JSON and vice versa, and Q6(a) for worker pool versus thread-per-connection, "including concurrency control and queueing". Use a mini-table or paired bullets ("TCP …; UDP …"), and make each difference name the dimension it is about: reliability, ordering, connection, and so on.
Designing with a paradigm
Q5(a) asked you to choose a tuple space, a message queue or publish-subscribe for a "music popularity" app, explain the choice and draw a diagram; Q5(b) to design a distributed shared memory (DSM) middleware, with its protocol, messages and OS support; and Q8(c) to design a name space and name format for the fastest object access. State your choice and draw the diagram, with boxes and labelled arrows. Then walk through the message flow step by step, justify the design against the requirement, and mention one trade-off.
Your project
Q2 asked, about the first project, what problem would arise if the design changed in a given way, how you would fix it, and what failure model you had assumed. This needs precise reasoning about your own assignment design; 11.4 answers the 2016 version and 11.5 prepares the 2026 assignments.
Four types new in the 2026 practice exam
The 2026 practice exam keeps several of the six types: Q2 applies the transparencies to a scenario, Q3 compares TCP and UDP, Q5, Q7 and Q10 ask you to explain a concept, and Q6 asks for a labelled diagram with an explanation. It has no project question, but it adds four types the 2016 paper did not have.
Multiple choice
Each item is a short scenario with four options, and it tests whether you can apply a definition exactly: fault versus failure, what UDP'ssend and receive do, which thread architecture creates how many threads, write-through versus commit. The wrong options are near-misses, so read all four before choosing.Short definitions
Give one or two precise sentences per term, in the course's vocabulary, and stop there.Trace a mechanism with given values
Work step by step through the numbers or messages in the question (DNS caching in Q8, a ticket exchange in Q9), saying at each step which rule applies, and then name the consequence: a stale answer, a replay attack.Write code
A complete Java RMI client and server. The question prints its marking rubric (registry binding, the interface, its implementation, lookup and invocation, two kinds of exception), so make each of those parts easy to find.The answer technique that consistently scores
Whatever the type, the same seven habits earn marks. They are worth rehearsing until they are automatic, because under time pressure you fall back on habit.
- Answer exactly the number asked. If the question asks for "three differences", give three, clearly separated. Extra items are not marked, and they cost time.
- Bold or underline the key term at the start of each bullet, so that the marker finds it.
- Always tie back to the scenario when one is given. Generic textbook text earns roughly half marks.
- Draw when asked, and when it helps: architecture boxes, message sequence arrows, the Kerberos or Needham–Schroeder exchange. Label every arrow with the message content.
- Justify choices with trade-offs, along the lines of "X because R1, R2; the cost is C, acceptable here because …".
- Use the course's vocabulary, such as "at-most-once semantics", "space and time uncoupling", "freshness interval", "authenticator" and "omission failure", because markers scan for it.
- Write concisely and legibly. The Week 12 lecture asks for clear, concise, to-the-point answers, accepts bullet points, and warns that unreadable parts are marked as incorrect. Keep each answer inside its box, and if you must continue in an overflow box, say so in the original box.
Weak and strong answers, side by side
The habits are easiest to see in action. Below, the same two questions are answered twice. The weak answers are illustrations written for this page, of the kind that loses marks; the strong ones are the study guide's worked answers, shortened. Look at what changes: the scenario appears in every line, and every difference names its dimension.
A university digital library lets students search and access e-books stored on several campus and partner-university servers through one web interface; if a server fails, downloads continue from a backup replica. Explain how distribution transparency is demonstrated and which types are involved.
Transparency is hiding things from the user.
- Access transparency: local and remote resources are accessed with the same operations.
- Location transparency: resources are accessed without knowing their location.
- Replication transparency: replicas are hidden.
- Failure transparency: faults are hidden.
about half marks Correct definitions, but the library never appears, and the opening definition is too vague to earn its mark.
Distribution transparency conceals the separation of components so the system is perceived as a whole: many servers, one library.
- Access: students search and download every book with the same operations, through the same interface, whether it is on their campus or a partner's.
- Location: they find a book by title, never by server or address.
- Replication: each book is on several servers, but students see one copy.
- Failure: when a server fails, the download continues from a replica, so the fault is concealed.
Give three differences between UDP and TCP.
- TCP is reliable and UDP is not.
- TCP is slower.
- TCP is used for the web and UDP for games.
- UDP is simpler.
loses marks Four items for three asked; "slower" and "simpler" are vague; the third line is a use, not a difference in how they work.
- Connection: TCP is connection-oriented, set up before data flows; UDP is connectionless, each datagram addressed independently.
- Reliability: TCP uses acknowledgements, timeouts and retransmission; UDP gives no guarantee, and datagrams may be lost.
- Ordering and duplicates: TCP delivers in the order sent and discards duplicates; UDP does neither.
Check yourselfWhich type is "Choose a tuple space, a message queue or publish-subscribe for this app, explain, and draw a diagram"? What five moves should the answer make?
It is design with a paradigm. The answer should state the choice, draw the diagram (boxes and labelled arrows), walk through the message flow step by step, justify the design against the requirement, and mention one trade-off.
Check yourselfA question asks for "two benefits of a broker network". You know four. What do you write?
Exactly two, clearly separated, each opening with a bold key term (for example Scalability and Fault tolerance), and each tied to the question's scenario if it has one. Extra items are not marked and they cost time you need elsewhere.
- Six classic types: apply a list, classify and justify, define, compare, design, your project. The 2026 practice exam adds MCQs, short definitions, tracing a mechanism with given values, and writing code.
- Answer exactly the number asked, bold the key terms, tie every line to the scenario, draw and label, justify with a trade-off, use the course's words, write legibly.
Topic Coverage of the 2016 Paper
If you have limited time, it helps to know how the marks have been spread over the topics in the past. This section maps each 2016 question onto the Part of this site that covers it, and then sets the 2016 spread beside the 2026 practice exam's, so you can see what has changed.
| Topic | 2016 questions | Marks |
|---|---|---|
| Part I Characterization (challenges) | Q1(a) | 5 |
| Part II System models (architecture; channel performance; timing failures; failure model) | Q1(b), Q2(b), Q3(a), Q3(b) | ~12 |
| Part III IPC (UDP vs TCP; XML vs JSON; broadcast over a server overlay) | Q2(a), Q4(a), Q4(b) | ~8 |
| Part IV Threads (worker pool vs thread-per-connection) | Q6(a) | 4 |
| Part V OS support (virtualization vs emulation; OS support for DSM) | Q6(b), part of Q5(b) | ~3 |
| Part VI Remote invocation (invocation semantics, request-reply, Java RMI) | Q4(c) | 5 |
| Part VII Indirect communication (pub-sub / message queue / tuple space design; DSM) | Q5(a), Q5(b) | ~8 |
| Part VIII DFS (NFS client caching) | Q8(a) | 5 |
| Part IX Name services (DNS load balancing; name-space design, pure names) | Q8(b), Q8(c) | 5 |
| Part X Security (trust-on-first-use / man-in-the-middle; challenge-response) | Q7(a), Q7(b) | 5 |
Every lecture topic was examined in 2016, weighted roughly by lecture time. No 2016 question asked you to write code, though questions that ask you to read code or to "outline the steps" on sockets, threads or RMI were always plausible given lectures L2, L3 and L6. The 2026 format differs on exactly this point: the Week 12 lecture announced one 10-mark coding question, and in the practice exam it is a complete Java RMI program.
Two things stand out about the 2026 practice paper as a whole. Every lecture from L1 to L10 is represented, so no lecture is safe to skip. And it rewards precise definitions and mechanisms more than open-ended design: the multiple-choice items each turn on a single distinction, and the only question that asks you to build something is the RMI program.
Check yourselfWhich Part carried the most marks in 2016, and which carries the most in the 2026 practice exam? Why the change?
In 2016, system models (Part II) carried about 12 marks, across the architecture question, the project's failure model, channel performance and timing failures. In the 2026 practice exam, remote invocation (Part VI) carries 15: the 5-mark definitions in Q4 plus the 10-mark RMI program in Q11. The new coding question is what moved the weight.
Both papers examine every topic. The 2016 paper leaned on system models and design questions and had no code; the 2026 practice exam leans on precise mechanisms and definitions, and its 10-mark RMI program makes remote invocation the heaviest single topic.
The 2016 Paper, Question by Question
The 2016 final is the only full past paper, so it is the best extra practice after the 2026 practice exam, especially for scenario and design questions. Do the 2026 paper first (11.9), because it is closer to the real one. Model answers for every 2016 question except Q2 are in the self-tests of the Parts that teach them, where they are tagged as 2016 past-exam questions. Q2, the project question, is answered in full below. Use the table as an index: find a question, see what it asks and what it is worth, and go to its model answer.
| Q | Marks | Asks | Model answer |
|---|---|---|---|
| 1(a) | 5 | Five DS challenges applied to a campus computer lab | Part I self-test |
| 1(b) | 5 | Architectural model of a browser-based cloud app; 3 supporting reasons; an unsuitable application | Part II self-test |
| 2(a)+(b) | 5 (shared) | Project: servers connecting to multiple existing servers: what breaks, how to fix it; the failure model assumed | below (and Part II self-test) |
| 3(a) | 3 | Three fundamental aspects of a communication channel | Part II self-test |
| 3(b) | 2 | Timing failure: definition + example | Part II self-test |
| 4(a) | 3 | Three differences between UDP and TCP | Part III self-test |
| 4(b) | 2 | XML vs JSON benefits | Part III self-test |
| 4(c) | 5 | Maybe / at-most-once / at-least-once; semantics of request-reply and Java RMI | Part VI self-test |
| 5(a) | 5 | Music-popularity app with tuple space / message queue / pub-sub + diagram | Part VII self-test |
| 5(b) | 5 | DSM middleware: protocol, messages, OS support | Part VII self-test |
| 6(a) | 4 | Worker pool vs thread-per-connection: concurrency control and queueing | Part IV self-test |
| 6(b) | 1 | Virtualization vs emulation | Part V self-test |
| 7(a) | 2 | Trusting a server's public key on first connection (SSH): the risk | Part X self-test |
| 7(b) | 3 | Challenge-response + example | Part X self-test |
| 8(a) | 5 | NFS client caching: parameters, checks, order, why | Part VIII self-test |
| 8(b) | 2 | DNS-based load distribution | Part IX self-test |
| 8(c) | 3 | Name space and name format for fastest access; pure or not? | Part IX self-test |
Q2: the project question (2016 version) 2016 Q2
The 2016 project was a network of servers that broadcast messages to each other. A broadcast here means a message that every server in the network must receive. Each new server joined by connecting to exactly one existing server, so the servers always formed a tree: a connected network with no loops. The broadcast rule was simple: forward every message to all your neighbours except the one you received it from. On a tree that rule reaches every server exactly once, because there is only one path between any two servers.
(a) In your first project, what problem would arise if a new server could connect to several existing servers? How would you fix it? (b) Explain the failure model you assumed.
The stepper shows what goes wrong. Server E joins by connecting to two servers, C and D, and the unchanged forwarding rule does the rest.
- The servers start as a tree: A–B, B–C, B–D. Every server applies the same rule: forward each message to all neighbours except the sender.
- New server E connects to two servers, C and D. The network now contains a cycle, B–C–E–D–B, so there are two paths between some pairs of servers.
- A broadcasts a message m to its only neighbour, B.
- B forwards m to C and D, everyone except A. So far this is exactly what happens on a tree.
- C forwards m to E, and D also forwards m to E. E receives m twice: the second copy (red) is a duplicate delivery.
- E treats each copy as new: the copy from C goes on to D, the copy from D goes on to C. Now C and D each have a second copy.
- C and D forward their second copies to B, which forwards them to A and back round the cycle. Nothing ever stops this: an unbounded broadcast storm that floods links and servers.
(a) What breaks, and how to fix it
- The server graph can now contain cycles. With the forwarding rule unchanged, a broadcast travels round each cycle and comes back to servers that have already handled it, which forward it again, indefinitely. The result is duplicate delivery and an unbounded broadcast storm.
- Fix 1 is duplicate suppression. Give every message a globally unique ID, such as the originating server's ID plus a per-server sequence number. Each server keeps a set of the IDs it has already seen, with expiry, and forwards and delivers a message only the first time it sees its ID, dropping any later copies. This is the standard fix for flooding, and it works on any topology.
- Fix 2 is a spanning tree. A spanning tree is a subset of the links that still connects every server but contains no cycle. Keep the extra links for redundancy, but broadcast only over a spanning tree computed by the servers. This needs a distributed spanning-tree protocol, and the tree has to be recomputed when servers fail.
- A hop count or TTL (time-to-live: a counter in the message, decremented at each hop, with the message dropped at zero) is not sufficient on its own. It bounds the storm, but it still delivers duplicates.
(b) The failure model assumed
A failure model states which ways each component may fail, and which it is assumed never to fail in. State it per component and per interaction, in the vocabulary of Part II:
- The channels are TCP connections, assumed reliable. TCP (the Transmission Control Protocol) masks omission, duplication and reordering of segments, so while a connection is up the application sees no channel omission failures. In other words, the channels have validity (every message sent is eventually delivered) and integrity (what is delivered is what was sent, once).
- The server processes are assumed not to crash, and to show no arbitrary (Byzantine) behaviour, meaning no failure in which a process does something other than what its program says: all the servers are correct and trusted. Clients may disconnect, and that is handled as a normal event.
- The network has no partitions, so the server tree stays connected.
- The timing model is asynchronous: no bounds on message delay were assumed, and none were needed.
A correct answer shows that you know a failure model is a set of assumptions, and that each assumption removes failure-handling work from the design. Prepare the same kind of answer for your own assignments (11.5).
Check yourselfA classmate proposes fixing the storm by giving each broadcast a hop limit of 10. Is that enough?
No. A hop limit (TTL) stops each copy after 10 hops, so it bounds the storm, but copies still go round the cycle within those 10 hops and servers still receive and deliver duplicates. Only duplicate suppression with unique message IDs, or broadcasting over a spanning tree, removes the duplicates.
Check yourselfWhy does the original rule ("forward to all neighbours except the sender") work on a tree but not on a graph with cycles?
On a tree there is exactly one path between any two servers, so each server is reached once and the rule never sends a message back towards where it has been. A cycle adds a second path: copies arrive along both, and since the rule does not remember which messages a server has already handled, each copy is forwarded again, round the cycle, without end.
- Letting a server join several others creates cycles, and the tree-only forwarding rule then delivers duplicates and causes a broadcast storm.
- Fix it with unique message IDs and a seen-set (works on any topology), or by broadcasting over a spanning tree; a TTL alone only bounds the storm.
- The failure model: reliable TCP channels, servers that neither crash nor misbehave, no partitions, asynchronous timing.
Assignment-Based Questions for 2026
The 2016 exam spent 5 marks on the project, so questions on the 2026 assignments are possible. A1 was a multi-threaded subject enrolment server, built with TCP sockets, threads, a read-write lock per subject, and persistence (saving state to disk). A2 was the Turf War multiplayer game. Be aware, though, that the 2026 practice exam has no assignment question: its 10-mark question asks you to write a Java RMI program from scratch instead. The concepts the assignments exercise, namely sockets, threads, locking and failure models, are examined directly either way.
The A1 answers below are the study guide's, built on course concepts, so they apply even if your own implementation differed. Each names the Part that teaches the concept behind it.
A1-1. Which server threading architecture did you use, and why? Part IV
A threading architecture is the rule a server uses to decide which thread handles which piece of work. Three are candidates for A1 (see Part IV).
With thread-per-connection, a dedicated thread reads requests from one client's socket and handles them sequentially. This is natural for long-lived interactive command-line sessions, and it preserves the order of requests on each connection. The downsides are that every idle client still takes up a thread, and that there is no bound on the number of threads.
With a worker pool, the acceptor or reader threads put requests on a shared, synchronised queue, and a fixed number of workers take them off. This bounds resource use and avoids the cost of creating threads. But it needs a thread-safe queue, and requests from one client may be processed out of order unless you route them carefully.
Thread-per-request is the simplest to write, but it pays the thread-creation cost on every request and has no bound. It is a poor fit when one connection carries many small requests.
Whichever you choose, the shared subject data still needs concurrency control: the threading architecture and the locking are separate decisions.
A1-2. How do you prevent two clients both taking the last seat? Part IV
This is a check-then-act race: a bug in which a thread checks a condition and then acts on it, but another thread changes the data in between, so the check is stale by the time the action happens. Two threads both read enrolled < capacity before either of them writes, so both enrol and the subject ends up over capacity. The fix is to hold the subject's write lock across the whole check-and-update, so that the check and the update form one atomic critical section (a stretch of code only one thread may run at a time). The second thread then blocks until the first releases the lock; when it re-checks, it sees that the subject is full and returns FULL.
- Subject S has capacity 30 and 29 enrolled: one seat left. Two threads, T1 (blue) and T2 (green), are each handling an ENROL request for S.
- T1 reads n = 29 and checks 29 < 30: there is room, so it decides to enrol.
- Before T1 writes anything, T2 reads n = 29 too, and its check also passes. Both checks are now based on the same, soon-to-be-stale value.
- T1 writes n = 30 and replies OK.
- T2 acts on its stale check, writes n = 31 and also replies OK: 31 students in 30 seats. This is the check-then-act race.
- The fix, from the same starting point. T1 first takes S's write lock.
- T2 asks for the same write lock and blocks, because T1 holds it. T2 has not read anything yet.
- T1 checks and updates inside the lock (29 < 30, write 30), then unlocks. The check and the update were one atomic step.
- T2 now gets the lock and re-checks: 30 < 30 is false, so it replies FULL. The capacity holds.
A1-3. How does TRANSFER avoid deadlock? Part IV
A deadlock is a state in which a set of threads each wait for a lock held by another thread in the set, so none can ever proceed. It could arise in A1 like this. T1 transfers from A to B and locks A, while T2 transfers from B to A and locks B. Each then waits for the other's lock, which gives a circular wait. The fix is to acquire both write locks in a single global order, such as ascending subject code, whatever the direction of the transfer. That breaks the circular-wait condition, so no cycle in the wait-for graph (the graph of which thread waits for which) is possible. Release the locks in finally blocks, so that an exception never leaves a lock held.
- Two transfers run at once in opposite directions: T1 moves a student from A to B, T2 from B to A. Each needs both subjects' write locks.
- T1 locks its source subject first: T1 holds A.
- T2 does the same: T2 holds B.
- T1 now asks for B and waits (red dashed arrow), because T2 holds it.
- T2 asks for A and waits, because T1 holds it. The waits form a cycle: each holds what the other needs, and neither will let go. This is deadlock.
- The fix: every TRANSFER locks the subjects in ascending code order, A before B, whatever the direction. T1 locks A.
- T2 must also start with A, so it waits for A while holding nothing. It cannot block T1.
- T1 takes B as well, does the transfer, and releases both in
finallyblocks. - T2 now gets A, then B, and completes. Because everyone acquires in the same order, a cycle cannot form.
A1-4. Why a read-write lock per subject, rather than one global lock or synchronized on the whole map? Part IV
A read-write lock has two modes: any number of threads may hold it for reading at once, but a thread that holds it for writing holds it alone. The first reason for this design is granularity, meaning how much data one lock protects. Per-subject locks let operations on different subjects run in parallel, whereas a global lock serialises everything. The second is that a read-write lock lets many concurrent QUERYs on the same subject proceed together, while writes stay exclusive. The cost is more locks to manage, and multi-lock operations like TRANSFER need lock ordering (A1-3).
A1-5. State A1's failure model. Part II
As in 2016 Q2(b) (11.4), state the assumptions per component, in the failure-model vocabulary of Part II.
- The channels are TCP, assumed reliable: loss, duplication and reordering are masked while the connection lasts.
- The server may crash, which means it simply stops (a fail-stop or crash failure). Durability is achieved by persisting state after every successful write, so committed writes survive a restart. There are no arbitrary failures.
- Clients may crash or disconnect. The server detects this as EOF (end of file on the socket's input) or an
IOException, closes the socket and frees the thread. Reconnection is not required. - There is one failure the client cannot resolve. If the connection drops after a request is sent but before the reply arrives, the client cannot tell whether the operation was executed. Because there is no retry with duplicate filtering, a failure that the client sees means the operation ran either once or not at all, which is at-most-once semantics at best (Part VI).
A1-6. Why newline-delimited JSON? What is the "message boundary" problem? Part III
TCP is a byte stream and does not preserve message boundaries: the receiver sees one long sequence of bytes, so one read may return half a message, or two messages. The receiver therefore needs framing, a way to find where each message ends: either a delimiter (a newline, read with BufferedReader.readLine()) or a length prefix. JSON (JavaScript Object Notation) is text, language-independent and human-readable, which makes debugging and interoperability easy. The cost is larger messages and more parsing work than a binary format would need.
read can cut anywhere, because TCP delivers bytes, not messages. The gold newline bytes are the delimiter, and readLine cuts only there (green), so each call yields one whole request.A1-7. Why TCP rather than UDP for A1? Part III
Every request must be executed exactly once and its reply received. TCP gives reliable, ordered delivery and a connection lifecycle, so a dead client is detected via EOF. UDP (the User Datagram Protocol, which sends independent datagrams with no guarantees) would force the application to implement timeouts, retransmission, duplicate filtering and fragmentation for large replies. Duplicate filtering would be essential because ENROL is not idempotent: an operation is idempotent if doing it twice has the same effect as doing it once, and enrolling twice does not.
Assignment 2 (Turf War)
Expect exam questions that ask you to explain and justify your own A2 design using course concepts. Likely topics are:
- keeping every client consistent under simultaneous actions (Part II, and ordering in group communication in Part VII);
- choosing between sockets, UDP and RMI, and choosing the protocol (Part III, Part VI);
- detecting crashed or disconnected players (the failure model and failure detection, Part II);
- why the server keeps the clock rather than each client (the interaction model, Part II);
- bringing a late joiner up to date;
- your threading model (multithreaded server architectures, Part IV);
- why client-server rather than peer-to-peer (Part II).
Write a model answer to each of these from your own implementation, in the same style as the A1 answers above.
Check yourselfWhich of the four conditions for deadlock does acquiring locks in ascending subject-code order remove?
- Mutual exclusion
- Hold and wait
- No preemption
- Circular wait
D, circular wait. Threads still hold locks exclusively (A), may hold one while waiting for another (B), and cannot have locks taken from them (C). But if every thread acquires in the same global order, a thread holding a later lock never waits for an earlier one, so no cycle can form in the wait-for graph.
Check yourselfYour A1 server uses synchronized on the whole subject map. Is the last-seat race fixed? What does it cost?
Yes, provided the check and the update are both inside the same synchronised block, because then they are one atomic critical section. The cost is granularity: every operation on every subject is serialised, so QUERYs on the same subject cannot run together and operations on different subjects cannot run in parallel. Per-subject read-write locks keep correctness and recover that parallelism.
Check yourselfIf A1 had used UDP and the client simply resent ENROL after a timeout, what could go wrong?
If the first request was executed but its reply was lost, the resent ENROL would be executed again. ENROL is not idempotent, so repeating it changes the state again (a double enrolment, or a seat taken twice). The server would need request IDs and duplicate filtering to prevent this; TCP avoids the problem for messages within a live connection.
- Threading architecture and locking are separate decisions; each threading choice trades bounds and ordering against simplicity.
- Hold the write lock across check and update (no check-then-act race); take multiple locks in one global order (no circular wait); use per-subject read-write locks for parallelism.
- Failure model: reliable TCP channels, a server that may crash but persists every write, clients that may vanish, and one unresolvable case that makes the semantics at-most-once.
- TCP is a byte stream, so frame messages, here with newlines; and TCP rather than UDP because ENROL is not idempotent.
Must-Know Lists exam
Many exam questions begin "list and explain", and you cannot explain items you cannot first name. These are the enumerations the exam can ask for, grouped by the Part that explains them. Check that you can reproduce every one from memory: cover the middle column, say the items aloud, then look.
| List | Items | Where |
|---|---|---|
| Reasons for building a DS (slides) | Functional separation · inherent distribution · power imbalance / load variation · reliability · economies | Part I |
| Consequences of distribution | Concurrency · no global clock · independent failures (+ heterogeneity on the slides) | Part I |
| The 8 challenges (CDK) | Heterogeneity · openness · security · scalability · failure handling · concurrency · transparency · quality of service | Part I |
| The 8 transparencies | Access · location · concurrency · replication · failure · mobility · performance · scaling (access + location = network transparency) | Part I |
| Scalability challenges | Controlling the cost of physical resources · controlling performance loss · preventing software resources running out · avoiding performance bottlenecks | Part I |
| Failure-handling techniques | Detecting · masking · tolerating · recovery · redundancy | Part I |
| Security components | Confidentiality · integrity · availability | Part I |
| List | Items | Where |
|---|---|---|
| Physical models | Early · Internet-scale · contemporary DS (+ systems of systems) | Part II |
| Architectural model elements | Entities · communication paradigms · roles and responsibilities · placement | Part II |
| Placement strategies | Mapping services to multiple servers · caching · mobile code · mobile agents | Part II |
| Fundamental models | Interaction · failure · security | Part II |
| Communication channel performance | Latency · bandwidth · jitter | Part II |
| Failure classes | Omission (crash / fail-stop, send-omission, receive-omission, channel omission) · arbitrary (Byzantine) · timing (clock, performance) | Part II |
| Reliable communication | Validity · integrity | Part II |
| List | Items | Where |
|---|---|---|
| IPC characteristics | Synchronous vs asynchronous · message destinations · reliability · ordering | Part III |
| TCP stream: hidden network characteristics | Message sizes · lost messages · flow control · duplication and ordering · message destinations | Part III |
| External data representations | CORBA CDR · Java object serialization · XML (and JSON) | Part III |
| Creating a Java thread | Extend Thread · implement Runnable | Part IV |
| Deadlock conditions | Mutual exclusion · hold and wait · no preemption · circular wait | Part IV |
| Server threading architectures | Worker pool · thread-per-request · thread-per-connection · thread-per-object | Part IV |
| Kernel architectures | Monolithic · layered · microkernel · hybrid | Part V |
| List | Items | Where |
|---|---|---|
| Request-reply primitives | doOperation · getRequest · sendReply | Part VI |
| Request/reply message fields | messageType · requestId · remoteReference · operationId · arguments | Part VI |
| Fault-tolerance measures | Retransmit request · duplicate filtering · re-execute vs retransmit reply from history | Part VI |
| Exchange protocols | R · RR · RRA | Part VI |
| Invocation semantics | Maybe · at-least-once · at-most-once (local calls: exactly once) | Part VI |
| RMI implementation components | Communication module · remote reference module · proxy · dispatcher · skeleton · servant · binder | Part VI |
| Parts of a Java RMI program | Remote interface (extends Remote, methods throw RemoteException) · servant (extends UnicastRemoteObject) · server creates and binds it in the registry · client looks it up and invokes it · exceptions handled (RemoteException, NotBoundException, application exceptions) | Part VI, 11.10 Q11 |
| Uncoupling | Space uncoupling · time uncoupling | Part VII |
| Group communication guarantees | Reliability (integrity, validity, agreement) · ordering (FIFO, causal, total) | Part VII |
| Kinds of group | Closed vs open · overlapping vs non-overlapping · process vs object groups | Part VII |
| Pub-sub subscription models | Channel-based · topic-based · content-based · type-based (+ objects of interest, concept-based) | Part VII |
| Message queue receive styles | Blocking receive · non-blocking receive (poll) · notify | Part VII |
| Tuple space operations | write · read · take | Part VII |
| List | Items | Where |
|---|---|---|
| DFS requirements | Transparency (access, location, mobility, performance, scaling) · concurrent updates · replication · heterogeneity · fault tolerance · consistency · security · efficiency | Part VIII |
| File service architecture | Flat file service · directory service · client module | Part VIII |
| NFS client cache validation | Tc · Tm (client vs server) · freshness interval t; an entry is valid if (T − Tc < t) ∨ (Tm client = Tm server) | Part VIII |
| NFS mounts and server write caching | Hard mount (block and retry) vs soft mount (error after a few retries) · write-through vs commit | Part VIII |
| Name service goals | Scale · long lifetime · high availability · fault isolation · tolerance of mistrust | Part IX |
| Navigation methods | Iterative · multicast · non-recursive server-controlled · recursive server-controlled | Part IX |
| DNS query types | Host name resolution · mail host location · reverse resolution · host information · well-known services | Part IX |
| DNS resource records | A · NS · CNAME · SOA · PTR · HINFO · MX · TXT (· AAAA) | Part IX |
| Threat classes | Leakage · tampering · vandalism | Part X |
| Methods of attack | Eavesdropping · masquerading · message tampering · replay · denial of service (+ man-in-the-middle) | Part X |
| Uses of cryptography | Secrecy and integrity · authentication · digital signatures | Part X |
| Obtaining a certificate | Generate key pair · get the CA's certificate · gather identity information · send request · CA verifies identity · CA issues certificate | Part X |
| Kerberos components | KDC = Authentication Service + Ticket-Granting Service · tickets · authenticators · session keys | Part X |
| TLS layers | Handshake layer (handshake, change cipher spec, alert) · record layer | Part X |
Check yourselfName all eight transparencies, and say which two make up network transparency.
Access, location, concurrency, replication, failure, mobility, performance and scaling. Access + location together are network transparency. One way to remember them is in the order above: the first two are about reaching a resource, the next three about sharing and surviving, the last three about change (moving, load, growth).
Check yourselfAn NFS client cached a block with Tc = 100 s, the freshness interval is t = 3 s, and now T = 105 s. What must the client do before using the block?
T − Tc = 5 s, which is not less than t = 3 s, so the first test fails and the client must ask the server for the file's modification time (Tm server). If it equals the cached Tm client, the entry is still valid; otherwise the client discards the cached block and fetches it again.
Check yourselfList the three invocation semantics, plus what local calls give, and the three exchange protocols.
Invocation semantics: maybe, at-least-once, at-most-once; local calls give exactly once. Exchange protocols: R (request only), RR (request, reply) and RRA (request, reply, acknowledge reply). Part VI explains each.
About fifty lists cover the enumerations the exam can ask for. Learn the items by name first, then make sure you can give one line of explanation for each; the Part in the last column has the explanation.
Final-Week Plan
With a week to go, the risk is spending it re-reading, which feels productive but builds little recall. The study guide's plan spreads the last week over seven days, moving from section-by-section recall to full exam practice and then to light review. The exam is on Tuesday 10 November at 8:30 AM; counting back seven days puts Day 1 on Tuesday 3 November and Day 7 on Monday 9 November.
- Days 1–3: one section a day. Read the section, close it, and write the answers to its self-test from memory. Then compare, and repeat the ones you missed.
- Day 4: the 2026 practice exam under exam conditions: 15 minutes of reading with no writing, then 3 hours, closed book, handwritten, in pen. Write the RMI program in Q11 by hand from memory. Mark the paper against the worked answers in 11.9 and 11.10, post any draft you are unsure of on Ed for staff to review, and then do the 2016 paper if you have time.
- Day 5: the must-know lists (11.6). Write each list from memory, and then do the same with the comparison tables.
- Day 6: assignments. Rehearse 11.5 aloud for A1, and work through the same questions for your own A2 design: threading model, locking, failure model, protocol and consistency.
- Day 7: light review only. Go over the mechanism walk-throughs: Kerberos, the TLS handshake, the NFS cache check, iterative versus recursive DNS resolution, an RMI call, and request-reply with duplicate filtering.
The plan placed the Zoom exam consultation (Tuesday 3 November, 3:00–5:00 PM) early in the week, so that questions from an untimed first attempt at the practice exam could be brought to it. It took place on 3 November; posting those questions on Ed with your draft answer is the route that stays open.
Use the reading time to choose the order. Do the questions you can answer fully first, but attempt every part, because partial credit is available.
Recall section by section (Days 1–3, Tue 3 to Thu 5 Nov), sit the practice exam for real (Day 4, Friday), drill the lists (Day 5) and the assignments (Day 6), and keep Day 7 light. In the room, pick your order during reading time and attempt everything.
Tutorial Question Bank official
The weekly tutorial questions are short-answer questions in the same style as the 2016 paper, and staff have confirmed that tutorial content is examinable. Their official answers, written by the tutors and posted on Ed, are given at the end of the Part that teaches each topic. Use the table as a closed-book drill: answer each question aloud or on paper, then check the Part.
| Week (Ed tutorial) | Questions | Answers |
|---|---|---|
| 2 (Tutorial 1) | Define a DS · network vs DS · three reasons for a DS · four consequences | Part I |
| 3 (Tutorial 2) | Three aspects of the socket interface · three UDP failures · how TCP fixes them · steps to set up a TCP connection | Part III |
| 4 (Tutorial 3) | What is a thread · thread life cycle · synchronised access to shared resources · worker pool vs thread-per-request | Part IV |
| 5 (Tutorial 4) | Marshalling and external data representation · XML vs JSON | Part III |
| 6 (Tutorial 5) | Client-server vs P2P · six architecture variations, each with a benefit | Part II |
| 7 (Tutorial 6) | NOS vs DOS · core OS components · kernel and kernel designs · supervisor vs user mode | Part V |
| 7–8 (Tutorials 6–7) | R / RR / RRA · request-reply issues · invocation semantics · RPC components · building a system with Java RMI | Part VI |
| 9 (Tutorial 8) | DFS transparencies · absolute names · mount points · uncached RPC vs caching DFS · Dropbox | Part VIII |
| 10 (Tutorial 9) | URIs, URLs, URNs · why name services · navigation · DNS vs a hosts file · TLS in brief | Part IX, Part X |
| 11 (Tutorial 10) | Threats and methods of attack · worst-case assumptions · encryption and the two kinds of key · authentication server · shared key via Bob's public key · digital signatures · certificates and PKI · obtaining a certificate | Part X |
| 12 (Tutorial 11) | Revision: what is a DS · goals of a DS · TCP vs UDP · thread life cycle · Java RMI overview · classes of cryptographic algorithms · non-recursive and recursive server-controlled navigation (official answers, posted 23 Oct) | 11.11 on this page |
There was no tutorial on indirect communication, so for that topic use the self-test in Part VII.
Check yourselfWhich weeks' tutorials cover remote invocation, and what is the last question in that set?
Weeks 7–8 (Tutorials 6–7). The set ends with building a system with Java RMI, the same question the revision tutorial asks again as T11-5 (11.11), and the one the practice exam turns into a 10-mark program.
Eleven tutorials, all with official answers and all examinable. Drill them closed-book; the revision tutorial's answers are on this page, the rest at the end of each Part.
The 2026 Practice Exam: Q1 Multiple Choice 2026 practice
The official practice final exam for 2026 (COMP90015_26_SM2_SampleExam, posted on 20 October) is laid out exactly like the real paper: a cover page with the venue rules and permitted materials, then 11 questions with an answer box each, and two overflow boxes at the end. It is the best guide you have to the real paper, so this section and the next work through it question by question.
The practice exam came without solutions, and staff have said on Ed that none will be released. Every answer below is a worked answer written for the study guide, built from the Parts that teach each topic and cross-referenced to them, and pitched at about the length that fits the answer box, so it shows how much to write as well as what. Many questions can be answered correctly in more than one way, as staff also pointed out. If your answer takes a different route, post it on Ed with the question for staff to review rather than assuming it is wrong. Do the paper under exam conditions before reading on (11.7).
The table is the index: find a question, see what it asks and what it is worth, and follow the link to the Part that teaches it.
| Q | Marks | Asks | Taught in |
|---|---|---|---|
| 1 | 10 × 0.5 | Multiple choice: fault vs failure, UDP send and receive, accept(), thread architectures, mobile agents, the asynchronous model, open groups, delivery semantics, NFS soft mounts, NFS write-through | I, II, III, IV, VII, VIII |
| 2 | 5 | Distribution transparency in a digital library | Part I |
| 3 | 5 | TCP vs UDP: connection set-up, ordering and loss, flow control | Part III |
| 4 | 5 | Define at-most-once, at-least-once, remote interface, stub, registry | Part VI |
| 5 | 5 | Microkernel architecture and extensibility | Part V |
| 6 | 5 | Draw the file service architecture; the flat file service and the client module | Part VIII |
| 7 | 5 | Space and time uncoupling in publish-subscribe; broker networks | Part VII |
| 8 | 5 | DNS caching with a TTL; the effect of a shorter TTL | Part IX |
| 9 | 5 | Checking identity with a ticket; the attack it allows | Part X |
| 10 | 5 | Digital signatures and certificate chains | Part X |
| 11 | 10 | A Java RMI dictionary service, client and server | Part VI |
As 11.3 showed, every lecture from L1 to L10 is represented, so no lecture is safe to skip, and the paper rewards precise definitions and mechanisms more than open-ended design.
Q1: ten multiple-choice items 10 × 0.5 marks
In the exam you write only the letter of the one correct option for each item. Each item is given here as its scenario; open it to see the correct option, its reason and a picture of the mechanism. The reason is what lets you get a new item right, because the wrong options are near-misses built from the same vocabulary.
Q1 item 1Four replicated web servers sit behind a load balancer. One server's disk crashes, the load balancer stops sending it requests, and users notice no change. Which statement is correct?
(b) The disk crash is a fault, and because the website still meets its specification, the website did not fail. A failure is a deviation from the specification, and hiding a fault like this is what fault tolerance means (Part I).
Q1 item 2A UDP client sends a request to port 6789 on a server machine that is switched off, then calls receive(reply) without setting a timeout. What happens?
(d) send() returns normally and receive() blocks indefinitely. UDP has no connection to refuse and no acknowledgements, so send returns once the datagram has been handed over, and the loss is never reported. receive blocks until a datagram arrives, which here is never, because no timeout was set with setSoTimeout() (Part III).
receive would end the wait.Q1 item 3A server listens with new ServerSocket(5000), and a client whose operating system assigned it port 51234 connects. Which statement about the socket that accept() returns is correct?
(a) The socket that accept() returns is bound to server port 5000, and the server can keep accepting other clients on the original ServerSocket. TCP tells connections apart by the 4-tuple of both addresses and both ports, so many sockets can share local port 5000; 51234 is the client's port. Option (b) is the "different port" claim from Buyya's chapter, which Part III warns against.
Q1 item 4A client sends 100 requests over one TCP connection. How many threads does the server create under thread-per-connection, and how many under thread-per-request?
(c) 1 and 100. Thread-per-connection creates one thread when the client connects and serves every request on that connection with it, whereas thread-per-request creates a new thread for each request (Part IV).
Q1 item 5A price-comparison program runs at one retailer's server, then moves, with its code and the results so far, to the next retailer's server. What is it?
(b) A mobile agent: a running program, code and data, that travels between computers doing a task on someone's behalf. An applet is mobile code, which is downloaded once and runs only at the client. Price comparison across vendors is one of the standard uses of agents (Part II).
Q1 item 6No reply has arrived after 2 seconds, and the Internet is modelled as an asynchronous system. What can the client conclude?
(a) Nothing certain. An asynchronous system has no bounds on process speed or message delay, so a timeout means only "not responding yet": the server may have crashed, or the request, the reply or the server may simply be slow (Part II).
Q1 item 7Sensors that never join the group must get every alert to all three logging servers. What kind of group do the logging servers need to form?
(d) An open group, which accepts messages from processes outside it. A closed group accepts multicasts only from its own members (Part VII).
Q1 item 8An acknowledgement is lost, so the broker resends the notification and the order is processed twice. Which delivery guarantee is the broker providing?
(c) At-least-once delivery: resending until an acknowledgement arrives guarantees delivery but allows duplicates (Part VII, and Part VI for the same trade-off in remote procedure calls).
Q1 item 9Applications should receive an error after a few retries when the NFS server is unreachable, rather than wait. How should the file system be mounted?
(a) Soft-mounted. With a hard mount, the process blocks while the client retries until the server is reachable again (Part VIII).
Q1 item 10Once the NFS server has replied to a write, the data must survive a server crash, even if the client never sends a commit request. Which server write policy is needed?
(d) Write-through, which writes the data to disk before replying. Under the commit policy the data is safe only after a commit request, and a delayed write gives no guarantee at all (Part VIII).
Every item turns on one distinction: fault vs failure, returning vs blocking, local vs remote port, per-connection vs per-request, agent vs applet, slow vs crashed, open vs closed, at-least-once vs at-most-once, soft vs hard, write-through vs commit. When you revise a Part, list its pairs like these and make sure you can state the difference in one line.
The practice exam is the best model of the real paper, but its answers here are the guide's, not official. Q1's ten items each test one exact distinction; the wrong options are near-misses, so read all four before choosing.
The 2026 Practice Exam: Q2–Q11 2026 practice
The written questions follow. Each starts with the question as set, then gives the study guide's worked answer (again: not official, and not the only good answer), with a picture of the mechanism the question is about and a link to the Part that teaches it. Try each one on paper first; then compare not only the content but the length, which is pitched to fit the answer box.
Q2: Distribution transparency 5 marks Part I
A university digital library lets students search and access e-books stored on several campus and partner-university servers through a single web interface. If one server fails, downloads continue automatically from a backup replica. Explain how distribution transparency is demonstrated, identify the types of transparency involved, and describe briefly how each contributes to a seamless and reliable experience.
Distribution transparency means concealing the separation of the system's components from users and application programmers, so that the system is perceived as a single whole rather than as a collection of independent computers. Here the books are spread over many servers belonging to different institutions, yet a student sees one library behind one website. Four of the eight transparencies produce that effect:
- Access transparency. Students search and download every book with the same operations, through the same web interface, whether the book is held on their own campus or at a partner university.
- Location transparency. Students find a book by its title or by searching, never by the server or address that holds it, so they need not know where it is stored. The library could also move a book to another server without students noticing, which is mobility transparency.
- Replication transparency. Each book is held on several servers, for availability and performance, but students see a single copy and never choose between replicas.
- Failure transparency. When a server fails, the download carries on from a backup replica automatically, so the fault is concealed and the task still completes. Replication is what makes this possible.
Access and location transparency together make up network transparency. If space allows, add concurrency transparency, since many students can download the same book at once without interfering, and performance and scaling transparency, since the load can be spread over more servers without students noticing.
Q3: TCP and UDP 5 marks Part III
Service A sends data to service B. (a) A knows B's IP address and port: for each protocol, must A first establish a connection? (1 mark) (b) A sends the one-byte values 1, 2 and 3 in separate UDP datagrams, and B's application receives 3 and then 1, while 2 never arrives. (1) Which two UDP properties does this show? (2) If A used TCP and B's application received 3, could 1 and 2 never have been delivered to the application? (2 marks) (c) B reads slowly over TCP. Why is the claim "TCP's retransmissions will make B keep up with A" wrong, and which TCP mechanism handles the difference in rates? (2 marks)
(a) TCP: yes. It is connection-oriented, so A must connect and B must accept before any application data flows. UDP: no. It is connectionless, so A simply sends a datagram addressed to B's IP address and port.
(b)(1) The scenario shows that UDP gives no ordering guarantee, since 3 arrived before 1, and no delivery guarantee, since datagram 2 was lost (an omission failure) and nothing retransmitted it.
(b)(2) No. TCP delivers a reliable, ordered byte stream. It uses sequence numbers to put segments back in order, retransmits any that are lost, and passes bytes to the application only in the order they were sent. So if B's application has received 3, it has already received 1 and 2. All three might come back from a single read, since TCP keeps no message boundaries, but never out of order and never with a gap. If 2 could not be delivered at all, TCP would eventually declare the connection broken, and B would get an error instead of 3.
(c) Retransmission deals with lost segments: TCP resends data that was not acknowledged. It does nothing to make B's application read faster, and pushing more data at a slow reader would only overflow its buffer. The mechanism that handles the difference in rates is flow control. Each acknowledgement from B carries a window, the free space left in B's receive buffer, and A may have only that much unacknowledged data outstanding. When B's buffer is full, the window falls to zero and A's writes block until B has consumed some data.
Q4: Remote invocation definitions 5 × 1 mark Part VI
In the context of remote invocation, define (a) at-most-once invocation semantics, (b) at-least-once invocation semantics, (c) a remote interface, (d) a stub and (e) a registry.
Two pictures carry the five definitions. The first shows how the two invocation semantics differ when a request is retransmitted; the second shows where the remote interface, the stub and the registry sit in a Java RMI system.
(a) At-most-once. The invoker receives either a result, in which case it knows the method was executed exactly once, or an exception, in which case the method was executed either once or not at all. It is implemented by retransmitting requests, filtering duplicates at the server and retransmitting saved replies instead of re-executing, so the method never runs more than once. Java RMI uses it.
(b) At-least-once. The invoker receives either a result, in which case it knows the method was executed one or more times, or an exception. It is implemented by retransmitting the request and re-executing it each time, with no duplicate filtering, so it is safe only for idempotent operations. Sun RPC uses it.
(c) Remote interface. The specification of the methods of an object that can be invoked by objects in other processes, together with their argument and result types. In Java it is an interface that extends java.rmi.Remote, and every one of its methods declares throws RemoteException.
(d) Stub (proxy). A local object in the client that stands in for the remote object and implements the same remote interface, which makes a remote invocation look like a local one. Each of its methods marshals (flattens into bytes for transmission) the target reference, the method and the arguments into a request, sends it, waits for the reply, and then unmarshals the result and returns it.
(e) Registry. Java RMI's binder, the RMIregistry: a name service that maps textual names to remote object references. A server binds (or rebinds) each remote object under a name, and a client looks the name up to obtain a stub for the object. It runs on the server's host, by default on port 1099.
Q5: Microkernels and extensibility 5 marks Part V
Discuss the architecture of a microkernel-based operating system. Comment on how well this architectural model supports the creation of extensible operating systems.
Architecture. A microkernel keeps the kernel as small as possible. It provides only the most basic abstractions, namely address spaces, threads with their scheduling, and local interprocess communication, plus low-level access to the hardware. Every other service runs as a user-level server process: the file server, the network and protocol servers, the display server, the memory and process servers, and even emulations of other operating systems. These servers are loaded dynamically, and each node loads only the ones it needs. A client, which may be an application or another server, obtains a service by sending a request message through the kernel's IPC to the server, and the reply comes back the same way. Above the servers sit subsystems, such as language runtimes and OS emulators (UNIX on Mach, for example), and middleware is built on these or directly on the microkernel. A quick sketch of the figure that the Week 12 lecture repeats (CDK Fig. 7.15) earns marks here: in a monolithic kernel the servers S1–S3 are part of the kernel's code and data, whereas in a microkernel every server, S1–S4, is a dynamically loaded program running above a small kernel.
Support for extensibility. The model supports extensible operating systems very well, at a cost in performance.
- Services can be added, replaced or upgraded by starting a different server process, without changing, recompiling or rebooting the kernel.
- Several OS interfaces can coexist on one machine, as emulation subsystems above the same microkernel, so existing applications keep running.
- Modularity is enforced by memory protection, so a faulty new server crashes on its own without bringing down the kernel, and the small kernel is more likely to be free of bugs.
- Message-based interfaces suit a distributed system, because a request to a local server extends naturally to an RPC to a remote one.
The cost is performance. Every service request involves IPC, context switches and changes of protection domain, which are more expensive than the procedure calls inside a monolithic kernel. That is why Mach and Chorus later allowed servers to be loaded into kernel space, giving up protection for speed, and why virtualization has since taken over much of the microkernel's role.
Q6: The file service architecture 5 marks Part VIII
Draw a diagram of a model File Service Architecture (FSA). Explain the role of the flat file service and the client module in this architecture.
Diagram. Draw the figure above. On the left is a client computer, with several application programs calling a client module. On the right is a server computer holding the directory service and the flat file service. Draw an arrow from the client module to each service and label it with that service's RPC operations: Lookup, AddName, UnName and GetNames for the directory service, which maps names to UFIDs, and Read, Write, Create, Delete, GetAttributes and SetAttributes for the flat file service, which works on files by UFID. Add an arrow from the directory service to the flat file service, because directories are themselves stored as files.
Flat file service. It performs the operations on the contents and attributes of files, and it identifies files only by unique file identifiers (UFIDs), which are unique among all the files in the distributed system and are allocated by Create. Its interface differs from UNIX in ways that support fault tolerance: there is no open or close, every Read and Write carries an explicit position, and every operation except Create is idempotent. The server can therefore be stateless. It keeps no per-client state, a client can simply repeat a request after a timeout (at-least-once semantics), and a crashed server restarts with nothing to rebuild.
Client module. One runs on each client computer. It integrates and extends the operations of the flat file service and the directory service under a single application programming interface, for example by emulating the UNIX file operations, so that applications see a familiar file system. To do this, it resolves pathnames by calling Lookup on the directory service one component at a time, keeps the open-file descriptors and read-write positions locally, knows the network locations of the flat file server and directory server processes, and caches recently used file blocks to improve performance.
Q7: Uncoupling in publish-subscribe 5 marks Part VII
Explain how publish-subscribe communication achieves space and time uncoupling in distributed systems. What are the benefits of using a broker network in such systems?
In publish-subscribe, publishers send events to an event service (broker) rather than to receivers, and subscribers register subscriptions, which are patterns over topics or event content. The service matches each event against the subscriptions and notifies every subscriber whose subscription matches.
- Space uncoupling. Publishers address events to the service, by topic or content, and never to named receivers, while subscribers express interest in kinds of event rather than in particular publishers. Neither side knows the other's identity or how many of them there are, so publishers and subscribers can be added, removed, replaced or replicated without the others changing.
- Time uncoupling. This needs the intermediary to store events. When the broker retains events and supports durable subscriptions, it keeps each event until every matching subscriber is ready to receive it. A subscriber that is offline when an event is published receives it when it reconnects, by which time the publisher may already have exited, so the two need not be active at the same time. Without that persistence, publish-subscribe is space-uncoupled but time-coupled.
A broker network replaces a single central broker with many cooperating brokers, and that has three main benefits:
- Scalability. The work of storing subscriptions and of matching and routing events is shared among many brokers, so the service can grow to Internet scale, and publishers and subscribers can connect to a nearby broker.
- Fault tolerance. There is no single point of failure or bottleneck, so the service survives the failure of one broker, which a central broker cannot.
- Efficient routing. Brokers propagate subscriptions towards the publishers and forward each event only along paths that lead to matching subscribers (filtering, advertisements or rendezvous routing), which saves a great deal of traffic compared with flooding every event to every node.
The price is that subscription and routing state has to be distributed among the brokers and kept up to date.
Q8: DNS caching and TTLs 5 marks Part IX
At t = 0 a local DNS server caches 192.0.2.10 for files.example.com with a TTL of 300 seconds. At t = 120 the authoritative server changes the address to 192.0.2.20. Clients do not cache, no other queries occur, and expired entries are not used. (a) Clients query the local server at t = 180 and t = 360. Which address is returned each time, and does the local server use its cached address or perform a fresh lookup? (3 marks) (b) The administrator proposes a shorter TTL for future records. Explain one benefit and one drawback. (2 marks)
A TTL (time to live) on a DNS record says how many seconds a server may keep a cached copy before discarding it. An authoritative server is one that holds the master data for a name; a local server's cached copy is non-authoritative. The stepper traces the question's numbers on one time line.
- Three lanes share one time axis. At first the authoritative server maps files.example.com to 192.0.2.10.
- t = 0: the local DNS server caches 192.0.2.10 with a TTL of 300 s, so its copy is valid until t = 300.
- t = 120: the authoritative server changes the address to 192.0.2.20. Nobody tells the local server: from now on its cached copy is stale, but still within its TTL.
- t = 180: a client asks. 180 < 300, so the entry is valid and the local server answers from its cache, without contacting the authoritative server: 192.0.2.10, the stale address, marked non-authoritative.
- t = 300: the TTL runs out and the entry expires. Expired entries are not used.
- t = 360: a client asks again. The cache has nothing valid, so the local server performs a fresh lookup, navigating to the authoritative server, returns 192.0.2.20 and caches it under the new record's TTL.
- Part (b): stale answers are possible only inside the gold window, which can be at most one TTL long. A shorter TTL shrinks that window (the benefit), but every cached entry expires sooner, so local servers must ask the authoritative servers more often (the drawback).
(a) The entry was cached at t = 0 with a TTL of 300 seconds, so it is valid until t = 300.
- At t = 180 the entry is still valid, since 180 < 300. The local server answers from its cache, without contacting the authoritative server, and returns 192.0.2.10. That address is now stale, because it changed at t = 120, but DNS does not detect staleness: a cached record is served until its TTL expires, marked as non-authoritative.
- At t = 360 the entry has expired (at t = 300), and expired entries are not used. The local server therefore performs a fresh lookup, navigating to the authoritative server for the name, and returns 192.0.2.20. It then caches the new address under the new record's TTL.
(b) The benefit of a shorter TTL is that changes reach clients sooner. Cached copies expire quickly, so after an address change, a failover, or a change to DNS-based load sharing, stale data is served for at most the shorter TTL. The drawback is extra lookup traffic. Entries expire sooner, so local servers have to query the authoritative servers more often, which raises the load on those servers and on the network, and more client queries wait for a full resolution instead of getting a cached answer. That is why administrators normally give stable data long TTLs and shorten them only before a planned change.
Q9: A ticket exchange and its weakness 5 marks Part X
Alice and Bob trust an authentication server, Sara. Bob shares a secret key KB with Sara, and Sara securely provides Alice with a session key KAB and a ticket for Bob. Alice sends Bob the ticket {Alice, KAB}KB together with the message {Alice}KAB. (a) Explain how Bob decrypts these two items and checks Alice's claimed identity. (3 marks) (b) Identify an attack that this exchange is vulnerable to, and explain how an attacker could carry it out without knowing either secret key. (2 marks)
Notation: {M}K means message M encrypted with key K. A ticket is an item encrypted by a trusted server in the key of the service it is for, so only that service can open it. A session key is a fresh secret key for one conversation.
- Sara has given Alice, securely, the session key K_AB and a ticket for Bob. Only Bob and Sara know K_B.
- Alice sends Bob two items: the ticket {Alice, K_AB}K_B and the second item {Alice}K_AB.
- Bob decrypts the ticket with K_B. It decrypts to something sensible, a name and a key, so it must have been made by Sara, whom he trusts. He learns K_AB, and that Sara issued it for Alice.
- Bob decrypts the second item with the K_AB he has just obtained, and gets the name "Alice".
- Bob compares the two names. They match, and apart from Sara only Alice knows K_AB, so only she could have produced {Alice}K_AB. Bob accepts the sender as Alice and uses K_AB for the session.
- But Mallory has been eavesdropping: he copies both encrypted items as Alice sends them, along with the request that follows.
- Later, Mallory resends the copies unchanged to Bob.
- Bob decrypts them exactly as before, the names match, and he accepts the sender as Alice. Nothing in either item is fresh, so a copy is indistinguishable from the original: a replay attack.
- The defence is freshness: a timestamp in the authenticator and a lifetime in the ticket, or a nonce challenge from Bob.
(a) Bob checks Alice's claim in three steps.
- He decrypts the ticket with KB, which only he and Sara know. It decrypts to a sensible result, a name and a key, so it must have been made by Sara, whom he trusts. From it he learns the session key KAB, and that Sara issued it for Alice.
- He decrypts the second item with the KAB he has just obtained, and gets the name "Alice".
- He compares the two names. They match, and only someone who knows KAB could have produced {Alice}KAB. Apart from Sara, the only party who knows KAB is Alice, because Sara delivered it to her securely. So Bob concludes that the sender is Alice, and he uses KAB for the rest of the session.
This is the ticket scenario taught in Part X (and the authentication-server question of Tutorial 10). The second item plays the part of a Kerberos authenticator, but without a timestamp.
(b) The exchange is open to a replay attack, because neither item contains anything fresh: there is no nonce (a number used only once), timestamp or sequence number. The attacker, Mallory, eavesdrops on the network and copies both encrypted items as Alice sends them, along with the request that follows. Later he resends the copies unchanged to Bob. Bob decrypts them exactly as before, the names match, and he accepts the sender as Alice. Mallory can therefore masquerade as Alice and make Bob repeat whatever Alice's request did, such as a payment. He needs neither KB nor KAB, because he never decrypts or alters anything. He cannot read Bob's replies, but by then the damage is done. The defence is freshness: a timestamp in the authenticator and a lifetime in the ticket, as Kerberos uses, or a nonce challenge from Bob, {NB}KAB answered by {NB − 1}KAB, as in Needham–Schroeder.
Q10: Digital signatures and certificate chains 5 marks Part X
What is a digital signature? What is the role of the certificate chain in authenticating an individual's identity?
Digital signature. A digital signature binds a signer's identity to a document in a way that is authentic (it shows that the signer deliberately signed this exact document), unforgeable (it cannot be moved to another document) and non-repudiable (the signer cannot credibly deny it). With public keys, it is made and checked in three steps:
- The signer computes a secure digest of the message, h = H(M), with a one-way, collision-resistant hash function such as SHA-2.
- The signer encrypts the digest with their private key, S = {h}Kpriv, and sends M together with S.
- The verifier decrypts S with the signer's public key, computes H(M) itself, and accepts the signature only if the two digests match.
Only the holder of Kpriv could have made an S that decrypts correctly, which gives authentication and non-repudiation, and any change to M changes H(M), which gives integrity. Signing the short digest rather than the whole message keeps the slow public-key operation cheap.
Role of the certificate chain. Verifying a signature only means something if the verifier has the signer's genuine public key; otherwise an impostor could sign with his own key and publish that key under the individual's name. A certificate is a statement, signed by an authority, that binds a name to a public key. In X.509 it holds the subject's name and public key, the issuer's name, a validity period and the issuer's signature. Checking that signature needs the issuer's own public key, which comes in a certificate signed by a higher authority, and so on up: that sequence is the certificate chain. It ends at a root CA (certification authority), whose self-signed certificate was obtained out of band, for example pre-installed with the operating system or browser, and is trusted by fiat. The verifier checks each certificate's signature with the key from the certificate above it, along with its validity dates and revocation status, all the way up to the root. If every link verifies, the verifier can trust that the individual's name really is bound to that public key, and so that a signature verified with it really identifies the individual. This is what defeats a man in the middle who tries to substitute his own key. The weak points of chains are the choice of root, compromised private keys, long fragile chains and revocation.
Q11: A Java RMI dictionary service 10 marks Part VI
Write a simple Java RMI program that demonstrates the invocation of remote object services, implementing a dictionary service with three operations: ADD, which adds a new word and its meaning; SEARCH, which returns the meaning of a word passed as an argument; and DELETE, which deletes the word passed as an argument. Write both the server and the client programs. Marks: binding the RMI object to the registry (1); defining interfaces for the services (2); implementing the RMI interfaces (3); looking up the remote object and invoking remote methods (2); handling two distinct types of errors or exceptions (2).
The answer follows the shape of the standard Hello example in Part VI, and the comment at the top of each file shows which part of the marking scheme it earns. The five files compile and run as written (the study guide checked them with Java 21). In the exam you can shorten the imports and comments, but keep extends Remote, throws RemoteException, the registry calls and the catch blocks, because those are what the marks are for. First, the shape of the program:
1. The remote interface interfaces: 2 marks
// DictionaryService.java -- remote interface, needed by BOTH sides [interfaces: 2 marks]
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface DictionaryService extends Remote {
boolean add(String word, String meaning) throws RemoteException; // ADD: false if present
String search(String word) // SEARCH: the meaning
throws RemoteException, WordNotFoundException;
boolean delete(String word) throws RemoteException; // DELETE: false if absent
}
The interface is the contract both programs share. It extends Remote, which marks it as callable from another JVM, and every method declares RemoteException, because any remote call can fail in transit. SEARCH also declares an application exception, which RMI marshals back to the client and re-throws there.
2. The application exception
// WordNotFoundException.java -- application exception, sent back to the client by RMI
public class WordNotFoundException extends Exception { // Exception is Serializable
public WordNotFoundException(String word) {
super("No such word: " + word);
}
}
Because Exception is Serializable, an instance thrown in the server can be marshalled into the reply and thrown again in the client.
3. The servant implementation: 3 marks
// DictionaryServant.java -- implements the remote interface [implementation: 3 marks]
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.concurrent.ConcurrentHashMap;
public class DictionaryServant extends UnicastRemoteObject implements DictionaryService {
// RMI may run calls from different clients on different threads: use a thread-safe map
private final ConcurrentHashMap<String, String> words = new ConcurrentHashMap<>();
public DictionaryServant() throws RemoteException {
super(); // exports the object to receive remote calls
}
@Override
public boolean add(String word, String meaning) {
return words.putIfAbsent(word.toLowerCase(), meaning) == null; // atomic check-then-add
}
@Override
public String search(String word) throws WordNotFoundException {
String meaning = words.get(word.toLowerCase());
if (meaning == null) throw new WordNotFoundException(word); // re-thrown at client
return meaning;
}
@Override
public boolean delete(String word) {
return words.remove(word.toLowerCase()) != null;
}
}
extends UnicastRemoteObject: the superclass constructor, called bysuper(), exports the object, meaning it starts listening so that it can receive remote calls. That is why the constructor itself declaresRemoteException.ConcurrentHashMap: the RMI runtime may run calls from different clients on different threads at the same time, so the words are kept in a thread-safe map.putIfAbsentdoes the check ("is the word already there?") and the insert as one atomic step, which avoids exactly the check-then-act race of A1-2 (11.5). It returnsnullonly if nothing was there, soaddreturnstruefor a new word.searchthrowsWordNotFoundExceptionfor an unknown word;deletereturns whether something was removed. Words are lower-cased so that look-ups ignore case.
4. The server binding: 1 mark
// DictionaryServer.java -- creates the servant and binds it [binding: 1 mark]
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
public class DictionaryServer {
public static void main(String[] args) {
try {
Registry registry = LocateRegistry.createRegistry(1099); // registry in this JVM
DictionaryService dict = new DictionaryServant(); // create and export
registry.rebind("Dictionary", dict); // name -> remote ref
System.out.println("Dictionary server ready");
} catch (RemoteException e) { // e.g. port 1099 in use, export failed
System.err.println("Server failed to start: " + e.getMessage());
}
}
}
The server starts a registry inside its own JVM with createRegistry, so no separate rmiregistry process is needed, and binds the servant under the name "Dictionary". The Naming.rebind("//localhost/Dictionary", dict) form from Part VI is equally acceptable. The program keeps running after main returns, because the exported servant keeps the JVM alive.
5. The client lookup and invocation: 2 marks · exceptions: 2 marks
// DictionaryClient.java [lookup and invocation: 2 marks; errors and exceptions: 2 marks]
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
public class DictionaryClient {
public static void main(String[] args) {
String host = (args.length > 0) ? args[0] : "localhost";
try {
Registry registry = LocateRegistry.getRegistry(host, 1099);
DictionaryService dict =
(DictionaryService) registry.lookup("Dictionary"); // returns a stub
System.out.println(dict.add("socket", "an endpoint of a two-way link")
? "Added" : "Already in the dictionary");
System.out.println("socket: " + dict.search("socket"));
System.out.println(dict.delete("socket") ? "Deleted" : "Not in the dictionary");
System.out.println("socket: " + dict.search("socket")); // throws: word gone
} catch (WordNotFoundException e) { // application error: no such word
System.err.println(e.getMessage());
} catch (NotBoundException e) { // naming error: nothing bound as "Dictionary"
System.err.println("Service not registered: " + e.getMessage());
} catch (RemoteException e) { // communication failure: server or registry down
System.err.println("Remote failure: " + e.getMessage());
}
}
}
The client gets a reference to the registry on the server's host, and lookup returns a stub, cast to the interface type. From then on it calls ADD, SEARCH and DELETE on the stub as if it were a local object. The stepper runs the program from start to finish.
- Five participants: the client program, the stub it will obtain, the registry, the server program and the servant.
- The server starts a registry inside its own JVM on port 1099 (
createRegistry). - It creates the servant; the
UnicastRemoteObjectconstructor exports it, ready for remote calls. - It binds the servant under the name "Dictionary" with
rebind: the registry now maps that name to a remote reference. 1 mark - The client asks the registry on the server's host for "Dictionary" and gets back a stub, which implements
DictionaryService. lookup - The client calls
addon the stub. The stub marshals the call into a request, the servant runs it, andtruecomes back: "Added". invocation search("socket")returns the meaning just added. (For brevity the stub is no longer drawn separately; every call still passes through it.)delete("socket")removes the word and returnstrue: "Deleted".- The final
searchfinds nothing. The servant throwsWordNotFoundException, RMI marshals it back, and it is re-thrown in the client, whose first catch block prints the message. exceptions
A few points explain the design, and each is worth a sentence in your answer if you have room:
- The interface is the contract that both programs share. Every method declares
RemoteException, because any remote call can fail in transit. SEARCH also declares an application exception, which RMI marshals back to the client and re-throws there. - The servant extends
UnicastRemoteObject, whose constructor exports the object so that it can receive remote calls. The RMI runtime may run calls from different clients on different threads at the same time, so the words are kept in aConcurrentHashMap, and ADD usesputIfAbsentso that the check and the insert happen as one atomic step. - The server starts a registry inside its own JVM with
createRegistry, so no separatermiregistryprocess is needed, and binds the servant under the name "Dictionary". TheNaming.rebind("//localhost/Dictionary", dict)form is equally acceptable. - The client gets a stub from
lookupand then calls ADD, SEARCH and DELETE on it as if it were a local object. - The kinds of error are kept apart. A
RemoteExceptionis a distribution failure: the registry or the server is down, or the connection was lost. In that case the client cannot tell whether the operation was carried out, which is at-most-once semantics. ANotBoundExceptionis a naming failure: no object is registered under that name.WordNotFoundExceptionis a third, application-level error. An exception for adding a word that already exists, or for empty input, would be equally good choices.
Check yourselfWhy must catch (WordNotFoundException e) come before catch (RemoteException e) in this client? Would the order matter for NotBoundException?
In this program none of the three is a subclass of another (WordNotFoundException extends Exception directly, and NotBoundException is not a RemoteException), so the order does not actually matter here: Java only rejects a catch block that comes after a catch of its own superclass. Order matters when one exception extends another, in which case the more specific one must come first. What matters for the marks is that the catch blocks handle distinct kinds of error.
Check yourselfA classmate's servant uses a plain HashMap and writes if (!words.containsKey(w)) words.put(w, m); for ADD. What two problems might a marker point out?
First, HashMap is not thread-safe, and the RMI runtime may run calls from different clients on different threads at once. Second, the check-then-act sequence is not atomic: two clients adding the same word could both pass the check and the second put would overwrite the first. ConcurrentHashMap.putIfAbsent fixes both (or a synchronized method around a HashMap).
- Q2–Q10 each test one mechanism or definition precisely: transparencies in a scenario, TCP vs UDP guarantees and flow control, invocation semantics and RMI parts, microkernels, the FSA diagram, uncoupling and broker networks, DNS TTLs, a replayable ticket, signatures and certificate chains.
- Q11 is five short files: an interface extending
Remote, a servant extendingUnicastRemoteObject, a server that binds it, a client that looks it up and calls it, and catch blocks for distinct kinds of error. - All of these answers are the guide's worked answers, not official ones.
Revision Tutorial: Official Answers official
Tutorial 11, in Week 12, was a recap of the whole subject, and its seven questions are a compact checklist of what staff consider central. The tutors' official solutions were posted on Ed on 23 October, and staff have confirmed that tutorial content is examinable, so these are answers to learn, not just practice. (The question slides open with a "Recap of Distributed Systems" item where question 1 would be and number the rest from 2 to 7, which is why earlier versions of the study guide said there was no question 1; the official solutions settle that the set runs from 1 to 7.)
Each answer below opens with the official answer, the points the tutors' solution slides make, and then gives the study guide's fuller explanation wherever it helps, saying where that goes beyond what the tutors expected. Where the guide's earlier answer disagreed with the official one, the answer says so. Each is about the size of a 5-mark exam answer.
T11-1. What is a distributed system? Part I
The tutors give the two standard definitions, from the two textbooks. Coulouris (CDK): a distributed system is one in which hardware or software components located at networked computers communicate and coordinate their actions only by message passing. Tanenbaum: a collection of independent computers that appear to the users of the system as a single computer.
Give both, because they stress different things. CDK's definition is about the mechanism, and its word "only" rules out shared memory, while Tanenbaum's is about the user's view, the single-system image that transparency provides (Part I). This is the same question as Tutorial 1's first question. The tutors' answer stops at the two definitions, so if a question carries more marks, the natural extension goes beyond it: the three consequences that follow from CDK's definition, which are concurrency, no global clock and independent failures.
T11-2. What are the goals of distributed systems? Part I
Five goals: connecting users and resources, transparency, openness, scalability and enhanced availability.
The L1 slide on goals has a sixth, concurrency, and the study guide's earlier answer gave all six. Concurrency is not wrong, since it is on the lecture slide, but the tutors left it out, so if a question asks for the goals, lead with their five and add concurrency only as an extra. The official answer is just the list; the one-line explanations below go beyond it, and they are what turn a list into an answer worth the marks:
- Connecting users and resources, so that users can access and share remote resources such as printers, files, data and services. Resource sharing is the main motivation for building a distributed system.
- Transparency: hiding the distribution of the resources, so that the system is perceived as a whole rather than as a collection of independent components (the eight forms in 11.6).
- Openness: publishing the key interfaces, so that the system can be extended and re-implemented, and components from different vendors can work together.
- Scalability: remaining effective when the number of users and resources grows significantly.
- Enhanced availability: keeping the service usable when some components fail, through redundancy and replication.
- Concurrency, which is on the L1 slide but not in the tutors' list: letting many users and processes use shared resources at the same time, safely.
T11-3. What are the differences between TCP and UDP? Part III
TCP (Transmission Control Protocol) is a connection-oriented protocol that provides a reliable flow of data between two computers; HTTP, FTP and Telnet run over it. UDP (User Datagram Protocol) is a connectionless protocol that sends independent packets of data, called datagrams, from one computer to another with no guarantees about arrival or the order of arrival. The tutors liken UDP to sending a friend a message split across several letters, each travelling on its own, and give a clock server and ping as UDP applications.
Strictly, the ping utility uses ICMP rather than UDP; the example comes from the classic Java networking tutorial. A clock server or DNS is the safer example to give in the exam.
The official answer covers only connection, reliability and ordering. The matched pairs below go further, and they are what a "give three differences" question needs, as in 2016 Q4(a) and the practice exam's Q3. So open with the official definitions and then give the differences as matched pairs, each naming its dimension (Part III has the full table).
| Dimension | TCP | UDP |
|---|---|---|
| Connection | Connection-oriented: set up before data flows, closed afterwards | Connectionless: every datagram addressed independently |
| Abstraction | A two-way byte stream with no message boundaries | Discrete datagrams whose boundaries are preserved |
| Reliability | Acknowledgements, timeouts and retransmission: data arrives unless the connection breaks | No guarantee; datagrams may be lost |
| Ordering and duplicates | Delivered in the order sent; duplicates discarded | Neither |
| Flow control | Sliding window blocks a writer that is too fast for its reader | None: a fast sender overruns the receiver |
| Overhead | State at both ends, extra messages, set-up latency | Small header, no set-up: cheap |
| Typical uses | File transfer (FTP), the web (HTTP), remote login (Telnet), email | A clock server, DNS, voice and video, games, multicast |
T11-4. What is the life cycle of a thread? Part IV
The tutors answer with the lecture's state diagram, which has seven states: new, ready, running, sleeping, waiting, blocked and dead. Calling start() moves a new thread to ready, and the scheduler then dispatches a ready thread to running. From running, a thread goes to sleeping when it calls sleep(), to waiting when it calls wait(), and to blocked when it blocks on I/O or is suspended with suspend(). Each of those three states leads back to ready, never straight to running: a sleeping thread returns when its time expires or it is interrupted, a waiting thread when another thread calls notify(), and a blocked thread when its I/O completes or it is resumed with resume(). A running thread becomes dead when run() completes or when stop() is called.
This is the diagram to draw in the exam. The guide's version also has the dashed arrow from running back to ready, for yield() or an expired time slice, which the tutors' slide leaves out; drawing it is correct and costs nothing. And although stop(), suspend() and resume() are deprecated in modern Java, they are on the slide, so label the arrows as the slide does.
The guide's earlier answer used the five-state model from Tutorial 3, which describes the same life cycle with less detail. Its Runnable state is the slide's ready state, and its single Non-Runnable state merges sleeping, waiting and blocked. It is still a correct answer, and quicker to draw under time pressure, but since the tutors chose the seven-state diagram for the revision tutorial, learn that one first. In five-state terms a thread passes through:
- New: the
Threadobject has been created, butstart()has not yet been called. - Runnable: after
start(), the thread is ready and waiting for the scheduler to give it a processor. - Running: the scheduler has dispatched it, and it is executing
run(). - Non-Runnable (Blocked): it is sleeping, waiting for I/O, waiting for a lock, or waiting to be notified. When the cause ends (the sleep finishes, the I/O completes, the lock becomes free or another thread calls
notify) it goes back to Runnable, not straight to Running. - Terminated:
run()has finished, and the thread cannot be started again.
T11-5. Java RMI overview Part VI
Explain how one goes about using Java RMI to build a distributed system, what needs to be compiled, and the important parts of the system that must be used. No code is required.
This is the same question as Tutorial 6's RMI question, and the tutors answer it the same way: a diagram that traces one remote call in ten numbered steps (stepped through below), followed by four steps for building the system:
- Define the interface for remote objects, using the interface definition mechanism of the RMI software.
- Compile the interface, which generates the proxy, dispatcher and skeleton classes.
- Write the server program: implement the remote object classes and compile them with the dispatcher and skeleton classes; the server creates and initialises the objects and registers them with the binder.
- Write the client programs, which contain the invoking code and proxies for all the remote classes, and which use the binder to look up remote objects.
- The parts: a client host with the client (its proxy appears later), a server host with the server program, the remote object and the skeleton, and the RMI registry.
- 1 · The server creates the remote object with
new RemoteObj(). - 2 · It binds the object in the RMI registry under a name,
bind("myRO", RemoteObj): the registry now holds the name together with a remote reference to the object. - 3 · The client calls
lookup("myRO")on the registry. - 4 · It gets back a proxy for the remote object, which implements the same remote interface.
- 5 · The client calls
method1()on the proxy, exactly as if it were local. - 6 · The proxy sends the request over the network to the skeleton on the server.
- 7 · The skeleton invokes
method1()on the real remote object. - 8 · The return value goes back to the skeleton.
- 9 · It travels back over the network to the proxy as the reply.
- 10 · The proxy returns it to the client as the result of its call.
The question asks what needs to be compiled, and the guide's earlier answer did not say. The official answer is that compiling the interface produces the proxy, dispatcher and skeleton classes. In current Java there is no separate rmic step, because proxies are generated at run time and reflection has made skeletons unnecessary, so it is worth saying both. The earlier answer also traced each call through the server's dispatcher, whereas the tutors' diagram shows a skeleton. In CDK's model both are there, with the dispatcher selecting the method and the skeleton unmarshalling the arguments and invoking the servant, so name the skeleton when you draw the tutors' figure.
The guide's points below go beyond the tutors' answer, but the remote interface, the stub and the registry are exactly what the practice exam's Q4 definitions test, so they are worth knowing. Java RMI lets an object in one JVM invoke methods on an object in another JVM, usually on another computer, with the same syntax as a local call.
- Model. The client holds a stub (proxy) that implements the remote interface, and the server holds the servant, the object that really implements it. The RMI runtime marshals calls with Java object serialization, carries them over TCP (using its protocol, JRMP), and gives at-most-once semantics.
- Remote interface. It extends
java.rmi.Remote, and every method throwsRemoteException. Remote objects are passed by reference, as remote object references, and other serializable objects by value, as copies. - RMI registry. This is the binder. The server binds a name to its remote object, and the client looks the name up to get its first stub.
- Steps. First define the remote interface. Then implement the servant, usually by extending
UnicastRemoteObject. The server creates the servant and binds it in the registry, and the client looks it up and invokes its methods, handlingRemoteException. - Behind each call. The call goes from the stub, as a request over the network, to the server's skeleton, which the dispatcher has selected, and on to the servant; the result comes back by the same route.
The 2026 practice exam asks you to write such a program in full: Q11 in 11.10.
T11-6. What are the classes of cryptographic algorithms? Part X
There are two main classes. With shared secret keys, the sender and the recipient share knowledge of the key, and it must not be revealed to anyone else. With a public/private key pair, the sender encrypts the message with the recipient's public key, and the recipient decrypts it with the matching private key. The uses of cryptography are secrecy and integrity, which stop eavesdropping and tampering (integrity also relying on redundant information such as checksums); authentication; and digital signatures.
The study guide's earlier answer said there were three classes, counting hybrid protocols as the third, and that was wrong: both the official answer and CDK §11.3 name exactly two. Hybrid protocols combine the two classes rather than forming a class of their own, and secure digest functions are a different kind of algorithm used alongside encryption. So answer "two", name the three uses, and then use the detail below to explain each class.
This detail goes beyond what the tutors expected, but it earns its place in a longer answer (Part X):
- Secret-key (symmetric) algorithms use one shared key both to encrypt and to decrypt, and are built from simple operations such as XOR, shifts and transpositions. They are fast, so they are used for bulk data, but the key has to be distributed securely. The block ciphers TEA, DES, 3DES, IDEA and AES are examples, and RC4 is a stream cipher.
- Public-key (asymmetric) algorithms use a key pair: what one key encrypts, only the other can decrypt, and the private key cannot feasibly be derived from the public one. They rest on trap-door functions (easy to compute one way, infeasible to invert without a secret), such as the difficulty of factoring large numbers in RSA. They make key distribution and signatures easy, but they are 100–1000 times slower.
- Hybrid protocols combine the two classes rather than forming a third. They use public-key cryptography to authenticate the parties and exchange a secret session key, and then symmetric encryption for the data. TLS and PGP work this way.
- Alongside these are secure digest (hash) functions, such as SHA-2 and MD5, which are one-way and collision-resistant. They are what digital signatures and MACs (message authentication codes) are built on.
T11-7. What are non-recursive and recursive server-controlled navigation? Part IX
The tutors give CDK's two diagrams with a one-line definition: in server-controlled navigation, a name server NS1 communicates with other name servers on behalf of a client. In the non-recursive form, the client (1) asks NS1, NS1 itself queries NS2 (2) and then NS3 (3), each of which replies to NS1, and NS1 (4) returns the answer to the client. In the recursive form, the client (1) asks NS1, NS1 (2) passes the request on to NS2, NS2 (3) passes it on to NS3 and gets the reply, NS2 (4) replies to NS1, and NS1 (5) returns the answer to the client. DNS offers recursive navigation as an option, but iterative navigation is the standard technique, and recursive navigation must be used in domains that limit client access to their DNS information for security reasons.
Both are ways of resolving a name whose data is spread over several name servers, in which the client contacts a single server and leaves the navigation to the servers (Part IX). The explanation and trade-off below go beyond the official answer, but the point about tying up a thread in every server is what turns a definition into a 5-mark answer.
- In non-recursive server-controlled navigation, the server the client contacted acts as a client to the other servers, querying them iteratively or by multicast, and each one sends the next step back to it. That first server stays in charge of the whole lookup and finally returns the attributes to the client.
- In recursive server-controlled navigation, a server that cannot resolve the name passes the request on to another server, one that holds a larger prefix of the name, which does the same in turn. The result comes back along the same chain, and the client never learns which server resolved the name.
The trade-off: recursive navigation works across administrative domains that will not let outsiders see where their naming data is stored, but it ties up a thread in every server on the chain until the answer comes back. The non-recursive form keeps the navigation work in one server, which can then cache results for many clients. That first property is why, as the official answer says, DNS uses recursion in domains that restrict access to their data, even though iterative navigation is its standard.
Check yourselfHow many classes of cryptographic algorithm are there, according to the official answer?
- One: public-key
- Two: shared secret key and public/private key pair
- Three: secret-key, public-key and hybrid
- Four: secret-key, public-key, hybrid and hash
B. Hybrid protocols combine the two classes (C is the guide's old, corrected answer), and hash functions are a different kind of algorithm used alongside encryption (D).
Check yourselfA sleeping thread's time expires. Which state does it enter next, and why not running?
Ready. Leaving sleeping, waiting or blocked only makes the thread eligible to run again; it must wait for the scheduler to dispatch it, because another thread may be using the processor.
Check yourselfIn the recursive navigation diagram, which servers hold a thread busy while NS3 is working, and why does that matter?
NS1 and NS2. Each forwarded the request and waits for the reply to come back along the chain. With many concurrent look-ups, every server on every chain ties up resources, which is the cost of recursion; the non-recursive form keeps that waiting in NS1 alone.
- Two definitions of a DS (CDK: message passing only; Tanenbaum: single computer). Five official goals; concurrency is an extra.
- TCP vs UDP: connection, reliability, ordering, then matched pairs. Thread life cycle: the seven-state slide diagram, with every return going through ready.
- RMI: ten steps from bind to result, compile the interface to get proxy, dispatcher and skeleton. Cryptography: two classes, three uses. Navigation: non-recursive keeps NS1 in charge; recursive passes the request along and ties up a thread in each server.