A toy TLS record boundary is not a production TLS parser.

highlighted = computed this step

This is only a toy record boundary

This example checks content type 22, length 4, and the tiny payload marker.

22,422,4
Toy record boundaryThe header length separates the record header from the payload bytes.Record header40 bits / 5 bytes0x1603030004byte 0byte 1byte 2byte 300010110000000110000001100000000byte 400000100content-type22legacy-version0x0303record-length4(cont.)Record payload32 bits / 4 bytes0x01000000byte 0byte 1byte 2byte 300000001000000000000000000000000handshake-type1remaining-payload0x000000

It does not model encryption

The payload is visible toy bytes here. This book does not model encryption or AEAD tags.

payload bytes=4\text{payload bytes}=4
Toy record boundaryThe header length separates the record header from the payload bytes.Record header40 bits / 5 bytes0x1603030004byte 0byte 1byte 2byte 300010110000000110000001100000000byte 400000100content-type22legacy-version0x0303record-length4(cont.)Record payload32 bits / 4 bytes0x01000000byte 0byte 1byte 2byte 300000001000000000000000000000000handshake-type1remaining-payload0x000000

What this does not model

NOTE: toy TLS record header and payload-boundary example only; not encryption, AEAD tags, key schedule, certificate validation, fragmentation or coalescing behavior, middlebox behavior, or production TLS parsing.

header bytes=5\text{header bytes}=5
Toy record boundaryThe header length separates the record header from the payload bytes.Record header40 bits / 5 bytes0x1603030004byte 0byte 1byte 2byte 300010110000000110000001100000000byte 400000100content-type22legacy-version0x0303record-length4(cont.)Record payload32 bits / 4 bytes0x01000000byte 0byte 1byte 2byte 300000001000000000000000000000000handshake-type1remaining-payload0x000000

Summary

A TLS record carries a checked length; this toy lesson stops at that byte boundary.

record bytes=9\text{record bytes}=9
Toy record boundaryThe header length separates the record header from the payload bytes.Record header40 bits / 5 bytes0x1603030004byte 0byte 1byte 2byte 300010110000000110000001100000000byte 400000100content-type22legacy-version0x0303record-length4(cont.)Record payload32 bits / 4 bytes0x01000000byte 0byte 1byte 2byte 300000001000000000000000000000000handshake-type1remaining-payload0x000000