The Frame That Got Your Latest Meme Across City
A small story about a very busy layer of the OSI model
The internet feels like one big thing. You send a cat meme on your phone and a moment later two grey ticks appear, telling you it was delivered to your friend.
The truth: IT IS NOT THAT SIMPLE!
Your Data doesn’t make that journey in one hop. It travels from one nearby device to another; phone to Wi-Fi router, router to another router, and so on…until it reaches the destination that is, your friend’s device.
The Data Link Layer takes care of each local handoff. It doesn’t plan the packet’s entire trip, that is the network layer’s job. It just makes sure the next step works.
I find it easiest to picture a parcel being passed across a crowded campus. Each person only needs to know who should receive it next. They don’t need to know the entire route the parcel went through.
Yes, the computer network as a whole is a labyrinth, believe me. But we will go step by step to understand this.
First, give the packet an envelope
Our courier boy (the link layer) can not deliver a loose packet to the receiver, just like an Amazon delivery person can not deliver an unsealed package to us. So, it needs a frame i.e. a link-specific envelope with information such as who sent it, who should receive it and what the payload contains.
The receiving device opens the frame and passes the payload up. A switch can read the local destination address and pass the frame forward through the correct port, think of it like a gate that will help you reach your home, not anyone else’s.
One thing to remember, though, is that the exact frame format changes with the link. For example, a wired Ethernet frame is not the same as a Wi-Fi frame.
Did the road shake the message?
Bits can be changed by cables, radio interference and electrical noise. To provide the receiving end with the ability to detect damage to the frame, frames generally carry additional bits.
A basic 1-D parity check will append a bit to ensure that the number of 1s in a sequence is either even or odd. This is a way of checking for errors, however if there are two error-prone bits flipped, this form of error checking will not be able to identify those errors. A more advanced 2-D parity check will add checks horizontally (rows) and vertically (columns), which will make it possible to find and correct any errors.
A checksum acts much like a receipt for the individual bits within a message. To calculate the checksum, the sending party groups the message data into words, then performs an addition operation on all the words. This addition uses the one’s complement number system, which means that any carry over resulting from adding together two or more words is carried over to the right-hand side of the result and added back into the final result. Once the sum has been calculated, the sender will invert every bit in the sum (i.e. change all 0s to 1s and other way) and use the resulting complement as the checksum.
Real Internet checksums use 16-bit words, and RFC 1071 is used to describe how these are used in IP, UDP and TCP.
In order to provide a more rigorous and effective check of the frame level, numerous links utilize a cyclic redundancy check, frequently referred to as CRC.
For a moment now, think of the data as a long binary number and divide it by a thoughtfully chosen polynomial, the number that is left after the division, that is the ‘remainder’, it travels with the frame. The receiver performs the same kinda division. A non-zero remainder means “something changed.” That means the received item could be corrupted.
DISCLAIMER ALERT!
Though CRCs are really good at finding common errors, error detection is not magic, so it does not miraculously repair every corrupted frame or guarantee that every error is found. Therefore, keep your expectations low.
Get Varsha Rai’s stories in your inbox
Join Medium for free to get updates from this writer.
A link-layer frame check sequence is described, for example, in PPP’s HDLC-like framing specification. Check this out if you’re interested in knowing all the drama in detail!
Who gets to speak?
Imagine a group of students in a hall using a single microphone. It is likely that if each student is allowed to speak at will, their voices will coincide with each other. In a similar manner, a shared network channel also experiences interference when multiple devices attempt to transmit simultaneously.
Random Access Protocols allow devices to send data at will, but if two frames overlap on the same channel, a collision may result in having to retry sending those frames after a randomly selected amount of time. Classic Ethernet’s shared coaxial cable was one of the early examples of this type of protocol; however, even though Wi-Fi does not use physical wires like Ethernet did, Wi-Fi devices must continue to “contend” for access to the radio airwaves.
Taking turn protocols are making the microphone example more popular. A token may move around or a coordinator can ask each station if they want to speak. Only the station that has been given permission to speak will be able to do so while the remaining stations remain quiet and wait their turn to speak.
A whole street in one cable
DOCSIS, which stands for Data Over Cable Service Interface Specification, turns the neighbourhood’s shared cable into a kind of group microphone. If every home shouted at once, their signals would clash as we discussed above.
So when a cable modem has data to send, it asks the cable modem termination system (CMTS) for airtime. The CMTS acts like a patient host: it schedules a turn, announces the grant, and gives the modem a slot to send. When its turn arrives, the modem puts its data on the shared line and lets the next neighbor speak.
CableLabs documents this process in its DOCSIS specification.
When a “link” is bigger than a wire
A link, it appears, can be more than one cable between two boxes. A VLAN divides a switched network into separate logical LANs, even when they share the same physical equipment, like giving different groups their own rooms in one busy building. IEEE’s 802.1Q describes how those virtual LANs work.
MPLS takes the idea further. At the edge of an MPLS network, a router attaches a label to a packet. Routers inside the network read that label to decide where the packet goes next, thoughtfully swapping it for a new one along the way. The label is like a local direction card that guides the packet through that network, but do not mistake it for the packet’s final address. It's not that.
That’s the basic idea behind MPLS in RFC 3031.
So our cat meme’s trip wasn’t just one giant jump from phone to phone. It was a chain of small journeys here and there, through many routers. At each one, the link layer wrapped the packet in a frame, helped check for damage, helped locate errors and managed access to the next stretch of network. The stretch might be a Wi-Fi channel or a virtual path through a service provider’s network.
So, in the end, the Data Link Layer makes sure every little hop goes smoothly, helping your packet get closer to its right destination. And after all that hard work, the meme finally reaches your friend. All that networking, just for them to reply with “😭” and go offline!
Want to follow the packet trail a little further? These sources explain the details behind the blog and may even help with cutting screen time on Instagram.
- Kurose & Ross, Chapter 6: The Link Layer
- R. Braden et al., RFC 1071: Computing the Internet Checksum
- W. Simpson, ed., RFC 1662: PPP in HDLC-like Framing
- CableLabs, DOCSIS 3.1 MAC and Upper Layer Protocols specification
- IEEE 802.1, 802.1Q Bridges and Bridged Networks
- E. Rosen et al., RFC 3031: Multiprotocol Label Switching Architecture





