The Want
Mira lives across the courtyard. Her window faces yours, about thirty metres away, and one afternoon the two of you string a wire between them. It is an ordinary wire. You have a computer at your end and she has one at hers, and each computer has a small card in it that the wire plugs into. When your machine puts a voltage on the wire, her card notices. When your machine takes the voltage off, her card notices that too. That is everything the wire does, and you want to use it to send her something.
Before you do, it is fair to be clear about what is being assumed, because from here to the end of the book nothing will be introduced until something you already have has broken for want of it. Every mechanism has to be earned. But you must start from somewhere, and the starting point is this. The wire carries bits. Your machine can put a one or a zero onto it, and Mira’s machine will see a one or a zero come off. It carries them in the order you sent them, and it almost always gets them right.
That is the whole of the assumption. We are not going to ask how the card knows when one bit ends and the next begins, or what voltage means a one, or what happens if the two machines’ clocks disagree slightly about how long a bit lasts. Those are real questions, and real engineers have answered them with great ingenuity, but the answers live inside the card, on the far side of a boundary that you will never cross as a person writing software. We treat the wire, and the card that drives it, as a thing that exists, in much the way that a book about how computers work might treat the transistor as a thing that exists and build everything else from there. A wire, a bit at a time, in order, mostly right: that is what we have.
Two machines and one wire. Your card puts a bit on and hers takes a bit off. Everything inside the dashed boundary is given; everything outside it is ours to build.
You decide to keep the first attempt modest. You will send Mira a single bit, and you will do it in the most literal way possible. You wire a switch to your card so that closing it puts a one on the wire. She wires a small lamp to hers so that a one lights it. You close the switch, and across the courtyard her lamp comes on.
Her lamp is lit, and it is fair to ask whether you have sent her a message. Mira can certainly see the lamp. What she cannot do is say what it means. She knows that you closed your switch, and that is all she knows. You might have meant that she should come over, or that you were home, or that the kettle was on, and the lamp is equally good at meaning any of these, which is to say that it means none of them. The wire carried your bit across the courtyard without error. The bit, on arrival, carried nothing.
So you walk across the courtyard and make an arrangement. When the lamp is on, you tell her, it means come over. She agrees, you walk back, you close the switch, and a minute later she knocks at your door. This time it was a message, and the only thing that has changed since the first attempt is the arrangement the two of you made beforehand. The wire is the same wire and the bit is the same bit. The meaning was never in either of them. It was in the agreement.
This is an easy thing to nod along with, and it is easier still to underestimate, so let us try to say something else with the same equipment. The next evening you want to tell Mira that you are running late. You have the wire, the switch, and the lamp, so you close the switch, and she comes over. That is what the two of you agreed a lit lamp means, and it is the only thing you agreed. You have no way to say that you are running late because you never settled on a way to say it. You could flash the lamp twice, but she has no idea what two flashes mean, and she will probably take it as an emphatic form of come over. You could leave the lamp on for a long time, and she will take that the same way. Every possible thing you do with that switch will be read through the one agreement you have, because it is the only agreement you have.
If you want to say more things, you need more agreements. Two flashes means running late. Three flashes means call me. A long steady light means an emergency. Each one has to be settled before it is used, by both of you, or it is not a message at all; it is only a lamp doing things. And with a handful of these you have, without quite meaning to, invented something. You have a small vocabulary of signals, each mapped to a meaning, agreed in advance by both parties. The familiar word for such a vocabulary is a code, but the word matters less than the shape of what just happened, because that shape is going to recur in every chapter of this book.
It is worth stating the shape plainly, since you have just seen its first instance. A network is a tower of agreements. Every single thing you will build between your machine and Mira’s, and later between your machine and a million strangers’, will be an agreement of the kind you made about the lamp. Some of them will be about what a pattern of bits means. Some will be about when to speak and when to listen. Some will be about what to do when something goes wrong. Some will be so elaborate that they run to hundreds of pages of specification, and some will be so basic that nobody thinks to write them down. But in structure every one of them is the same: both sides settled this in advance, and that is why it works.
Each agreement will be added for the same reason you added two flashes for running late, which is that the agreements you already had were not enough to say the thing you needed to say. Nothing gets added because it would be nice to have. Things get added because the tower, as it stands, has just failed to carry a message. You will name most of the agreements yourself as you make them, and the names the industry uses will arrive afterwards, once you already know the thing, because a name is much easier to remember when it is a label for something you built than when it is a word you were told to memorise.
A lamp and a handful of flash patterns will not get you far. What you actually want to send Mira is words, so let us use the wire the way it was meant to be used, as a stream of bits, one after another, at speed. You already know from the assumption that the wire will carry a sequence of ones and zeros in order. You presumably also know that text can be written as bits. You agree on a table in which each letter is a number, you write each number as eight bits, and a sentence becomes a long string of ones and zeros. That table is itself an agreement, of course; the lamp has taught you to see these things. So you take a short message, say HI, look up each letter in the table, and get sixteen bits.
H = 01001000
I = 01001001
Your card puts them on the wire one after another. Her card takes them off one after another. She groups them into eights, looks each group up in the same table, and reads HI. It works, and it is worth seeing how much it works. The two of you can now send any text at all, of any length, and you did not have to agree on a flash pattern for every possible sentence. You agreed on one table, once, and the table does the rest. Good agreements tend to be like that. They are small, and they cover a great deal.
We could stop here with the wire working, but the wire has two flaws, and the next two chapters are about them, so it is only honest to look at them now. The first is that the wire does not know where anything begins. Look at those sixteen bits again, as they actually travel.
0100100001001001
Mira’s card grouped them into eights starting from the first one, and got HI. But suppose she was not listening from the very first bit. Suppose her machine started paying attention one bit late, because it was busy, or had only just been switched on, or because you started sending before she was ready. Then the first bit she sees is the second one you sent, and she groups from there.
1001000010010010
└──────┘└──────┘
There are only fifteen bits left after the one she missed, so the last group is short; let us say a zero follows. She reads 10010000 and 10010010 and looks them up in the table. They are not H and I. They are two other characters entirely, control codes that do not even print. And the important thing is not which wrong characters she got. It is that nothing told her she was wrong. Her card did its job. Her table lookup did its job. Every group of eight bits is a valid character, so every wrong grouping produces a valid-looking and entirely wrong result, and she has no reason to suspect anything.
The same sixteen bits, read from the first bit and read from the second. Both readings produce valid characters. Only one of them is what you sent.
Start listening two bits late, or three, and you get different garbage each time, all of it well formed and none of it HI. The wire carries bits in order, as promised. What it does not carry is any indication of where your message starts within that order. From the wire’s point of view there is no message. There is only a stream. And the same problem exists at the other end. When you have finished sending HI, the wire does nothing; it sits at zero. But a wire sitting at zero looks the same as you sending a very long run of zeros. Is that silence, or is it a message made of nothing-characters? The wire cannot say. It does not know where anything ends either.
The second flaw is that, once in a while, a bit arrives wrong. Not often. The assumption says almost always correctly, and it means it; on a good wire you might send millions of bits between mistakes. But a mistake will come. A motor starts up in the building next door, or a light switch arcs, and for a fraction of a microsecond the voltage on the wire is not what your card put there. A one arrives as a zero. Take H again, which is 01001000, and flip its last bit. You get 01001001, which is I. You sent HI and Mira reads II. Flip a different bit and H becomes X, or h, or a control character. Every one of these is a valid, plausible letter, and once again nothing tells her it is wrong. The flipped bit looks the same as a bit you meant to send.
So at the end of this first chapter you have a wire that carries bits. You have learned that bits mean nothing until both sides agree what they mean, and you have made your first agreement, a table from letters to numbers, which lets you send any text at all. That is a real accomplishment. Two computers that could not talk can now talk. You have also found two problems, and both of them come from the same place: the wire does what it promised, and no more. It carries a stream of bits, in order, mostly right. It does not carry the boundaries of your message, and it does not carry any guarantee about which bits are right. Neither problem is the wire’s fault, and both of them are yours to solve, with agreements. The first of them is the matter of how Mira is to know where your message starts and where it stops.
Coming up · I·2 — Where Does It Start?The wire does not know where a message begins. In the next chapter we make it possible to tell.
→