# Questions on stream tags

**URL:** <https://www.ruby-forum.com/t/questions-on-stream-tags/240886>\
**Category:** GNU Radio\
**Created:** [May 5, 2014, 9:57am UTC](https://www.ruby-forum.com/t/questions-on-stream-tags/240886 "2014-05-05T09:57:47Z")\
**Posts on this page:** 6\
**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:** [May 5, 2014, 9:57am UTC](https://www.ruby-forum.com/t/questions-on-stream-tags/240886/1 "2014-05-05T09:57:47Z")

</div>

Dear List,

I’m new to stream tags. Could someone help me to understand about stream  
tags and know how to use it?

1. In GNU Radio Manual: “A stream tags is generated by a block’s work  
function and from there on flows the downstream…_until it reaches a  
sink_  
…”.  
If we use tags to tell the USRP Sink to start/stop the TX chain, do we  
need  
to modify the USRP Sink block?  
I found that gr\_uhd\_usrp\_sink.cc file contains the get\_tags\_in\_range()  
function. However, this file is not, at first, in the GNU Radio 3.7.0  
source folder. How to add this to project and make it work with USRP  
Sink?

2. I am implementing a model of ofdm-based two-way relaying network  
apply  
network coding. Up to now, each single transmission in one time slot are  
done, but the model runs without any timing synchronization. For this, I  
need to use TDMA, and stream tags is the solution. I list here the steps  
to  
make TDMA with stream tags. Could you leave some comments if I miss some  
thing?

- Add tags to stream; using provided block such as PDU to Tagged Stream,  
or  
custom block.
- Write a block for error checking, repeat request…

Sorry if my questions are silly.

Thanks,  
Hoang

---

<div class="post-metadata">

**Author:** ![Hoang\_Ngo\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/97f17d/32.png) [@Hoang\_Ngo\_K](https://www.ruby-forum.com/u/Hoang_Ngo_K)\
**Post date:** [May 5, 2014, 2:59pm UTC](https://www.ruby-forum.com/t/questions-on-stream-tags/240886/2 "2014-05-05T14:59:03Z")

</div>

On 05.05.2014 09:56, Hoang Ngo K. wrote:

> Dear List,
> 
> I’m new to stream tags. Could someone help me to understand about stream  
> tags and know how to use it?

Remember that we have a lot tag debugging tools available, such as the  
QT GUI Time Sink and tag debug.

> 1. In GNU Radio Manual: “A stream tags is generated by a block’s work  
> function and from there on flows the downstream…_until it reaches a  
> sink_…”.  
> If we use tags to tell the USRP Sink to start/stop the TX chain, do we  
> need to modify the USRP Sink block?

Probably not… are you talking about tx\_sob and tx\_eob?

> I found that gr\_uhd\_usrp\_sink.cc file contains the get\_tags\_in\_range()  
> function. However, this file is not, at first, in the GNU Radio 3.7.0  
> source folder. How to add this to project and make it work with USRP Sink?

Look in gr-uhd/, there it is.

> 1. I am implementing a model of ofdm-based two-way relaying network  
> apply network coding. Up to now, each single transmission in one time  
> slot are done, but the model runs without any timing synchronization.  
> For this, I need to use TDMA, and stream tags is the solution. I list  
> here the steps to make TDMA with stream tags. Could you leave some  
> comments if I miss some thing?
> 
> - Add tags to stream; using provided block such as PDU to Tagged Stream,  
> or custom block.
> - Write a block for error checking, repeat request…

Seems right. You shouldn’t need other blocks to control UHD.

M

---

<div class="post-metadata">

**Author:** ![Hoang\_Ngo\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/97f17d/32.png) [@Hoang\_Ngo\_K](https://www.ruby-forum.com/u/Hoang_Ngo_K)\
**Post date:** [May 6, 2014, 4:45am UTC](https://www.ruby-forum.com/t/questions-on-stream-tags/240886/3 "2014-05-06T04:45:19Z")

</div>

Hi Martin, and all,

I meant, I want to add tx\_sob and tx\_eob to tell the USRP Sink to  
start/stop the TX chain. I intend to add tags before the modulation,  
where  
data type is \*byte. \*Since the provided block PDU to Tagged Stream takes  
message as input, I guess I need to make my own block(s).

---

<div class="post-metadata">

**Author:** ![Hoang\_Ngo\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/97f17d/32.png) [@Hoang\_Ngo\_K](https://www.ruby-forum.com/u/Hoang_Ngo_K)\
**Post date:** [May 6, 2014, 9:37am UTC](https://www.ruby-forum.com/t/questions-on-stream-tags/240886/4 "2014-05-06T09:37:57Z")

</div>

On 06.05.2014 04:44, Hoang Ngo K. wrote:

> Hi Martin, and all,
> 
> I meant, I want to add tx\_sob and tx\_eob to tell the USRP Sink to  
> start/stop the TX chain. I intend to add tags before the modulation,  
> where data type is /byte. /Since the provided block PDU to Tagged Stream  
> takes message as input, I guess I need to make my own block(s).

On current master, you can also pipe the tagged stream straight into the  
uhd sink.

M

---

<div class="post-metadata">

**Author:** ![Hoang\_Ngo\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/97f17d/32.png) [@Hoang\_Ngo\_K](https://www.ruby-forum.com/u/Hoang_Ngo_K)\
**Post date:** [May 6, 2014, 12:21pm UTC](https://www.ruby-forum.com/t/questions-on-stream-tags/240886/5 "2014-05-06T12:21:41Z")

</div>

Sorry, I didn’t really get what you meant by “pipe the tagged stream  
straight into the uhd sink”.

---

<div class="post-metadata">

**Author:** ![Hoang\_Ngo\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/97f17d/32.png) [@Hoang\_Ngo\_K](https://www.ruby-forum.com/u/Hoang_Ngo_K)\
**Post date:** [May 7, 2014, 9:43am UTC](https://www.ruby-forum.com/t/questions-on-stream-tags/240886/6 "2014-05-07T09:43:44Z")

</div>

On 06.05.2014 12:18, Hoang Ngo K. wrote:

> Sorry, I didn’t really get what you meant by “pipe the tagged stream  
> straight into the uhd sink”.

If you put tagged streams into the UHD sink it’ll understand that (and  
add eob automatically).

M
