[Xorp-users] VLAN support in XORP

Kristian Larsson kristian at spritelink.net
Wed Sep 26 11:23:26 PDT 2007


Pavlin Radoslavov wrote:
> Kristian Larsson <kristian at spritelink.net> wrote:
> 
>> On Wed, Sep 26, 2007 at 02:01:07AM -0700, Pavlin Radoslavov wrote:
>>> All,
>>>
>>> The first-cut VLAN support is now committed in the CVS tree.
>>>
>>> Below is some high-level information about the current configuration
>>> mechanism. Nothing is final so here is your chance to suggest
>>> improvements or alternative solutions.
>>>
>>> Currently, the configuration looks like:
>>>
>>> interfaces {
>>>     interface fxp0 {
>>>         vif vlan10 {
>>>             vlan {
>>>                 vlan-id: 10
>>>             }
>>>             address 10.10.10.10 {
>>>                 ...
>>>             }
>>>             ...
>>>         }
>>>     }
>>> }
>>
>> What do the actual interface look like if I check
>> with `ifconfig` ?
> 
> There will be interface named "vlan10". E.g., on FreeBSD-6.2 it will
> look like:
> 
> root at xorp13[7] ifconfig vlan10
> vlan10: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         inet 10.10.10.10 netmask 0xffffff00 broadcast 10.10.10.255
>         inet6 fe80::xxx:xxxx:xxxx:xxxx%vlan10 prefixlen 64 scopeid 0xd 
>         ether xx:xx:xx:xx:xx:xx
>         media: Ethernet autoselect (none)
>         status: no carrier
>         vlan: 10 parent interface: fxp0
> 
>> Do I manually have to make sure that the "vif
>> vlan10" section doesn't collide with other
>> interfaces, ie do vlan 10 have to be unique and
>> will XORP or the user keep track of that?
> 
> If the system doesn't allow you to have more than one VLANs with the
> same name (even if they have different parent interfaces), then you
> need to manually make sure that there is only one vlan10 in your
> configuration. E.g., on FreeBSD you cannot have configuration like:
> 
> interfaces {
>     interface fxp0 {
>         vif vlan10 {
>             vlan {
>                 vlan-id: 10
>             }
>             address 10.10.10.10 {
>                 prefix-length: 24
>             }
>         }
>     }
>     interface sk0 {
>         vif vlan10 {
>             vlan {
>                 vlan-id: 10
>             }
>             address 10.44.44.44 {
>                 prefix-length: 24
>             }
>         }
>     }
> }


I think this makes it very difficult to use. Having to make sure that 
the interface name is unique is a typical task for a computer, not a 
human :)
I'm seeing a configuration with hundreds of interfaces, it would be 
unbearable.

>>> I.e., the "vlan {}" block inside the "vif {}" block is used to
>>> identify the vif as a VLAN and to apply the VLAN-specific
>>> configuration. For now the VLAN-specific configuration is only the
>>> VLAN ID.
>> Can't you put this thing under the main interface,
>> like adding "vlan-tagging" or something?
>> I don't want another two lines of configuration
>> per sub-interface.
> 
> We could, but the reason I prefer to have an explicit "vlan {}"
> block is for clarity. E.g., if we keep the above model, then in the
> future all VLAN-specific parameters will go to that block rather
> than cluttering everything together inside the generic "vif {}"
> block.

I see your point.
I'm just fond of "vlan-tagging" directly under vif since that is how 
Junipers work.
In the future I see adding support for inner and outer vlans (ie, QinQ), 
VLAN rewriting and stuff. I'm not sure how much we should plan for now.
A simple way would be to simply duplicate Junipers effort, I can imagine 
they already put some thought into it and a lot of people are used to 
how JUNOS works.


>>> To add yet another possible solution, my personal preference and
>>> my original intention was to use configuration like the following:
>>>
>>> interfaces {
>>>     interface fxp0 {
>>>         vlan vlan10 {
>>>             vlan-id: 10
>>>             address 10.10.10.10 {
>>>                 ...
>>>             }
>>>             ...
>>>         }
>>>     }
>>> }
>> I support this one.
>> Having an extra vlan { branch just adds more lines
>> and doesn't really bring anything useful, imho.
> 
> My preference is also for this one (again, for clarity reason), but
> I would like to see some rough concensus before making any changes.
> 
>>> In term of VLAN naming, the situation is the following.
>>> In FreeBSD (and I believe in other BSDs as well, but I haven't
>>> double-checked it yet), the vlan name has to be "vlan%d". However,
>>> the integer after "vlan" doesn't need to match the VLAN ID. E.g.,
>>> vlan10 could have VLAN ID of, say, 20.
>> I don't think so. I think you can rename the
>> interface to whatever you wish.
> 
> Which OS and OS version?
> In another email, Dan Lukes said the same thing, but it doesn't seem
> to be the case for FreeBSD-6.2.

I believe you can rename the interface after it has been created.
I don't have a FreeBSD machine to test with, right now...

>>> In Linux the naming scheme can be programmed in advance using
>>> ioctl(SET_VLAN_NAME_TYPE_CMD). The choices are names like:
>>>  (a) vlan0005
>>>  (b) eth1.0005
>>>  (c) vlan5
>>>  (d) eth0.5
>>>
>>> Unlike FreeBSD, in Linux the integer value at the end of the name
>>> must match the VLAN ID.
>> Are you sure?
>> I'm pretty sure you can rename the interfaces in
>> Linux as well. Let me get back on this.
> 
> I was looking into the ioctl() API (I was reading the source code of
> vconfig(8) from Ben Greear and I was checking <linux/if_vlan.h>),
> but I couldn't see anything that indicates that you could explicitly
> assign your own VLAN name.
> 
> Ben, if the Linux ioctl() API allows me to specify the VLAN name to
> any string, could you tell me the exact API setup I need to use.
> In my testing I am using Gentoo 2006.1 with 2.6.20 kernel.

See Ben's mail. I was thinking about the iproute2 functionality for 
renaming interfaces :)

    Kristian.



More information about the Xorp-users mailing list