Opera#
This example demonstrates how to use OpenOptics library functions to implement Opera [1].
You can specify the number of nodes and links per node using the topology function
openoptics.OpticalTopo.opera(), and configure routing
with openoptics.OpticalRouting.routing_ksp()
examples/routing_opera.py#
1from openoptics import Toolbox, OpticalTopo, OpticalRouting
2
3if __name__ == "__main__":
4 node_nb = 8
5 nb_link = 4
6 net = Toolbox.BaseNetwork(
7 name="my_network",
8 backend="Mininet",
9 nb_node=node_nb,
10 nb_link=nb_link,
11 time_slice_duration_ms=64, # in ms
12 use_webserver=True,
13 )
14 circuits = OpticalTopo.opera(nb_node=node_nb, nb_link=nb_link)
15 assert net.deploy_topo(circuits)
16 paths = OpticalRouting.routing_ksp(net.get_topo())
17 net.deploy_routing(paths, routing_mode="Source")
18 net.start()