It is currently Thu Jun 20, 2019 11:19 am


All times are UTC




Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: qinq on generic ethernet switch - is BROKEN
PostPosted: Mon Mar 11, 2013 12:36 pm 
Offline

Joined: Fri Mar 05, 2010 11:33 am
Posts: 1494
Location: Australia
Hi,

Has anyone used (more to the point SUCCESSFULLY used) the qinq option on the generic switch?

Now I have actually read http://www.gns3.net/switching-qinq-with ... ch-option/ - but in actual fact this article does NOT talk about the qinq option for the generic switch, but talks about using qinq on an external switch.

From my observation. qinq is BROKEN - and should be removed as an option in the configuration of a generic switch (after all, if it hasn't worked for 5 years and no-one's noticed, then why have it?)

The behaviour I would EXPECT from a qinq port on a generic switch is to add a tag to the frame as it arrived already tagged, and strip a tag from a frame as it forwarded it. Much like an access port.

The behaviour I observed was that qinq would add a tag to the frame as it arrived already tagged, but NOT strip it as the frame was forwarded, making it impossible to get rid of the extra tag.

Using qinq i SHOULD be able to do this:


R1: int fa0/0.10 [dot1q 10] 192.168.10.1 ------sw port1:VLAN 100 qinq
R2: int fa0/0.10 [dot1q 10] 192.168.10.2 ------sw port2:VLAN 100 qinq
R3: int fa0/0.10 [dot1q 10] 192.168.10.1 ------sw port3:VLAN 101 qinq
R4: int fa0/0.10 [dot1q 10] 192.168.10.2 ------sw port4:VLAN 101 qinq

Note R1 & R3 have the same IPs - as does R2 & R4

I would expect that R1 and R2 could ping each other, and R3 or R4 would never see the ARPs or pings



_________________
RedNectar
http://rednectar.net
@rednectarchris
GNS3 WorkBench-a VMware image of Ubuntu with GNS3 and VPCS installed and a collection of exercises/labs


Top
 Profile  
 
 Post subject: Re: qinq on generic ethernet switch - is BROKEN
PostPosted: Sun Mar 24, 2013 7:16 am 
Offline

Joined: Fri Mar 25, 2011 11:09 am
Posts: 40
I actually have tried to get the built in generic switch to work with QinQ and it seems to fail every time. It's been a year or so since I tinkered with it. As I recall though QinQ hasn't been there for 5 years, it's a relatively new feature for the switch in GNS3. Perhaps nobody complained because they figured it was just broken for them and worked for everyone else? ;) I dunno. At any rate it's also busted for other people. What is your OS? Not knowing how the GNS3 switch was implemented, it's possible that this is related to an OS feature problem and is external to GNS3.

The document you linked to is written to allow connection of external switches to GNS3, QinQ needs to be configured in both GNS3 and the exit points of the breakout switch. So there's nothing wrong with THAT at least. In that case the connection to the outside is a dot1q trunk, which leaves tags intact.


Last edited by crackerjoe69 on Sun Mar 24, 2013 9:25 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: qinq on generic ethernet switch - is BROKEN
PostPosted: Sun Mar 24, 2013 8:31 am 
Offline

Joined: Fri Mar 25, 2011 11:09 am
Posts: 40
QinQ may be new in GNS3, but it's possibly been in Dnyamips for some time I guess. I was curious so I looked over the dynamips RC3-community source code. In eth_switch.c the pop tag routine is only ever called three times. As far as I can see it only pops a dot1q VLAN tag when a packet is recieved on a trunk interface. Here are the comments from the code sections where dot1q_pop_tag was called.

Code:
      /* 802.1Q -> Access: pop tag */
      /* 802.1Q -> 802.1Q: pop tag if native VLAN in output otherwise no-op */
      /*
       * 802.1Q -> QinQ: pop outer tag if native VLAN in the one specified
       * tunnel port.
       */

When a packet is recieved in a QinQ port and sent to a QinQ port it just forwards it, and doesn't pop the tag at all. According to my limited coding skillz ;)
Code:
      /*
       * QinQ -> QinQ: valid situation if we have the same customer connected
       * on two ports (so with identical VLAN id on tunnel ports).
       */
      case ETHSW_PORT_TYPE_QINQ:
         if (sp->input_port->vlan_id == op->vlan_id)
            netio_send(op,pkt,sp->pkt_len);
         break;


So, to fix this the code should be changed to be similar to how it pops the tag from a trunk port. Here's the trunk port code:
Code:
      /*
       * 802.1Q -> QinQ: pop outer tag if native VLAN in the one specified
       * tunnel port.
       */
      case ETHSW_PORT_TYPE_QINQ:
         if (op->vlan_id == sp->input_vlan) {
            dot1q_pop_tag(pkt,sp);
            netio_send(op,pkt,sp->pkt_len-4);
         }


         break;

