You are on page 1of 14

SDN

16 JAN 2023
REVIEW
• Codes to create nodes
• Python codes to create
customized topologies
• Experience environment of
emulated network
• Notice the related
discussions between
NETDESM and SWDENET
REVIEW
Last meeting’s SDN Controller basic
commands
from mininet.topo import Topo

Answer to last
from mininet.net import Mininet
from mininet.node import OVSSwitch, Controller, RemoteController

class RectTopo( Topo ):


"Rectangular topology example."

def __init__( self ):


meeting
"Create custom topo."

# Initialize topology
Topo.__init__( self )

# Add hosts and switchesovs-ofctl


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

# Add links
self.addLink( h1, s1 )
self.addLink( h2, s2 )
self.addLink( h3, s3 )
self.addLink( h4, s4 )

self.addLink( s1, s2 )
self.addLink( s2, s3 )
self.addLink( s3, s4 )
# self.addLink( s4, s1 )

topos = { 'recttopo': ( lambda: RectTopo() ) }


Types of SDN Controllers
mininet@mininet-vm:~$ sudo mn –topo single,3
mininet> h1 xterm
Login to mininet
mininet@mininet-vm:~$ dir
mininet@mininet-vm:~$ cd pox
mininet@mininet-vm:~/pox$ dir
mininet@mininet-vm:~/pox$ ./pox.py
mininet@mininet-vm:~$ dir
mininet@mininet-vm:~$ cd pox
mininet@mininet-vm:~/pox$ dir
mininet@mininet-vm:~/pox$ ./pox.py
BEFORE WE
DID THIS
LET’S DO THIS NOW WITH A
PYTHON SCRIPT

You might also like