The link that answered its own call

Somewhere on a bad day in the early 1990s, a serial link handed a frame back to its sender. The frame was intact. The checksum agreed with itself. Every byte arrived exactly as it had left, which is precisely the problem: a link that folds its own output into its own receiver looks, from the inside, like a link with a remarkably attentive partner at the far end.

PPP's answer was a four-octet field called Magic-Number, standardised in RFC 1661 in July 1994. It is one of the quietest clever ideas in link-layer engineering, and one of the most reliably misread. The number was never magic. It was not an identity, not a credential, not a globally assigned name. It was a locally chosen marker plus a shared procedure for settling one narrow question: was that the other end choosing, or was that me, coming back?

The short version

  • Magic-Number was an endpoint-chosen marker for spotting reflected link-control traffic — not a device identity, not a cryptographic credential.
  • The same integer meant opposite things in a Configure-Request and a Configure-Ack; telling them apart required the packet type, local history and numbers that were genuinely independent.
  • The shared rule constrained negotiation and stopped there. Recovery policy stayed with the implementer, and a sound frame, an independent peer and an authenticated peer remained three separate findings.

Same number, opposite conclusion

Suppose an endpoint proposes a Magic-Number and an acknowledgment comes back carrying exactly that value. Nothing is suspicious. A valid Configure-Ack is required to reproduce the proposed options unchanged — same values, same order, matching Identifier. The echo is the receipt.

Now change one thing: the incoming packet is a Configure-Request, not an Ack. The far end appears to be proposing the very number the local endpoint last proposed. That coincidence deserves a raised eyebrow. Either two independent choosers collided, or the local request has come home wearing someone else's clothes.

Same integer, opposite conclusion. The rules that produce this sit in different corners of RFC 1661, and read together they form a small, sharp lesson about protocol evidence: an integer is not a verdict. Its meaning depends on who was supposed to be acting, what the action was, and which earlier action it answers.

A clean frame can be the wrong answer

A point-to-point link looks like the least confusing object in networking: two ends, one wire, no crowd. But a circuit can fold a transmitter's output back into its own receiver, and once it does, well-formed traffic proves rather less than it appears to.

Frame checking cannot rescue you. RFC 1662, the July 1994 specification for PPP's HDLC-like framing, defines a Frame Check Sequence that defaults to two octets, with a four-octet alternative, computed over specified frame fields. A frame that returns unchanged to its origin can carry a perfectly valid check — because nothing was damaged. Bit integrity asks whether the frame agrees with its check value. Loop detection asks something else entirely: is this the state of an independent endpoint, or my own output handed back to me?

Confusing the two produces a beautifully persuasive false signal. The cleaner the returned frame, the more convincing the illusion. PPP needed evidence of a distinct choice, not evidence of an undamaged copy.

The field arrived years before the procedure

The history starts earlier than 1994. In November 1989, RFC 1134 sketched PPP as an encapsulation method, an extensible Link Control Protocol and a family of Network Control Protocols: LCP would establish and test the link, NCPs would configure the network protocols riding on it. Its Echo and Discard formats already carried a four-octet Magic-Number field — sent as zero unless a configuration option changed it, and ignored on receipt. The field was a reserved seat in an extensible design, not yet a negotiated meaning.

In July 1990, D. Perkins and R. Hobby's RFC 1172 laid out the initial configuration options, and Magic-Number turned up with nearly all of its later character: local choice, collision handling, a demand for adequate uniqueness, reciprocal behaviour, implementation-dependent recovery. RFC 1331 carried the mechanism forward in May 1992; RFC 1661 later parked it in section 6.4.

That is continuity across four specifications, not a 1994 invention. It also carries a warning that outlives the protocol: a clearer rule buys interoperability only if real implementations actually supply the assumptions the rule leans on.

Breaking the tie, one comparison at a time

Before offering the option, an endpoint picks its number. The property it wants is a high probability of differing from whatever sits at the other end of this particular link — not global uniqueness. Nobody is reserving anything.

When an incoming Configure-Request carries the option, the endpoint compares that value with the one in the last Configure-Request it sent. Different values rule out simple reflection under the model. Equal values leave two explanations standing: reflection, or an honest collision.

Equality triggers a Configure-Nak suggesting a different number. The endpoint does not helpfully fire off an extra Configure-Request out of sequence; a received Nak or the Restart timer supplies the ordinary reason to send the next one.

Then comes a second comparison with a different reference point: the value in an incoming Configure-Nak against the value in the last Nak the local endpoint transmitted. Match, and the suspicion of reflection deepens — pick a new number. Differ, and the procedure has caught sight of a distinct chooser. The next Configure-Request carries the new value.

