# Generating Custom Packet Header

**URL:** <https://www.ruby-forum.com/t/generating-custom-packet-header/241340>\
**Category:** GNU Radio\
**Created:** [March 30, 2015, 8:53pm UTC](https://www.ruby-forum.com/t/generating-custom-packet-header/241340 "2015-03-30T20:53:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [March 30, 2015, 8:53pm UTC](https://www.ruby-forum.com/t/generating-custom-packet-header/241340/1 "2015-03-30T20:53:26Z")

</div>

Hello everyone,

I’ve made the default packet generator work for my radio. I now want to  
make a custom header. The difference is described below:

_GNU Radio Default Header:_ [Payload Length (12 bits) | Packet Number  
(12  
bits) | CRC (12 bits)]

_My Custom Header:_ [ Sync Bits (1010101…) (128 bits) | PN Sequence  
(16  
bit) | PN Sequence (16 bit) | Payload Length (16 bits) ]

I am using my header for synchronization only. I don’t want the CRC  
check  
in there and I don’t want packet numbers.

My understanding of how to attack this is as follows:  
_1)_ Customize packet\_header\_default.cc which is responsible for making  
the  
custom header object  
_2)_ No change needed for the Packet\_Header\_Generator block  
_3)_ No change needed for the Packet\_Header\_Parser block

If this is correct, how should I replace packet\_header\_default.cc with  
packet\_header\_mycustom.cc, since they are not blocks in GRC? Should I  
think  
of this the same way I would if I were making a custom GRC block, and  
follow the custom block tutorials?

Thanks,  
Rich

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [March 30, 2015, 10:38pm UTC](https://www.ruby-forum.com/t/generating-custom-packet-header/241340/2 "2015-03-30T22:38:26Z")

</div>

On 30.03.2015 11:51, Richard B. wrote:

> If this is correct, how should I replace packet\_header\_default.cc with  
> packet\_header\_mycustom.cc, since they are not blocks in GRC? Should I  
> think of this the same way I would if I were making a custom GRC block,  
> and follow the custom block tutorials?

Kind of. The SWIG magic won’t work out-of-the-box, though. Bastian’s  
gr-ieee-80211a does this, or check out how gr-digital does this.

Cheers,  
M

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [March 30, 2015, 11:57pm UTC](https://www.ruby-forum.com/t/generating-custom-packet-header/241340/3 "2015-03-30T23:57:52Z")

</div>

Are you referring to the packet\_header.i file in the swig folder of  
gr-digital? Are there other spots that need to be changed as well?

Rich

On Mon, Mar 30, 2015 at 1:36 PM, Martin B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![reback](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@reback](https://www.ruby-forum.com/u/reback)\
**Post date:** [March 31, 2015, 8:47pm UTC](https://www.ruby-forum.com/t/generating-custom-packet-header/241340/4 "2015-03-31T20:47:21Z")

</div>

On 30.03.2015 14:56, Richard B. wrote:

> Are you referring to the packet\_header.i file in the swig folder of  
> gr-digital? Are there other spots that need to be changed as well?

I don’t think so. Also check Bastian’s 802.11 OOT for pointers.

M