The fix is just 4 lines of code and it seems like it addresses the issue. Completely un-tested of course. I like shooting from the hip.

Code:
     /*
       * QinQ -> QinQ: valid situation if we have the same customer connected
       * on two ports (so with identical VLAN id on tunnel ports).
       */
      case ETHSW_PORT_TYPE_QINQ:
         if (sp->input_port->vlan_id == op->vlan_id) {
            dot1q_pop_tag(pkt,sp);
            netio_send(op,pkt,sp->pkt_len-4);
         }
         break;


Top
 Profile  
 
 Post subject: Re: qinq on generic ethernet switch - is BROKEN
PostPosted: Mon Mar 25, 2013 9:58 am 
Offline

Joined: Fri Mar 05, 2010 11:33 am
Posts: 1494
Location: Australia
Hey Jeremy, can you add this to the list.

_________________
RedNectar
http://rednectar.net
@rednectarchris
GNS3 WorkBench-a VMware image of Ubuntu with GNS3 and VPCS installed and a collection of exercises/labs


Top
 Profile  
 
 Post subject: Re: qinq on generic ethernet switch - is BROKEN
PostPosted: Mon Apr 01, 2013 10:42 am 
Offline
Site Admin

Joined: Sat Oct 11, 2008 1:41 pm
Posts: 2668
Location: Canada
Done. Love it when I the solution included :)

_________________
Jeremy, GNS3 Programmer & Benevolent Dictator for Life.


Top
 Profile  
 
 Post subject: Re: qinq on generic ethernet switch - is BROKEN
PostPosted: Mon Apr 29, 2013 7:53 pm 
Offline
Site Admin

Joined: Sat Oct 11, 2008 1:41 pm
Posts: 2668
Location: Canada
Hi,

I implemented crackerjoe69's patch and ... it works well! Thanks!

I tested with the following topology:

Attachment:
File comment: QinQ topology
qinq.png
qinq.png [ 23.22 KiB | Viewed 8397 times ]


Code:
R1: int fa0/0.100 [dot1q 100] 192.168.100.1 ------SW1 port1:VLAN 100 qinq
R3: int fa0/0.100 [dot1q 100] 192.168.100.1 ------SW1 port3:VLAN 200 qinq
R2: int fa0/0.100 [dot1q 100] 192.168.100.2 ------SW2 port2:VLAN 100 qinq
R4: int fa0/0.100 [dot1q 100] 192.168.100.2 ------SW2 port4:VLAN 200 qinq
SW1 port10: dot1q 999 --------------------------- SW2 port10: dot1q 999


R1 can ping R2 but not R3 and R4
R3 can ping R4 but not R1 and R2

Wireshark captures shows only one tag (100) on router interfaces.

_________________
Jeremy, GNS3 Programmer & Benevolent Dictator for Life.


Top
 Profile  
 
 Post subject: Re: qinq on generic ethernet switch - is BROKEN
PostPosted: Mon Apr 29, 2013 9:25 pm 
Offline

Joined: Fri Mar 05, 2010 11:33 am
Posts: 1494
Location: Australia
woo-hoo - thanks crackerjoe69 (and Jeremy)

_________________
RedNectar
http://rednectar.net
@rednectarchris
GNS3 WorkBench-a VMware image of Ubuntu with GNS3 and VPCS installed and a collection of exercises/labs


Top
 Profile  
 
 Post subject: Re: qinq on generic ethernet switch - is BROKEN
PostPosted: Sun Sep 29, 2013 2:51 am 
Offline

Joined: Sun Feb 27, 2011 1:53 am
Posts: 32
Q-in-Q is not working with the latest GNS3 version 0.8.5. The above scenario does not work.


Top
 Profile  
 
 Post subject: Re: qinq on generic ethernet switch - is BROKEN
PostPosted: Wed Oct 02, 2013 2:12 am 
Offline
Site Admin

Joined: Sat Oct 11, 2008 1:41 pm
Posts: 2668
Location: Canada
Quote:
Q-in-Q is not working with the latest GNS3 version 0.8.5. The above scenario does not work.


That's weird. I am gonna have a look at it soon.

Thanks,

_________________
Jeremy, GNS3 Programmer & Benevolent Dictator for Life.


Top
 Profile  
 
 Post subject: Re: qinq on generic ethernet switch - is BROKEN
PostPosted: Tue Oct 22, 2013 11:25 pm 
Offline
Site Admin

Joined: Sat Oct 11, 2008 1:41 pm
Posts: 2668
Location: Canada
Hi,

Quote:
Q-in-Q is not working with the latest GNS3 version 0.8.5. The above scenario does not work.


I restested the scenario. Works fine for me.

I've included the topology so you can test.

Cheers,




Attachments:
QinQ.tar.gz [24.75 KiB]
Downloaded 388 times

_________________
Jeremy, GNS3 Programmer & Benevolent Dictator for Life.
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO