LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-10-2013, 05:03 AM   #1
Kalamram
LQ Newbie
 
Registered: Apr 2013
Location: bangalore
Posts: 3

Rep: Reputation: Disabled
Smile How to connect two systems via virtual network devices like tap in linux.


Hi,

I have two systems host-A and host-B.
I want to communicate these two host systems via virtual ethernet devices like tap.

I have using to spilt a data strem to two using NIC bonding. Here, my two ethernet cards are eth0 and eth1.
After creating bond0, my two ethernet interfaces attached with bond0.
Now, I have a application stack called GNUradio installed in host-A.Same, GNURadio installed in host-B.

So, I created two tap interfaces in both host-A and host-B. _________
So, if suppose I send 10000 tcp packets from host-A to host-B, it should go through the __________
bond0 |-> eth0 -> tap0 ->| |
-> eth1 -> tap1 ->|GNU Radio | |_________|

So, in GNu radio, I am sending both the tap0 output to OFDM mod and send outside via wireless devices.

Same setup is in other end and it will receive and demodulate and receive on the two tap interfaces and using same NIC bonding mechanism I am combine the data strem at host-B.

In host-A I created a tap0 and tap1 interface and create a bridge interface br0 and br1 to connect with eth0 and eth1.

Here my requirement is whatever ethernet frame/packets comes it should go through eth0 -> tap0 -> Gnuradio OFDM1, same like eth1 -> tap1 -> Gnuradio OFDM2 pathg.

I tried with linux bridging with examle setup.

I created tap0 and attach with br0 which already have eth0 if attached. I try to send some tcp packets to remote host via this bridge, bridge have IP address and subnet mask. I removed IP address to both eth0 and tap0.
When I send packets to remote host, it goes through bridge , but tap0 not seen any packets.I checked via tcpdump.

Whether my approach right?. If mistake correct me.

How to stream data to gnuradio stack via eth0 -> tap0.

Thank you,
SJK
 
Old 04-12-2013, 02:48 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
You can use the "tap" virtual ethernet driver which lets a userspace program pretend to be an ethernet interface. This is a standard kernel feature for some time now (it might not be enabled in your kernel though).
 
Old 04-18-2013, 01:09 PM   #3
Kalamram
LQ Newbie
 
Registered: Apr 2013
Location: bangalore
Posts: 3

Original Poster
Rep: Reputation: Disabled
Post

Hi nini,
thank you.
I tried the tunctl mechanism and created tap devices.
But, not able to send packets via tap.

Is it correct or any method available.

Can I bond two ethernet inetrfaces and forward each interface packets to tap devices.
This I tried, but not able to forward ethernet packets to tap devices.

What is the problem with the setup.
please correct me.

thanks,
SJK
 
Old 04-18-2013, 02:24 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
Tun/tap interfaces are software-only interfaces, meaning that they exist only in the kernel and, unlike regular network interfaces, they have no physical hardware component (and so there's no physical "wire" connected to them). You can think of a tun/tap interface as a regular network interface that, when the kernel decides that the moment has come to send data "on the wire", instead sends data to some userspace program that is attached to the interface (using a specific procedure, see below). When the program attaches to the tun/tap interface, it gets a special file descriptor, reading from which gives it the data that the interface is sending out. In a similar fashion, the program can write to this special descriptor, and the data (which must be properly formatted, as we'll see) will appear as input to the tun/tap interface. To the kernel, it would look like the tun/tap interface is receiving data "from the wire".
The difference between a tap interface and a tun interface is that a tap interface outputs (and must be given) full ethernet frames, while a tun interface outputs (and must be given) raw IP packets (and no ethernet headers are added by the kernel). Whether an interface functions like a tun interface or like a tap interface is specified with a flag when the interface is created.
 
Old 04-19-2013, 02:53 PM   #5
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
Following link could help you to understand and learn.
http://backreference.org/2010/03/26/...face-tutorial/
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing virtual network Driver for Ethernet devices grreddy Linux - Kernel 0 11-24-2011 06:51 AM
how to create arbitrary network paths with tap devices? krisweston Linux - Networking 0 09-10-2011 10:14 AM
How to connect systems in private network with public network jeetv33 Linux - Networking 2 01-12-2011 08:55 PM
How to connect systems in private network with public network jeetv33 Linux - Newbie 4 01-11-2011 11:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration