Source Routing

Source Routing#

Source routing allows a sender of a data packet to completely specify the route the packet takes through the network. OpenOptics’ openoptics.TimeFlowTable.TimeFlowEntry() supports source routing as well as per-hop routing. Users can specify source routing by setting the routing_mode="Source in openoptics.Toolbox.BaseNetwork.deploy_routing().

examples/routing_hoho_source.py#
 1from openoptics import Toolbox, OpticalTopo, OpticalRouting
 2
 3if __name__ == "__main__":
 4    nb_node = 4
 5    nb_link = 1
 6    net = Toolbox.BaseNetwork(
 7        name="my_network",
 8        backend="Mininet",
 9        nb_node=nb_node,
10        time_slice_duration_ms=128,  # in ms
11        use_webserver=True,
12    )
13    circuits = OpticalTopo.opera(nb_node=nb_node, nb_link=nb_link)
14    assert net.deploy_topo(circuits)
15    paths = OpticalRouting.routing_hoho(net.get_topo(), max_hop=2)
16    assert net.deploy_routing(paths, routing_mode="Source")
17    net.start()