Four nodes, one block: directory walkthroughs and the exam exercise

After this lesson you will take any directory entry and any request, name the home, local and remote nodes, write the message sequence with its senders and receivers, and give the final states, sharer bits and owner — the 5-point directory exercise of the recent papers, solved in full.

The paper of 22 June 2026 gives one line, Directory N0 Block B0 | State: SHARED | Sharer Bits: 1001, one event, a Write Miss on B0 from N2, and eleven boxes to fill. Ten of them ask for a name or a state. The seventh asks for a reason: "Is(are) there any message(s) sent from the remote node(s) to the home node? Why?"

N0 and N3 hold copies of B0, and the home is about to destroy them. Should they send their data back first, as an owner in the same position must? Write down yes or no, and why. The lesson comes back to your answer once every scenario of the protocol has run.

One block, one home, three shapes

Take the machine of the three papers and of the notes (Fig. 42, p. 468): four nodes N0 … N3, each with a processor P, a cache C, a main memory MM and a directory D, on one interconnection network. The physical address space is statically partitioned among the nodes, so every block has exactly one home. The notes follow one block, B0, whose home is N0: B0 lives in MM0, and its directory entry lives in D0.

The papers write the entry on one line, and so does this lesson: Directory N0 Block B0 | State: Shared | Sharer Bits: 1001. The state is Uncached, Shared or Modified. The four sharer bits are read left to right as N0 N1 N2 N3, so 1001 means that C0 and C3 hold copies. In Modified exactly one bit is set, and it names the owner.

From lesson 37: the seven messages (Invalidate travels in two directions). P is the requesting node, A the address, D the data. The notes write ReadMiss, WriteMiss, DataValueReply, Fetch/Inv and DataWriteBack for the same messages.
MessageFrom → toSent whenCarries the block?
Read Miss (P, A)local → homea read misses in the local cacheno
Write Miss (P, A)local → homea write misses in the local cacheno
Invalidate (A)local → homea write hits a block the local cache holds Sharedno
Invalidate (A)home → remotea sharer must drop its copyno
Fetch (A)home → remote ownera Read Miss finds the block Modifiedno
Fetch/Invalidate (A)home → remote ownera Write Miss finds the block Modifiedno
Data Value Reply (D)home → localthe answer to a Read Miss or a Write Missyes
Data Write-Back (A, D)remote owner → homethe answer to a Fetch or a Fetch/Invalidate, or the owner evicts the blockyes

The three roles come from the same lesson. The home holds the block in its memory and keeps its entry; the local node issues the request; a remote node is one whose cache holds a copy, Shared or Modified. One node can play two roles: in the June 2026 entry N0 is the home and, because C0 holds a copy, also a remote.

Lesson 37 pictured the home as a librarian with a lending card for every book. Asked for a book, the librarian has only three ways to answer, and every scenario of this lesson is one of them (Fig. 1). If the copy on the shelf is good — nobody has the book, or readers hold only photocopies — the librarian lends from the shelf. If readers hold photocopies and someone wants to edit, the readers are told to shred them, and they bring nothing back: a photocopy holds nothing the shelf lacks. If one reader holds the edited master, the shelf copy is out of date, and the master must come back first.

local home remote Uncached, or a read on Shared: the memory answers Read Miss or Write Miss Data Value Reply from memory 1 2 Shared, and a write: the copies are told to leave Write Miss Invalidate Data Value Reply nothing comes back 1 2 3 Modified: the owner must give the block back Read Miss or Write Miss Fetch or Fetch/Invalidate Data Write-Back Data Value Reply memory updated 1 2 3 4
Fig. 1. The three shapes of every directory transaction, as numbered message sequences like the notes' diagrams (pp. 469–474): time runs down, each arrow is one message, orange for a request, blue for data, red for an invalidation. Top: the home answers from its own memory. Middle: clean copies are told to invalidate, and nothing comes back. Bottom: the dirty block must come back to the home before anybody else may have it.

The home answers from its own memory whenever memory is up to date (Uncached, Shared); only in Modified must it first fetch the block from the owner. A clean copy is told to invalidate and sends nothing back.

Two things in the entry make this possible. The state tells the home whether its memory can be trusted: yes in Uncached and Shared, no in Modified. The sharer bits tell it whom to contact, so nothing is ever broadcast: only the nodes the bits name receive a message.

Uncached and Shared: the memory answers

Run the notes' walkthrough on B0 (pp. 469–471). Start from Directory N0 Block B0 | Uncached | 0000: no cache holds B0, and MM0 has the only copy. N1 reads B0 and misses. N1 sends a Read Miss to N0; N0 answers with a Data Value Reply read from MM0 and sets N1's bit: Shared | 0100. Two messages, and memory is still up to date, because N1 holds a clean photocopy.

From the same Uncached entry, a Write Miss from N2 costs two messages too. There is nobody to invalidate, so the home replies at once and records N2 as the owner: Modified | 0010. N2 writes into its copy, and from that moment MM0 is stale.