On a genuinely looped link, requests and Naks keep coming home to their author. Between two independently choosing peers, the numbers should part company quickly. This is not one dramatic equality test; it is an organised attempt to make two initially indistinguishable explanations start behaving differently — and it is why packet history matters. Flatten everything into one undifferentiated "current number" and you throw away the Request-to-Request and Nak-to-Nak relationships the whole test rests on.

Randomness is a job, not a label

The specifications offer an idealised collision estimate for uniform 32-bit choices: roughly 2.3 × 10^-10 for a single equality. That is a model, not a measured false-alarm rate.

Two boxes initialised from the same state and stepping through the same deterministic sequence are not independent draws. Receiving the same request five times is not five trials. Even the selection space needs care: zero is illegal as an offered Magic-Number, so a uniform selector confined to legal nonzero values occupies a slightly different space from the published 32-bit idealisation.

None of that arithmetic is the operational point. The point is whether the two ends can produce genuinely distinct choices, and no protocol conjures that property by calling a field random. RFC 1172 and its successors therefore advise against offering the option when no decent source of uniqueness exists. Such an implementation may still acknowledge or reject the peer's offer; it simply cannot claim reliable local loop detection from a weak generator. The peer may detect loops perfectly well on its own.

It is a restrained kind of optionality. An implementation is allowed to lack a capability. It is not allowed to advertise weak evidence as strong.

A rejection is a witness

The option carries a reciprocal obligation: an implementation that offers Magic-Number must not reject the same option when its peer offers it.

That single rule turns a received Configure-Reject into unusually good news. A conforming offerer would never generate that rejection in response to its own reflected offer. The refusal therefore points to another conforming participant rather than the local behaviour bouncing back.

RFC 1661 tells the offerer to proceed as though negotiation had succeeded, while accepting that the peer will not use Magic-Numbers. That is not a claim that both ends negotiated the same capabilities. It is a way to keep a useful result when the other side declines the feature.

And the inference is bounded by its model. A rejection is not a signature; an adversary is under no obligation to behave like the conforming peer the state machine has in mind. What you learn concerns distinguishable protocol conduct, not a verified organisational identity.

The reply carries the replier's number

Once negotiated, the local Magic-Number rides in the endpoint's LCP Echo-Request, Echo-Reply and Discard-Request packets. Each sender supplies its own marker.

An Echo-Reply copies the request's Identifier so the exchange can be correlated. It does not copy the requester's Magic-Number. Two fields, two jobs: one ties the reply to the request, the other reports the sending endpoint's negotiated state.

This is where the word "echo" earns its keep as a trap. Echo suggests everything comes back unchanged. Here, an unchanged local marker in the relevant received diagnostic traffic is exactly what can betray reflection.

State boundaries apply. Echo requests and replies travel only in LCP Opened, and an Echo-Request received in that state must be answered. They are not general-purpose probes available before negotiation. Discard-Request is a sink: it produces no reply. Until Magic-Number is successfully negotiated, the diagnostic field goes out as zero — a legitimate default that must not be confused with the illegal zero offered inside the configuration option. During operation, the expected peer value, or its valid unnegotiated zero, is different evidence from the local endpoint's own value; an unrelated value suggests a different peer is on the line.

None of this proves an IP route works, a service is healthy, or the fault sits in a particular rack. These are link-control observations, and they stay that way.

Numbers are not credentials

The IANA PPP registry lists Magic-Number as LCP configuration option type 5, six octets including type and length, four left for the value. Authentication-Protocol is a separate option, type 3.

The registry hands out shared meanings for option types. It does not allocate anyone's Magic-Number. No operator needs a global reservation before choosing a fresh local marker, and a registry entry is no evidence that a given link supports the option at all.

Authentication rests on something else entirely. The August 1996 RFC 1994, describing CHAP, builds a response from a challenge and a shared secret. The contrast is about the division of duties, not an invitation to deploy a legacy authentication algorithm today.

Magic-Number is visible state, not secret-dependent proof. A frame check, a locally distinct marker and an authenticated peer should never be melted down into one comfortable "link good" label.

Detection ends; policy begins

RFC 1661 declines to specify recovery. It sketches the options — treat the link as Down and reopen it, or use Echo traffic to watch the reflection end where state permits — and imposes no universal restart count or timeout.

That boundary is the economy of the design. Two endpoints need common rules for reading the negotiation. They do not need identical operational costs or identical reflexes when something looks wrong.

Four bytes, properly situated, could say one specific thing. Calling them magic never excused anyone from explaining what they could not say.