csle_ryu.dao package
Submodules
csle_ryu.dao.agg_flow_statistic module
- class csle_ryu.dao.agg_flow_statistic.AggFlowStatistic(timestamp: float, datapath_id: str, total_num_packets: int, total_num_bytes: int, total_num_flows: int)[source]
Bases:
JSONSerializable
DTO containing aggregated flow statistics of an OpenFlow switch
- copy() AggFlowStatistic [source]
Copies the object
- Returns
a copy of the DTO
- static from_dict(d: Dict[str, Any]) AggFlowStatistic [source]
Converts a dict representation to an instance
- Parameters
d – the dict to convert
- Returns
the created instance
- static from_json_file(json_file_path: str) AggFlowStatistic [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static from_kafka_record(record: str) AggFlowStatistic [source]
Converts a kafka record to a DTO
- Parameters
record – the kafka record
- Returns
the DTO
csle_ryu.dao.avg_flow_statistic module
- class csle_ryu.dao.avg_flow_statistic.AvgFlowStatistic(timestamp: float, datapath_id: str, total_num_packets: int, total_num_bytes: int, avg_duration_nanoseconds: int, avg_duration_seconds: int, avg_hard_timeout: int, avg_idle_timeout: int, avg_priority: int, avg_cookie: int)[source]
Bases:
JSONSerializable
DTO containing avg data of a flow statistics returned by an OpenFlow switch
- static average_flow_statistics(timestamp: float, datapath_id: str, flow_statistics: List[FlowStatistic]) AvgFlowStatistic [source]
Computes the average metrics from a list of flow statistics
- Parameters
flow_statistics – the list of flow statistics to average
- Returns
the computed averages
- copy() AvgFlowStatistic [source]
- Returns
a copy of the DTO
- static from_dict(d: Dict[str, Any]) AvgFlowStatistic [source]
Converts a dict representation to an instance
- Parameters
d – the dict to convert
- Returns
the created instance
- static from_json_file(json_file_path: str) AvgFlowStatistic [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static from_kafka_record(record: str) AvgFlowStatistic [source]
Converts a kafka record to a DTO
- Parameters
record – the kafka record
- Returns
the DTO
csle_ryu.dao.avg_port_statistic module
- class csle_ryu.dao.avg_port_statistic.AvgPortStatistic(timestamp: float, datapath_id: str, total_num_received_packets: int, total_num_received_bytes: int, total_num_received_errors: int, total_num_transmitted_packets: int, total_num_transmitted_bytes: int, total_num_transmitted_errors: int, total_num_received_dropped: int, total_num_transmitted_dropped, total_num_received_frame_errors, total_num_received_overrun_errors, total_num_received_crc_errors, total_num_collisions, avg_duration_nanoseconds, avg_duration_seconds)[source]
Bases:
JSONSerializable
DTO containing data with average port statistics from an OpenFlow switch
- static average_port_statistics(timestamp: float, datapath_id: str, port_statistics: List[PortStatistic]) AvgPortStatistic [source]
Computes the average metrics from a list of flow statistics
- Parameters
port_statistics – the list of flow statistics to average
- Returns
the computed averages
- copy() PortStatistic [source]
- Returns
a copy of the DTO
- static from_dict(d: Dict[str, Any]) AvgPortStatistic [source]
Converts a dict representation to an instance
- Parameters
d – the dict to convert
- Returns
the created instance
- static from_json_file(json_file_path: str) AvgPortStatistic [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static from_kafka_record(record: str) AvgPortStatistic [source]
Converts a kafka record to a DTO
- Parameters
record – the kafka record
- Returns
the DTO
csle_ryu.dao.flow_statistic module
- class csle_ryu.dao.flow_statistic.FlowStatistic(timestamp: float, datapath_id: str, in_port: str, out_port: str, dst_mac_address: str, num_packets: int, num_bytes: int, duration_nanoseconds: int, duration_seconds: int, hard_timeout: int, idle_timeout: int, priority: int, cookie: int)[source]
Bases:
JSONSerializable
DTO containing data of a flow statistic returned by an OpenFlow switch
- copy() FlowStatistic [source]
- Returns
a copy of the DTO
- static from_dict(d: Dict[str, Any]) FlowStatistic [source]
Converts a dict representation to an instance
- Parameters
d – the dict to convert
- Returns
the created instance
- static from_json_file(json_file_path: str) FlowStatistic [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static from_kafka_record(record: str) FlowStatistic [source]
Converts a kafka record to a DTO
- Parameters
record – the kafka record
- Returns
the DTO
csle_ryu.dao.port_statistic module
- class csle_ryu.dao.port_statistic.PortStatistic(timestamp: float, datapath_id: str, port: int, num_received_packets: int, num_received_bytes: int, num_received_errors: int, num_transmitted_packets: int, num_transmitted_bytes: int, num_transmitted_errors: int, num_received_dropped: int, num_transmitted_dropped: int, num_received_frame_errors: int, num_received_overrun_errors: int, num_received_crc_errors: int, num_collisions: int, duration_nanoseconds: int, duration_seconds: int)[source]
Bases:
JSONSerializable
DTO containing data with port statistics from an OpenFlow switch
- copy() PortStatistic [source]
- Returns
a copy of the DTO
- static from_dict(d: Dict[str, Any]) PortStatistic [source]
Converts a dict representation to an instance
- Parameters
d – the dict to convert
- Returns
the created instance
- static from_json_file(json_file_path: str) PortStatistic [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static from_kafka_record(record: str) PortStatistic [source]
Converts a kafka record to a DTO
- Parameters
record – the kafka record
- Returns
the DTO
csle_ryu.dao.ryu_controller_type module
Type of RYU SDN controllers in CSLE