diff --git a/proto/.gitignore b/proto/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..79d17a55d24e501e34b462c9005e8e5429fc43ba --- /dev/null +++ b/proto/.gitignore @@ -0,0 +1,2 @@ +src/ +uml/generated diff --git a/proto/compile.sh b/proto/compile.sh index 85cf5c562fda22d44c47b341ed4a0d1e2f9a25e4..9f0acdb050d3e4d05dd8a8e374c157e2040142c1 100755 --- a/proto/compile.sh +++ b/proto/compile.sh @@ -1,7 +1,7 @@ #!/bin/bash python3 -m grpc_tools.protoc -I=./ --python_out=src/ --grpc_python_out=src/ *.proto #requires installation of protoc-gen-uml -export PATH=/home/osboxes/protoc-gen-uml/target/universal/stage/bin:$PATH +export PATH=${HOME}/protoc-gen-uml/target/universal/stage/bin:$PATH protoc --uml_out=uml/ -I ./ *.proto cd uml java -jar plantuml.7997.jar *.puml diff --git a/proto/policy.proto b/proto/policy.proto index 4b1b50985abd32cb02b56e66f15f31be5a4c04db..6a5874125820c576e75a5adb547173754b6e8316 100644 --- a/proto/policy.proto +++ b/proto/policy.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package policy; import "context.proto"; -import "service.proto"; service PolicyService { rpc PolicyAdd (PolicyRule) returns (PolicyRuleState) {} @@ -10,53 +9,77 @@ service PolicyService { rpc PolicyDelete (PolicyRule) returns (PolicyRuleState) {} rpc GetPolicy (PolicyRuleId) returns (PolicyRule) {} rpc GetPolicyByDeviceId (context.DeviceId) returns (PolicyRuleList) {} - rpc GetPolicyByServiceId (service.ServiceId) returns (PolicyRuleList) {} + rpc GetPolicyByServiceId (context.ServiceId) returns (PolicyRuleList) {} } -message PolicyRuleList { - repeated PolicyRule policyRuleList = 1; +enum RuleState { + POLICY_INACTIVE = 0; // Rule is currently inactive + POLICY_PLANNED = 1; // Rule installation planned + POLICY_ACTIVE = 2; // Rule is currently active } -//according to IETF’s RFC 3060 [] and RFC 3460 [] -message PolicyRule { - PolicyRuleId policyRuleId = 1; - repeated service.ServiceId serviceList = 2; - repeated context.DeviceId deviceList = 3; - string policyRuleType = 4; - string PolicyRulePriority = 5; - repeated PolicyRuleCondition polRuleConditionList = 6; - repeated PolicyRuleAction polRuleActionList = 7; +enum PolicyRuleType { + POLICYTYPE_DEVICE = 0; // Device-level + POLICYTYPE_NETWORK = 1; // Network-wide } -message PolicyRuleId { +message PolicyRuleId { context.Uuid uuid = 1; } +message PolicyRuleState { + context.Uuid policyRuleId = 1; + RuleState policyRuleState = 2; +} + +message PolicyRuleVariable { + string policyRuleVariable = 1; +} + +message PolicyRuleValue { + string policyRuleValue = 1; +} + +// IETF draft: Framework for Use of ECA (Event Condition Action) in Network Self Management +// Source: https://datatracker.ietf.org/doc/draft-bwd-netmod-eca-framework/ +// Event +message PolicyRuleEvent { + context.Event event = 1; +} + +// Condition message PolicyRuleCondition { PolicyRuleVariable polRuleConditionVar = 1; PolicyRuleValue polRuleConditionVal = 2; } +// Action message PolicyRuleAction { PolicyRuleVariable polRuleActionVar = 1; PolicyRuleValue polRuleActionVal = 2; } -message PolicyRuleVariable { - string policyRuleVariable = 1; -} +// Policy rule partially complies with IETF’s: +// RFC 3060: https://datatracker.ietf.org/doc/html/rfc3060 +// RFC 3460: https://datatracker.ietf.org/doc/html/rfc3460 +// Enhanced with a policy rule event according to the ECA model +message PolicyRule { + // Basic policy rule attributes + PolicyRuleId policyRuleId = 1; + PolicyRuleType policyRuleType = 2; + uint32 PolicyRulePriority = 3; -message PolicyRuleValue { - string policyRuleValue = 1; -} + // Event-Condition-Action model + PolicyRuleEvent event = 4; // A single event triggers the policy + repeated PolicyRuleCondition polRuleConditionList = 5; // One or more conditions must be met + repeated PolicyRuleAction polRuleActionList = 6; // One or more actions should be applied -message PolicyRuleState { - context.Uuid policyRuleId = 1; - RuleState policyRuleState = 2; + // Affected services and devices + repeated context.ServiceId serviceList = 7; + repeated context.DeviceId deviceList = 8; } -enum RuleState { - PLANNED = 0; - ACTIVE = 1; +// A list of policy rules +message PolicyRuleList { + repeated PolicyRule policyRuleList = 1; } - diff --git a/proto/slice.proto b/proto/slice.proto index bdba8e11bf49b4fccf96c3b466e3e612bc47e7c9..ab83b15cfe45316ef7cf7cf43a5c857d313d6043 100644 --- a/proto/slice.proto +++ b/proto/slice.proto @@ -3,24 +3,21 @@ syntax = "proto3"; package slice; import "context.proto"; -import "service.proto"; service SliceService { - rpc CreateUpdateSlice ( TransportSlice ) returns (SliceStatus) {} - rpc DeleteSlice ( TransportSlice ) returns (context.Empty) {} + rpc CreateUpdateSlice (TransportSlice) returns (SliceStatus) {} + rpc DeleteSlice (TransportSlice) returns (context.Empty) {} } - message SliceEndpoint { context.EndPoint port_id = 1; } - message TransportSlice { SliceId slice_id = 1; repeated slice.SliceEndpoint endpoints = 2; repeated context.Constraint constraints = 3; - repeated service.ServiceId services = 4; + repeated context.ServiceId services = 4; repeated SliceId subSlicesId = 5; SliceStatus status = 6; }