route0/topology/one_rtr/topo.py

24 lines
474 B
Python
Raw Permalink Normal View History

2019-04-06 17:59:00 +02:00
import os
from mininet.topo import Topo
class NetTopo(Topo):
"""The network topology.
"""
def __init__(self):
# Add default members to class.
super(NetTopo, self).__init__()
# Add routers
r_1 = self.addSwitch('R1')
# Add hosts
h_1_1 = self.addSwitch('h1_1')
2019-04-07 22:30:53 +02:00
h_1_2 = self.addSwitch('h1_2')
2019-04-06 17:59:00 +02:00
# Setup links as shown in README.md
self.addLink(r_1, h_1_1)
2019-04-07 22:30:53 +02:00
self.addLink(r_1, h_1_2)