04 Try it yourself Interactive
The payload is fourteen bits, 01111110011010, and it was chosen for one reason: its first eight bits are the flag pattern. Sent raw it would close the frame six bits early and the receiver would throw the rest away. Sender walks the fourteen bits one at a time, counting consecutive 1s, and when the count reaches five it inserts a 0 and resets, producing the fifteen bits 011111010011010. Receiver walks those fifteen bits with the same counter and removes the 0 that follows five 1s. The last step of the receiver run puts the recovered bits and the original side by side and compares them in code, not in prose. Nothing plays on its own: Next, Back and Reset, or the arrow keys.