csle_collector.five_g_cu_manager package

Subpackages

Submodules

csle_collector.five_g_cu_manager.five_g_cu_manager module

class csle_collector.five_g_cu_manager.five_g_cu_manager.FiveGCUManagerServicer[source]

Bases: FiveGCUManagerServicer

gRPC server for managing the 5G CU

getFiveGCUStatus(request: GetFiveGCUStatusMsg, context: ServicerContext) FiveGCUStatusDTO[source]

Gets the status of the 5G CU

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

a DTO with the status of the 5g cu

initFiveGCU(request: InitFiveGCUMsg, context: ServicerContext) FiveGCUStatusDTO[source]

Initializes the 5G CU

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

a DTO with the status of the 5g cu

startFiveGCU(request: StartFiveGCUMsg, context: ServicerContext) FiveGCUStatusDTO[source]

Starts the 5G CU

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

a DTO with the status of the 5g cu

startFiveGCUMonitor(request: StartFiveGCUMonitorMsg, context: ServicerContext) FiveGCUStatusDTO[source]

Starts the 5G CU monitor thread

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

a DTO with the status of the CU monitor thread

stopFiveGCU(request: StopFiveGCUMsg, context: ServicerContext) FiveGCUStatusDTO[source]

Stops the 5G CU

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

a DTO with the status of the 5g cu

stopFiveGCUMonitor(request: StopFiveGCUMonitorMsg, context: ServicerContext) FiveGCUStatusDTO[source]

Stops the CU monitor thread if it is running

Parameters
  • request – the gRPC request

  • context – the gRPC context

Returns

a DTO with the status of the CU monitor thread

csle_collector.five_g_cu_manager.five_g_cu_manager.serve(port: int = 50053, log_dir: str = '/', max_workers: int = 100, log_file_name: str = 'five_g_cu_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_cu_manager.five_g_cu_manager_pb2 module

Generated protocol buffer code.

csle_collector.five_g_cu_manager.five_g_cu_manager_pb2_grpc module

Client and server classes corresponding to protobuf-defined services.

class csle_collector.five_g_cu_manager.five_g_cu_manager_pb2_grpc.FiveGCUManager[source]

Bases: object

Interface exported by the server

static getFiveGCUStatus(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
static initFiveGCU(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
static startFiveGCU(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
static startFiveGCUMonitor(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
static stopFiveGCU(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None)[source]
static stopFiveGCUMonitor(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_cu_manager.five_g_cu_manager_pb2_grpc.FiveGCUManagerServicer[source]

Bases: object

Interface exported by the server

getFiveGCUStatus(request, context)[source]

Missing associated documentation comment in .proto file.

initFiveGCU(request, context)[source]

Missing associated documentation comment in .proto file.

startFiveGCU(request, context)[source]

Missing associated documentation comment in .proto file.

startFiveGCUMonitor(request, context)[source]

Missing associated documentation comment in .proto file.

stopFiveGCU(request, context)[source]

Missing associated documentation comment in .proto file.

stopFiveGCUMonitor(request, context)[source]

Missing associated documentation comment in .proto file.

class csle_collector.five_g_cu_manager.five_g_cu_manager_pb2_grpc.FiveGCUManagerStub(channel)[source]

Bases: object

Interface exported by the server

csle_collector.five_g_cu_manager.five_g_cu_manager_pb2_grpc.add_FiveGCUManagerServicer_to_server(servicer, server)[source]

csle_collector.five_g_cu_manager.five_g_cu_manager_util module

class csle_collector.five_g_cu_manager.five_g_cu_manager_util.FiveGCUManagerUtil[source]

Bases: object

Class with utility functions for the 5G CU manager

static five_g_cu_status_dto_empty() FiveGCUStatusDTO[source]
Returns

An empty FiveGCUStatusDTO

static five_g_cu_status_dto_from_dict(d: Dict[str, Any]) FiveGCUStatusDTO[source]

Converts a FiveGCUStatusDTO to a dict

Parameters

d – the dict to convert

Returns

the converted DTO

static five_g_cu_status_dto_to_dict(five_g_cu_status_dto: FiveGCUStatusDTO) Dict[str, Any][source]

Converts a FiveGCUStatusDTO to a dict

Parameters

five_g_cu_status_dto – the DTO to convert

Returns

a dict representation of the DTO

static get_cu_status(control_script_path: str) Dict[str, bool][source]

Executes the control script, parses the output, and return the statuses of the 5G CU 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_config_file(core_backhaul_ip: str, cu_backhaul_ip: str, cu_fronthaul_ip: str) bool[source]

Initializes the /srsRAN_Project/build/apps/cu/cu.yml configuration file.

Parameters
  • core_backhaul_ip – The backhaul IP address of the 5G Core (AMF).

  • cu_backhaul_ip – The backhaul IP address of the CU (Central Unit).

  • cu_fronthaul_ip – The fronthaul IP address of the CU (Central Unit).

Returns

True if the file was updated successfully, False otherwise.

static start_cu(control_script_path: str) bool[source]

Starts the 5G CU using the control script with the ‘start’ command.

Parameters

control_script_path – the path to the control script

Returns

True if the script execution completed successfully, False otherwise.

static stop_cu(control_script_path: str) bool[source]

Stops the 5G CU using the control script with the ‘stop’ command.

Parameters

control_script_path – the path to the control script

Returns

True if the script execution completed successfully, False otherwise.

csle_collector.five_g_cu_manager.query_five_g_cu_manager module

csle_collector.five_g_cu_manager.query_five_g_cu_manager.get_five_g_cu_status(stub: FiveGCUManagerStub, timeout=60) FiveGCUStatusDTO[source]

Queries the 5G cu manager for the status of the 5G cu

Parameters
  • stub – the stub to send the remote gRPC to the server

  • timeout – the timeout for the gRRPC call

Returns

a FiveGCUStatusDTO describing the status of the 5G cu

csle_collector.five_g_cu_manager.query_five_g_cu_manager.init_five_g_cu(stub: FiveGCUManagerStub, core_backhaul_ip: str, cu_backhaul_ip: str, cu_fronthaul_ip: str, timeout=60) FiveGCUStatusDTO[source]

Sends a request to the 5G cu manager for initializing the 5G cu

Parameters
  • stub – the stub to send the remote gRPC to the server

  • core_backhaul_ip – the backhaul ip of the core network

  • cu_backhaul_ip – the backhaul ip of the CU network

  • cu_fronthaul_ip – the fronthaul ip of the CU network

  • timeout – the timeout for the gRRPC call

Returns

a FiveGCUStatusDTO describing the status of the 5G cu

csle_collector.five_g_cu_manager.query_five_g_cu_manager.start_five_g_cu(stub: FiveGCUManagerStub, timeout=60) FiveGCUStatusDTO[source]

Sends a request to the 5G cu manager for starting the 5G cu

Parameters
  • stub – the stub to send the remote gRPC to the server

  • timeout – the timeout for the gRRPC call

Returns

a FiveGCUStatusDTO describing the status of the 5G cu

csle_collector.five_g_cu_manager.query_five_g_cu_manager.start_five_g_cu_monitor(stub: FiveGCUManagerStub, kafka_ip: str, kafka_port: int, time_step_len_seconds: int, timeout=60) FiveGCUStatusDTO[source]

Sends a request to the 5G CU manager to start the CU 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 FiveGCUStatusDTO describing the cu status

csle_collector.five_g_cu_manager.query_five_g_cu_manager.stop_five_g_cu(stub: FiveGCUManagerStub, timeout=60) FiveGCUStatusDTO[source]

Sends a request to the 5G cu manager for stopping the 5G cu

Parameters
  • stub – the stub to send the remote gRPC to the server

  • timeout – the timeout for the gRRPC call

Returns

a FiveGCUStatusDTO describing the status of the 5G cu

csle_collector.five_g_cu_manager.query_five_g_cu_manager.stop_five_g_cu_monitor(stub: FiveGCUManagerStub, timeout=60) FiveGCUStatusDTO[source]

Sends a request to the 5G CU manager to stop the CU monitor thread

Parameters
  • stub – the stub to send the remote gRPC to the server

  • timeout – the GRPC timeout (seconds)

Returns

a FiveGCUStatusDTO describing the 5G cu status

Module contents