-
Notifications
You must be signed in to change notification settings - Fork 29
Zeta integration implementation #158
Zeta integration implementation #158
Conversation
Hello, Eric. Is there a specific implementation of OAM packet in the zeta gateway now? I want to understand its data structure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good start in the right direction. You have good understanding on the proposed code change. The next step is to get is ready to merge without the full implementation. We just needed to make sure the change doesn't break any existing functionality.
I am working with Alcor team on the needed contract update so that we can send down an updated goal state message with Zeta info.
please reference this: https://github.com/futurewei-cloud/zeta/blob/main/docs/design/zeta_system_design.md#735-in-band-operation And look at how DHCP model parse the packet to get some idea. |
After the ACA receives the OAM package, it will parse the information in it to install and delete the direct path. But installing the direct path needs to specify the VXLAN interface, that is, the mapping relationship between the host and the VXLAN interface is required. Is this mapping relationship stored in ACA? Or does ACA need to dump flow or view OVSDB interface information to get it? |
If you are talking about the "remote" host (IP), that information is embedded inside the OAM packet:
|
|
I mean how to query the corresponding VXLAN interface after knowing the remote ip? For example: |
okay, I understand now. The remote IP was not known before ACA receives the OAM packet. Therefore, after ACA receives the OAM packet, it will need to create this remote port "vxlan233" corresponding to 172.16.62.233 if it is not yet there. There are existing code/logic to create this port, and also internal data structure to keep track of these "outports". Let me know if you have trouble finding it. |
okay, thanks, I have found the corresponding code.
|
src/zeta/aca_oam_server.cpp
Outdated
|
||
if (!aca_is_port_on_same_host(remote_host_ip)) { | ||
ACA_LOG_INFO("%s", "port_neighbor not exist!\n"); | ||
string neighbor_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you will get the neighbor ID from the oam packet.
src/zeta/aca_oam_server.cpp
Outdated
// get netigbor_id | ||
|
||
//crate neighbor_port | ||
aca_ovs_l2_programmer::ACA_OVS_L2_Programmer::get_instance().create_or_update_l2_neighbor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you can reuse the same fuction create_or_update_l2_neighbor.
For Zeta enabled port, looks like we can still do the outport for both ZGC gateway path and direct path. Let me know if that's not doable.
That's the source side, for the destination side, we don't expect an OAM packet to go there to setup direct path (until the destination side send packet to the source side). In order for the destination side to receive the packet, we need to create the "outport". The idea is during the creation Zeta supported ports, it should create a generic "outport" to accept all vxlan packets.
If this generic "outport" for all vxlan packets would have problem working with the current aca remote IP specific "outport", we will then switch all the aca implementation for both Zeta supported and non-zeta supported to use this generic "outport".
",idle_timeout=" + action.idle_timeout + ",output:" + outport_name; | ||
|
||
// Adding unicast rules in table20 | ||
string opt = "table=20,priority=50," + cmd_match + "," + cmd_action; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great aproach, keep in mind table 20 (unicast) is not hooked up in current ACA yet, you will needed to hook it up :) using openflow rules.
src/zeta/aca_zeta_programming.cpp
Outdated
ACA_Vlan_Manager::get_instance().set_oam_server_port(vpc_id, oam_server_port); | ||
|
||
//update oam_ports_table and add the OAM punt rule also if this is the first port in the VPC | ||
Aca_Oam_Port_Manager::get_instance().add_vpc(oam_server_port, vpc_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this implementation has two place to track similar things, please consolidate to avoid confusions:
set_oam_server_port - put the oam_port info into the vpc table
Aca_Oam_Port_Manager::get_instance().add_vpc - put vpc ids into the unordered_map using oam_port as the key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we really need to address this as we are using two places to store same information.
string cmd = "-O OpenFlow13 add-group br-tun group_id=" + zeta_cfg->group_id + ",type=select"; | ||
list<string>::iterator it; | ||
for (it = zeta_cfg->zeta_buckets.begin(); it != zeta_cfg->zeta_buckets.end(); it++) { | ||
string outport_name = aca_get_outport_name(alcor::schema::NetworkType::VXLAN, *it); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you will need to create an outport to send traffic to ZGC gateway.
@zhangml I have merged my aca change to take in the latest contract, you should take the change into your branch to continuing the development. Next steps:
|
|
||
static Aca_Oam_Port_Manager &get_instance(); | ||
|
||
void create_entry_unsafe(uint32_t port_number); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think we need to use uint32_t, we can use uint directly (it will likely be 32bit anyway. This will give compile a chance to optimize it.
_oam_ports_table_mutex.lock(); | ||
if (_oam_ports_table.find(port_number) == _oam_ports_table.end()) { | ||
create_entry_unsafe(port_number); | ||
_create_oam_ofp(port_number); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_create_oam_ofp can return failure now, let's propagate the failure to this add_vpc function so that it would return an overall_rc.
if (found_auxgateway.aux_gateway_type() == ZETA) { | ||
ACA_LOG_INFO("%s", "AuxGateway_type is zeta!\n"); | ||
// Delete the zeta settings of vpc | ||
overall_rc = ACA_Zeta_Programming::get_instance().delete_zeta_config( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happen when there is multiple ports (from the same VPC) sharing this zeta configuration? when one of the port is deleted, we cannot simply delete the configuration because it will affect the other port which is not deleted.
Also multiple VPC can share a ZGC configuration.
@zhangml - as a reminder, please do give me permission to make code change in your branch: https://github.com/zhangml/alcor-control-agent/ |
@zhangml - CI has passed now, and I accepted the invite for your branch. Let's focus on getting the test cases passing as the next step: https://github.com/futurewei-cloud/alcor-control-agent/wiki/How-to-run-the-full-suite-of-aca_tests |
My test result: current test results on your branch after my change :) . All tests are passing now: ./build/tests/aca_tests: [ OK ] ovs_l2_test_cases.DISABLED_2_ports_CREATE_test_traffic_CHILD (484 ms) [----------] Global test environment tear-down [ OK ] ovs_l2_test_cases.DISABLED_2_ports_CREATE_test_traffic_PARENT (30555 ms) [ OK ] dhcp_request_test_case.DISABLED_l2_dhcp_test (3510 ms) [ OK ] dhcp_request_test_case.DISABLED_l3_dhcp_test (4506 ms) [ OK ] ovs_l3_test_cases.DISABLED_2_ports_ROUTING_test_traffic_one_machine (25777 ms) [ OK ] ovs_l3_test_cases.DISABLED_2_ports_ROUTING_test_traffic_PARENT (56857 ms) Next step I have merged my change into your branch. Please review. |
…RENT tests passing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some change and confirm all the existing test cases are passing with this change.
While the full Zeta support is not done yet. This initialize change laid out the framework and we can continue to iterate with new PRs and tracking individual issues to complete the implementation.
Since this change does not impact existing functionality and all the existing tests are passing. I am going to merge it now.
#149 Zeta integration implementation
This PR is the code implementation of the integration of Zeta and ACA. We have added some files:
Parse oam packet installation or delete direct path。
aca_oam_server.h
aca_oam_server.cpp
aca_oam_port_manager.h
aca_oam_port_manager.cpp
aca_test_oam.cpp
Receive alocr goal state message to update the group table.
aca_zeta_programming.h
aca_zeta_programming.cpp