ifacesProvided | Topology Syntax Guide - buzz66boy/ns3-lxc GitHub Wiki
The tag 'ifacesProvided' creates a mapping between an unconnected interface to a variable name that can be referenced at a higher level. The unconnected interface may exist within the same level as the provided interface, or it may be an interface provided by a lower-level topology that has been left unconnected at the current level.
Note: Unconnected ifacesProvided from lower-level (instantiated) topologies must be explicitly re-declared as provided interfaces on the current level; there is no implicit re-declaration of unconnected provided interfaces.
A simple example:
#...
nodes:
- node1:
iface: eth0
ifacesProvided:
- n1e0: node1 eth0 #give the provided interface a useful name to be referenced by a higher level.
Now, let's instantiate that topology within another topology and re-declare the provided interfaces:
#...
nodes:
- node2:
iface: eth0
topologies:
- simpleTop:
template: topAbove #using topology above this one as an example
ifacesProvided:
- simpTop_if1: simpleTop n1e0 #re name provided iface from sub topology
- n2e0: node2 eth0 #name n2e0 and reference to node2 eth0
If instead we wanted to connect the interfaces, we simply refer to the provided interface by the sub topology's name followed by the provided interface name.
#...
nodes:
- node2:
iface: eth0
topologies:
- simpleTop:
template: topAbove #using topology above this one as an example
links:
- link1:
type: csma
ifaces:
- node2 eth0 10.0.0.1
- simpleTop n1e0 10.0.0.2