Demo entry 6641354

py

   

Submitted by anonymous on Sep 18, 2017 at 05:05
Language: Python 3. Code size: 506 Bytes.

# my_topo.py
from mininet.topo import Topo


class MyTopo(Topo):

    def __init__(self):
        super(MyTopo, self).__init__()

        s1 = self.addSwitch('s1')
        s2 = self.addSwitch('s2')
        h1 = self.addHost('h1')
        h2 = self.addHost('h2')
        h3 = self.addHost('h3')
        h4 = self.addHost('h4')

        self.addLink(s1, s2)
        self.addLink(s1, h1)
        self.addLink(s1, h2)
        self.addLink(s2, h3)
        self.addLink(s2, h4)

topos = {
    'mytopo': MyTopo
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).