The Shared cases are the ones the papers ask. Take Shared | 0100, where only C1 holds B0, and the two requests of the notes. The table uses the columns of the June 2025 paper.

The four scenarios of pp. 469–471: block B0, so the home node is N0 in every row. Each message is written sender → receiver.
Entry beforeAccessLocal nodeRemote node(s)Sequence of messagesEntry after
Uncached | 0000Read Miss from N1N1none1. N1 → N0 Read Miss
2. N0 → N1 Data Value Reply (from MM0)
Shared | 0100
Uncached | 0000Write Miss from N2N2none1. N2 → N0 Write Miss
2. N0 → N2 Data Value Reply (from MM0)
Modified | 0010
Shared | 0100Read Miss from N2N2N1 (not contacted)1. N2 → N0 Read Miss
2. N0 → N2 Data Value Reply (from MM0)
Shared | 0110
Shared | 0100Write Miss from N2N2N11. N2 → N0 Write Miss
2. N0 → N1 Invalidate
3. N0 → N2 Data Value Reply (from MM0)
Modified | 0010

In the Read Miss from N2, N1 is a remote node — its cache holds a copy — yet it receives nothing. In Shared, memory is up to date, so the home replies from MM0 by itself; asking N1 would only add a message.

In the Write Miss from N2, N1 must lose its copy before N2 may write. The home sends N1 an Invalidate, then the Data Value Reply to N2. N1 invalidates and sends no data back: its copy was clean, identical to MM0, so there is nothing to save.

A write hit on a Shared block

The papers add a scenario the notes never walk: the local node already holds the block Shared and writes it. Take the second access of June 2025, Directory N1 Block B1 | Shared | 0110 and a Write Hit from N2. N2 already has the data, so it needs no block, only permission. It sends an Invalidate to the home N1, which invalidates every other sharer — here the copy in its own cache C1 — and makes N2 the owner: Modified | 0010. That is 1 + k messages for k other sharers, and no Data Value Reply. With k = 0 the request is still sent, because the home must learn that N2 now owns a dirty block.

"A write hit on Shared is just a write, so the local node sends a Write Miss." No: a Write Miss asks for the data and gets a Data Value Reply. A write hit on a Shared block sends an Invalidate request and gets no data. The June 2025 and July 2024 papers both test it.

Two quieter cases

When the local node is the home, only the route changes. In the first access of the July 2024 quiz (question 4), N1 reads B1 and N1 is B1's home: C1 asks D1, MM1 answers, and N1's bit is set. It is the same pair of messages, inside one node, and the entry goes from Shared | 1001 to Shared | 1101.

When a sharer evicts its clean copy, nothing is sent at all. The home is not told, so the bit stays at 1: a stale sharer bit. The next Invalidate to that node finds nothing to invalidate, useless but harmless. Only a Modified copy announces its eviction, with a Data Write-Back.

Modified: the home must ask the owner

Now Directory N0 Block B0 | Modified | 0100: N1 owns a dirty copy, and MM0 is stale. Give the block a value to see what moves: C1 holds x = 7, while MM0 still holds the old x = 3. N2 reads B0 (pp. 472–473).

The three Modified scenarios of pp. 472–475: block B0, home N0, owner N1. The last column says whether MM0 holds the latest value once the transaction is over.
AccessSequence of messagesOwner N1Entry afterMemory after
Read Miss from N21. N2 → N0 Read Miss
2. N0 → N1 Fetch
3. N1 → N0 Data Write-Back
4. N0 → N2 Data Value Reply
Modified → SharedShared | 0110up to date
Write Miss from N21. N2 → N0 Write Miss
2. N0 → N1 Fetch/Invalidate
3. N1 → N0 Data Write-Back
4. N0 → N2 Data Value Reply
Modified → InvalidModified | 0010stale once N2 writes
N1 evicts B01. N1 → N0 Data Write-BackModified → InvalidUncached | 0000up to date

The read miss needs four messages because the fresh value is in C1, not in MM0. The home sends a Fetch to the owner. N1 answers with a Data Write-Back and keeps a read-only copy, Modified → Shared. The home writes the block into MM0 and forwards it to N2 with a Data Value Reply. The state does not become Modified, because N2 only reads: Shared | 0110 (Fig. 2).

home remote (owner) local N0 N1 N2 P0 P1 P2 I M I x = 7 MM0 x = 3 MM1 MM2 State N0 N1 N2 N3 Modified 0 1 0 0

Before: Modified | 0100 — MM0 is stale

home remote local N0 N1 N2 P0 P1 P2 I S S x = 7 x = 7 MM0 x = 7 MM1 MM2 State N0 N1 N2 N3 Shared 0 1 1 0

After: Shared | 0110 — MM0 is up to date

Fig. 2. A Read Miss from N2 on B0, Modified in C1 (notes, pp. 472–473), with a value in the block. Before, only C1 holds the latest value, 7, and MM0 still has the old 3. After the four messages the Data Write-Back has carried the 7 into MM0: memory, C1 and C2 agree, and the entry is Shared. The highlighted cells changed.

The write miss has the same four-message shape with one word changed: Fetch/Invalidate. N1 sends the block back and drops its copy, Modified → Invalid, and N2 becomes the new owner, Modified | 0010. For a moment MM0 is up to date again, refreshed by the Data Write-Back. But N2 asked for the block in order to write it, and once it writes, MM0 is stale once more.

In the last case the owner starts the conversation: N1 evicts B0 to make room for another block. A dirty copy cannot be dropped, so N1 sends a Data Write-Back; the home writes it into MM0 and clears the entry: Uncached | 0000, memory up to date, one message (p. 475). The notes call N1 "Remote, Owner" here, because a Data Write-Back always travels remote → home.

Why does the data travel owner → home → local, and not straight to N2?

Because the home is the only place where the requests for B0 are put in order, and before anybody else sees the block it must update two things: the copy in MM0 and the entry. Going through the home costs a fourth message, but every request then finds a consistent entry. Real machines often let the owner send the block straight to the requester and a copy to the home, which saves a hop: the Stanford DASH machine of the resources did so. The June 2026 paper asks for "the reply message sent from the home node to the local node", and the notes' walkthroughs go through the home: so should your answer.

Every scenario of the protocol is now on the table. At the exam, read it by rows: find the state of the entry, then the request, and copy the shape with the actual node names.

All scenarios, home H, local L, k = the number of other sharers. When a sharer is the home itself, its Invalidate stays inside the node; when L is the home, its request and reply do.
Entry beforeRequestMessages, in orderOther copiesEntry afterMemory afterCount
UncachedRead Miss from LL → H Read Miss; H → L Data Value Reply—Shared, bits = Lup to date2
UncachedWrite Miss from LL → H Write Miss; H → L Data Value Reply—Modified, bits = Lstale2
SharedRead Miss from LL → H Read Miss; H → L Data Value Replystay SharedShared, bits + Lup to date2
SharedWrite Miss from LL → H Write Miss; H → each sharer Invalidate; H → L Data Value ReplyShared → InvalidModified, bits = Lstale2 + k
Shared, L a sharerWrite Hit from LL → H Invalidate; H → each other sharer InvalidateShared → InvalidModified, bits = Lstale1 + k
ModifiedRead Miss from LL → H Read Miss; H → owner Fetch; owner → H Data Write-Back; H → L Data Value Replyowner Modified → SharedShared, bits = owner + Lup to date4
ModifiedWrite Miss from LL → H Write Miss; H → owner Fetch/Invalidate; owner → H Data Write-Back; H → L Data Value Replyowner Modified → InvalidModified, bits = Lstale4
Modifiedthe owner evictsowner → H Data Write-Backowner Modified → InvalidUncached, 0000up to date1
Shareda sharer evictsnonethat copy → Invalidunchanged (stale bit)up to date0

Four nodes, one block: the messages one at a time

Pick a scenario — an exam paper, a page of the notes, or free play from an entry you choose — and press Next message. The picture shows the roles, every cache's state, the home's entry and whether the home's memory is fresh; under it, the messages so far, numbered, with time running down. A loop on one line is a message that stays inside a node.

  1. June 2026, EX3 (the default). Before the first press, write down home, local, remote(s) and the messages. Then step through. Does anything travel from N0 or N3 back to the home?
    What you should see

    Home N0, local N2, remotes N0 and N3. Write Miss N2 → N0; Invalidate N0 → C0 (the loop: inside N0); Invalidate N0 → N3; Data Value Reply N0 → N2, read from MM0, which is fresh in Shared. Nothing comes back: clean sharers only invalidate. Final entry Modified | 0010, owner N2, C0 Invalid.

  2. Notes p. 472: Modified 0100, Read Miss from N2. Predict how many messages there will be, and watch the readout "memory up to date?" at message 3.
    What you should see

    Four: Read Miss, Fetch, Data Write-Back, Data Value Reply. The block comes from the owner through the home: in Modified the home must fetch; in Uncached and Shared it answers from memory. The readout turns to Yes at the Data Write-Back and stays Yes: the final entry is Shared | 0110 with fresh memory, not stale as the notes print.

  3. June 2025, Q1: three accesses from Shared 0100. Step through the first two; before the third (Write Miss from N0), predict the entry, who sends data and the final bits.
    What you should see

    After access 1: Shared | 0110, two messages, the data from MM1. After access 2: Modified | 0010 — Invalidate N2 → N1, and the invalidation of C1 stays inside N1; no data moves. Access 3: Write Miss N0 → N1, Fetch/Invalidate N1 → N2, Data Write-Back N2 → N1, Data Value Reply N1 → N0. Final Modified | 1000; MM1 is fresh after message 3 and stale again once N0 writes.

  4. Free play: start from Shared 1001, choose Replacement from N3 and press Next message. Then choose Write Miss from N2 and step. How many Invalidates does the home send?
    What you should see

    Two, to C0 and to N3, although C3 is already empty: the eviction of a clean copy sends nothing, so N3's bit stayed at 1. The extra Invalidate is useless but harmless — the sharer bits may name too many nodes, never too few.

