Utility functions

Utility functions#

openoptics.utils.gen_ocs_commands(...)

Generate table entries for OCS (Optical Circuit Switching) scheduling.

openoptics.utils.gen_tor_commands(tor_id, ...)

Old implementation of loading direct routing table entries.

openoptics.utils.metric_to_matrix(metric)

Convert queue depth to traffic metric

openoptics.utils.path2entries(paths, ...[, ...])

Convert paths to time flow table entries

openoptics.utils.tor_table_arrive_at_dst(...)

Generate table entries for checking if a packet arrives at the dst ToR.

openoptics.utils.tor_table_cal_port_slice_to_node(...)

Generate table entries for (src, next_node, send_slice)->send_port.

openoptics.utils.tor_table_ip_to_dst(ip_to_tor)

Generate table entries mapping IP addresses to ToR (Top of Rack) switch IDs.

openoptics.utils.tor_table_routing_per_hop(entry)

Generate table entries for per-hop routing.

openoptics.utils.tor_table_routing_source(entry)

Generate table entries for source routing.

openoptics.utils.tor_table_verify_desired_node(tor_id)

Generate table entries for checking if the receiver is the dst node.