(Netgraph problem) Inner tag and outer tag swapped

Julian Elischer julian at elischer.org
Fri Aug 8 21:23:44 UTC 2008


Younger Wang wrote:
> Hi,
> 
> I expect to see [Ether header][tag 4000][tag 201][payload] in hub_QinQ,
> but in fact it was [ether header][tag 201][tag 4000][payload].
> 
> I inserted the hub because I wanted to sniffer in the segment. It should
> not cause any problem, should it?

probably not.. that is what the 'tee' node is for though.

> 
> The system I run is based on vimage_7-20080228.tgz
> (http://imunes.tel.fer.hr/virtnet/), on FreeBSD Release 7, with ng_vlan
> module modified to support changing ethertype. My modification was made
> for release 7 however. Yes, the difference between vimage source and
> release 7 could be the cause. I will check it during the weekend. 

ok that shouldn't make a difference..

on thing is that the vlan header is removed very early
(just before the packet is handed to netgraph) and replaced
by a packet tag (metadata) is is added back on (at the front)
before transmission so that may be related how the headers
swap position.

it is possible that the vlan node converts the tag back to a header.


I'm not sure exactly where it gets added back but it may be worth
looking to see if the vlan type does so...


> 
> Big thanks!
> 
> BR
> Younger Wang
> 
> -----Original Message-----
> From: Julian Elischer [mailto:julian at elischer.org] 
> Sent: Friday, August 08, 2008 5:12 PM
> To: Younger Wang
> Subject: Re: (Netgraph problem) Inner tag and outer tag swapped
> 
> Younger Wang wrote:
>> Hi,
>>
>>  
>>
>> fxp0 is connected to a trunk port. Frames tagged with VID=201 arrives
> at
>> fxp0 from a switch trunk port, I expect it will be captured at
> hub_QinQ,
>> with outer tag = 4000, and inner tag = 201. But in fact, it was
> received
>> with the outer and inner tags reversed.
> 
> is this what you think is on the wire?
> 
> 
> [ether header][tag 201][tag 4000][payload]
> 
>>  
>>
>> But if I inject the same frame on hub_c4000, the frame is received at
>> hub_QinQ as expected (inner tag = 201, outer tag = 4000). I am really
>> confused. Has anyone seen the same problem? Big thanks.
>>
>>  
>>
>> Here is my netgraph setup:
>>
>>  
>>
>> ngctl mkpeer fxp0: hub lower physical
>>
>> ngctl name fxp0:lower hub_c4000
> 
> looking at your config.. I see:
> 
> 
> [hub]
>    down0
>     |
>    downstream
> [vlan]
>    vlan4000
>     |
>    up
> [hub]        <--- why do you need this?
>    physical
>     |
>    lower
> [ether]
> 
> 
> what version of FreeBSD?
> some changes were made in vlan handling in the late6/7 timeframe.
> 
> 
>>  
>>
>> ngctl mkpeer hub_c4000: vlan up vlan4000
>>
>> ngctl name hub_c4000:up vlan_QinQ
>>
>>  
>>
>> ngctl mkpeer vlan_QinQ: hub downstream down0
>>
>> ngctl name vlan_QinQ:downstream hub_QinQ
>>
>>  
>>
>> ngctl msg vlan_QinQ: addfilter { vlan=4000 hook="vlan4000" }
>>
>>  
>>
>> BR
>>
>> Younger Wang
>>
>>  
>>
>>  
>>
>> _______________________________________________
>> freebsd-net at freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-net
>> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"



More information about the freebsd-net mailing list