Contents

Preface

Acknowledgments

1     Introduction

I      Single Process

2     Steps

3     Processes

4     Names

5     Recursion

6     Limits: Imperfect Programs

7     Limits: Perfect Programs

II     Interacting Processes

8     Coordination

9     State, Change, and Equality

10   Controlled Access

11   Interrupts

12   Virtualization

13   Separation

14   Packets

15   Browsing

III    Unstoppable Processes

16   Failure

17   Software Failure

18   Reliable Networks

19   Inside the Cloud

20   Browsing Revisited

IV    Defending Processes

21   Attackers

22   Thompson’s Hack

23   Secrets

24   Secure Channel, Key Distribution, and Certificates

25   Bitcoin Goals

26   Bitcoin Mechanisms

27   Looking Back

Index of Metaphors and Examples

Subject Index

List of Figures

Figure 2.1  A stair and a ramp with the same slope.

Figure 2.2  Different relationships between ramp and stair.

Figure 2.3  Making steps smaller.

Figure 2.4  Noise added into an analog signal is hard to separate out.

Figure 2.5  Noise added into a digital signal is easier to separate out.

Figure 2.6  A sine wave.

Figure 2.7  Adding together multiple sine waves for a more complex wave.

Figure 2.8  Increasing sample frequency produces a more accurate reconstruction.

Figure 3.1  Pages and sentences.

Figure 3.2  Sentences and words.

Figure 3.3  Cheat sheet and scratch pad.

Figure 3.4  Turing machine.

Figure 3.5  A finite process and an infinite process.

Figure 4.1  A name and the named person.

Figure 4.2  Gesturing instead of using a name.

Figure 4.3  Three different names for five.

Figure 4.4  The parts of an expression.

Figure 6.1  A two-way choice.

Figure 6.2  Multiple levels of choice.

Figure 8.1  A waits for B.

Figure 8.2  A cycle of waiting, A and B are deadlocked.

Figure 8.3  Six processes in a deadlock.

Figure 9.1  Different kinds of equality.

Figure 9.2  x and y are equal now and forever with the value 3.

Figure 9.3  x and y name the same mutable cell containing 3.

Figure 9.4  x and y name the same mutable cell, now containing 17.

Figure 9.5  x and y name different mutable cells, both containing 3.

Figure 9.6  x and y name different mutable cells with different values.

Figure 10.1  Two different interleavings of the same steps.

Figure 11.1  Four steps as the programmer sees them.

Figure 11.2  The same four steps, a possible execution.

Figure 11.3  The same four steps with some possible interrupt times.

Figure 11.4  A keyboard and its associated cell.

Figure 11.5  Typing the letter “T”

Figure 12.1  The boxes need to be stored in the available spaces.

Figure 12.2  One solution to the box storage problem.

Figure 12.3  Two virtual address spaces sharing one real address space.

Figure 12.4  Two processes sharing a single machine via an operating system.

Figure 12.5  Two operating systems sharing a single machine via a hypervisor.

Figure 12.6  Different processes in different operating systems on one machine.

Figure 13.1  An interplanetary game of Marco Polo.

Figure 13.2  Message ordering among 4 widely separated people.

Figure 13.3  Normal operation vs. failover.

Figure 13.4  Bad failover caused by lack of communication.

Figure 13.5  Unwanted duplicate copies caused by bad failover.

Figure 15.1  The user-facing and network-facing parts of a browser.

Figure 15.2  A hierarchy identifying some American locations.

Figure 15.3  The directory for com.

Figure 15.4  The directory for google.com.

Figure 15.5  Looking up www.google.com.

Figure 15.6  Using a cache for faster lookup.

Figure 16.1  High reliability, low availability.

Figure 16.2  High availability, low reliability.

Figure 16.3  The ideal: high reliability and high availability.

Figure 16.4  Cross section of vinyl record in use.

Figure 16.5  Cross section of optical disk (CD/DVD) in use.

Figure 16.6  Cross section of magnetic disk in use.

Figure 16.7  Different kinds of updating.

Figure 16.8  Writing stable storage.

Figure 16.9  Misled by average depth.

Figure 16.10  “This hardly ever happens.”

Figure 17.1  Combining diverse computations to produce a single result.

Figure 17.2  Are diverse computations valuable?

Figure 19.1  Two communicating endpoints and a network cloud.

Figure 19.2  Two communicating endpoints and various network devices.

Figure 19.3  BlueBox and RedBox are connected to the simple router.

Figure 19.4  Connecting the routers to form a simple internet.

Figure 19.5  The evolution of routing tables.

Figure 19.6  A quad.

Figure 19.7  Connecting networks with different routing mechanisms.

Figure 19.8  Three interconnected Autonomous Systems.

Figure 20.1  Spraying requests.

Figure 20.2  Three tiers between user and stored data.

Figure 20.3  Each tier may have a different numbers of servers.

Figure 20.4  A single request may have a complex path.

Figure 20.5  Serving global clients from a single site.

Figure 20.6  Serving global clients from multiple sites.

Figure 22.1  Compiler cc translates an ordinary program.

Figure 22.2  Compiler cc translates itself.

Figure 22.3  Compiler cc translates the operating system.

Figure 22.4  Compiler HC translates the operating system, naughtily.

Figure 22.5  Compiler H2C translates itself.

Figure 22.6  Compiler H2C translates cc, naughtily.

Figure 23.1  Key in shared-secret cryptography.

Figure 23.2  Keys in public-key cryptography.

Figure 23.3  Alice proves her identity to Bob.

Figure 24.1  A key distribution center (KDC).

Figure 24.2  Signing data.

Figure 24.3  Checking the validity of signed data.

Figure 25.1  Alice and Bob and ledger, starting state.

Figure 25.2  Alice and Bob and ledger, final state.

Figure 26.1  Whole-log signature, two-item log.

Figure 26.2  Whole-log signature, three-item log.

Figure 26.3  Altering the log while it’s unprotected.

Figure 26.4  Nested signatures, one-item log.

Figure 26.5  Nested signatures, two-item log.

Figure 26.6  Chained signatures, one-item log.

Figure 26.7  Chained signatures, two-item log.

Figure 26.8  Single-bit change in item 1 breaks signature 1.

Figure 26.9  Recomputed signature 1 breaks signature 2.

List of Tables

Table 7.1  Some examples of how problem sizes grow with n

Table 8.1

Table 8.2

Table 16.1  Reliability vs. Availability

Table 16.2  Simple bit-doubling code: sender’s actions

Table 16.3  Simple bit-doubling code: receiver’s actions