nodes //查看节点,包括控制器、交换机、主机
links //查看连接
mn --topo single,10 --controller remote --switch ovsk,protocols=OpenFlow13  //single是交换机,后面的10是主机数

xterm h1  //打开h1的终端

mn --topo linear,10,3 --controller remote --switch ovsk,protocols=OpenFlow13 //linear,10,3 一条直线上10台交换机每台交换机连接3台主机

mn --topo tree,3,3 --controller remote --switch ovsk,protocols=OpenFlow13 // 三代人 每人生三个

 

 

cd /root/mininet/custom/
cp topo-2sw-2host.py 2s4h.py
vim 2s4h.py

# Add hosts and switches
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( s1, h1 )
self.addLink( s1, s2 )
self.addLink( s1, s4 )
self.addLink( s2, s1 )
self.addLink( s2, s3 )
self.addLink( s2, h2 )
self.addLink( s3, s2 )
self.addLink( s3, s4 )
self.addLink( s3, h3 )
self.addLink( s4, s1 )
self.addLink( s4, s3 )
self.addLink( s4, h4 )

mn --custom  2s4h.py  --topo mytopo   --controller remote --switch ovsk,protocols=OpenFlow13  //Topo名字