Internet

Internet wrapper for AutoNetkit

class AutoNetkit.internet.Internet(filename=None, tapsn=IPNetwork('172.16.0.0/16'), netkit=False, cbgp=False, dynagen=False, libvirt=False, junosphere=False, junosphere_olive=False, olive=False, policy_file=None, olive_qemu_patched=False, deploy=False, igp='ospf')[source]

Create Internet, loading from filename.

Args:
filename: file to load network topology from
Returns:
None

Example usage:

>>> inet = Internet("multias") 
add_dns()[source]

Set compiler to configure DNS.

Args:
None
Returns:
None

Example usage:

>>> inet = ank.internet.Internet()
>>> inet.add_dns() 
collect_data(count=1, delay=0)[source]

Collects data for hosts

compile()[source]

Compile into device configuration files.

Args:
None
Returns:
None

Example usage:

>>> inet = ank.internet.Internet()
>>> inet.compile()
>>> inet = ank.internet.Internet()
>>> inet.compile()
deploy()[source]

Deploy compiled configuration files.”

Args:
None
Returns:
None

Example usage:

>>> inet = ank.internet.Internet()
>>> inet.deploy()
dump()[source]

Dumps overlay graphs to file

Note

Doesn’t currently support saving graphs - NetworkX cannot save nodes/edges with dictionary attributes

load(filename)[source]

Loads the network description from a graph file. Note this is done automatically if a filename is given to the Internet constructor.

Args:
filename: The file to load from
Returns:
None

Example usage:

>>> inet = ank.internet.Internet()
>>> inet.load("simple")
>>> sorted(inet.network.graph.nodes())
[RouterB.AS1, RouterA.AS1, RouterD.AS2, RouterC.AS1, RouterA.AS2, RouterA.AS3, RouterB.AS2, RouterC.AS2]
>>> inet = ank.internet.Internet()
>>> inet.load("singleas")
>>> sorted(inet.network.graph.nodes())
[1a.AS1, 1b.AS1, 1d.AS1, 1c.AS1]
>>> inet = ank.internet.Internet()
>>> inet.load("multias")
>>> sorted(inet.network.graph.nodes())
[1b.AS1, 1a.AS1, 2d.AS2, 1c.AS1, 2a.AS2, 3a.AS3, 2b.AS2, 2c.AS2]
optimise()[source]

Optimise each AS within the network.

Args:
None
Returns:
None

Example usage:

>>> inet = ank.internet.Internet()
>>> inet.optimise()
plot(matplotlib=False)[source]

Plot the network topology

Args:
None
Returns:
None

Example usage:

>>> inet = ank.internet.Internet()
>>> inet.plot()