# TDMA on Gnu Radio

**URL:** <https://www.ruby-forum.com/t/tdma-on-gnu-radio/240209>\
**Category:** GNU Radio\
**Created:** [April 2, 2014, 11:47am UTC](https://www.ruby-forum.com/t/tdma-on-gnu-radio/240209 "2014-04-02T11:47:39Z")\
**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:** [April 2, 2014, 11:47am UTC](https://www.ruby-forum.com/t/tdma-on-gnu-radio/240209/1 "2014-04-02T11:47:39Z")

</div>

Hi everyone,

I have several USRP N210 and I want all of them to transmit using the  
same  
frequency. Since I cannot use FDMA (this is one of my requirements, not  
a  
GNU Radio/USRP limitation) then I thought I would give TDMA a try.

I want to be able to tell a node not to transmit when it is not its turn  
and to transmit when its turn comes up. I saw the tag feature of GNU  
Radio  
(tx\_sob, tx\_eob in particular) but I do not know how to use them from my  
python flowgraph.

I tried using pre-cog which compiles fine but some blocks seem to be  
missing because of grextras which doesn’t even pass the cmake step with  
my  
GR3.7.3 install.

Any pointers on this would be appreciated,  
Thanks

---

<div class="post-metadata">

**Author:** ![Jawad\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@Jawad\_S](https://www.ruby-forum.com/u/Jawad_S)\
**Post date:** [April 2, 2014, 1:42pm UTC](https://www.ruby-forum.com/t/tdma-on-gnu-radio/240209/2 "2014-04-02T13:42:08Z")

</div>

On 04/02/2014 11:46 AM, Jawad S. wrote:

> Hi everyone,
> 
> I have several USRP N210 and I want all of them to transmit using the  
> same frequency. Since I cannot use FDMA (this is one of my requirements,  
> not a GNU Radio/USRP limitation) then I thought I would give TDMA a try.
> 
> I want to be able to tell a node not to transmit when it is not its turn  
> and to transmit when its turn comes up. I saw the tag feature of GNU  
> Radio (tx\_sob, tx\_eob in particular) but I do not know how to use them  
> from my python flowgraph.

Are you only using stock GNU Radio blocks?

If you have your own blocks, it’s really simple: Just insert a tx\_sob on  
the first sample of any burst, and a tx\_eob on the last.

Martin

---

<div class="post-metadata">

**Author:** ![Jawad\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@Jawad\_S](https://www.ruby-forum.com/u/Jawad_S)\
**Post date:** [April 2, 2014, 1:47pm UTC](https://www.ruby-forum.com/t/tdma-on-gnu-radio/240209/3 "2014-04-02T13:47:24Z")

</div>

Yes I am using only stock GNU Radio blocks.

I don’t mind creating my own block for this, I just want to be sure that  
there is no easier way that already exists say in GRC or through a  
python  
wrapper (maybe using pmt).

2014-04-02 13:40 GMT+02:00 Martin B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Jawad\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@Jawad\_S](https://www.ruby-forum.com/u/Jawad_S)\
**Post date:** [April 2, 2014, 1:50pm UTC](https://www.ruby-forum.com/t/tdma-on-gnu-radio/240209/4 "2014-04-02T13:50:54Z")

</div>

On 04/02/2014 01:45 PM, Jawad S. wrote:

> Yes I am using only stock GNU Radio blocks.
> 
> I don’t mind creating my own block for this, I just want to be sure that  
> there is no easier way that already exists say in GRC or through a  
> python wrapper (maybe using pmt).

We are currently working on a solution which will make gr-uhd understand  
length tags. Until then, you’ll need to add blocks in there to do that.

MB

---

<div class="post-metadata">

**Author:** ![Jawad\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@Jawad\_S](https://www.ruby-forum.com/u/Jawad_S)\
**Post date:** [April 2, 2014, 1:56pm UTC](https://www.ruby-forum.com/t/tdma-on-gnu-radio/240209/5 "2014-04-02T13:56:45Z")

</div>

Ok, thanks for the quick reply, this clarifies things for me.

2014-04-02 13:49 GMT+02:00 Martin B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Jawad\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@Jawad\_S](https://www.ruby-forum.com/u/Jawad_S)\
**Post date:** [April 2, 2014, 2:35pm UTC](https://www.ruby-forum.com/t/tdma-on-gnu-radio/240209/6 "2014-04-02T14:35:18Z")

</div>

Jawad,

I though I’d add a few more comments:

_gr-mac_  
Much of the functionality of pre-cog has been ported to gr-mac, which  
works  
with “core” features of gnuradio like the new message passing API.  
_We’ve  
also added a burst\_tagger block that converts length tags to  
tx\_sob/tx\_eob  
tags as Martin suggests._

Of course, for real TDMA you will need to add tx\_time tags, in addition  
to  
adding the tx\_sob (doesn’t actually do much IIRC) and tx\_eob flags  
(makes  
the Tx switch off quickly after tx). tx\_time tells the USRP exactly when  
to  
start streaming and the value you assigned here would take into  
consideration slots, guard intervals, interface latency, processing  
jitter,  
etc. The block that adds these tags will also have to track time and  
schedule when these tags are added and samples go out.

If you plan to make a TDMA block, perhaps you can contribute that back  
to  
community through gr-mac. Balint and I were also planning to develop  
one,  
but I can’t make any specific promises on out timeline. We certainly  
welcome and encourage more contributions! You can see my GRCon13  
presentation for more information on how tx\_eob/time tags work, and how  
the  
FHSS/TDMA designs worked (could be vastly improved):  
[http://gnuradio.squarespace.com/storage/grcon13\_presentations/grcon13\_malsbury\_phy\_mac\_primer.pdf](http://gnuradio.squarespace.com/storage/grcon13_presentations/grcon13_malsbury_phy_mac_primer.pdf)

[https://github.com/jmalsbury/gr-mac](https://github.com/jmalsbury/gr-mac)

> **[GitHub - balint256/gr-mac: Easy-to-use MAC-layer implementations for GNU Radio.](https://github.com/balint256/gr-mac)**
>
> Easy-to-use MAC-layer implementations for GNU Radio. - GitHub - balint256/gr-mac: Easy-to-use MAC-layer implementations for GNU Radio.

_An Alternative Way to do Tags_

If you know that your radios will always transmit with the same packet  
length, even if those packets are “preamble/fillter” packets with no  
useful  
data, then you could do the following:

- Each USRP gets two antennas and runs in full duplex, and would be  
synchronized in time with PPS or a GPSDO with visibility to the GPS  
system
- On the transmit side, the transmit stream would run continuously
- Use offset LO tuning
- Interleave 0-samples with the useful transmitted data to reduce the  
null output of the quadrature modulator

This approach isn’t the cleanest and might come with some minor  
penalties  
like inflexibility, and the presence of a low, unmodulated carrier from  
LO  
leakage/DC offset. But this would require less knowledge of tags and  
custom block development.

_GR-Extras and Pre-Cog_  
Use GNU Radio 3.6 and some older commit from gr-extras, like  
4bbb1cf01a8ac35a989bc2468fd0ccd384dede45. This is not recommended as  
the  
community won’t be able to provide the same level of support as we can  
with  
3.7.

Best Regards,  
John M.  
Ettus R.
