The record length is checked against the payload byte count.

highlighted = computed this step

The length matches the payload bytes

The header says payload length 4, and the payload has 4 bytes.

4=44=4
Length matches payloadThe 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

The full record is nine bytes

Total bytes are header 5 plus payload 4.

5+4=95+4=9
Length matches payloadThe 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

A wrong length would not pass

The source helper rejects the record if the length field and payload byte count disagree.

length=4\text{length}=4
Length matches payloadThe 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

The length field gives the receiver a checked boundary for this record.

total bytes=9\text{total bytes}=9
Length matches payloadThe 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