Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-10-2013, 06:03 AM
|
#1
|
LQ Newbie
Registered: Apr 2013
Location: bangalore
Posts: 3
Rep: 
|
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
|
|
|
04-12-2013, 03:48 PM
|
#2
|
Senior Member
Registered: Apr 2009
Posts: 1,894
Rep: 
|
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).
|
|
|
04-18-2013, 02:09 PM
|
#3
|
LQ Newbie
Registered: Apr 2013
Location: bangalore
Posts: 3
Original Poster
Rep: 
|
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
|
|
|
04-18-2013, 03:24 PM
|
#4
|
Senior Member
Registered: Apr 2009
Posts: 1,894
Rep: 
|
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.
|
|
|
All times are GMT -5. The time now is 04:07 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|