[LiSA-Devel] Access/trunk vs. switched/routed
Radu Rendec
radu.rendec at mindbit.ro
Fri May 3 00:54:40 EEST 2013
Hi,
While trying to answer some of Claudiu's questions in the previous
message, I figured out there may be a missing function in
switch_operations.
For a given port, there are 2 totally different aspects, but we call
both of them "mode" and I think this is quite confusing.
1. A port can be either "access" or "trunk". In the CLI this
corresponds to "switchport mode access", "switchport mode trunk"
and "no switchport mode", with the 1st and the 3rd meaning quite
the same thing. In the switch module, it corresponds to the
SWCFG_SETACCESS and SWCFG_SETTRUNK sub-commands and it's
implemented in sw_set_port_trunk() and sw_set_port_access(),
where the latter is a wrapper for the former.
2. A port can be either "switched" or "routed". In the CLI this
corresponds to "switchport" and "no switchport", with
"switchport" being the default. In the switch module, it
corresponds to SWCFG_SETSWPORT and is implemented in
sw_set_switchport. In the userspace code, this is defined as
SW_IF_SWITCHED, SW_IF_ROUTED and SW_IF_VIF. VIF interfaces are a
special case because they take part in the switching process
(like switched ports) but can be (and usually are) assigned IP
addresses (like routed ports). Therefore, the VIF is treated as
a 3rd option to the interface type.
To avoid confusion, I suggest to call #1 "port mode" and #2 "port type".
According to the description, if_set_mode() in switch_operations
controls #1. But then it means there is no support for #2. I vaguely
recall that support for #2 wasn't complete in the CLI-only
implementation either, but I'm not sure anymore...
Anyway, for the bridge+8021q, setting a port to routed should completely
remove it from all vlan bridges, but sill keep its configuration (such
as description, access vlan, trunk vlans, etc) in the userspace SHM
area.
Radu
More information about the LiSA-Devel
mailing list