The home's view: one state machine, six invariants

Follow only the entry through the walkthroughs. It goes Uncached → Shared when N1 reads, Shared → Shared when N2 reads too, Shared → Modified when N2 writes, Modified → Shared when another node reads, Modified → Modified when another node writes, Modified → Uncached when the owner evicts. Those six arcs, plus Uncached → Modified, are the whole directory state machine of p. 476 (the notes' Fig. 43): three states, three events — Read Miss, Write Miss and Data Write-Back — described "from the Home directory's perspective".

What each directory state says about the four caches and about memory (p. 476).
Directory stateThe caches (MSI states)Memory
Uncachedevery cache Invalidup to date: the only copy
Sharedone or more caches Shared, the others Invalidup to date
Modifiedexactly one cache Modified (the owner), the others Invalidstale

The table is the MSI protocol of lesson 35 seen from the home. With snooping, every cache watched the bus and took its own transition. Here the caches still have their Invalid, Shared and Modified states, but the decisions are taken in one place, and the bus events have become messages: a snooped read miss on a Modified block is now a Fetch, a snooped write miss is now an Invalidate or a Fetch/Invalidate, sent only to the nodes the bits name. One arc is missing on purpose: there is no Shared → Uncached, because a clean eviction is silent and the home never learns that the last sharer has left.

The notes' own summary of the arcs (p. 477) repeats the slip of p. 473 on the Modified → Shared arc:

The notes close the chapter with six invariants, conditions that must hold "regardless of the sequence of operations" (p. 478). Each is kept true by particular messages:

  1. Single owner: at most one cache holds the block Modified. Kept by the Invalidates and the Fetch/Invalidate that go out before the home grants Modified.
  2. Memory freshness: Shared or Uncached → memory up to date; Modified → memory stale. Kept by the Data Write-Back that every exit from Modified requires.
  3. Sharer set: the sharer bits list every node that holds a copy. Kept by every miss, which sets the requester's bit. After silent evictions the list may name too many nodes, never too few.
  4. Owner membership: in Modified the owner is the one bit set.
  5. State-transition correctness: states change only through the defined messages. (The notes' list leaves out Write Miss; add it.)
  6. Atomicity of updates: the directory processes one request at a time for a given block. With no bus to order the requests, this is how write serialization comes back: two Write Misses that arrive together are served one after the other.

The directory state machine is MSI seen from the home: Uncached means no copies, Shared means clean copies and fresh memory, Modified means one dirty owner and stale memory. Every message of the protocol is there to keep one of the six invariants true.

The directory's state machine, and what each message protects

The circles are the states of the entry Directory N0 Block B0. Each arc carries its event (bold) and what the home sends besides the Data Value Reply that ends every miss arc: Invalidates to the sharers, a Fetch or a Fetch/Invalidate to the owner. Under the machine sit the four caches, with the value x of the block they hold, and MM0. Choose an event and a node, press Send, and read the six invariants of p. 478 under the picture. The protocol menu breaks the protocol on purpose.

  1. Reset, then send Read Miss from N1, Read Miss from N2, Write Miss from N3. Before each press, predict the arc and every cache's state. What do Uncached, Shared and Modified say about the four caches?
    What you should see

    U → S, S → S, S → M. Uncached: every cache Invalid. Shared: one or more caches Shared, and MM0 holds the latest x. Modified: exactly one cache Modified, and MM0 is stale. The entry is MSI seen from the home: a one-word summary of the four caches.

  2. With the block Modified in C3, send Read Miss from N1. Which arc, which messages, and what happens to x in MM0?
    What you should see

    M → S: Fetch to N3, the Data Write-Back received, Data Value Reply to N1. MM0's x becomes the latest value, and invariant 2 holds with the state Shared: after a Fetch, memory is fresh again.

  3. Now send a silent eviction from N1, then one from N3. Does the entry change? Does any invariant break?
    What you should see

    No arc is taken, and the entry stays Shared | 0101 although no cache holds the block any more: the home is never told about clean evictions, which is why the machine has no Shared → Uncached arc. Every invariant holds — the bits name too many nodes, never too few.

  4. Choose "bug: the owner skips the Data Write-Back", Reset, send Write Miss from N2, then Read Miss from N0. Then Reset again, choose "bug: two requests served at once" and send two Write Misses at once from N1. Which invariants turn red each time?
    What you should see

    Without the write-back, memory freshness (2) and defined messages (5) fail, and N0 reads the old x from MM0 — the two caches disagree. With two requests served at once, C1 and C2 both end Modified while the bits name only N2: single owner (1), sharer set (3), owner membership (4) and one request at a time (6) fail. Each message of the protocol is there to keep one invariant true.

The exam exercise in seven moves

The three papers ask the same exercise in three forms. July 2024 asks for the definitions and the message lists (Question 1) and adds a three-access quiz (quiz question 4); June 2025 asks for three accesses with home, local, remotes, messages and the final entry (Question 1); June 2026 asks for one access in eleven boxes (Exercise 3). The moves below solve any of them. Here they solve the hook.

  1. Home. The node named in the entry: Directory N0 Block B0, so the home is N0. It is fixed by the address and never changes during the exercise.

  2. Read the bits. 1001 is N0 N1 N2 N3, so C0 and C3 hold clean copies; the state Shared says that MM0 is up to date.

  3. Local. The node the request comes from: a Write Miss from N2, so the local node is N2. C2 holds no copy, so it really is a miss.

  4. Remotes. Every other node whose bit is 1, or the owner if the state is Modified: N0 and N3. The home's own cache counts too (unless the home is the requester), so N0 is the home and a remote at once.

  5. Shape. Shared and a Write Miss: the memory answers and the sharers are told to leave, 1 + 2 + 1 messages.

  6. Messages, each with sender and receiver. N2 → N0 Write Miss (N2, B0); N0 → N3 Invalidate (B0) and N0 → C0, inside N0, Invalidate (B0); N0 → N2 Data Value Reply, with the block read from MM0. From the remotes to the home: nothing, because their copies were clean.

  7. Final states. C0 Invalid, C3 Invalid, C2 Modified; Directory N0 Block B0 | Modified | 0010; final owner N2; MM0 stale as soon as N2 writes.

Back to the hook. The answer is no: N0 and N3 send nothing to the home. Their copies are Shared, which means clean, identical to MM0, so there is no newer value to save; they simply invalidate. Only an owner in Modified answers the home, with a Data Write-Back, because only an owner holds a value that memory lacks. If you answered yes, you mixed up the two kinds of remote: a sharer drops its copy, an owner returns it. A real machine would send an invalidation acknowledgement, but the course's seven messages have none.

Five checks before you hand in the exercise. The home's own cache is a remote whenever its bit is 1, unless the home is the requester itself. A write hit sends an Invalidate, not a Write Miss, and receives no data. In Shared no Fetch is ever sent. After a read on a Modified block both copies are Shared and memory is up to date. A cache block is Invalid, never "Uncached".

Exam-style questions

Four of the questions are directory questions of the three official papers, word for word: June 2026 Exercise 3, June 2025 Question 1, July 2024 Question 1 and quiz question 4. The other three follow the same patterns. There are no official solutions: the model answers are written here, and every state in them was recomputed.

(22 June 2026, Exercise 3) Consider a directory-based protocol for a distributed shared memory system with 4 nodes (N0, N1, N2, N3). Let's consider: Directory N0 Block B0 | State: SHARED | Sharer Bits: 1001|. Assuming a Write Miss on B0 from N2, please answer to the following questions:

  1. What is the home node?
  2. What is local node?
  3. What is(are) the remote node(s)?
  4. What is the initial message sent from the local node to the home node?
  5. What is the reply message sent from the home node to the local node?
  6. What is the reply message sent from the home node to the remote node(s)?
  7. Is(are) there any message(s) sent from the remote node(s) to the home node? Why?
  8. What is the final coherence state of the block in the home cache?
  9. What is the final coherence state of the block in the local cache?
  10. What are the final coherence state and the sharers bits of the block in the home directory?
  11. Which node is the final owner of the block?
Show model answer
QuestionAnswer
1. Home nodeN0: B0 is in MM0 and its entry in D0.
2. Local nodeN2: the node that issues the Write Miss.
3. Remote node(s)N0 and N3: the nodes whose sharer bits are 1 (1001). N0 is the home and also a remote, because its cache C0 holds a copy.
4. Initial message, local → homeWrite Miss (P = N2, A = B0), from N2 to N0.
5. Reply, home → localData Value Reply (B0), from N0 to N2, with the block read from MM0: memory is up to date because the state is Shared.
6. Reply, home → remote(s)Invalidate (B0) from N0 to N3, and to the home's own cache C0 inside N0.
7. Messages remote → home? Why?No. C0 and C3 hold the block in Shared state: clean copies, identical to MM0, so there is no data to write back; they only invalidate. A Data Write-Back is sent only by an owner in Modified state.
8. Final state in the home cacheInvalid (C0).
9. Final state in the local cacheModified (C2).
10. Home directoryDirectory N0 Block B0 | State: Modified | Sharer Bits: 0010
11. Final ownerN2.

Each box takes one line. The three traps of the form: N0 counted among the remotes, the "no" with its reason (clean copies), and Invalid — not Uncached — for the home cache. You may add that a real machine sends invalidation acknowledgements; the message set of the course has none.

(10 June 2025, Question 1) Let's consider a directory-based protocol for a distributed shared memory system with 4 Nodes (N0, N1, N2, N3) where we consider the block B1 in the directory of N1: Directory N1 Block B1 | State: Shared | Sharer Bits: 0 1 0 0 |. Given the following sequence of accesses, please answer to the following questions:

  1. Read Miss on B1 from node N2
  2. Write Hit on B1 from node N2
  3. Write Miss on B1 from node N0

For each access: Home node? Local node? Remote node(s)? What is the sequence of messages sent among the nodes? Which are the final coherence state and sharer bits of the block B1 in the home directory?

Show model answer

1. Read Miss on B1 from node N2

Home nodeN1
Local nodeN2
Remote node(s)N1: its cache C1 holds the only copy (not contacted)
Sequence of messages1. N2 → N1 Read Miss (N2, B1)
2. N1 → N2 Data Value Reply (B1 from MM1, up to date in Shared)
B1 in the home directoryState: Shared | Sharer Bits: 0 1 1 0

2. Write Hit on B1 from node N2

Home nodeN1
Local nodeN2
Remote node(s)N1: C1 holds a copy
Sequence of messages1. N2 → N1 Invalidate (B1): the request to invalidate the other copies
2. N1 → C1, inside N1: Invalidate (B1)
No data is sent: N2 already has the block.
B1 in the home directoryState: Modified | Sharer Bits: 0 0 1 0 (owner N2)

3. Write Miss on B1 from node N0

Home nodeN1
Local nodeN0
Remote node(s)N2: the owner, Modified
Sequence of messages1. N0 → N1 Write Miss (N0, B1)
2. N1 → N2 Fetch/Invalidate (B1)
3. N2 → N1 Data Write-Back (B1, data); C2: Modified → Invalid; MM1 updated
4. N1 → N0 Data Value Reply (B1)
B1 in the home directoryState: Modified | Sharer Bits: 1 0 0 0 (owner N0)

Three shapes in one exercise: two messages, 1 + k, four. The classic slips are answering the second access with a Write Miss and a Data Value Reply (the block is already in C2) and forgetting, in the first, that the only copy is the home's own. Writing "N1 (the home's own cache), not contacted" for the first remote leaves no doubt about what you mean.

Let's consider a directory-based protocol for a distributed shared memory system with 4 Nodes (N0, N1, N2, N3) where we consider the block B2 in the directory of N2: Directory N2 Block B2 | State: Shared | Sharer Bits: 0 0 1 1 |. Given the following sequence of accesses, please answer to the following questions:

  1. Write Miss on B2 from node N1
  2. Read Miss on B2 from node N3
  3. Write Hit on B2 from node N1

For each access: Home node? Local node? Remote node(s)? What is the sequence of messages sent among the nodes? Which are the final coherence state and sharer bits of the block B2 in the home directory?

Show model answer

1. Write Miss on B2 from node N1

Home nodeN2
Local nodeN1
Remote node(s)N2 (its own cache C2) and N3
Sequence of messages1. N1 → N2 Write Miss (N1, B2)
2. N2 → C2, inside N2: Invalidate (B2)
3. N2 → N3 Invalidate (B2)
4. N2 → N1 Data Value Reply (B2 from MM2)
B2 in the home directoryState: Modified | Sharer Bits: 0 1 0 0 (owner N1)

2. Read Miss on B2 from node N3

Home nodeN2
Local nodeN3
Remote node(s)N1: the owner, Modified
Sequence of messages1. N3 → N2 Read Miss (N3, B2)
2. N2 → N1 Fetch (B2)
3. N1 → N2 Data Write-Back (B2, data); C1: Modified → Shared; MM2 up to date
4. N2 → N3 Data Value Reply (B2)
B2 in the home directoryState: Shared | Sharer Bits: 0 1 0 1

3. Write Hit on B2 from node N1

Home nodeN2
Local nodeN1
Remote node(s)N3
Sequence of messages1. N1 → N2 Invalidate (B2): the request to invalidate the other copies
2. N2 → N3 Invalidate (B2)
No data is sent.
B2 in the home directoryState: Modified | Sharer Bits: 0 1 0 0 (owner N1)

Not from a paper: the June 2025 pattern with the home's own copy invalidated in the first access and a Fetch in the second. The second access is the case the notes get wrong (pp. 473 and 477): after the Data Write-Back the memory of N2 is up to date, and both copies are Shared.

(15 July 2024, Question 1) Consider a directory-based protocol for a distributed shared memory system with 4 nodes (N0, N1, N2, N3). Please answer to the following questions:

  1. What is the definition of home node?
  2. What is the definition of local node?
  3. What is the definition of remote node?
  4. What are the possible messages sent from the local node to the home node?
  5. What are the possible messages sent from the home node to the local node?
  6. What are the possible messages sent from the home node to the remote node?
  7. What are the possible messages sent from the remote node to the home node?
  8. What are the possible coherence states of a block in the local cache?
  9. What are the possible coherence states of a block in the home directory?
  10. What is the meaning of the sharer bits of a block in the home directory?
Show model answer
QuestionAnswer
1. Home nodeThe node whose main memory holds the block, fixed by the physical address; its directory keeps the block's state and sharer bits, and every request for the block goes through it.
2. Local nodeThe node whose processor issues the request: the read or write miss originates in its cache.
3. Remote nodeA node whose cache holds a copy of the block, Shared or Modified. The home may have to invalidate it (a sharer) or fetch the data from it (the owner); the home itself can also be a remote.
4. Local → homeRead Miss (P, A); Write Miss (P, A); Invalidate (A), the request sent on a write hit to a Shared block.
5. Home → localData Value Reply (D): the block, in answer to a Read Miss or a Write Miss.
6. Home → remoteInvalidate (A); Fetch (A): the owner returns the block and goes to Shared; Fetch/Invalidate (A): the owner returns the block and invalidates it.
7. Remote → homeData Write-Back (A, D): the owner's modified block, in reply to a Fetch or a Fetch/Invalidate, or when the owner evicts it.
8. States in the local cache1) Invalid 2) Shared 3) Modified.
9. States in the home directory1) Uncached 2) Shared 3) Modified.
10. Sharer bitsOne bit per node (N0 N1 N2 N3): bit i = 1 means that node i's cache holds a copy. In Uncached all bits are 0; in Shared they mark all the sharers; in Modified exactly one bit is set and it marks the owner. They let the home send Invalidate and Fetch messages only to the nodes concerned, with no broadcast.

