# How does benchmark\_rx.py know the packet size?

**URL:** <https://www.ruby-forum.com/t/how-does-benchmark-rx-py-know-the-packet-size/214642>\
**Category:** GNU Radio\
**Created:** [December 8, 2011, 8:08am UTC](https://www.ruby-forum.com/t/how-does-benchmark-rx-py-know-the-packet-size/214642 "2011-12-08T08:08:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [December 8, 2011, 8:08am UTC](https://www.ruby-forum.com/t/how-does-benchmark-rx-py-know-the-packet-size/214642/1 "2011-12-08T08:08:54Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Songsong\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/49beb7/32.png) [@Songsong\_G](https://www.ruby-forum.com/u/Songsong_G)\
**Post date:** [December 8, 2011, 11:07am UTC](https://www.ruby-forum.com/t/how-does-benchmark-rx-py-know-the-packet-size/214642/2 "2011-12-08T11:07:44Z")

</div>

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
