# How does Packet Header Generator module handle tags

**URL:** <https://www.ruby-forum.com/t/how-does-packet-header-generator-module-handle-tags/231081>\
**Category:** GNU Radio\
**Created:** [July 20, 2014, 2:58pm UTC](https://www.ruby-forum.com/t/how-does-packet-header-generator-module-handle-tags/231081 "2014-07-20T14:58:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [July 20, 2014, 2:58pm UTC](https://www.ruby-forum.com/t/how-does-packet-header-generator-module-handle-tags/231081/1 "2014-07-20T14:58:20Z")

</div>

Hi Experts,  
I was reading tx\_ofdm.py. I found this module use  
‘set\_tag\_propagation\_policy(TPP\_DONT)’ to handle tags by itself, but I  
cann’t find the code that used to handle tag in this module.  
I knew this module will call ‘packet\_header\_ofdm.header\_formatter()’ and  
‘packet\_header\_default.header\_formatter()’, but I also cann’t find the  
handle tag code in these functions.  
Anyone can help me figure out where does this module process tags?

Thanks  
Tiankun

---

<div class="post-metadata">

**Author:** ![Tiankun\_Hu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/46a35a/32.png) [@Tiankun\_Hu](https://www.ruby-forum.com/u/Tiankun_Hu)\
**Post date:** [July 20, 2014, 3:17pm UTC](https://www.ruby-forum.com/t/how-does-packet-header-generator-module-handle-tags/231081/2 "2014-07-20T15:17:31Z")

</div>

Hi Tiankun,

what’s your GNU Radio version [1]? Where did you find that tx\_ofdm.py?  
There is no tx\_ofdm.py in my GNU Radio source tree (in none of v3.7.4,  
v3.6.5 or v3.4.2). There is a tx\_ofdm.grc, which can be used to generate  
a tx\_ofdm.py, but that does not (and shouldn’t) contain a  
“set\_tag\_propagation\_policy” line.

Greetings,  
Marcus

[1] you can find out by running “gnuradio-config-info -v”

---

<div class="post-metadata">

**Author:** ![Tiankun\_Hu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/46a35a/32.png) [@Tiankun\_Hu](https://www.ruby-forum.com/u/Tiankun_Hu)\
**Post date:** [July 20, 2014, 3:52pm UTC](https://www.ruby-forum.com/t/how-does-packet-header-generator-module-handle-tags/231081/3 "2014-07-20T15:52:01Z")

</div>

Hi Marcus,  
My tx\_ofdm.py is gen by tx\_ofdm.grc, there are a  
‘packet\_headergenerator\_bb’ module in it. This module use  
‘set\_tag\_propagation\_policy(TPP\_DONT)’ to handle tags by itself.  
I didn’t find any code has touch tags in this module, but when I connect  
it to Tag Debug module, I can find the tags output.  
In my opinion, if one module use ‘set\_tag\_propagation\_policy(TPP\_DONT)’,  
and it does not handle it, tags will not pass down.

Thanks  
Tiankun

于 2014年07月20日 21:15, Marcus Müller 写道:

---

<div class="post-metadata">

**Author:** ![Tiankun\_Hu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/46a35a/32.png) [@Tiankun\_Hu](https://www.ruby-forum.com/u/Tiankun_Hu)\
**Post date:** [July 20, 2014, 4:56pm UTC](https://www.ruby-forum.com/t/how-does-packet-header-generator-module-handle-tags/231081/4 "2014-07-20T16:56:22Z")

</div>

Hi Tiankun,

On 20.07.2014 15:50, hutiantian wrote:

> Hi Marcus,  
> My tx\_ofdm.py is gen by tx\_ofdm.grc, there are a  
> ‘packet\_headergenerator\_bb’ module in it. This module use  
> ‘set\_tag\_propagation\_policy(TPP\_DONT)’ to handle tags by itself.  
> Ah ok!  
> I didn’t find any code has touch tags in this module, but when I  
> connect it to Tag Debug module, I can find the tags output.  
> This is indeed strange. However, packet\_headergenerator\_bb is a subclass  
> of tagged\_stream\_block [1].

> In my opinion, if one module use  
> ‘set\_tag\_propagation\_policy(TPP\_DONT)’, and it does not handle it,  
> tags will not pass down.  
> That’s generally correct, but there’s the tagged stream block exception:  
> [1], “A note on tag propagation” tells us that one most of the time  
> would use TPP\_DONT to handle all non-length tags, whilst length tags are  
> always passed forward.

Hope that helped!

Greetings,  
Marcus

[1] [http://gnuradio.org/doc/doxygen/page\_tagged\_stream\_blocks.html](http://gnuradio.org/doc/doxygen/page_tagged_stream_blocks.html)

---

<div class="post-metadata">

**Author:** ![Tiankun\_Hu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/46a35a/32.png) [@Tiankun\_Hu](https://www.ruby-forum.com/u/Tiankun_Hu)\
**Post date:** [July 21, 2014, 11:55am UTC](https://www.ruby-forum.com/t/how-does-packet-header-generator-module-handle-tags/231081/5 "2014-07-21T11:55:57Z")

</div>

Before myths about tagged stream blocks start perpetuating the webs:  
TPP\_DONT on a tagged stream blocks does the same as on any other type of  
block; however, TSB tags still get through.

A closer inspection of packet\_headergenerator\_bb (either by reading the  
source code or the manual page  
([GNU Radio Manual and C++ API Reference: gr::digital::packet\_headergenerator\_bb Class Reference](http://gnuradio.org/doc/doxygen/classgr_1_1digital_1_1packet __headergenerator__ bb.html#details))  
reveals that the actual processing is done in a separate kernel, the  
header formatter object, which is user-defined. See  
packet\_header\_default for an example.

M

---

<div class="post-metadata">

**Author:** ![Tiankun\_Hu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/46a35a/32.png) [@Tiankun\_Hu](https://www.ruby-forum.com/u/Tiankun_Hu)\
**Post date:** [July 21, 2014, 2:05pm UTC](https://www.ruby-forum.com/t/how-does-packet-header-generator-module-handle-tags/231081/6 "2014-07-21T14:05:52Z")

</div>

Hi Martin,  
What’s the TSB tags? Does the tags have the different types? I think the  
tags just a pair of key-value.

Thanks  
Tiankun

于 2014年07月21日 17:54, Martin B. 写道:

---

<div class="post-metadata">

**Author:** ![Tiankun\_Hu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/46a35a/32.png) [@Tiankun\_Hu](https://www.ruby-forum.com/u/Tiankun_Hu)\
**Post date:** [July 21, 2014, 1:54pm UTC](https://www.ruby-forum.com/t/how-does-packet-header-generator-module-handle-tags/231081/7 "2014-07-21T13:54:58Z")

</div>

Hi Marcus,  
What’s the “non-length tags” mean? the “length tags” you mentioned is  
that input parameter, right? I only find this one tags.  
When I remove ‘set\_tag\_propagation\_policy(TPP\_DONT)’, this module seems  
still works fine. Why should we need set this flag in this module?

Thanks  
Tiankun

于 2014年07月20日 22:54, Marcus Müller 写道:

---

<div class="post-metadata">

**Author:** ![Tiankun\_Hu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/46a35a/32.png) [@Tiankun\_Hu](https://www.ruby-forum.com/u/Tiankun_Hu)\
**Post date:** [July 22, 2014, 10:52am UTC](https://www.ruby-forum.com/t/how-does-packet-header-generator-module-handle-tags/231081/8 "2014-07-22T10:52:55Z")

</div>

On 07/21/2014 02:04 PM, hutiantian wrote:

> Hi Martin,  
> What’s the TSB tags? Does the tags have the different types? I think the  
> tags just a pair of key-value.

[http://gnuradio.org/doc/doxygen/page\_tagged\_stream\_blocks.html](http://gnuradio.org/doc/doxygen/page_tagged_stream_blocks.html)

M
