LinuxQuestions.org
Visit Jeremy's Blog.
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 05-19-2011, 11:52 AM   #1
nktns
LQ Newbie
 
Registered: May 2011
Posts: 2

Rep: Reputation: Disabled
Virtual interfaces for bridge for performance testing


Hey,

Now doing some research about performance of Linux switch. I'll start with basic structure of my system:
PC1 is connected to PC2 - both have 1 NIC so not much to add.
PC2 eth0 is divided in VLAN`s - as far as maximum of 4094. Every VLAN has it's own switch (bridge). On PC1 when I run a test I just make VLAN/configure IP address and stream data to IP that's configured for that bridge on PC2.
But now I want to add one more interface to each bridge, so I could stream from PC1 through bridge to Virtual interface (just an endpoint out of bridge). I could possibly add one more computer, physical interface to PC1 and make it work, but is there any way to make this work with virtual interfaces, like tun or something? Making just a simple tun interface and adding it to bridge, as you understand, doesn't do the trick, I need some kind of other endpoint that /virtually/ connects to tun interface.
Maybe someone has made some kind of script or something?
Using Iperf for my tests.

I hope I explained it clearly enough and thanks for your answers in advance!

Last edited by nktns; 05-19-2011 at 11:53 AM.
 
Old 05-19-2011, 01:52 PM   #2
ambrop7
Member
 
Registered: May 2011
Distribution: Gentoo
Posts: 98

Rep: Reputation: 16
As far as I get it, you want to simulate your bridge having another port, but you don't want any real hardware. Though it sounds pointless to me, here are some options:

1.) You may think you need an additional interface, but really just need an additional IP address. If this is the case, just assign it to the bridge (any interface can have multiple IP addresses). Example: "ip addr add 192.168.72.4/24 dev br0". Note that ifconfig will only show one address - to see all assigned addresses, use "ip addr show".

2.) Run a virtual machine on your system and make it appear that it's network card is connected to the bridge. Make sure not to use NAT networking for the VM - instead use TAP, or, with VirtualBox, "host-only" networking. Then, on the host, add the guest interface into the bridge.

3.) Make two TAP devices (tap0, tap1). Add tap0 to the bridge. Start some program(s) to join the software ends of tap0 and tap1 into each other. Then it will be as if tap1 is connected into the bridge with a cable - you can assign it an IP address etc.. (but DON'T assign an IP to tap0).

For example, with my open source VPN software ( http://code.google.com/p/badvpn/ ):

First configure the TAP devices.

root # openvpn --mktun --dev tap0 --user myuser
root # openvpn --mktun --dev tap1 --user myuser
root # ifconfig tap0 up
root # ifconfig tap1 up

Then run the following daemons, which will make it appear as if tap0 and tap1 are joined into each other (it will be identical as if you had eth0 and eth1, and connected them directly with a cable).

myuser $ badvpn-server --listen-addr 127.0.0.1:7000
myuser $ badvpn-client --server-addr 127.0.0.1:7000 --transport-mode tcp --bind-addr 127.0.0.1:7001 --ext-addr 127.0.0.1:7001 local --tapdev tap0
myuser $ badvpn-client --server-addr 127.0.0.1:7000 --transport-mode tcp --scope local --tapdev tap1

Last edited by ambrop7; 05-19-2011 at 02:35 PM.
 
Old 05-19-2011, 04:03 PM   #3
nktns
LQ Newbie
 
Registered: May 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
First of all - thanks for your response! It's really helpful.
Whole point of my simulations is to check how well those bridges scale. Overall that's already another story why I need that and do I really need to know that, but fact is I don't need production network solution - I need find a way to test this, because running 4094 bridges already made that machine slow, so running addition VM would just destroy that computer.
I already made a few tests with bridges and IP assigned to them. What I think I need is an /virtual/ interface and bridge should assume he's forwarding traffic (br_forward() from network stack), because if I'm streaming data to IP of the bridge it's consuming packets locally by passing frames up (br_pass_frame_up() from network stack). At least I hope I'm not wrong with this part, am I? :/

So your third option is pretty much what I need and I'm already trying to solve this using tap devices, so I'm pretty much looking for this part you mentioned: "Start some program(s) to join the software ends of tap0 and tap1 into each other.". So gonna check your software and see how it goes.
Cheers!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Howto bridge wireless and wired network interfaces? pohl886 Debian 11 07-19-2011 06:58 PM
[SOLVED] /etc/network/interfaces configuration for virtual interfaces nonshatter Linux - Networking 4 10-25-2010 06:22 AM
[SOLVED] HTB shaping and IPERF performance measurents on virtual interfaces skypixel Linux - Networking 1 06-22-2010 03:45 AM
KVM on Centos 5.4 - bridge issue on virtual interfaces asmar Linux - Networking 1 03-01-2010 11:11 PM
Debian bridge-utils via /etc/network/interfaces uhcafigdc Linux - Networking 3 12-10-2008 01:24 PM

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

All times are GMT -5. The time now is 08:02 PM.

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