Python code for Implement the Domain name system( DNS) using wireshark.
- from mininet.cli import CLI
- from mininet.log import setLogLevel
- from mininet.net import Mininet
- from mininet.topo import Topo
-
- def runMultiLink():
- "Create and run multiple link network"
- topo = simpleMultiLinkTopo( n=1 )
- net = Mininet( topo=topo )
- net.start()
- CLI( net )
- net.stop()
-
- class simpleMultiLinkTopo( Topo ):
- "Simple topology with multiple links"
-
- def __init__( self, n, **kwargs ):
- Topo.__init__( self, **kwargs )
-
- h1, h2, h3 = self.addHost( 'h1' ), self.addHost( 'h2' ), self.addHost( 'h3' )
- s1 = self.addSwitch( 's1' )
- s2 = self.addSwitch( 's2' )
-
- for _ in range( 1 ):
-
- self.addLink( s1, h1 )
- self.addLink( s1, h2 )
- self.addLink( s1, h3 )
-
-
- self.addLink( s2, h1 )
- self.addLink( s2, h2 )
- self.addLink( s2, h3 )
-
-
- if __name__ == '__main__':
- setLogLevel( 'info' )
- runMultiLink()
-
No comments:
Post a Comment