How does benchmark_rx.py know the packet size?

When I run benchmark_tx.py, the packet size has to be specified (default
is
1500)
However, I could see nothing defining the packet size on benchmark_rx.py

In benchmark_rx.py, messages from benchmark_tx.py are queued after
passing
demodulator, correlator, and framer sink.
But, I’m wondering that how can the receiver queue a message which has
the
exact size defined by the transmitter without defining the packet size
on
the receiver.

Are there any steps or procedures inside the demodulator, correlator, or
framer sink that recognize the start and the end of the packet?

Song,

Every transmitted pkt has structure
preamble:access_code:header:payload_with_crc:’\x55’
header consists of 2 16-bit shorts, having payload length and whitener
offset.
On receiver side “framer sink” extracts the payload depending upon the
value of header (2 shorts).
see “packet_utils.py” and doxygen doc of “gr_framer_sink”

-Adeel