Skip to content

Add bridge service#125

Merged
frisso merged 6 commits intopolycube-network:masterfrom
gianlu33:project_stppbridge
Jun 6, 2019
Merged

Add bridge service#125
frisso merged 6 commits intopolycube-network:masterfrom
gianlu33:project_stppbridge

Conversation

@gianlu33
Copy link
Copy Markdown
Contributor

L2 bridge service, features:

  • VLAN support
  • Per-VLAN STP

@gianlu33 gianlu33 requested a review from a team as a code owner May 11, 2019 12:55
@gianlu33 gianlu33 force-pushed the project_stppbridge branch 2 times, most recently from 295b398 to 821c556 Compare May 14, 2019 21:00
Copy link
Copy Markdown
Contributor

@mauriciovasquezbernal mauriciovasquezbernal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @gianlu33,

The code overall looks good to me, I some comments of things to be improved, just to summarize:

  • trunk and access inside the ports are very similar to the stp case we already discussed, those objects are created automatically by the code and the user is not able to create nor delete them, additionally those objects should only exists when the port is configured in such mode, this will avoid all the checks of port mode in PortsTrunk and PortsAccess.
  • there are some functions that are not used, they can be removed.
  • remove this-> and unseful comments, add copyright headers.

Comment thread src/services/pcn-bridge/cmake/LoadFileAsVariable.cmake Outdated
Comment thread src/services/pcn-bridge/src/Bridge.cpp Outdated
Comment thread src/services/pcn-bridge/src/Fdb.cpp Outdated
Comment thread src/services/pcn-bridge/src/Bridge.cpp Outdated
Comment thread src/services/pcn-bridge/test/vlan_and_stp/test1.sh Outdated
Comment thread src/services/pcn-bridge/src/PortsStp.cpp Outdated
Comment thread src/services/pcn-bridge/src/PortsStp.cpp Outdated
Comment thread src/services/pcn-bridge/src/PortsStp.h Outdated
Comment thread src/services/pcn-bridge/src/PortsStp.cpp Outdated
Comment thread src/services/pcn-bridge/src/PortsStp.cpp Outdated
@gianlu33 gianlu33 force-pushed the project_stppbridge branch 7 times, most recently from 66f157d to 2860c23 Compare May 20, 2019 10:35
Copy link
Copy Markdown
Contributor

@mauriciovasquezbernal mauriciovasquezbernal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor details yet to fix, overall looks very good.
I'll try to do some tests in few hours/days.

Comment thread src/services/pcn-bridge/src/Bridge.cpp Outdated
Comment thread src/services/pcn-bridge/src/Bridge.cpp Outdated
Comment thread src/services/pcn-bridge/src/Bridge.cpp Outdated
Comment thread src/services/pcn-bridge/src/Bridge.h Outdated
Comment thread src/services/pcn-bridge/src/PortsTrunk.cpp Outdated
Comment thread src/services/pcn-bridge/src/FdbEntry.cpp Outdated
Comment thread src/services/pcn-bridge/src/FdbEntry.cpp Outdated
Comment thread src/services/pcn-bridge/src/FdbEntry.cpp Outdated
Comment thread src/services/pcn-bridge/src/FdbEntry.cpp Outdated
Comment thread src/services/pcn-bridge/src/FdbEntry.h Outdated
@gianlu33 gianlu33 force-pushed the project_stppbridge branch 5 times, most recently from 06b95a7 to 7a55e89 Compare May 23, 2019 16:20
Copy link
Copy Markdown
Contributor

@mauriciovasquezbernal mauriciovasquezbernal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks very food to me, kudos on the work.

There are two small details that I would like to get improved.

  1. The 300 constant is used some times in the code, this should be avoided as this is defined in the datamodel.
  2. When the bridge is created this is possible that the code has to be compiled twice, the first one in the bridge constructor and the second one when setAgingTime. It would be nice to rework the code a little bit so it takes the correct value of the aging time from he beginning and and compiles just once.

