Link layer
All the physical layer does is convey bits over the power line. The link layer is responsible for conveying information from one device to another, including providing mechanisms for framing messages and rules for sending and receiving messages.
The first task the link layer must accomplish is to mark the start of each message so the receiver can reliably know where in a bit stream the actual message starts. X-10 does this with a unique start code (Figure 4), a signal pattern that cannot occur within a message. That start code is the sequence tone-tone-tone-no tone (1110) transmitted on sequential half cycles, starting at a rising voltage zero crossing. The first two zero crossings — the first full waveform cycle — are an invalid sequence, violating the requirement that the complement of a rising voltage zero crossing be transmitted on the following zero crossing. The second full cycle is a valid sequence, representing a one bit. Including an invalid sequence in the start code, an instance of what is more generally called out-of-band signaling, ensures that no error-free message can be mistaken for a start code.

FIGURE 4: X-10 start code
Nine bits of data immediately follow the start code in the subsequent nine cycles, as shown in Figure 5. The information in the message is comprised of four bits of house code, followed by five bits of key number or function code. The house code is simply a group address, while the key number identifies the specific device within the group. Function codes are operations such as on or off.

FIGURE 5: X-10 standard message format
In another layer of error detection, every message gets transmitted twice. Ordinary messages should have three full empty cycles between messages, but bright/dim commands should be sequential, with no intervening empty cycles.