Loading hackfest/p4/setup.sh +2 −2 Original line number Diff line number Diff line Loading @@ -4,5 +4,5 @@ export POD_NAME=$(kubectl get pods -n=tfs | grep device | awk '{print $1}') kubectl exec ${POD_NAME} -n=tfs -- mkdir /root/p4 kubectl cp src/tests/netx22-p4/p4/p4info.txt tfs/${POD_NAME}:/root/p4 kubectl cp src/tests/netx22-p4/p4/bmv2.json tfs/${POD_NAME}:/root/p4 kubectl cp hackfest/p4/p4/p4info.txt tfs/${POD_NAME}:/root/p4 kubectl cp hackfest/p4/p4/bmv2.json tfs/${POD_NAME}:/root/p4 hackfest/p4/tests/Objects.py +38 −3 Original line number Diff line number Diff line # Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # # 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 Loading Loading @@ -42,6 +43,8 @@ PACKET_PORT_SAMPLE_TYPES = [ KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, ] # ----- Device Credentials and Settings -------------------------------------------------------------------------------- # ----- Devices -------------------------------------------------------------------------------------------------------- Loading @@ -54,7 +57,7 @@ DEVICE_SW1 = json_device_p4_disabled(DEVICE_SW1_UUID) DEVICE_SW1_DPID = 1 DEVICE_SW1_NAME = DEVICE_SW1_UUID DEVICE_SW1_IP_ADDR = '10.0.2.10' DEVICE_SW1_IP_ADDR = 'localhost' DEVICE_SW1_PORT = '50001' DEVICE_SW1_VENDOR = 'Open Networking Foundation' DEVICE_SW1_HW_VER = 'BMv2 simple_switch' Loading @@ -78,9 +81,38 @@ DEVICE_SW1_CONNECT_RULES = json_device_connect_rules( } ) DEVICE_SW2_UUID = 'SW2' DEVICE_SW2_TIMEOUT = 60 DEVICE_SW2_ID = json_device_id(DEVICE_SW2_UUID) DEVICE_SW2 = json_device_p4_disabled(DEVICE_SW2_UUID) ################################## TABLE ENTRIES ################################## DEVICE_SW2_DPID = 1 DEVICE_SW2_NAME = DEVICE_SW2_UUID DEVICE_SW2_IP_ADDR = 'localhost' DEVICE_SW2_PORT = '50002' DEVICE_SW2_VENDOR = 'Open Networking Foundation' DEVICE_SW2_HW_VER = 'BMv2 simple_switch' DEVICE_SW2_SW_VER = 'Stratum' DEVICE_SW2_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW2_INFO_PATH = '/root/p4/p4info.txt' DEVICE_SW2_CONNECT_RULES = json_device_connect_rules( DEVICE_SW2_IP_ADDR, DEVICE_SW2_PORT, { 'id': DEVICE_SW2_DPID, 'name': DEVICE_SW2_NAME, 'vendor': DEVICE_SW2_VENDOR, 'hw_ver': DEVICE_SW2_HW_VER, 'sw_ver': DEVICE_SW2_SW_VER, 'timeout': DEVICE_SW2_TIMEOUT, 'p4bin': DEVICE_SW2_BIN_PATH, 'p4info': DEVICE_SW2_INFO_PATH } ) ################################## TABLE ENTRIES ################################## DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ json_config_rule_set( Loading Loading @@ -123,6 +155,8 @@ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ ) ] DEVICE_SW2_CONFIG_TABLE_ENTRIES = DEVICE_SW1_CONFIG_TABLE_ENTRIES """ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ Loading Loading @@ -171,7 +205,6 @@ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ ################################## TABLE DECONF ################################## DEVICE_SW1_DECONF_TABLE_ENTRIES = [ json_config_rule_delete( 'table', Loading Loading @@ -213,6 +246,7 @@ DEVICE_SW1_DECONF_TABLE_ENTRIES = [ ) ] DEVICE_SW2_DECONF_TABLE_ENTRIES = DEVICE_SW1_DECONF_TABLE_ENTRIES """ Loading Loading @@ -271,6 +305,7 @@ TOPOLOGIES = [TOPOLOGY] DEVICES = [ (DEVICE_SW1, DEVICE_SW1_CONNECT_RULES, DEVICE_SW1_CONFIG_TABLE_ENTRIES, DEVICE_SW1_DECONF_TABLE_ENTRIES), (DEVICE_SW2, DEVICE_SW2_CONNECT_RULES, DEVICE_SW2_CONFIG_TABLE_ENTRIES, DEVICE_SW2_DECONF_TABLE_ENTRIES), ] LINKS = [] proto/kpi_sample_types.proto +15 −5 Original line number Diff line number Diff line Loading @@ -19,6 +19,16 @@ enum KpiSampleType { KPISAMPLETYPE_UNKNOWN = 0; KPISAMPLETYPE_PACKETS_TRANSMITTED = 101; KPISAMPLETYPE_PACKETS_RECEIVED = 102; KPISAMPLETYPE_PACKETS_DROPPED = 103; KPISAMPLETYPE_BYTES_TRANSMITTED = 201; KPISAMPLETYPE_BYTES_RECEIVED = 202; KPISAMPLETYPE_BYTES_DROPPED = 203; KPISAMPLETYPE_ML_CONFIDENCE = 401; //. can be used by both optical and L3 without any issue KPISAMPLETYPE_OPTICAL_SECURITY_STATUS = 501; //. can be used by both optical and L3 without any issue KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS = 601; KPISAMPLETYPE_L3_TOTAL_DROPPED_PACKTS = 602; KPISAMPLETYPE_L3_UNIQUE_ATTACKERS = 603; KPISAMPLETYPE_L3_UNIQUE_COMPROMISED_CLIENTS = 604; KPISAMPLETYPE_L3_SECURITY_STATUS_CRYPTO = 605; KPISAMPLETYPE_SERVICE_LATENCY_MS = 701; } proto/monitoring.proto +22 −8 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ service MonitoringService { rpc GetKpiDescriptorList (context.Empty ) returns (KpiDescriptorList ) {} // Stable and final rpc IncludeKpi (Kpi ) returns (context.Empty ) {} // Stable and final rpc MonitorKpi (MonitorKpiRequest ) returns (context.Empty ) {} // Stable and final rpc QueryKpiData (KpiQuery ) returns (KpiList ) {} // Not implemented rpc QueryKpiData (KpiQuery ) returns (RawKpiTable ) {} // Not implemented rpc SetKpiSubscription (SubsDescriptor ) returns (stream SubsResponse ) {} // Stable not final rpc GetSubsDescriptor (SubscriptionID ) returns (SubsDescriptor ) {} // Stable and final rpc GetSubscriptions (context.Empty ) returns (SubsList ) {} // Stable and final Loading @@ -48,6 +48,7 @@ message KpiDescriptor { context.EndPointId endpoint_id = 6; context.ServiceId service_id = 7; context.SliceId slice_id = 8; context.ConnectionId connection_id = 9; } message MonitorKpiRequest { Loading @@ -58,13 +59,26 @@ message MonitorKpiRequest { } message KpiQuery { KpiId kpi_id = 1; repeated KpiId kpi_ids = 1; float monitoring_window_s = 2; float sampling_rate_s = 3; uint32 last_n_samples = 4; // used when you want something like "get the last N many samples context.Timestamp start_timestamp = 5; // used when you want something like "get the samples since X date/time" context.Timestamp end_timestamp = 6; // used when you want something like "get the samples until X date/time" // Pending add field to reflect Available Device Protocols uint32 last_n_samples = 3; // used when you want something like "get the last N many samples context.Timestamp start_timestamp = 4; // used when you want something like "get the samples since X date/time" context.Timestamp end_timestamp = 5; // used when you want something like "get the samples until X date/time" } message RawKpi { // cell context.Timestamp timestamp = 1; KpiValue kpi_value = 2; } message RawKpiList { // column KpiId kpi_id = 1; repeated RawKpi raw_kpis = 2; } message RawKpiTable { // table repeated RawKpiList raw_kpi_lists = 1; } message KpiId { Loading proto/policy.proto +1 −1 Original line number Diff line number Diff line Loading @@ -109,5 +109,5 @@ message PolicyRuleDeviceList { // A list of policy rules message PolicyRuleList { repeated PolicyRuleId policyRules = 1; repeated PolicyRule policyRules = 1; } Loading
hackfest/p4/setup.sh +2 −2 Original line number Diff line number Diff line Loading @@ -4,5 +4,5 @@ export POD_NAME=$(kubectl get pods -n=tfs | grep device | awk '{print $1}') kubectl exec ${POD_NAME} -n=tfs -- mkdir /root/p4 kubectl cp src/tests/netx22-p4/p4/p4info.txt tfs/${POD_NAME}:/root/p4 kubectl cp src/tests/netx22-p4/p4/bmv2.json tfs/${POD_NAME}:/root/p4 kubectl cp hackfest/p4/p4/p4info.txt tfs/${POD_NAME}:/root/p4 kubectl cp hackfest/p4/p4/bmv2.json tfs/${POD_NAME}:/root/p4
hackfest/p4/tests/Objects.py +38 −3 Original line number Diff line number Diff line # Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # # 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 Loading Loading @@ -42,6 +43,8 @@ PACKET_PORT_SAMPLE_TYPES = [ KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, ] # ----- Device Credentials and Settings -------------------------------------------------------------------------------- # ----- Devices -------------------------------------------------------------------------------------------------------- Loading @@ -54,7 +57,7 @@ DEVICE_SW1 = json_device_p4_disabled(DEVICE_SW1_UUID) DEVICE_SW1_DPID = 1 DEVICE_SW1_NAME = DEVICE_SW1_UUID DEVICE_SW1_IP_ADDR = '10.0.2.10' DEVICE_SW1_IP_ADDR = 'localhost' DEVICE_SW1_PORT = '50001' DEVICE_SW1_VENDOR = 'Open Networking Foundation' DEVICE_SW1_HW_VER = 'BMv2 simple_switch' Loading @@ -78,9 +81,38 @@ DEVICE_SW1_CONNECT_RULES = json_device_connect_rules( } ) DEVICE_SW2_UUID = 'SW2' DEVICE_SW2_TIMEOUT = 60 DEVICE_SW2_ID = json_device_id(DEVICE_SW2_UUID) DEVICE_SW2 = json_device_p4_disabled(DEVICE_SW2_UUID) ################################## TABLE ENTRIES ################################## DEVICE_SW2_DPID = 1 DEVICE_SW2_NAME = DEVICE_SW2_UUID DEVICE_SW2_IP_ADDR = 'localhost' DEVICE_SW2_PORT = '50002' DEVICE_SW2_VENDOR = 'Open Networking Foundation' DEVICE_SW2_HW_VER = 'BMv2 simple_switch' DEVICE_SW2_SW_VER = 'Stratum' DEVICE_SW2_BIN_PATH = '/root/p4/bmv2.json' DEVICE_SW2_INFO_PATH = '/root/p4/p4info.txt' DEVICE_SW2_CONNECT_RULES = json_device_connect_rules( DEVICE_SW2_IP_ADDR, DEVICE_SW2_PORT, { 'id': DEVICE_SW2_DPID, 'name': DEVICE_SW2_NAME, 'vendor': DEVICE_SW2_VENDOR, 'hw_ver': DEVICE_SW2_HW_VER, 'sw_ver': DEVICE_SW2_SW_VER, 'timeout': DEVICE_SW2_TIMEOUT, 'p4bin': DEVICE_SW2_BIN_PATH, 'p4info': DEVICE_SW2_INFO_PATH } ) ################################## TABLE ENTRIES ################################## DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ json_config_rule_set( Loading Loading @@ -123,6 +155,8 @@ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ ) ] DEVICE_SW2_CONFIG_TABLE_ENTRIES = DEVICE_SW1_CONFIG_TABLE_ENTRIES """ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ Loading Loading @@ -171,7 +205,6 @@ DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ ################################## TABLE DECONF ################################## DEVICE_SW1_DECONF_TABLE_ENTRIES = [ json_config_rule_delete( 'table', Loading Loading @@ -213,6 +246,7 @@ DEVICE_SW1_DECONF_TABLE_ENTRIES = [ ) ] DEVICE_SW2_DECONF_TABLE_ENTRIES = DEVICE_SW1_DECONF_TABLE_ENTRIES """ Loading Loading @@ -271,6 +305,7 @@ TOPOLOGIES = [TOPOLOGY] DEVICES = [ (DEVICE_SW1, DEVICE_SW1_CONNECT_RULES, DEVICE_SW1_CONFIG_TABLE_ENTRIES, DEVICE_SW1_DECONF_TABLE_ENTRIES), (DEVICE_SW2, DEVICE_SW2_CONNECT_RULES, DEVICE_SW2_CONFIG_TABLE_ENTRIES, DEVICE_SW2_DECONF_TABLE_ENTRIES), ] LINKS = []
proto/kpi_sample_types.proto +15 −5 Original line number Diff line number Diff line Loading @@ -19,6 +19,16 @@ enum KpiSampleType { KPISAMPLETYPE_UNKNOWN = 0; KPISAMPLETYPE_PACKETS_TRANSMITTED = 101; KPISAMPLETYPE_PACKETS_RECEIVED = 102; KPISAMPLETYPE_PACKETS_DROPPED = 103; KPISAMPLETYPE_BYTES_TRANSMITTED = 201; KPISAMPLETYPE_BYTES_RECEIVED = 202; KPISAMPLETYPE_BYTES_DROPPED = 203; KPISAMPLETYPE_ML_CONFIDENCE = 401; //. can be used by both optical and L3 without any issue KPISAMPLETYPE_OPTICAL_SECURITY_STATUS = 501; //. can be used by both optical and L3 without any issue KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS = 601; KPISAMPLETYPE_L3_TOTAL_DROPPED_PACKTS = 602; KPISAMPLETYPE_L3_UNIQUE_ATTACKERS = 603; KPISAMPLETYPE_L3_UNIQUE_COMPROMISED_CLIENTS = 604; KPISAMPLETYPE_L3_SECURITY_STATUS_CRYPTO = 605; KPISAMPLETYPE_SERVICE_LATENCY_MS = 701; }
proto/monitoring.proto +22 −8 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ service MonitoringService { rpc GetKpiDescriptorList (context.Empty ) returns (KpiDescriptorList ) {} // Stable and final rpc IncludeKpi (Kpi ) returns (context.Empty ) {} // Stable and final rpc MonitorKpi (MonitorKpiRequest ) returns (context.Empty ) {} // Stable and final rpc QueryKpiData (KpiQuery ) returns (KpiList ) {} // Not implemented rpc QueryKpiData (KpiQuery ) returns (RawKpiTable ) {} // Not implemented rpc SetKpiSubscription (SubsDescriptor ) returns (stream SubsResponse ) {} // Stable not final rpc GetSubsDescriptor (SubscriptionID ) returns (SubsDescriptor ) {} // Stable and final rpc GetSubscriptions (context.Empty ) returns (SubsList ) {} // Stable and final Loading @@ -48,6 +48,7 @@ message KpiDescriptor { context.EndPointId endpoint_id = 6; context.ServiceId service_id = 7; context.SliceId slice_id = 8; context.ConnectionId connection_id = 9; } message MonitorKpiRequest { Loading @@ -58,13 +59,26 @@ message MonitorKpiRequest { } message KpiQuery { KpiId kpi_id = 1; repeated KpiId kpi_ids = 1; float monitoring_window_s = 2; float sampling_rate_s = 3; uint32 last_n_samples = 4; // used when you want something like "get the last N many samples context.Timestamp start_timestamp = 5; // used when you want something like "get the samples since X date/time" context.Timestamp end_timestamp = 6; // used when you want something like "get the samples until X date/time" // Pending add field to reflect Available Device Protocols uint32 last_n_samples = 3; // used when you want something like "get the last N many samples context.Timestamp start_timestamp = 4; // used when you want something like "get the samples since X date/time" context.Timestamp end_timestamp = 5; // used when you want something like "get the samples until X date/time" } message RawKpi { // cell context.Timestamp timestamp = 1; KpiValue kpi_value = 2; } message RawKpiList { // column KpiId kpi_id = 1; repeated RawKpi raw_kpis = 2; } message RawKpiTable { // table repeated RawKpiList raw_kpi_lists = 1; } message KpiId { Loading
proto/policy.proto +1 −1 Original line number Diff line number Diff line Loading @@ -109,5 +109,5 @@ message PolicyRuleDeviceList { // A list of policy rules message PolicyRuleList { repeated PolicyRuleId policyRules = 1; repeated PolicyRule policyRules = 1; }