Ten short answers. The marks hide in the directions: Invalidate appears twice (local → home and home → remote), and the remote → home list has a single entry, Data Write-Back — the June 2025 quiz asked exactly that. Keep the two lists of states apart: Invalid belongs to caches, Uncached to the directory.

(15 July 2024, Question 4, SINGLE ANSWER) Let's consider a directory-based protocol for a distributed shared memory system with 4 Nodes (N0, N1, N2, N3) where: Directory N1 Block B1 | State: Shared | Sharer Bits: 1001. Which is the state of the block B1 in N1 after this sequence: Read Miss B1 from local cache N1; Read Miss B1 from local cache N2; Write Hit B1 from local cache N1;

  • Answer 1: Directory N1 Block B1 | State: Shared | Sharer Bits: 1111 That is the entry after the two read misses; the write hit by N1 then invalidates the other three copies.
  • Answer 2: Directory N1 Block B1 | State: Modified | Sharer Bits: 0100 1001 → 1101 (N1 reads, local and home at once) → 1111 (N2 reads) → the write hit by N1 invalidates N0, N2 and N3: Modified, owner N1.
  • Answer 3: Directory N1 Block B1 | State: Shared | Sharer Bits: 0110 A read never removes a sharer: N0 and N3 keep their copies until the write hit, and after it the state is Modified.
  • Answer 4: Directory N1 Block B1 | State: Modified | Sharer Bits: 0110 In Modified exactly one bit is set: the owner's.
