Re: [ovs-dev] [PATCH] rstp: add ability to receive VLAN-tagged BPDUs
On Mon, Feb 18, 2019 at 12:07:54PM +0100, Matthias May wrote: > On 15/02/2019 01:28, Ben Pfaff wrote: > > On Fri, Feb 15, 2019 at 12:27:11AM +0100, Matthias May wrote: > >> On 14/02/2019 20:17, Ben Pfaff wrote: > >>> On Thu, Feb 14, 2019 at 10:58:48AM +0100, Matthias May via dev wrote: > There are switches which allow to transmit their BPDUs VLAN-tagged. > With this change OVS is able to receive VLAN-tagged BPDUs, but still > transmits its own BPDUs untagged. > This was tested against Westermo RFI-207-F4G-T3G. > > Signed-off-by: Matthias May > >>> > >>> Thanks for the patch. > >>> > >>> To me, it seems really odd to treat packets with and without an > >>> arbitrary VLAN header the same way. I could see it if the VLAN header > >>> had VID 0 or 1 or some other specified value, but it seems unusual to > >>> ignore it entirely. Is this standardized or a de facto standard of some > >>> kind? > >>> > >> > >> I totally agree. > >> To me a VLAN header has nothing lost on a BPDU of a (R)STP frame, simply > >> because (R)STP is not per VLAN. > >> > >> However the fact is that there are switches which are transmitting > >> frames on a VLAN. > >> > >> With this change we simply ignore the VLAN header if is present. The > >> meaning of the BPDU doesn't cheange. The provided information still is > >> not per VLAN and applies to all ports the same. > >> > >> This patch does not add the ability to transmit VLAN tagged BPDUs for > >> the same reasoning above: RSTP/STP is not supposed to be per VLAN. > >> I was thinking about adding to the patch that one can specify a VLAN via > >> config and only BPDUs with the configured VLAN are accepted. I guess > >> this is what you propose: only accept vlan tagged BPDUs on a specified > >> VLAN. > >> Having such a config-parameter would also enable to transmit the BPDUs > >> VLAN tagged. But I'm still of the opinion that this only suggests that > >> one could have an (R)STP tree per VLAN. > > > > I see we are basically in agreement, but I'd like more information, if > > you have it. > > > > Do the switches that transmit RSTP on a VLAN transmit it on a particular > > VLAN like 0 or 1? (Maybe they are transmitting them as priority-tagged > > frames for some reason?) If so, then it would be possible to accept > > just that VLAN. > > > > Hi Ben > The switch I tested against has config options to specify with which VLAN the > BPDUs should be transmitted. > From the tests I did, for this switch it doesn't matter if the received BPDUs > are tagged or not. The VLAN header is > simply ignored. > I have an open question with the vendor regarding this. > > I did some digging on the net how other switches handle this. E.g at [1]. > From what I get, switches which allow tagged BPDUs simply ignore the header. > > I started reading the 802.1d-2004 and 802.1q-2018, but so far haven't found > anything which specifies how this situation > should be handled. I guess networking doesn't always make total sense. It's a shame. I applied the patch to master, thanks! ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] rstp: add ability to receive VLAN-tagged BPDUs
On 15/02/2019 01:28, Ben Pfaff wrote: > On Fri, Feb 15, 2019 at 12:27:11AM +0100, Matthias May wrote: >> On 14/02/2019 20:17, Ben Pfaff wrote: >>> On Thu, Feb 14, 2019 at 10:58:48AM +0100, Matthias May via dev wrote: There are switches which allow to transmit their BPDUs VLAN-tagged. With this change OVS is able to receive VLAN-tagged BPDUs, but still transmits its own BPDUs untagged. This was tested against Westermo RFI-207-F4G-T3G. Signed-off-by: Matthias May >>> >>> Thanks for the patch. >>> >>> To me, it seems really odd to treat packets with and without an >>> arbitrary VLAN header the same way. I could see it if the VLAN header >>> had VID 0 or 1 or some other specified value, but it seems unusual to >>> ignore it entirely. Is this standardized or a de facto standard of some >>> kind? >>> >> >> I totally agree. >> To me a VLAN header has nothing lost on a BPDU of a (R)STP frame, simply >> because (R)STP is not per VLAN. >> >> However the fact is that there are switches which are transmitting >> frames on a VLAN. >> >> With this change we simply ignore the VLAN header if is present. The >> meaning of the BPDU doesn't cheange. The provided information still is >> not per VLAN and applies to all ports the same. >> >> This patch does not add the ability to transmit VLAN tagged BPDUs for >> the same reasoning above: RSTP/STP is not supposed to be per VLAN. >> I was thinking about adding to the patch that one can specify a VLAN via >> config and only BPDUs with the configured VLAN are accepted. I guess >> this is what you propose: only accept vlan tagged BPDUs on a specified VLAN. >> Having such a config-parameter would also enable to transmit the BPDUs >> VLAN tagged. But I'm still of the opinion that this only suggests that >> one could have an (R)STP tree per VLAN. > > I see we are basically in agreement, but I'd like more information, if > you have it. > > Do the switches that transmit RSTP on a VLAN transmit it on a particular > VLAN like 0 or 1? (Maybe they are transmitting them as priority-tagged > frames for some reason?) If so, then it would be possible to accept > just that VLAN. > Hi Ben The switch I tested against has config options to specify with which VLAN the BPDUs should be transmitted. >From the tests I did, for this switch it doesn't matter if the received BPDUs >are tagged or not. The VLAN header is simply ignored. I have an open question with the vendor regarding this. I did some digging on the net how other switches handle this. E.g at [1]. >From what I get, switches which allow tagged BPDUs simply ignore the header. I started reading the 802.1d-2004 and 802.1q-2018, but so far haven't found anything which specifies how this situation should be handled. BR Matthias [1] https://community.extremenetworks.com/extremeswitching-eos-230140/what-happens-if-an-s-series-receives-tagged-rstp-bpdus-7765211 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] rstp: add ability to receive VLAN-tagged BPDUs
On Fri, Feb 15, 2019 at 12:27:11AM +0100, Matthias May wrote: > On 14/02/2019 20:17, Ben Pfaff wrote: > > On Thu, Feb 14, 2019 at 10:58:48AM +0100, Matthias May via dev wrote: > >> There are switches which allow to transmit their BPDUs VLAN-tagged. > >> With this change OVS is able to receive VLAN-tagged BPDUs, but still > >> transmits its own BPDUs untagged. > >> This was tested against Westermo RFI-207-F4G-T3G. > >> > >> Signed-off-by: Matthias May > > > > Thanks for the patch. > > > > To me, it seems really odd to treat packets with and without an > > arbitrary VLAN header the same way. I could see it if the VLAN header > > had VID 0 or 1 or some other specified value, but it seems unusual to > > ignore it entirely. Is this standardized or a de facto standard of some > > kind? > > > > I totally agree. > To me a VLAN header has nothing lost on a BPDU of a (R)STP frame, simply > because (R)STP is not per VLAN. > > However the fact is that there are switches which are transmitting > frames on a VLAN. > > With this change we simply ignore the VLAN header if is present. The > meaning of the BPDU doesn't cheange. The provided information still is > not per VLAN and applies to all ports the same. > > This patch does not add the ability to transmit VLAN tagged BPDUs for > the same reasoning above: RSTP/STP is not supposed to be per VLAN. > I was thinking about adding to the patch that one can specify a VLAN via > config and only BPDUs with the configured VLAN are accepted. I guess > this is what you propose: only accept vlan tagged BPDUs on a specified VLAN. > Having such a config-parameter would also enable to transmit the BPDUs > VLAN tagged. But I'm still of the opinion that this only suggests that > one could have an (R)STP tree per VLAN. I see we are basically in agreement, but I'd like more information, if you have it. Do the switches that transmit RSTP on a VLAN transmit it on a particular VLAN like 0 or 1? (Maybe they are transmitting them as priority-tagged frames for some reason?) If so, then it would be possible to accept just that VLAN. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] rstp: add ability to receive VLAN-tagged BPDUs
On 14/02/2019 20:17, Ben Pfaff wrote: > On Thu, Feb 14, 2019 at 10:58:48AM +0100, Matthias May via dev wrote: >> There are switches which allow to transmit their BPDUs VLAN-tagged. >> With this change OVS is able to receive VLAN-tagged BPDUs, but still >> transmits its own BPDUs untagged. >> This was tested against Westermo RFI-207-F4G-T3G. >> >> Signed-off-by: Matthias May > > Thanks for the patch. > > To me, it seems really odd to treat packets with and without an > arbitrary VLAN header the same way. I could see it if the VLAN header > had VID 0 or 1 or some other specified value, but it seems unusual to > ignore it entirely. Is this standardized or a de facto standard of some > kind? > I totally agree. To me a VLAN header has nothing lost on a BPDU of a (R)STP frame, simply because (R)STP is not per VLAN. However the fact is that there are switches which are transmitting frames on a VLAN. With this change we simply ignore the VLAN header if is present. The meaning of the BPDU doesn't cheange. The provided information still is not per VLAN and applies to all ports the same. This patch does not add the ability to transmit VLAN tagged BPDUs for the same reasoning above: RSTP/STP is not supposed to be per VLAN. I was thinking about adding to the patch that one can specify a VLAN via config and only BPDUs with the configured VLAN are accepted. I guess this is what you propose: only accept vlan tagged BPDUs on a specified VLAN. Having such a config-parameter would also enable to transmit the BPDUs VLAN tagged. But I'm still of the opinion that this only suggests that one could have an (R)STP tree per VLAN. BR Matthias ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] rstp: add ability to receive VLAN-tagged BPDUs
On Thu, Feb 14, 2019 at 10:58:48AM +0100, Matthias May via dev wrote: > There are switches which allow to transmit their BPDUs VLAN-tagged. > With this change OVS is able to receive VLAN-tagged BPDUs, but still > transmits its own BPDUs untagged. > This was tested against Westermo RFI-207-F4G-T3G. > > Signed-off-by: Matthias May Thanks for the patch. To me, it seems really odd to treat packets with and without an arbitrary VLAN header the same way. I could see it if the VLAN header had VID 0 or 1 or some other specified value, but it seems unusual to ignore it entirely. Is this standardized or a de facto standard of some kind? ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH] rstp: add ability to receive VLAN-tagged BPDUs
There are switches which allow to transmit their BPDUs VLAN-tagged. With this change OVS is able to receive VLAN-tagged BPDUs, but still transmits its own BPDUs untagged. This was tested against Westermo RFI-207-F4G-T3G. Signed-off-by: Matthias May --- ofproto/ofproto-dpif-xlate.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index acd4817c2..7830fee2e 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -1771,9 +1771,12 @@ xport_rstp_should_manage_bpdu(const struct xport *xport) return rstp_should_manage_bpdu(xport_get_rstp_port_state(xport)); } +#define LEN_WITHOUT_VLAN (ETH_HEADER_LEN + LLC_HEADER_LEN) +#define LEN_WITH_VLAN (VLAN_HEADER_LEN + LEN_WITHOUT_VLAN) static void rstp_process_packet(const struct xport *xport, const struct dp_packet *packet) { +int len; struct dp_packet payload = *packet; struct eth_header *eth = dp_packet_data(); @@ -1787,7 +1790,9 @@ rstp_process_packet(const struct xport *xport, const struct dp_packet *packet) dp_packet_set_size(, ntohs(eth->eth_type) + ETH_HEADER_LEN); } -if (dp_packet_try_pull(, ETH_HEADER_LEN + LLC_HEADER_LEN)) { +/* Pull a bit less payload when the BPDU is enveloped in a VLAN header */ +len = (ntohs(eth->eth_type) == 0x8100) ? LEN_WITH_VLAN : LEN_WITHOUT_VLAN; +if (dp_packet_try_pull(, len)) { rstp_port_received_bpdu(xport->rstp_port, dp_packet_data(), dp_packet_size()); } -- 2.20.1 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev