4.3.4 · D1Computer Networks

Foundations — Data link layer — framing, error detection (CRC computation), MAC

2,059 words9 min readBack to topic

Before you can read the parent note, you need to own every symbol it throws at you. This page builds each one from absolute zero, in the order they depend on each other. Nothing here is assumed.


0. What is a bit? What is a stream?

The picture: imagine beads sliding down a wire one at a time. Each bead is black () or white (). Nobody hands you a "this word ends here" card — that is exactly the problem the whole chapter solves.

Why the topic needs it: the Physical Layer delivers only this raw stream. Every later idea — a frame, a check-bit, a collision — is something we bolt onto this featureless line of beads.


1. Grouping bits: byte, frame, payload

The picture: a train. The locomotive at the front is the START flag, the caboose at the back is the END flag / check field, and the boxcars in the middle are the payload bytes.

Why the topic needs it: "framing" literally means drawing the envelope around a run of bits so the receiver knows where the letter begins and ends.


2. Hexadecimal — reading bytes without going cross-eyed

Why the topic needs it: flag bytes (0x7E), escape bytes (0x7D), and 48-bit MAC addresses (AA:BB:CC:DD:EE:FF) are all written in hex. Without hex the numbers are unreadable walls of bits.


3. XOR — the only arithmetic CRC uses

The key surprise is the last one: . There is no carry — unlike ordinary addition where . This "add with no carry" is the entire engine of CRC.

Why the topic needs it: CRC long division is identical to ordinary long division except every "subtract" step is an XOR. Master XOR and the scary division becomes bookkeeping.


4. GF(2) — a tiny number-world with just

The picture: a light switch world. Addition = flip if the other is on. Multiplication = light only if both switches are on.

Why the topic needs it: treating bits as GF(2) numbers is what lets us do algebra on frames. Full detail lives in Polynomials over GF(2); here you only need "add = XOR, no carries".


5. Polynomials as bit strings

The picture: a row of slots labelled . Each slot is either lit (, term present) or dark (, term absent).

Why the topic needs it: the whole CRC recipe is stated in this language — , , , "". If you can flip between 1101 and in your head, the parent's derivation reads like plain English.


6. The named polynomials:

Now every symbol in the CRC section, decoded:

The picture: a rack of boxcars shoved positions to the left, leaving empty flatbeds at the back — later we load the FCS onto them.


7. Divisibility and "remainder "

Why the topic needs it: the receiver's entire test is "divide by , is the remainder ?". A remainder means the frame is a clean multiple of → assume no error. Any nonzero remainder → definite error. This is why we bothered to make divisible in the first place.


8. The MAC symbols: , , ,


Prerequisite map

Bit and bit stream

Byte and frame

Hex notation

XOR

GF2 arithmetic

Bits as polynomials

Degree and shift

M G R Q T E

Divisibility mod G

Framing flags and MAC address

Timing tau B L k

CRC error detection

Framing and MAC

Data Link Layer topic

Every foundation on this page feeds one of the three parent jobs, which merge into the topic. Return now to the parent topic once these click.


Equipment checklist

Cover the right side and answer; reveal to check.

What is a bit stream and what is missing from it?
A gapless run of s and s in time, with no built-in markers for where messages start or end.
Convert 0x7E to binary.
01111110 — the bit-stuffing flag pattern.
State the four XOR results.
, , , (no carry).
Why is XOR both addition and subtraction in GF(2)?
Because , so applying it twice undoes it — one operation plays both roles.
Write 10110 as a polynomial.
.
What is of a polynomial, in bit terms?
The position of the left-most -bit (counting from on the right); a degree- polynomial fills slots.
What do , , , stand for?
Message, generator (fixed divisor), remainder/FCS, transmitted frame .
What does multiplying by do to the bits?
Shifts them places left and appends zeros — parking spaces for the check bits.
When is a frame "divisible by "?
When dividing leaves remainder , i.e. the frame is an exact multiple .
What do , , , mean?
One-way propagation delay, bit-rate, frame length in bits, collision counter for backoff.
Why does ?
Transmit-time must be at least the round-trip so the sender is still talking when the collision echo returns.
Recall Quick self-test: could you re-derive

using only §3 and §6? (division). Append : . By §3, , so — an exact multiple. If you followed that, you're ready.