kytos-ng / flow_manager

Kytos NApp that manages OpenFlow 1.3 entries
https://kytos-ng.github.io/api/flow_manager.html
MIT License
0 stars 7 forks source link

feat: added kytos.flow_manager.flows.single.(install|delete) handler #186

Closed viniarck closed 4 months ago

viniarck commented 4 months ago

Closes #185

Summary

See updated changelog file

Local Tests

- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-60.00  sec  65.0 GBytes  9.31 Gbits/sec  5578             sender
[  4]   0.00-60.00  sec  65.0 GBytes  9.30 Gbits/sec                  receiver
2024-06-13 11:49:40,064 - INFO [kytos.napps.kytos/flow_manager] (dynamic_single_0) Send FlowMod from KytosEvent dpid: 00:00:00:00:00:00:00:06, command: add, force: True,  flows[0, 7]: 
[{'table_id': 0, 'owner': 'telemetry_int', 'table_group': 'evpl', 'priority': 20100, 'cookie': 12176856864668478786, 'idle_timeout': 0, 'hard_timeout': 0, 'match': {'in_port': 22, 'dl_
vlan': 27, 'dl_type': 2048, 'nw_proto': 6}, 'instructions': [{'instruction_type': 'apply_actions', 'actions': [{'action_type': 'push_int'}]}, {'instruction_type': 'goto_table', 'table_
id': 2}]}, {'table_id': 0, 'owner': 'telemetry_int', 'table_group': 'evpl', 'priority': 20100, 'cookie': 12176856864668478786, 'idle_timeout': 0, 'hard_timeout': 0, 'match': {'in_port'
: 22, 'dl_vlan': 27, 'dl_type': 2048, 'nw_proto': 17}, 'instructions': [{'instruction_type': 'apply_actions', 'actions': [{'action_type': 'push_int'}]}, {'instruction_type': 'goto_tabl
e', 'table_id': 2}]}, {'table_id': 2, 'owner': 'telemetry_int', 'table_group': 'evpl', 'priority': 20000, 'cookie': 12176856864668478786, 'idle_timeout': 0, 'hard_timeout': 0, 'match':
 {'in_port': 22, 'dl_vlan': 27}, 'instructions': [{'instruction_type': 'apply_actions', 'actions': [{'action_type': 'add_int_metadata'}, {'action_type': 'push_vlan', 'tag_type': 's'}, 
{'action_type': 'set_vlan', 'vlan_id': 30}, {'action_type': 'output', 'port': 5}]}]}, {'table_id': 0, 'owner': 'telemetry_int', 'table_group': 'evpl', 'priority': 20100, 'cookie': 1217
6856864668478786, 'idle_timeout': 0, 'hard_timeout': 0, 'match': {'in_port': 5, 'dl_vlan': 30, 'dl_type': 2048, 'nw_proto': 6}, 'instructions': [{'instruction_type': 'apply_actions', '
actions': [{'action_type': 'add_int_metadata'}, {'action_type': 'output', 'port': 25}]}]}, {'table_id': 0, 'owner': 'telemetry_int', 'table_group': 'evpl', 'priority': 20100, 'cookie':
 12176856864668478786, 'idle_timeout': 0, 'hard_timeout': 0, 'match': {'in_port': 5, 'dl_vlan': 30, 'dl_type': 2048, 'nw_proto': 17}, 'instructions': [{'instruction_type': 'apply_actio
ns', 'actions': [{'action_type': 'add_int_metadata'}, {'action_type': 'output', 'port': 25}]}]}, {'table_id': 0, 'owner': 'telemetry_int', 'table_group': 'evpl', 'priority': 20000, 'co
okie': 12176856864668478786, 'idle_timeout': 0, 'hard_timeout': 0, 'match': {'in_port': 26, 'dl_vlan': 30}, 'instructions': [{'instruction_type': 'apply_actions', 'actions': [{'action_
type': 'send_report'}]}, {'instruction_type': 'goto_table', 'table_id': 2}]}, {'table_id': 2, 'owner': 'telemetry_int', 'table_group': 'evpl', 'priority': 20000, 'cookie': 121768568646
68478786, 'idle_timeout': 0, 'hard_timeout': 0, 'match': {'in_port': 26, 'dl_vlan': 30}, 'instructions': [{'instruction_type': 'apply_actions', 'actions': [{'action_type': 'pop_int'}, 
{'action_type': 'pop_vlan'}, {'action_type': 'output', 'port': 22}]}]}]
2024-06-13 11:49:40,088 - INFO [kytos.napps.kytos/flow_manager] (dynamic_single_0) Send FlowMod from KytosEvent dpid: 00:00:00:00:00:00:00:02, command: add, force: True,  flows[0, 4]: 
[{'table_id': 0, 'owner': 'telemetry_int', 'table_group': 'evpl', 'priority': 20100, 'cookie': 12176856864668478786, 'idle_timeout': 0, 'hard_timeout': 0, 'match': {'in_port': 2, 'dl_v
lan': 30, 'dl_type': 2048, 'nw_proto': 6}, 'instructions': [{'instruction_type': 'apply_actions', 'actions': [{'action_type': 'add_int_metadata'}, {'action_type': 'set_vlan', 'vlan_id'
: 30}, {'action_type': 'output', 'port': 1}]}]}, {'table_id': 0, 'owner': 'telemetry_int', 'table_group': 'evpl', 'priority': 20100, 'cookie': 12176856864668478786, 'idle_timeout': 0, 
'hard_timeout': 0, 'match': {'in_port': 2, 'dl_vlan': 30, 'dl_type': 2048, 'nw_proto': 17}, 'instructions': [{'instruction_type': 'apply_actions', 'actions': [{'action_type': 'add_int_
metadata'}, {'action_type': 'set_vlan', 'vlan_id': 30}, {'action_type': 'output', 'port': 1}]}]}, {'table_id': 0, 'owner': 'telemetry_int', 'table_group': 'evpl', 'priority': 20100, 'c
ookie': 12176856864668478786, 'idle_timeout': 0, 'hard_timeout': 0, 'match': {'in_port': 1, 'dl_vlan': 30, 'dl_type': 2048, 'nw_proto': 6}, 'instructions': [{'instruction_type': 'apply
_actions', 'actions': [{'action_type': 'add_int_metadata'}, {'action_type': 'set_vlan', 'vlan_id': 30}, {'action_type': 'output', 'port': 2}]}]}, {'table_id': 0, 'owner': 'telemetry_in
t', 'table_group': 'evpl', 'priority': 20100, 'cookie': 12176856864668478786, 'idle_timeout': 0, 'hard_timeout': 0, 'match': {'in_port': 1, 'dl_vlan': 30, 'dl_type': 2048, 'nw_proto': 
17}, 'instructions': [{'instruction_type': 'apply_actions', 'actions': [{'action_type': 'add_int_metadata'}, {'action_type': 'set_vlan', 'vlan_id': 30}, {'action_type': 'output', 'port

End-to-End Tests

For completeness, I'll dispatch an e2e exec, but this handler will only be fully covered with e2e once telemetry_int is using it, since this handler telemetry_int will be the main user as of now.