Skip to content

Align with new HLD schema #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion misc/tests/utils_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,19 @@ TEST(Utils, ValidUrlConversion)
{"sonic/dash.acl_rule.AclRule", "DASH_ACL_RULE_TABLE"},
{"sonic/dash.appliance.Appliance", "DASH_APPLIANCE_TABLE"},
{"sonic/dash.eni.Eni", "DASH_ENI_TABLE"},
{"sonic/dash.eni_route.EniRoute", "DASH_ENI_ROUTE_TABLE"},
{"sonic/dash.meter_policy.MeterPolicy", "DASH_METER_POLICY_TABLE"},
{"sonic/dash.meter_rule.MeterRule", "DASH_METER_RULE_TABLE"},
{"sonic/dash.meter.Meter", "DASH_METER_TABLE"},
{"sonic/dash.pa_validation.PaValidation", "DASH_PA_VALIDATION_TABLE"},
{"sonic/dash.prefix_tag.PrefixTag", "DASH_PREFIX_TAG_TABLE"},
{"sonic/dash.qos.Qos", "DASH_QOS_TABLE"},
{"sonic/dash.route_group.RouteGroup", "DASH_ROUTE_GROUP_TABLE"},
{"sonic/dash.route_rule.RouteRule", "DASH_ROUTE_RULE_TABLE"},
{"sonic/dash.route_type.RouteType", "DASH_ROUTE_TYPE_TABLE"},
{"sonic/dash.route.Route", "DASH_ROUTE_TABLE"},
{"sonic/dash.routing_appliance.RoutingAppliance", "DASH_ROUTING_APPLIANCE_TABLE"},
{"sonic/dash.tunnel.Tunnel", "DASH_TUNNEL_TABLE"},
{"sonic/dash.vnet_mapping.VnetMapping", "DASH_VNET_MAPPING_TABLE"},
{"sonic/dash.vnet.Vnet", "DASH_VNET_TABLE"},
};
Expand Down Expand Up @@ -97,7 +101,8 @@ TEST(Utils, CInterface)

const std::string json_str1 =
"{\n"
" \"action_type\": \"ROUTING_TYPE_VNET\",\n"
" \"action_type\": \"ROUTING_TYPE_UNSPECIFIED\",\n"
" \"routing_type\": \"ROUTING_TYPE_VNET\",\n"
" \"vnet\": \"Vnet2\"\n"
"}\n";

Expand Down
3 changes: 2 additions & 1 deletion proto/eni.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ message Eni {
string vnet = 6;
// Optional
// Private Link encoding for IPv6 SIP transpositions
optional types.IpPrefix pl_sip_encoding = 7;
optional types.IpPrefix pl_sip_encoding = 7 [deprecated = true];
// Optional
// Underlay SIP (ST GW VIP) to be used for all private link transformation for this ENI
optional types.IpAddress pl_underlay_sip = 8;
Expand All @@ -33,6 +33,7 @@ message Eni {
// Optional
// IPv6 meter policy ID
optional string v6_meter_policy_id = 10;
optional bool disable_fast_path_icmp_flow_redirection = 11;
}

message EniKey {
Expand Down
12 changes: 12 additions & 0 deletions proto/eni_route.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto3";

package dash.eni_route;

message EniRoute {
// Group ID in DASH_ROUTE_GROUP_TABLE
string group_id = 1;
}

message EniRouteKey {
string eni = 1;
}
13 changes: 13 additions & 0 deletions proto/pa_validation.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto3";

package dash.pa_validation;

import "types.proto";

message PaValidation {
repeated types.IpAddress addresses = 1;
}

message PaValidationKey {
uint32 vni = 1;
}
28 changes: 17 additions & 11 deletions proto/route.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,50 @@ import "types.proto";
import "route_type.proto";

message VnetDirect {
// destination vnet name if action_type is {vnet, vnet_direct}, a vnet other than eni's vnet means vnet peering
// destination vnet name if routing_type is {vnet, vnet_direct}, a vnet other than eni's vnet means vnet peering
string vnet = 1;
// overly_ip to lookup if routing_type is {vnet_direct}, use dst ip from packet if not specified
optional types.IpAddress overlay_ip = 2;
}

message ServiceTunnel {
// overlay ipv6 src ip if routing_type is {servicetunnel}
types.IpAddress overlay_sip = 1;
types.IpAddress overlay_sip = 1 [deprecated = true]; // replaced by overlay_sip_prefix
// overlay ipv6 dst ip if routing_type is {servicetunnel}
types.IpAddress overlay_dip = 2;
types.IpAddress overlay_dip = 2 [deprecated = true]; // replaced by overlay_dip_prefix
// underlay ipv4 src ip if routing_type is {servicetunnel}, this is the ST GW VIP (for ST traffic) or custom VIP
types.IpAddress underlay_sip = 3;
// underlay ipv4 dst ip to override if routing_type is {servicetunnel}, use dst ip from packet if not specified
types.IpAddress underlay_dip = 4;
types.IpAddress overlay_sip_prefix = 5;
types.IpAddress overlay_dip_prefix = 6;
}

message Route {
route_type.RoutingType action_type = 1;
route_type.RoutingType action_type = 1 [deprecated = true]; // renamed as routing_type
oneof Action {
// destination vnet name if action_type is vnet,, a vnet other than eni's vnet means vnet peering
// destination vnet name if routing_type is vnet,, a vnet other than eni's vnet means vnet peering
string vnet = 2;
// destination vnet name if action_type is vnet_direct,, a vnet other than eni's vnet means vnet peering
// destination vnet name if routing_type is vnet_direct,, a vnet other than eni's vnet means vnet peering
route.VnetDirect vnet_direct = 3;
// appliance id if action_type is {appliance}
// appliance id if routing_type is {appliance}
string appliance = 4;
// service tunnel if action_type is {service_tunnel}
// service tunnel if routing_type is {service_tunnel}
route.ServiceTunnel service_tunnel = 5;
}
// Metering policy lookup enable (optional), default = false
optional bool metering_policy_en = 6;
optional bool metering_policy_en = 6 [deprecated = true];
// Metering class-id, used if metering policy lookup is not enabled
optional uint64 metering_class = 7;
optional uint64 metering_class = 7 [deprecated = true];
optional uint32 metering_class_or = 8;
optional uint32 metering_class_and = 9;
route_type.RoutingType routing_type = 10;
}

// ENI route table with CA prefix for packet Outbound
message RouteKey {
string eni = 1;
string eni = 1 [deprecated = true]; // renamed as group_id
// IP prefix string with prefix length. E.G. 10.1.0.0/16
string prefix = 2;
string group_id = 3;
}
12 changes: 12 additions & 0 deletions proto/route_group.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto3";

package dash.route_group;

message RouteGroup {
optional string guid = 1;
string version = 2;
}

message RouteGroupKey {
string group_id = 1;
}
9 changes: 7 additions & 2 deletions proto/route_rule.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "route_type.proto";

message RouteRule {
// reference to routing type, action can be decap or drop
route_type.RoutingType action_type = 1;
route_type.RoutingType action_type = 1 [deprecated = true]; // renamed as routing_type
// priority of the rule, lower the value, higher the priority
uint32 priority = 2;
// Optional
Expand All @@ -20,10 +20,15 @@ message RouteRule {
optional bool pa_validation = 5;
// Optional
// Metering class-id
optional uint64 metering_class = 6;
optional uint64 metering_class = 6 [deprecated = true]; // replaced by metering_class_or and metering_class_and
// Optional
// optional region_id which the vni/prefix belongs to as a string for any vendor optimizations
optional string region = 7;
route_type.RoutingType routing_type = 8;
// Optional
// Metering class aggregate bits
optional uint32 metering_class_or = 9;
optional uint32 metering_class_and = 10;
}

// ENI Inbound route table with VNI and optional SRC PA prefix
Expand Down
2 changes: 1 addition & 1 deletion proto/route_type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ enum RoutingType {
ROUTING_TYPE_VNET_ENCAP = 4;
ROUTING_TYPE_APPLIANCE = 5;
ROUTING_TYPE_PRIVATELINK = 6;
ROUTING_TYPE_PRIVATELINKNSG = 7;
ROUTING_TYPE_PRIVATELINKNSG = 7 [deprecated = true];
ROUTING_TYPE_SERVICETUNNEL = 8;
ROUTING_TYPE_DROP = 9;
}
Expand Down
18 changes: 18 additions & 0 deletions proto/tunnel.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
syntax = "proto3";

package dash.tunnel;

import "route_type.proto";
import "types.proto";

message Tunnel {
repeated types.IpAddress endpoints = 1;
route_type.EncapType encap_type = 2;
uint32 vni = 3;
optional uint32 metering_class_or = 4;
}

// ENI Inbound route table with VNI and optional SRC PA prefix
message TunnelKey {
string tunnel_name = 1;
};
17 changes: 11 additions & 6 deletions proto/vnet_mapping.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,37 @@ import "route_type.proto";

message VnetMapping {
// reference to routing type
route_type.RoutingType action_type = 1;
route_type.RoutingType action_type = 1 [deprecated = true]; // renamed as routing_type
// PA address for the CA
types.IpAddress underlay_ip = 2;
// Optional
// Inner dst mac
optional bytes mac_address = 3;
// Optional
// metering class-id
optional uint64 metering_class = 4;
optional uint64 metering_class = 4 [deprecated = true];
// Optional
// override the metering class-id coming from the route table
optional bool override_meter = 5;
optional bool override_meter = 5 [deprecated = true];
// Optional
// if true, use the destination VNET VNI for encap. If false or not specified, use source VNET's VNI
optional bool use_dst_vni = 6;
// Optional
optional bool use_pl_sip_eni = 7;
// Optional
// overlay src ip if routing_type is {privatelink}
optional types.IpAddress overlay_sip = 8;
optional types.IpAddress overlay_sip = 8 [deprecated = true]; // changed to overlay_sip_prefix
// Optional
// overlay dst ip if routing_type is {privatelink}
optional types.IpAddress overlay_dip = 9;
optional types.IpAddress overlay_dip = 9 [deprecated = true]; // changed to overlay_dip_prefix
// Optional
// ID of routing appliance if routing_type is {privatelinknsg}
optional uint32 routing_appliance_id = 10;
optional uint32 routing_appliance_id = 10 [deprecated = true];
optional uint32 metering_class_or = 12;
optional types.IpPrefix overlay_sip_prefix = 13;
optional types.IpPrefix overlay_dip_prefix = 14;
optional string tunnel = 15;
route_type.RoutingType routing_type = 16;
}

// CA-PA mapping table for Vnet
Expand Down