csle_collector.five_g_core_manager package
Subpackages
- csle_collector.five_g_core_manager.dao package
- Submodules
- csle_collector.five_g_core_manager.dao.five_g_core_amf_metrics module
FiveGCoreAMFMetricsFiveGCoreAMFMetrics.copy()FiveGCoreAMFMetrics.from_dict()FiveGCoreAMFMetrics.from_json_file()FiveGCoreAMFMetrics.from_kafka_record()FiveGCoreAMFMetrics.num_attributes()FiveGCoreAMFMetrics.schema()FiveGCoreAMFMetrics.to_dict()FiveGCoreAMFMetrics.to_kafka_record()FiveGCoreAMFMetrics.update_with_kafka_record()
- csle_collector.five_g_core_manager.dao.five_g_core_hss_metrics module
FiveGCoreHSSMetricsFiveGCoreHSSMetrics.copy()FiveGCoreHSSMetrics.from_dict()FiveGCoreHSSMetrics.from_json_file()FiveGCoreHSSMetrics.from_kafka_record()FiveGCoreHSSMetrics.num_attributes()FiveGCoreHSSMetrics.schema()FiveGCoreHSSMetrics.to_dict()FiveGCoreHSSMetrics.to_kafka_record()FiveGCoreHSSMetrics.update_with_kafka_record()
- csle_collector.five_g_core_manager.dao.five_g_core_mme_metrics module
FiveGCoreMMEMetricsFiveGCoreMMEMetrics.copy()FiveGCoreMMEMetrics.from_dict()FiveGCoreMMEMetrics.from_json_file()FiveGCoreMMEMetrics.from_kafka_record()FiveGCoreMMEMetrics.num_attributes()FiveGCoreMMEMetrics.schema()FiveGCoreMMEMetrics.to_dict()FiveGCoreMMEMetrics.to_kafka_record()FiveGCoreMMEMetrics.update_with_kafka_record()
- csle_collector.five_g_core_manager.dao.five_g_core_pcf_metrics module
FiveGCorePCFMetricsFiveGCorePCFMetrics.copy()FiveGCorePCFMetrics.from_dict()FiveGCorePCFMetrics.from_json_file()FiveGCorePCFMetrics.from_kafka_record()FiveGCorePCFMetrics.num_attributes()FiveGCorePCFMetrics.schema()FiveGCorePCFMetrics.to_dict()FiveGCorePCFMetrics.to_kafka_record()FiveGCorePCFMetrics.update_with_kafka_record()
- csle_collector.five_g_core_manager.dao.five_g_core_pcrf_metrics module
FiveGCorePCRFMetricsFiveGCorePCRFMetrics.copy()FiveGCorePCRFMetrics.from_dict()FiveGCorePCRFMetrics.from_json_file()FiveGCorePCRFMetrics.from_kafka_record()FiveGCorePCRFMetrics.num_attributes()FiveGCorePCRFMetrics.schema()FiveGCorePCRFMetrics.to_dict()FiveGCorePCRFMetrics.to_kafka_record()FiveGCorePCRFMetrics.update_with_kafka_record()
- csle_collector.five_g_core_manager.dao.five_g_core_smf_metrics module
FiveGCoreSMFMetricsFiveGCoreSMFMetrics.copy()FiveGCoreSMFMetrics.from_dict()FiveGCoreSMFMetrics.from_json_file()FiveGCoreSMFMetrics.from_kafka_record()FiveGCoreSMFMetrics.num_attributes()FiveGCoreSMFMetrics.schema()FiveGCoreSMFMetrics.to_dict()FiveGCoreSMFMetrics.to_kafka_record()FiveGCoreSMFMetrics.update_with_kafka_record()
- csle_collector.five_g_core_manager.dao.five_g_core_upf_metrics module
FiveGCoreUPFMetricsFiveGCoreUPFMetrics.copy()FiveGCoreUPFMetrics.from_dict()FiveGCoreUPFMetrics.from_json_file()FiveGCoreUPFMetrics.from_kafka_record()FiveGCoreUPFMetrics.num_attributes()FiveGCoreUPFMetrics.schema()FiveGCoreUPFMetrics.to_dict()FiveGCoreUPFMetrics.to_kafka_record()FiveGCoreUPFMetrics.update_with_kafka_record()
- Module contents
- csle_collector.five_g_core_manager.threads package
Submodules
csle_collector.five_g_core_manager.five_g_core_manager module
- class csle_collector.five_g_core_manager.five_g_core_manager.FiveGCoreManagerServicer[source]
Bases:
FiveGCoreManagerServicergRPC server for managing the 5g core
- getFiveGCoreStatus(request: GetFiveGCoreStatusMsg, context: ServicerContext) FiveGCoreStatusDTO[source]
Gets the status of the 5G core
- Parameters
request – the gRPC request
context – the gRPC context
- Returns
a DTO with the status of the 5g core
- initFiveGCore(request: InitFiveGCoreMsg, context: ServicerContext) FiveGCoreStatusDTO[source]
Initializes the 5G core services
- Parameters
request – the gRPC request
context – the gRPC context
- Returns
a DTO with the status of the 5g core
- startFiveGCore(request: StartFiveGCoreMsg, context: ServicerContext) FiveGCoreStatusDTO[source]
Starts the 5G core services
- Parameters
request – the gRPC request
context – the gRPC context
- Returns
a DTO with the status of the 5g core
- startFiveGCoreMonitor(request: StartFiveGCoreMonitorMsg, context: ServicerContext) FiveGCoreStatusDTO[source]
Starts the 5G Core monitor thread
- Parameters
request – the gRPC request
context – the gRPC context
- Returns
a DTO with the status of the Core monitor thread
- csle_collector.five_g_core_manager.five_g_core_manager.serve(port: int = 50052, log_dir: str = '/', max_workers: int = 100, log_file_name: str = 'five_g_core_manager.log') None[source]
Starts the gRPC server for managing clients
- Parameters
port – the port that the server will listen to
log_dir – the directory to write the log file
log_file_name – the file name of the log
max_workers – the maximum number of GRPC workers
- Returns
None
csle_collector.five_g_core_manager.five_g_core_manager_pb2 module
Generated protocol buffer code.
csle_collector.five_g_core_manager.five_g_core_manager_pb2_grpc module
Client and server classes corresponding to protobuf-defined services.
- class csle_collector.five_g_core_manager.five_g_core_manager_pb2_grpc.FiveGCoreManager[source]
Bases:
objectInterface exported by the server
- static getFiveGCoreStatus(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
- static initFiveGCore(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
- static startFiveGCore(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
- static startFiveGCoreMonitor(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
- class csle_collector.five_g_core_manager.five_g_core_manager_pb2_grpc.FiveGCoreManagerServicer[source]
Bases:
objectInterface exported by the server
- getFiveGCoreStatus(request, context)[source]
Missing associated documentation comment in .proto file.
csle_collector.five_g_core_manager.five_g_core_manager_util module
- class csle_collector.five_g_core_manager.five_g_core_manager_util.FiveGCoreManagerUtil[source]
Bases:
objectClass with utility functions for the 5G core manager
- static fetch_amf_metrics(ip: str) FiveGCoreAMFMetrics[source]
Fetches AMF metrics from the given URL and parses them into an AMFMetrics DTO.
- Parameters
ip – The IP address string to populate the ‘ip’ field of the DTO
- Returns
A populated AMFMetrics object
- static fetch_hss_metrics(ip: str) FiveGCoreHSSMetrics[source]
Fetches HSS metrics from the given URL and parses them into an HSSMetrics DTO.
- Parameters
ip – The IP address string to populate the ‘ip’ field of the DTO
- Returns
A populated HSSMetrics object
- static fetch_mme_metrics(ip: str) FiveGCoreMMEMetrics[source]
Fetches MME metrics from the given URL and parses them into an MMEMetrics DTO.
- Parameters
ip – The IP address string to populate the ‘ip’ field of the DTO
- Returns
A populated MMEMetrics object
- static fetch_pcf_metrics(ip: str) FiveGCorePCFMetrics[source]
Fetches PCF metrics from the given URL and parses them into an PCFMetrics DTO.
- Parameters
ip – The IP address string to populate the ‘ip’ field of the DTO
- Returns
A populated PCFMetrics object
- static fetch_pcrf_metrics(ip: str) FiveGCorePCRFMetrics[source]
Fetches PCRF metrics from the given URL and parses them into an PCRFMetrics DTO.
- Parameters
ip – The IP address string to populate the ‘ip’ field of the DTO
- Returns
A populated PCRFMetrics object
- static fetch_smf_metrics(ip: str) FiveGCoreSMFMetrics[source]
Fetches SMF metrics from the given URL and parses them into an SMFMetrics DTO.
- Parameters
ip – The IP address string to populate the ‘ip’ field of the DTO
- Returns
A populated SMFMetrics object
- static fetch_upf_metrics(ip: str) FiveGCoreUPFMetrics[source]
Fetches UPF metrics from the given URL and parses them into an UPFMetrics DTO.
- Parameters
ip – The IP address string to populate the ‘ip’ field of the DTO
- Returns
A populated UPFMetrics object
- static five_g_core_status_dto_empty() FiveGCoreStatusDTO[source]
- Returns
An empty FiveGCoreStatusDTO
- static five_g_core_status_dto_from_dict(d: Dict[str, Any]) FiveGCoreStatusDTO[source]
Converts a FiveGCoreStatusDTO to a dict
- Parameters
d – the dict to convert
- Returns
the converted DTO
- static five_g_core_status_dto_to_dict(five_g_core_status_dto: FiveGCoreStatusDTO) Dict[str, Any][source]
Converts a FiveGCoreStatusDTO to a dict
- Parameters
five_g_core_status_dto – the DTO to convert
- Returns
a dict representation of the DTO
- static get_core_status(control_script_path: str) Dict[str, bool][source]
Executes the control script, parses the output, and return the statuses of the 5G core services
- Parameters
control_script_path – the path to the control script
- Returns
A dict with the names of the statuses and boolean values indicating if the services are running
- static init_all_core_services(control_script_path: str) bool[source]
Initializes all 5G core services using the control script with the ‘all init’ command.
- Parameters
control_script_path – the path to the control script
- Returns
True if the script execution completed successfully, False otherwise.
- static init_config_files(ip: str) bool[source]
Modifies the Open5GS configuration files to set the bind IP addresses. Specifically updates: 1. /etc/open5gs/amf.yaml (amf -> ngap -> server -> address) 2. /etc/open5gs/upf.yaml (upf -> pfcp -> server -> address)
- Parameters
ip – The new IP address to set.
- Returns
True if all files were updated successfully, False otherwise.
- static init_subscriber_data(control_script_path: str, subscribers: List[FiveGSubscriberDTO]) bool[source]
Initializes the subscriber data for the 5G core.
- Parameters
control_script_path – the path to the control script
subscribers – list of subscribers
- Returns
True if the script execution completed successfully, False otherwise.
csle_collector.five_g_core_manager.query_five_g_core_manager module
- csle_collector.five_g_core_manager.query_five_g_core_manager.get_five_g_core_status(stub: FiveGCoreManagerStub, timeout=60) FiveGCoreStatusDTO[source]
Queries the 5G core manager for the status of the 5G core
- Parameters
stub – the stub to send the remote gRPC to the server
timeout – the timeout for the gRRPC call
- Returns
a FiveGCoreStatusDTO describing the status of the 5G core
- csle_collector.five_g_core_manager.query_five_g_core_manager.init_five_g_core(stub: FiveGCoreManagerStub, subscribers: List[FiveGSubscriberDTO], core_backhaul_ip: str, timeout=60) FiveGCoreStatusDTO[source]
Sends a request to the 5G core manager for stopping the 5G core services
- Parameters
stub – the stub to send the remote gRPC to the server
subscribers – list of subscribers
core_backhaul_ip – The backhaul IP of the core network
timeout – the timeout for the gRRPC call
- Returns
a FiveGCoreStatusDTO describing the status of the 5G core
- csle_collector.five_g_core_manager.query_five_g_core_manager.start_five_g_core(stub: FiveGCoreManagerStub, timeout=60) FiveGCoreStatusDTO[source]
Sends a request to the 5G core manager for starting the 5G core services
- Parameters
stub – the stub to send the remote gRPC to the server
timeout – the timeout for the gRRPC call
- Returns
a FiveGCoreStatusDTO describing the status of the 5G core
- csle_collector.five_g_core_manager.query_five_g_core_manager.start_five_g_core_monitor(stub: FiveGCoreManagerStub, kafka_ip: str, kafka_port: int, time_step_len_seconds: int, timeout=60) FiveGCoreStatusDTO[source]
Sends a request to the 5G core manager to start the core monitor thread
- Parameters
kafka_ip – the ip of the Kafka server
kafka_port – the port of the Kafka server
time_step_len_seconds – the length of one time-step
stub – the stub to send the remote gRPC to the server
timeout – the GRPC timeout (seconds)
- Returns
a FiveGCoreStatusDTO describing the core status
- csle_collector.five_g_core_manager.query_five_g_core_manager.stop_five_g_core(stub: FiveGCoreManagerStub, timeout=60) FiveGCoreStatusDTO[source]
Sends a request to the 5G core manager for stopping the 5G core services
- Parameters
stub – the stub to send the remote gRPC to the server
timeout – the timeout for the gRRPC call
- Returns
a FiveGCoreStatusDTO describing the status of the 5G core
- csle_collector.five_g_core_manager.query_five_g_core_manager.stop_five_g_core_monitor(stub: FiveGCoreManagerStub, timeout=60) FiveGCoreStatusDTO[source]
Sends a request to the 5G Core manager to stop the 5G Core monitor thread
- Parameters
stub – the stub to send the remote gRPC to the server
timeout – the GRPC timeout (seconds)
- Returns
a FiveGCoreStatusDTO describing the 5G core status