[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] gr-extras: tuntap : How to use ?
From: |
Josh Blum |
Subject: |
Re: [Discuss-gnuradio] gr-extras: tuntap : How to use ? |
Date: |
Wed, 03 Oct 2012 10:57:46 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 |
On 10/03/2012 10:21 AM, Iain Young, G7III wrote:
> Hi Folks,
>
> Finally getting around to playing with some of the stuff in gr-extras.
>
> Having compiled 3.6.2, and the extras, I found the tuntap block, and
> was hoping to use it to implement some RF Networking with the GMSK
> modules.
>
> I found the tuntap block, and noticed that it had an input and output.
> I was expecting my flowgraph to take the userspace end of the network
> interface, with the other end being the network device.
>
> I found the presentation from the recent conference on a basic MAC
> layer, and that seemed to imply the input could be almost anything,
> but didn't leave me any the wiser as to exactly how to use it.
>
Basically, the TUN/TAP block was there for the purposes of replacing
tunnel.py. Few people *actually* want to pipe stuff through a virtual
ethernet interface.
For the example, we will probably replace that block with the "socket
msg" block. You can just open netcat on the host/port and use it like a
wireless IM chat session :-) There will soon be a demonstration video w/
the MAC layer stuff presented.
> What I was hoping to do was essentially this (and a similiar) RX chain:
>
> tuntap --> packet framer --> GMSK_Mod --> USRP
>
Instead, try the "socket to blob" block. Outside the flowgraph, open a
socket and send packets.
> But the input to the tuntap block has confused me. Can I just give
> it a Null source ? (With the block picking up data from the network
> device ?)
>
>
I pushed a change adding <optional>1</optional> to the input and output
ports. You shouldnt need to actually connect.
> Also, even when connecting it to a source, I seem to have another
> issue, as I get this error at runtime:
>
> RuntimeError: gr_make_tuntap: tun_alloc failed
>
> Despite having the /dev/net/tun device, and it being writable by the
> user running the flow graph. This happens if I specify "Automatic" or
> a specific network device.
>
> Anyone want to point me in the right direction ? Or even anyone have
> an example ?
>
I think you need to run as root to allocate tun/tap stuff. I copied the
tun_alloc from here: /usr/src/linux/Documentation/networking/tuntap.txt
-josh