Comment thread src/services/pcn-bridge/src/Bridge.cpp Outdated
Comment thread src/services/pcn-bridge/src/Bridge.cpp Outdated
Comment thread src/services/pcn-bridge/src/Bridge.cpp Outdated
Comment thread src/services/pcn-bridge/src/Fdb.h Outdated
Comment thread src/services/pcn-bridge/src/Fdb.cpp Outdated
@gianlu33 gianlu33 force-pushed the project_stppbridge branch from 7a55e89 to 77f7867 Compare May 24, 2019 09:52
Comment thread src/services/pcn-bridge/src/Bridge_dp_no_stp.c Outdated
Comment thread src/services/pcn-bridge/src/Bridge_dp_no_stp.c Outdated
Comment thread src/services/pcn-bridge/src/Bridge_dp_no_stp.c Outdated
Comment thread src/services/pcn-bridge/src/Bridge_dp_no_stp.c Outdated
Comment thread src/services/pcn-bridge/src/Bridge_dp_no_stp.c Outdated
Comment thread src/services/pcn-bridge/src/Bridge_dp_stp.c Outdated
@gianlu33 gianlu33 force-pushed the project_stppbridge branch 2 times, most recently from e71ced3 to d0a56b0 Compare May 26, 2019 13:10
@gianlu33 gianlu33 force-pushed the project_stppbridge branch 2 times, most recently from d252f79 to 28539de Compare May 28, 2019 14:42
Comment thread src/services/pcn-bridge/src/Bridge_dp.c
Comment thread src/services/pcn-bridge/src/Bridge_dp.c
Comment thread src/services/pcn-bridge/src/Bridge_dp.c
@gianlu33 gianlu33 force-pushed the project_stppbridge branch from 28539de to 4aa8e85 Compare May 28, 2019 16:45
@gianlu33 gianlu33 force-pushed the project_stppbridge branch 4 times, most recently from f5d23f2 to 0995767 Compare May 30, 2019 10:26
@gianlu33 gianlu33 force-pushed the project_stppbridge branch 2 times, most recently from 73e8ec5 to 7612729 Compare May 30, 2019 23:34
Features:
- The datapath code is regenerated automatically whenever stp is enabled
or disabled, so it is not necessary to configure that parameter at the
creation of the bridge.
- For each port, there are one or more PortsStp instances according to
the VLANs allowed for that port.
- A Stp instance is created automatically, when the first PortStp instance
for the same VLAN is created.
- In the same way, a Stp instance is destroyed automatically, when the last
PortsStp instance for the same VLAN is destroyed.
- Since the management of Stp/PortsStp instances is done automatically, the
user is not allowed to create/destroy manually those instances, but only to
configure their parameters.
- Containers Access/Trunk do not exist at the same time; if the port is
configured in access mode the user can't configure trunk parameters and
vice versa

Signed-off-by: Gianluca Scopelliti <gianlu.1033@gmail.com>
@gianlu33 gianlu33 force-pushed the project_stppbridge branch 2 times, most recently from 2700bd1 to 71e8862 Compare May 31, 2019 15:25
@gianlu33 gianlu33 force-pushed the project_stppbridge branch from ec9567e to 7b19d6b Compare June 5, 2019 15:24
These tests verify the correctness of the bridge.
In each folder there are tests for each feature
(connectivity, vlan, stp, vlan_and_stp).

Signed-off-by: Gianluca Scopelliti <gianlu.1033@gmail.com>
@gianlu33 gianlu33 force-pushed the project_stppbridge branch from 7b19d6b to 9acc935 Compare June 5, 2019 19:17
Add documentation for bridge, with three examples:
- Connectivity
- VLAN configuration
- STP configuration

Signed-off-by: Gianluca Scopelliti <gianlu.1033@gmail.com>
@frisso
Copy link
Copy Markdown
Contributor

frisso commented Jun 6, 2019

Really great, @gianlu33 (and also @mauriciovasquezbernal)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants