Tunnel.py command not working

HI,
I am using tunnel.py command to setup a TCP/IP link between two usrp1.
When i try to use the command , i get this error

./tunnel.py
linux; GNU C++ version 4.6.3; Boost_104800; UHD_003.005.001-29-g3cb515f7

Traceback (most recent call last):
File “./tunnel.py”, line 295, in
main()
File “./tunnel.py”, line 241, in main
(tun_fd, tun_ifname) = open_tun_interface(options.tun_device_filename)
File “./tunnel.py”, line 79, in open_tun_interface
ifs = ioctl(tun, TUNSETIFF, struct.pack(“16sH”, “gr%d”, mode))
IOError: [Errno 1] Operation not permitted

ANy suggestions,

BEST REGARDS;
SAJJAD SAFDAR

On 02/26/2013 06:55 PM, Sajjad S. wrote:

File “./tunnel.py”, line 241, in main
(tun_fd, tun_ifname) = open_tun_interface(options.tun_device_filename)
File “./tunnel.py”, line 79, in open_tun_interface
ifs = ioctl(tun, TUNSETIFF, struct.pack(“16sH”, “gr%d”, mode))
IOError: [Errno 1] Operation not permitted

Try running it with root rights, i.e. “sudo ./tunnel.py”. Also make sure
that the device actually exists, run “ifconfig tun0”.

-Andre

Hi,
Yes now it works but can not able to ping the Machines. I am using
RFX400 daughter card and set 192.168.200.1 and 192.168.200.2
respectively on machine A and B.

On machine A: # sudo ./tunnel.py --freq 423.0M --bitrate 500k -A TX/RX
-v # # in another window on A, # ifconfig gr0 192.168.200.1 On machine
B: # sudo ./tunnel.py --freq 423.0M --bitrate 500k -A TX/RX -v # # in
another window on B # ifconfig gr0 192.168.200.2
I got the following outputs
ON MACHINE A after setting up the virtual ethernet by sudo ifconfig gr0
192.168.200.1:
helmut@ubuntu:~/gnuradio/gnuradio/gr-digital/examples/narrowba$ sudo
./tunnel.py --freq 423.0M --bitrate 500k -A TX/RX -v
linux; GNU C++ version 4.6.3; Boost_104800; UHD_003.005.001-29-g3cb515f7

gr_fir_fff: using SSE
bits per symbol = 1
Gaussian filter bt = 0.35
– Opening a USRP1 device…
– Using FPGA clock rate of 64.000000MHz…

No gain specified.
Setting gain to 32.500000 (from [0.000000, 65.000000])

UHD Receiver:
UHD Args:
Freq: 423MHz
Gain: 32.500000 dB
Sample Rate: 1Msps
Antenna: TX/RX
Spec: None

No gain specified.
Setting gain to -10.000000 (from [-20.000000, 0.000000])

UHD Transmitter:
Args:
Freq: 423MHz
Gain: -10.000000 dB
Sample Rate: 1Msps
Antenna: TX/RX
Subdev Sec: None
bits per symbol = 1
Gaussian filter bt = 0.35
Using Volk machine: ssse3_32
Tx amplitude 0.25
modulation: gmsk_mod
bitrate: 500kb/s
samples/symbol: 2.0000
Differential: False
bits per symbol = 1
M&M clock recovery omega = 2.000000
M&M clock recovery gain mu = 0.175000
M&M clock recovery mu = 0.500000
M&M clock recovery omega rel. limit = 0.005000
frequency error = 0.000000

Receive Path:
modulation: gmsk_demod
bitrate: 500kb/s
samples/symbol: 2.0000
Differential: False
modulation: gmsk
freq: 423M
bitrate: 500kb/sec
samples/symbol: 2
Carrier sense threshold: 30 dB

Allocated virtual ethernet interface: gr0
You must now use ifconfig to set its IP address. E.g.,

$ sudo ifconfig gr0 192.168.200.1

Be sure to use a different address in the same subnet for each machine.

UUTx: len(payload) = 90
Tx: len(payload) = 54
Rx: ok = True len(payload) = 90
UTx: len(payload) = 81
URx: ok = True len(payload) = 54
Tx: len(payload) = 299
Tx: len(payload) = 202
Rx: ok = True len(payload) = 81
Rx: ok = True len(payload) = 299
UUTx: len(payload) = 299
Rx: ok = False len(payload) = 299
UUTx: len(payload) = 299
Rx: ok = False len(payload) = 299
URx: ok = False len(payload) = 101
Tx: len(payload) = 78
UUTx: len(payload) = 275
Rx: ok = False len(payload) = 275
UUTx: len(payload) = 81
UUTx: len(payload) = 202
URx: ok = True len(payload) = 81
UTx: len(payload) = 70
Tx: len(payload) = 110
Rx: ok = True len(payload) = 70
UUTx: len(payload) = 101
Rx: ok = True len(payload) = 110
Tx: len(payload) = 377
Tx: len(payload) = 192
Tx: len(payload) = 105
Tx: len(payload) = 222
Rx: ok = True len(payload) = 101
URx: ok = True len(payload) = 377
Rx: ok = True len(payload) = 192
Rx: ok = True len(payload) = 105
UTx: len(payload) = 236
URx: ok = True len(payload) = 222
Rx: ok = False len(payload) = 236
UTx: len(payload) = 377
Tx: len(payload) = 192
Rx: ok = True len(payload) = 377
URx: ok = False len(payload) = 192
UTx: len(payload) = 377
Tx: len(payload) = 192
URx: ok = True len(payload) = 377
Rx: ok = False len(payload) = 192
UTx: len(payload) = 353
Tx: len(payload) = 180
Rx: ok = True len(payload) = 353
Rx: ok = False len(payload) = 180
UUTx: len(payload) = 101
UUTx: len(payload) = 222
Rx: ok = True len(payload) = 101
UUTx: len(payload) = 81
UUTx: len(payload) = 319
Rx: ok = False len(payload) = 319
UUTx: len(payload) = 353
Tx: len(payload) = 152
Rx: ok = True len(payload) = 353
Rx: ok = False len(payload) = 152
UTx: len(payload) = 90
UUTx: len(payload) = 303
Rx: ok = False len(payload) = 303
UUTx: len(payload) = 54
UUTx: len(payload) = 101
UUTx: len(payload) = 323
Rx: ok = False len(payload) = 323
UUTx: len(payload) = 353
Tx: len(payload) = 180
Rx: ok = True len(payload) = 353
Tx: len(payload) = 70
Rx: ok = False len(payload) = 180
UUTx: len(payload) = 81
UUTx: len(payload) = 101
UUTx: len(payload) = 70
UUTx: len(payload) = 81
UUTx: len(payload) = 101
UU

FROM the MACHINE B after setting virtual ethernetsudo ifconfig gr0
192.168.200.2

hw@E-Lab:~/gnuradio/gr-digital/examples/narrowband$ sudo ./tunnel.py
–freq 423.0M --bitrate 500k -A TX/RX -v
linux; GNU C++ version 4.6.1; Boost_104601; UHD_003.005.001-25-ge134b863

gr_fir_fff: using SSE
bits per symbol = 1
Gaussian filter bt = 0.35
– Opening a USRP1 device…
– Using FPGA clock rate of 64.000000MHz…

No gain specified.
Setting gain to 32.500000 (from [0.000000, 65.000000])

UHD Receiver:
UHD Args:
Freq: 423MHz
Gain: 32.500000 dB
Sample Rate: 1Msps
Antenna: TX/RX
Spec: None

No gain specified.
Setting gain to -10.000000 (from [-20.000000, 0.000000])

