What is encoding in the context of the Physical Layer and what is an example encoding method?
Encoding converts the raw bit stream into a predictable pattern the next device can recognize; e.g. Manchester encoding represents bits by voltage transitions (and carries clocking along the way).
A receiver cannot just be handed raw 1s and 0s — it needs the bits laid out in a predictable pattern it knows how to read back. Encoding is the step that converts the stream of bits into exactly such a format, recognizable by the next device in the network path. The specific method used depends on the type of media, because a pattern that works on copper voltage looks nothing like one carried on light or radio.
* In Manchester encoding every bit has a transition in the middle of its period — 1 = low→high, 0 = high→low — so the receiver recovers the clock straight from the data. *
Manchester encoding (used in older Ethernet) is a classic example. Instead of holding a steady high or low voltage for each bit, it represents a bit by a transition in the middle of the bit period: a "0" is a high-to-low transition and a "1" is a low-to-high transition. The clever part — and why it matters — is that because there is a guaranteed transition in every single bit, the receiver can recover the sender's clock straight from the signal. There is no need for a separate clock wire; the timing rides along inside the data, keeping sender and receiver in sync.
Go deeper:
-
Manchester code — Wikipedia — the self-clocking line code in detail, including its use in early Ethernet.
-
Line coding techniques — TechnologyUK — Manchester vs NRZ and friends, with waveform diagrams and the clock-recovery rationale.
-
Line code — Wikipedia — the wider family of encodings that turn bits into media patterns.