Spanning Tree Protocol (STP) on Linux with GNS3 and VMware

What the heck?

You didn’t think that the Spanning Tree Protocol or STP is something that is only related to Cisco gear, did you? Well, it is not. It is standard based protocol defined in the IEEE 802.1D. At least the basic form of STP. Being standard means, among other things, that it can run on any platform or OS, Linux included. The real question is why? This is why…

first, let’s take a look at my previous blog on connecting GNS3 and VMware on Linux box. What if we would like to extend our scenario to something like this:

gns3 topology stp

So what? We will use vmnet11 for VMware’s side of the bridge (ACS and CA servers), tap11 and tap12 interfaces for the GNS3 side. What will do the trick is this:

root@pop-deb:~#
root@pop-deb:~# tunctl -t tap11
Set ‘tap11’ persistent and owned by uid 0
root@pop-deb:~# tunctl -t tap12
Set ‘tap12’ persistent and owned by uid 0
root@pop-deb:~#
root@pop-deb:~# ifconfig tap11 0.0.0.0 promisc up
root@pop-deb:~# ifconfig tap12 0.0.0.0 promisc up
root@pop-deb:~# ifconfig vmnet11 0.0.0.0 promisc up
root@pop-deb:~#
root@pop-deb:~# brctl addbr br11
root@pop-deb:~# brctl addif br11 tap11
root@pop-deb:~# brctl addif br11 tap12
root@pop-deb:~# brctl addif br11 vmnet11
root@pop-deb:~#
root@pop-deb:~# ifconfig br11 11.11.11.1 netmask 255.255.255.0 up
root@pop-deb:~#
root@pop-deb:~# ping -c 3 11.11.11.1
PING 11.11.11.1 (11.11.11.1) 56(84) bytes of data.
64 bytes from 11.11.11.1: icmp_req=1 ttl=64 time=0.057 ms
64 bytes from 11.11.11.1: icmp_req=2 ttl=64 time=0.054 ms
64 bytes from 11.11.11.1: icmp_req=3 ttl=64 time=0.059 ms

— 11.11.11.1 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.054/0.056/0.059/0.008 ms
root@pop-deb:~#

Or will it???

Before we power on anything, let’s see our current system performance:

system monitor 1 stp

We can see that our cores are killing themselves doing nothing.

Let’s now power on our servers. For the sake of this demo, my ACS server is a SLES Linux box and CA server is Ubuntu Linux box. It’s easier and quicker to manipulate the IP parameters, and the final result will be the same. Please note that both Linux boxes are setup with vmnet11 as the virtual network and they are addressed as depicted in the diagram.

Again, we verify our performance:

system monitor 2 stp

No, it’s not the same image 🙂

We utilize a little bit more memory, but CPU is doing nothing. Let’s verify our connectivity so far.

From the Linux host (11.11.11.1):

ping 1 stp

From ACS (SLES – 11.11.11.2):

ping 2 stp

And finally, from the CA (Ubuntu – 11.11.11.3):

ping 3 stp

So far so good. Now let’s start our only router from GNS3 topology…

system monitor 3 stp

Holly macaroni!

Don’t even bother trying to do anything now!

Our ping now looks like slightly different:

ping 4 stp

Duplicated packets, high CPU usage and layer two domain? I smew a wabbit. I mean a loop 🙂

So how do we deal with this?

Let’s check our bridge:

root@pop-deb:~#
root@pop-deb:~# brctl show br11
bridge name    bridge id        STP enabled    interfaces
br11        8000.005056c0000b    no        tap11
tap12
vmnet11
root@pop-deb:~#

We can see that the spanning tree protocol is disabled and what does STP do for living? Prevents loops! So, let’s make it prevent one:

root@pop-deb:~#
root@pop-deb:~# brctl stp br11 on
root@pop-deb:~#
root@pop-deb:~# brctl show br11
bridge name    bridge id        STP enabled    interfaces
br11        8000.005056c0000b    yes        tap11
tap12
vmnet11
root@pop-deb:~#

With the “brctl stp br11 on” we turned on the spanning tree protocol for our bridge domain. Did it have effect?

system monitor 4 stp

Sweeeeet 🙂

And what about ping?

ping 5 stp

No DUP!’s now 🙂

I hope this helped somebody. If so, then it’s worth blogging.

Thanks for reading.

Advertisements
This entry was posted in GNS3, LINUX, Virtualization, VMWare and tagged , , , . Bookmark the permalink.

2 Responses to Spanning Tree Protocol (STP) on Linux with GNS3 and VMware

  1. GNS3 Linux user says:

    Thanks, it did help me

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s