Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Zeta integration implementation #158

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
27ebd45
Zeta-integration-impleementation-inteface
zhangml Oct 29, 2020
ea64880
Zeta-integration-implementation
zhangml Oct 29, 2020
6fc5c35
Zeta-integration-implementation
zhangml Nov 5, 2020
b2ef4c8
Merge branch 'master' of https://github.com/futurewei-cloud/alcor-con…
zhangml Nov 11, 2020
2b1d9eb
aca_oam_server_implementation
zhangml Nov 11, 2020
946d987
oam_server_implement
zhangml Nov 11, 2020
3aa3ca9
consume the latest proto3 contract
er1cthe0ne Nov 13, 2020
040fecf
print out the new port and zeta fields
er1cthe0ne Nov 13, 2020
8f6430a
fix comments and text
er1cthe0ne Nov 13, 2020
d90d7f0
aca_zeta_state_handler
zhangml Nov 16, 2020
916dc53
added L2 port/neighbor delete plus updated tests
er1cthe0ne Nov 17, 2020
7504c8c
fixing ovs_L3 test
er1cthe0ne Nov 17, 2020
b48378a
move the handling of host DVR mac restore to the router level
er1cthe0ne Nov 17, 2020
c9ac291
improve the above implementation
er1cthe0ne Nov 17, 2020
75d9d84
L3 neighbor delete
er1cthe0ne Nov 18, 2020
e0c93ef
delete aca_zeta_state_handler, add aca_oam_port_manager
zhangml Nov 18, 2020
400af80
update
zhangml Nov 18, 2020
eaf41ac
zhangml Nov 18, 2020
6c1bfac
adding L3 neighbor delete test case
er1cthe0ne Nov 19, 2020
42327c6
consume the latest schema
er1cthe0ne Nov 19, 2020
195d401
adding neighbor delete into traffic test cases
er1cthe0ne Nov 19, 2020
223e839
fixing delete test cases
er1cthe0ne Nov 19, 2020
3fd3067
fixing test cases
er1cthe0ne Nov 19, 2020
07d90d6
fixing tests
er1cthe0ne Nov 19, 2020
4d179d2
port-delete
zhangml Nov 19, 2020
1fb60d4
port-delete
zhangml Nov 19, 2020
3df2f82
modify update_port_state_workitem
zhangml Nov 19, 2020
e3c3682
modify update_port_state_workitem
zhangml Nov 19, 2020
33e16a2
take in the latest contract change
er1cthe0ne Nov 23, 2020
48c3d46
modify aca_oam_port_manager
zhangml Nov 23, 2020
304e330
modify aca_dateplane_ovs
zhangml Nov 23, 2020
ab88ba1
Added the creation and deletion of oam server ports, and the creation…
zhangml Nov 23, 2020
c01a0a9
Added the creation and deletion of oam server ports, and the creation…
zhangml Nov 23, 2020
850fcb3
Added the creation and deletion of oam server ports, and the creation…
zhangml Nov 23, 2020
fea3f58
Added the creation and deletion of oam server ports, and the creation…
zhangml Nov 23, 2020
1fdf845
add unicast/multicast default flows
zhangml Nov 24, 2020
f6ac46e
add unicast/multicast default flows
zhangml Nov 25, 2020
73e4761
Add unicast flow initialization rules,fixed some bug
zhangml Nov 25, 2020
50430d0
update alcor submodule
zhangml Nov 26, 2020
2181e37
making basic and two machines DISABLED_2_ports_CREATE_test_traffic_PA…
er1cthe0ne Nov 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 132 additions & 0 deletions include/aca_oam_server.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
// Copyright 2019 The Alcor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef ACA_OAM_SERVER_H
#define ACA_OAM_SERVER_H

#include <cstdint>
#include <string>
#include <arpa/inet.h>
#include <net/ethernet.h>
#include <netinet/ether.h>

#include "goalstateprovisioner.grpc.pb.h"

