mnoptical.dataplane
¶
dataplane.py: Simple dataplane emulation for mininet-optical
We repurpose OvS to emulate optical line terminals and ROADMs, and we use TCLink to emulate delay on optical fiber spans.
For simplicity, we assume that the links and connections are full-duplex, and that transponders use thes ame tx and rx channels.
Provides the following Mininet classes:
- Terminal: A set of transceivers that can be connected to Ethernet
downlink ports.
ROADM: A colorless, directionless ROADM.
SimpleROADM: A 2-degree ROADM with two add/drop ports
- OpticalLink: a bidirectional optical link consisting of fiber
spans and amplifiers.
Module Contents¶
Classes¶
Add monitors to network |
|
A hacked PhyMonitor that can stand in for a node |
|
Base class for optical devices |
|
Simple terminal which is just a bank of transceivers |
|
A simple ROADM emulation based on OVSSwitch |
|
2-degree ROADM with simplified API. |
|
A bidirectional Optical Interface |
|
A unidirectional optical input interface |
|
A unidirectional optical output interface |
|
"An emulation of an optical link, bidirectional by default but |
|
A bidirectional PhyAmplifier pair. |
|
Comb Source with simulated optical signals. |
|
Two hosts/transceivers connected by a 2-way fiber span, which may |
Functions¶
|
Return a usable span of length km with amplifer amp |
|
Unidirectional OpticalLink constructor |
|
Disable IPv6 to avoid annoying router solicitations |
|
dump out network information |
|
|
|
Print out power for all spans in a Link |
|
Test two transponders connected over a link |
Attributes¶
- mnoptical.dataplane.km = 1.0¶
- mnoptical.dataplane.m = 0.001¶
- mnoptical.dataplane.dBm = 1.0¶
- mnoptical.dataplane.dB = 1.0¶
- class mnoptical.dataplane.OpticalNet¶
Bases:
mininet.net.Mininet
Add monitors to network
- monitors = []¶
- __iter__()¶
return iterator over node names
- addMonitor(monitor)¶
- addLinkComponents(link)¶
- addLink(*args, **kwargs)¶
- addSwitch(*args, **kwargs)¶
- restSetrippleHandler(query)¶
Demo/debugging: Support for REST setgain call
- set_ripple(amp_name, ripple)¶
- restSetgainHandler(query)¶
Demo/debugging: Support for REST setgain call
- setgainCmd(ampName, gain)¶
Demo/debugging: Support for demo CLI setgain command
- mnoptical.dataplane.Mininet¶
- class mnoptical.dataplane.Monitor(name, monitor)¶
A hacked PhyMonitor that can stand in for a node
- waiting = False¶
- execed = True¶
- intfs¶
- intfList()¶
- intfNames()¶
- pexec(*args, **kwargs)¶
- restMonitor(query)¶
Return OSNR to REST agent
- __str__()¶
Return str(self).
- mnoptical.dataplane.PhySpan(length, amp=None)¶
Return a usable span of length km with amplifer amp
- class mnoptical.dataplane.SwitchBase(name, dpid=None, listenPort=None, inNamespace=False, isSwitch=True, batch=False, **phyParams)¶
Bases:
mininet.node.OVSSwitch
Base class for optical devices
- modelClass¶
- dpidBase = 4096¶
- cmd(*args, **kwargs)¶
- defaultDpid(dpid=None)¶
Return a default DPID
- static restPortsDict(node)¶
Construct a ports dict for a node
- restResetHandler(query)¶
REST reset handler
- abstract reset()¶
Reset function - override this!
- class mnoptical.dataplane.Terminal(*args, transceivers=None, **kwargs)¶
Bases:
SwitchBase
Simple terminal which is just a bank of transceivers and some ethernet ports that can connect to them.
- model¶
- modelClass¶
- blockCookie = 195952365¶
- static makeTransceiver(txid, args)¶
Helper constructor for node.Transceiver
- start(_controllers)¶
Override to start without controller
- reset()¶
Reset/clear routes
- configTx(txNum, channel=None, power=None)¶
Configure transceiver txNum channels: [channel index…] power: power in dBm
- txnum(wdmPort)¶
Return a tx number for wdmPort number
- restTurnonHandler()¶
- turn_on()¶
- restConnectHandler(query)¶
REST connect handler
- connect(ethPort, wdmPort, channel=None, power=None, wdmInPort=None)¶
Connect an ethPort to transceiver tx on port wdmPort ethPort: ethernet port number wdmPort: WDM port number
- receiverCallback(inport, signalInfoDict)¶
Callback from PHY when signal is received
- block(inport, channel)¶
Block channel at inport
- unblock(inport, channel)¶
Unblock signal at inport
- class mnoptical.dataplane.ROADM(name, **kwargs)¶
Bases:
SwitchBase
A simple ROADM emulation based on OVSSwitch
Emulates a colorless, directionless ROADM.
Currently uses VLAN field for channel/lambda index.
- model¶
- modelClass¶
- start(_controllers)¶
Override to start without controller
- static ruleTuple(inport, outport, channels)¶
Return hashable tuple for rule
- phyReset()¶
Reset physical model
- phyInstall(inport, outport, channels)¶
Install switching rules into the physical model
- phyRemove(inport, outport, channels)¶
- restRulesHandler(query)¶
Handle REST rules request
- restCleanmeHandler(query)¶
Handle REST clean request - same as reset for now
- dpReset()¶
Reset/initialize dataplane
- dpFlow(inport, outport, channel, action='add-flow')¶
Return a switching rule for the dataplane
- dpInstall(inport, outport, channels, cmd='add-flow')¶
Install a switching rule into the dataplane
- dpRemove(inport, outport, channels)¶
Remove a switching rule from the dataplane
- reset()¶
Reset dataplane and physical model
- install(inport, outport, channels, action='install')¶
Install rules into dataplane and physical model
- remove(inport, outport, channels)¶
Remove rules from dataplane and physical model
- restConnectHandler(query, action='install')¶
REST connect handler
- connect(port1, port2, channels, action='install')¶
Install rule connecting port1 -> port2. If interfaces are bidirectional, connect port2<->port1 action: ‘install’ | ‘remove’ to install or remove rule
- class mnoptical.dataplane.SimpleROADM(name, **kwargs)¶
Bases:
ROADM
2-degree ROADM with simplified API.
We assume a 2-degree ROADM with full-duplex links and connections. For simplicity, we assume the same channel is used in both directions.
Local channels are bidirectionally added and dropped, while other channels are passed through.
Port 1 is east transit Port 2 is west transit Port 3 is southeast add/drop Port 4 is southwest add/drop
- update(localChannels, passChannels=None)¶
Update flow table to add/drop localChannels and pass passChannels
- class mnoptical.dataplane.OpticalIntf¶
Bases:
mininet.link.TCIntf
A bidirectional Optical Interface
- isInput()¶
Is this interface a WDM input?
- isOutput()¶
Is this interface a WDM output?
- class mnoptical.dataplane.OpticalIn¶
Bases:
OpticalIntf
A unidirectional optical input interface
- isInput()¶
Is this interface a WDM input?
- isOutput()¶
Is this interface a WDM output?
- class mnoptical.dataplane.OpticalOut¶
Bases:
OpticalIntf
A unidirectional optical output interface
- isInput()¶
Is this interface a WDM input?
- isOutput()¶
Is this interface a WDM output?
- class mnoptical.dataplane.OpticalLink(src, dst, port1=None, port2=None, boost=None, boost1=None, boost2=None, spans=None, bidirectional=True, **kwargs)¶
Bases:
mininet.link.Link
“An emulation of an optical link, bidirectional by default but optionally unidirectional.
The dataplane emulation is naturally bidirectional (veth pairs.)
By default, the Optical link is also a bidirectional fiber pair in both directions.
For the physical model(s), we create two unidirectional links, which are the reverse of each other in terms of fiber spans and amplfiers.
- phyLink1¶
- phyLink2¶
- _parseSpans(spans=None)¶
Parse list of spans and amplifiers into (span, amp) tuples
- intfName(node, n)¶
Construct a canonical interface name node-wdmN for interface N
- mnoptical.dataplane.UnidirectionalOpticalLink(*args, **kwargs)¶
Unidirectional OpticalLink constructor
- mnoptical.dataplane.UniLink¶
- class mnoptical.dataplane.AmplifierPair(name, *args, **kwargs)¶
Bases:
object
A bidirectional PhyAmplifier pair.
- phyAmp1¶
- phyAmp2¶
- class mnoptical.dataplane.CombSource(name, *args, power={1: 0 * dBm}, **kwargs)¶
Bases:
ROADM
Comb Source with simulated optical signals.
The CombSource component emulates a comb source in COSMOS or other hardware testbeds. It is a dataplane component (the MUX half of a ROADM) but it only generates and transmits simulated signals. It is convenient for emulating a hardware comb source or for generating opaque background traffic in the simulated physical plane.
- ADD = 4100¶
- LINEOUT = 4201¶
- addTerminal()¶
Add our simulated LineTerminal
- restTurnonHandler()¶
Handle REST call: /turn_on?node=name
- turn_on()¶
Configure components and turn on signals
- mnoptical.dataplane.cleanOptLinks()¶
- mnoptical.dataplane.disableIPv6(net)¶
Disable IPv6 to avoid annoying router solicitations
- mnoptical.dataplane.dumpNet(net)¶
dump out network information
- mnoptical.dataplane.formatSignals(signalPowers)¶
- mnoptical.dataplane.dumpLinkPower(link)¶
Print out power for all spans in a Link
- class mnoptical.dataplane.TwoTransceiverTopo¶
Bases:
mininet.topo.Topo
Two hosts/transceivers connected by a 2-way fiber span, which may consist of links and 2-way amplifiers
- build(spans=[25 * km, 'amp1', 50 * km, 'amp2', 25 * km])¶
- mnoptical.dataplane.twoTransceiverTest(cli=False)¶
Test two transponders connected over a link