[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Add support for outgoing VLAN tags?

From: web
Subject: Re: [lwip-users] Add support for outgoing VLAN tags?
Date: Wed, 02 Nov 2011 10:58:12 +0100

On 1 nov 2011 12:28 "Simon Goldschmidt" <address@hidden> wrote:
"address@hidden" <address@hidden> wrote:
Since 1.4, lwip supports incomming VLAN tagged frames.
Is there any interest in also adding support for VLAN tagging of outgoing frames for QoS purposes?

I guess it hasn't been added yet since no one knew how outgoing VLAN support should look like. for example, I wouldn't have thought that it would be useful to support different VLAN tags on the same IP address. Instead, I would have added multiple netifs each with their own IP address or subnet and assigned a VLAN tag to the netif.

Honestly, I wouldn't want to add a new argument in all the output functions for everybody for such a seldom used feature. Isn't there another way to implement this?


No, it is not particularly useful to support different VLAN IDs on the same IP address.
However, the VLAN tags have another purpose as well: They allow QoS (Quality of Service) in Ethernet networks.
The TOS/DiffServ-field in the IP header allows QoS in routers, but usually not in Ethernet switches.
By adding a VLAN tag with VLAN ID zero (means no VLAN), the "PCP" field in the VLAN tag can be used to enable QoS in Ethernet networks.

An IP phone with built in webserver would for example want to assign higher priority to its voice traffic than to the http traffic, and it is best if the voice frames can be prioritized in both switches and routers.

I can think of one alternative to the solution I mentioned before:
A new bit is defined in the socket option field in the PCB. This bit enables/disables VLAN tagging for the socket.
A new bit is defined in the "flags" field of the pbuf struct. This bit indicates if the frame shall be sent with a VLAN header. pbuf_alloc must also allocate room for 4 bytes more in the LINK header when this bit is set.

The existing "tos" field of the pcb is mapped to the "pcp" field in the VLAN tag as well as to the TOS field in the IP header.

With this method it could be possible to add support for outgoing VLAN taggning for QoS purposes, without having to add a new argument to a lot of internal LwIP functions.

What do you think?

Timmy Brolin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]