> For the complete documentation index, see [llms.txt](https://alex-robenko.gitbook.io/commsdsl-specification/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alex-robenko.gitbook.io/commsdsl-specification/frames/sync.md).

# sync Layer

The **\<sync>** layer represents synchronization bytes, usually (but not always) present at the beginning of the [frame](/commsdsl-specification/frames.md).

```
<?xml version="1.0" encoding="UTF-8"?>
<schema endian="big" ...>
    <frame name="ProtocolFrame">
        <sync name="Sync">
            <int name="SyncField" type="uint16" defaultValue="0xabcd">
                <validValue value="0xabcd" />
                <failOnInvalid value="true" />
            </int>
        </sync>
        <size name="Size">
            <int name="SizeField" type="uint16" />
        </size>
        <id name="Id">
            <int name="IdField" type="uint8" />  
        </id>
        <payload name="Data" />
    </frame>
</schema>
```

The example below implements `SYNC (2 bytes) | ID (2 bytes) | SIZE (2 bytes) | PAYLOAD` framing where `SYNC` must be `0xab 0xcd` bytes. Note, that read of the `SyncField` will fail in case its read value is not `0xabcd`.

The **\<sync>** layer doesn't have any extra properties in addition to [common](/commsdsl-specification/frames/common.md) ones.