Show model answer

Answer 2. Read Miss from N1: N1 is local and home, the block comes from MM1 and N1's bit is set: Shared | 1101. Read Miss from N2: Data Value Reply from MM1: Shared | 1111. Write Hit from N1: N1 holds a Shared copy, so it sends an Invalidate request to the home (itself), which invalidates N0, N2 and N3: Modified | 0100.

Two traps: in the first access local = home, which changes nothing in the rule — N1's bit is set like any reader's, 1001 → 1101; the last is a write hit, so the final state is Modified with one bit, whatever the bits were before.

(SINGLE ANSWER) Let's consider a directory-based protocol for a distributed shared memory system with 4 Nodes (N0, N1, N2, N3) where: Directory N3 Block B3 | State: Shared | Sharer Bits: 0110. Which is the state of the block B3 in N3 after this sequence: Write Miss B3 from local cache N0; Read Miss B3 from local cache N2;

  • Answer 1: Directory N3 Block B3 | State: Modified | Sharer Bits: 1000 That is the entry after the write miss alone; the read miss from N2 then fetches the block from N0.
  • Answer 2: Directory N3 Block B3 | State: Shared | Sharer Bits: 1010 The write miss invalidates N1 and N2 (Modified | 1000); the read miss from N2 fetches from the owner N0, which keeps a Shared copy.
  • Answer 3: Directory N3 Block B3 | State: Shared | Sharer Bits: 1110 N1's copy was invalidated by the write miss and was never read again.
  • Answer 4: Directory N3 Block B3 | State: Modified | Sharer Bits: 0010 A read miss never makes the reader the owner: both copies end Shared.