UHD Transmitter:
Args:
Freq: 423MHz
Gain: -10.000000 dB
Sample Rate: 1Msps
Antenna: TX/RX
Subdev Sec: None
bits per symbol = 1
Gaussian filter bt = 0.35
Using Volk machine: sse4_1_32
Tx amplitude 0.25
modulation: gmsk_mod
bitrate: 500kb/s
samples/symbol: 2.0000
Differential: False
bits per symbol = 1
M&M clock recovery omega = 2.000000
M&M clock recovery gain mu = 0.175000
M&M clock recovery mu = 0.500000
M&M clock recovery omega rel. limit = 0.005000
frequency error = 0.000000

Receive Path:
modulation: gmsk_demod
bitrate: 500kb/s
samples/symbol: 2.0000
Differential: False
modulation: gmsk
freq: 423M
bitrate: 500kb/sec
samples/symbol: 2
Carrier sense threshold: 30 dB

Allocated virtual ethernet interface: gr0
You must now use ifconfig to set its IP address. E.g.,

$ sudo ifconfig gr0 192.168.200.1

Be sure to use a different address in the same subnet for each machine.

UUTx: len(payload) = 54
Tx: len(payload) = 90
UUTx: len(payload) = 81
Rx: ok = True len(payload) = 54
Rx: ok = True len(payload) = 90
UUTx: len(payload) = 296
Rx: ok = False len(payload) = 296
UTx: len(payload) = 200
UTx: len(payload) = 78
Rx: ok = True len(payload) = 200
UUTx: len(payload) = 296
Rx: ok = False len(payload) = 296
UUTx: len(payload) = 296
Rx: ok = False len(payload) = 296
UUTx: len(payload) = 272
Rx: ok = False len(payload) = 272
UUTx: len(payload) = 81
UUTx: len(payload) = 70
Tx: len(payload) = 110
Rx: ok = True len(payload) = 70
UUTx: len(payload) = 101
Rx: ok = True len(payload) = 110
UUTx: len(payload) = 288
Rx: ok = True len(payload) = 101
Rx: ok = False len(payload) = 288
UTx: len(payload) = 374
Tx: len(payload) = 191
UTx: len(payload) = 88
Rx: ok = True len(payload) = 374
Rx: ok = True len(payload) = 191
UTx: len(payload) = 220
Rx: ok = True len(payload) = 88
UUTx: len(payload) = 374
Tx: len(payload) = 191
Rx: ok = True len(payload) = 374
Rx: ok = False len(payload) = 191
UTx: len(payload) = 374
Tx: len(payload) = 191
Tx: len(payload) = 81
URx: ok = True len(payload) = 374
Rx: ok = False len(payload) = 191
Tx: len(payload) = 256
URx: ok = True len(payload) = 81
Rx: ok = False len(payload) = 256
UTx: len(payload) = 350
Tx: len(payload) = 179
Rx: ok = True len(payload) = 350
URx: ok = False len(payload) = 179
UTx: len(payload) = 101
UUTx: len(payload) = 320
Rx: ok = False len(payload) = 320
UUTx: len(payload) = 81
UUTx: len(payload) = 350
Tx: len(payload) = 179
Rx: ok = True len(payload) = 350
Rx: ok = False len(payload) = 179
UTx: len(payload) = 288
Rx: ok = False len(payload) = 288
UUTx: len(payload) = 300
Rx: ok = False len(payload) = 300
UTx: len(payload) = 101
UUTx: len(payload) = 320
URx: ok = False len(payload) = 320
UTx: len(payload) = 70
UUTx: len(payload) = 350
Tx: len(payload) = 179
Rx: ok = True len(payload) = 350
Rx: ok = False len(payload) = 179
UUTx: len(payload) = 81
UUTx: len(payload) = 101
UTx: len(payload) = 54
Rx: ok = True len(payload) = 101
UUTx: len(payload) = 70
UUTx: len(payload) = 90
UUTx: len(payload) = 81
UUTx: len(payload) = 101
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 81
UUTx: len(payload) = 42
UUTx: len(payload) = 101
Tx: len(payload) = 42
URx: ok = True len(payload) = 101
UTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UUTx: len(payload) = 42
UTx: len(payload) = 42
UUTx: len(payload) = 42
UU