using namespace std;
namespace aca_oam_server
{
//OAM Message Type
//#define OAM_MSG_NONE
#define SIZE_OP_CODE 8
#define OAM_SOCKET_PORT 8300
er1cthe0ne marked this conversation as resolved.
Show resolved Hide resolved
#define OAM_MSG_FLOW_INJECTION (0x0)
#define OAM_MSG_FLOW_DELETION (0x1)
#define OAM_MSG_NONE (0x3)
#define OAM_MSG_MAX (0x3)

struct oam_match{
string sip;
string dip;
string sport;
string dport;
string proto;
string vni;
};

struct oam_action{
string inst_nw_dst;
string node_nw_dst;
string inst_dl_dst;
string node_dl_dst;
string idle_timeout;
};


struct flow_inject_msg{
struct in_addr inner_src_ip; // Inner Packet SIP
struct in_addr inner_dst_ip; // Inner Packet DIP
uint16_t src_port; // Inner Packet SPort
uint16_t dst_port; // Inner Packet DPort
uint8_t proto; // Inner Packet Protocol
uint8_t vni[4]; // Inner Packet Protocol
struct in_addr inst_dst_ip; // Destination Inst IP
struct in_addr node_dst_ip; // Destination Node IP
// struct ether_addr *inst_dst_mac; // Destination Inst MAC
// struct ether_addr *node_dst_mac; // Destination Node MAC
uint8_t inst_dst_mac[6];
uint8_t node_dst_mac[6];
uint16_t idle_timeout; // 0 - 65536s
};

struct flow_del_msg{
struct in_addr inner_src_ip;
struct in_addr inner_dst_ip;
uint16_t src_port;
uint16_t dst_port;
uint8_t proto;
uint8_t vni[4];
};

struct oam_message{
uint64_t op_code;
union op_data{
struct flow_inject_msg msg_inject_flow;
struct flow_del_msg msg_del_flow;
}data;
};


class ACA_Oam_Server {
public:
ACA_Oam_Server();
~ACA_Oam_Server();

static ACA_Oam_Server &get_instance();

void _init_oam_ofp();

void _deinit_oam_ofp();

void oams_recv(void *message);

uint8_t _get_message_type(oam_message *oammsg);

oam_match get_oam_match_field(oam_message *oammsg);

oam_action get_oam_action_field(oam_message *oammsg);

int add_direct_path(oam_match match, oam_action action);

int del_direct_path(oam_match match);

void _init_oam_msg_ops();

int _validate_oam_message(oam_message *oammsg);

void _standardize_mac_address(string &mac_string);

void _parse_oam_flow_injection(oam_message *oammsg);

void _parse_oam_flow_deletion(oam_message *oammsg);

void (aca_oam_server::ACA_Oam_Server ::*_parse_oam_msg_ops[OAM_MSG_MAX])(
oam_message *oammsg);

string _get_mac_addr(uint8_t *mac);

string get_vpc_id(uint8_t *vni);
er1cthe0ne marked this conversation as resolved.
Show resolved Hide resolved

};
}// namespace aca_oam_server
#endif // #ifndef ACA_OAM_SERVER_H
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ set(SOURCES
./ovs/ovs_control.cpp
./ovs/aca_ovs_control.cpp
./dhcp/aca_dhcp_state_handler.cpp
./dhcp/aca_dhcp_server.cpp
./dhcp/aca_dhcp_server.cpp
./zeta/aca_oam_server.cpp
)
FIND_LIBRARY(RDKAFKA rdkafka /usr/lib/x86_64-linux-gnu NO_DEFAULT_PATH)
FIND_LIBRARY(CPPKAFKA cppkafka /usr/local/lib NO_DEFAULT_PATH)
Expand Down
7 changes: 7 additions & 0 deletions src/ovs/aca_ovs_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <netinet/ip.h>
#include <arpa/inet.h>
#include "aca_dhcp_server.h"
#include "aca_oam_server.h"

using namespace std;
using namespace ovs_control;
Expand Down Expand Up @@ -264,6 +265,12 @@ void ACA_OVS_Control::parse_packet(uint32_t in_port, void *packet)
aca_dhcp_server::ACA_Dhcp_Server::get_instance().dhcps_recv(
in_port, const_cast<unsigned char *>(payload));
}

/* oam message procedure */
if (udp_dport == OAM_SOCKET_PORT){
ACA_LOG_INFO("%s", " Message Type: OAM\n");
aca_oam_server::ACA_Oam_Server::get_instance().oams_recv(const_cast<unsigned char *>(payload));
}
}
}
}
Expand Down
Loading