Show model answer

Answer 2. Write Miss from N0: the home N3 invalidates N1 and N2 and replies to N0: Modified | 1000. Read Miss from N2: the home sends a Fetch to N0, which returns a Data Write-Back and goes to Shared; the home replies to N2: Shared | 1010, memory up to date.

The July 2024 quiz pattern with a read on a Modified block. The wrong options are the entry after one access (Answer 1), a forgotten invalidation (Answer 3) and a reader made owner (Answer 4).

(MULTIPLE ANSWERS) Let's consider a directory-based protocol for a distributed shared memory system with 4 Nodes (N0, N1, N2, N3) where: Directory N0 Block B0 | State: Modified | Sharer Bits: 0100. A Read Miss on B0 arrives from node N2. Which of the following statements are true?

  • Answer 1: The home node N0 sends a Fetch message to N1. N1 is the owner: the only node with the fresh value.
  • Answer 2: N1 sends a Data Write-Back to N0 and keeps its copy in Shared state. A Fetch downgrades the owner; a Fetch/Invalidate would invalidate it.
  • Answer 3: N1 sends the block directly to N2 with a Data Value Reply. In the protocol of the course the home replies: owner → home Data Write-Back, then home → local Data Value Reply.
  • Answer 4: At the end of the transaction, the copy of B0 in MM0 is up to date. The Data Write-Back wrote the block into MM0; the final state is Shared, so memory is fresh.
  • Answer 5: At the end of the transaction, the directory entry is Modified | 0010. N2 only reads: the entry becomes Shared | 0110.