But i am not able to ping the two machines. The settings and parameters
used looks correct but ping does not work on either.

Berst Regards,
SAJJAD SAFDAR


From: Andre P. [email protected]
To: Sajjad S. [email protected]
Sent: Wednesday, February 27, 2013 4:34 PM
Subject: Re: tunnel.py command not working.

On 02/26/2013 06:55 PM, Sajjad S. wrote:

File “./tunnel.py”, line 241, in main
(tun_fd, tun_ifname) = open_tun_interface(options.tun_device_filename)
File “./tunnel.py”, line 79, in open_tun_interface
ifs = ioctl(tun, TUNSETIFF, struct.pack(“16sH”, “gr%d”, mode))
IOError: [Errno 1] Operation not permitted

Try running it with root rights, i.e. “sudo ./tunnel.py”. Also make sure
that the device actually
exists, run
“ifconfig tun0”.

-Andre

On Wed, Feb 27, 2013 at 9:28 AM, Sajjad S.
[email protected] wrote:

ifconfig gr0 192.168.200.1

On machine B:

sudo ./tunnel.py --freq 423.0M --bitrate 500k -A TX/RX -v

# in another window on B

ifconfig gr0 192.168.200.2

Try using different transmit and receive frequencies. tunnel.py has
some serious issues, and among them is with how data is handled with
the UHD interface where it doesn’t really handle the proper SOB and
BOB concepts that would allow you to do full duplex on the same
frequency. At this point, I’m not even sure doing FDD is going to work
properly with it.

Tom

On Wed, Feb 27, 2013 at 2:01 PM, sumitstop
[email protected] wrote:

Tom what do you mean by using different Tx & Rx frequencies.

I mean exactly that: use different frequencies like in an FDD system.
Set the transmit frequency to f_tx and the receive frequency to f_rx.
When you run “tunnel.py -h”, you’ll see options “–tx-freq” and
“–rx-freq”. Just setting “–freq” automatically sets tx_freq =
rx_freq = freq.

Also recently I did following. I connected 2 usrp with a single PC and ran 2
instances of tunnel in it with 1 usrp for each. Made two virtual ethernet
interfaces gr0 & gr1 also set two different ip addresses. And I was able to
ping from one ip address to another. I also did ssh and scp.

Now suddenly I am getting doubt that was that a wireless ping ?? Or was it
just withing a system i.e ping between two virtual ethernet interfaces
inside the system.

It was probably being done internally. First check your routing table,
but your system is probably being smart and just passing packets over
the loopback device. You can use wireshark/tcpdump to check this out.

If it was within the system then I might have made a wrong screen cast on
this tunnel thing which I recently uploaded on my channel

GNURADIO : tunnel - YouTube

PS : Video is a bit blurred but one can easily make out

Tom

Tom what do you mean by using different Tx & Rx frequencies.

Also recently I did following. I connected 2 usrp with a single PC and
ran 2
instances of tunnel in it with 1 usrp for each. Made two virtual
ethernet
interfaces gr0 & gr1 also set two different ip addresses. And I was able
to
ping from one ip address to another. I also did ssh and scp.

Now suddenly I am getting doubt that was that a wireless ping ?? Or was
it
just withing a system i.e ping between two virtual ethernet interfaces
inside the system.

If it was within the system then I might have made a wrong screen cast
on
this tunnel thing which I recently uploaded on my channel

PS : Video is a bit blurred but one can easily make out


View this message in context:
http://gnuradio.4.n7.nabble.com/tunnel-py-command-not-working-tp39857p39886.html
Sent from the GnuRadio mailing list archive at Nabble.com.