Show model answer

Answers 1, 2 and 4. The sequence is N2 → N0 Read Miss, N0 → N1 Fetch, N1 → N0 Data Write-Back (N1: Modified → Shared, MM0 updated), N0 → N2 Data Value Reply. Final entry: Shared | 0110, memory up to date.

A multiple-answer quiz in the June 2026 form. Answer 4 is the statement the notes get wrong (pp. 473 and 477); Answer 3 describes a real-machine optimization, not the protocol of the papers.

Check yourself

Directory N0 Block B0 | Shared | 0110. N3 sends a Read Miss. Where does the Data Value Reply take the block from?

  • From MM0, the home's memory In Shared, memory is up to date (invariant 2): the home answers by itself, in two messages.
  • From C1, after a Fetch A Fetch goes only to an owner in Modified; C1's copy is clean and equal to MM0.
  • From whichever of C1 and C2 is closer to N3 That is cache-to-cache forwarding, not part of the protocol of the course — and nothing needs forwarding when memory is fresh.
  • From C2, which then becomes Invalid A read never invalidates anybody: N1, N2 and N3 all end Shared, bits 0111.

Directory N0 Block B0 | Modified | 0100. N2's Read Miss has just been served. What does MM0 hold now?

  • The same value as C1 and C2 N1's Data Write-Back wrote the block into MM0 before the home replied: Shared, memory fresh.
  • An old value, refreshed only when N1 evicts its copy That is what the notes print (p. 473), but the Data Write-Back of step 3 has already refreshed it; a clean copy is evicted silently anyway.
  • An old value, refreshed when N2 writes A write by N2 makes memory stale, not fresh — and it would first need an Invalidate request.
  • Nothing: the block left MM0 when N1 took it Memory always keeps a copy of the block; the only question is whether it is up to date.

Directory N0 Block B0 | Shared | 1001. N3 evicts its clean copy, then N2 sends a Write Miss. What does the home send?

  • An Invalidate to its own cache C0 and one to N3, then a Data Value Reply to N2 N3's eviction was silent, so its bit is still 1; the Invalidate to N3 finds nothing — useless but harmless.
  • An Invalidate to C0 only, then a Data Value Reply The home cannot know that N3 left: a clean eviction sends no message.
  • A Fetch to N3, then a Data Value Reply A Fetch is for an owner in Modified; the state is Shared.
  • Only a Data Value Reply, because nobody else holds the block C0 still holds a copy, and the bits say that N3 does too.

The home is N0. Which of these transactions use exactly four messages between nodes?

  • Read Miss from N2 when the entry is Modified | 0100 Read Miss, Fetch, Data Write-Back, Data Value Reply.
  • Write Miss from N3 when the entry is Shared | 0110 Write Miss, Invalidate to N1, Invalidate to N2, Data Value Reply: 2 + k with k = 2.
  • Write Miss from N2 when the entry is Uncached | 0000 Two: nobody to invalidate, so Write Miss and Data Value Reply.
  • Write Hit from N1 when the entry is Shared | 0110 Two: the Invalidate request and one Invalidate to N2; no data moves.
  • N1 evicts B0 when the entry is Modified | 0100 One: the Data Write-Back.

Counting rule: 2 when memory answers, 2 + k for a write miss with k sharers, 1 + k for a write hit, 4 when an owner must be asked, 1 for an owner's eviction.

Why does the directory's state machine have an arc Modified → Uncached but none Shared → Uncached?

  • A clean copy is evicted silently, so the home never learns that the last sharer has left Only a dirty copy announces its eviction, with a Data Write-Back; that message is the M → U arc.
  • Because a Shared block can never become uncached It can: every sharer may drop its copy. The home is just not told.
  • Because S → U would need a Data Write-Back, which only owners send No data needs to move for a clean copy; the point is that no message at all is sent.
  • Because memory is stale in Shared In Shared memory is up to date (invariant 2).

Directory N0 Block B0 | Shared | 1000. Write Misses from N1 and N3 reach the home in the same cycle. What does invariant 6 make the home do?

  • Serve one, say N1 (Modified | 0100), then the other, with a Fetch/Invalidate to N1 (Modified | 0001) One request at a time: the second finds a Modified entry and is served like any write miss on an owned block.
  • Reply to both from MM0 and set the bits to 0101 Two Modified copies would break invariants 1 and 4; the bug "two requests served at once" in the second widget shows it.
  • Drop the second request The second request waits; it is not lost.
  • Merge the two writes into one The two processors write different values: the home orders them, it cannot merge them.

Key take-aways

What to watch and read