Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. from mininet.topo import Topo
  2.  
  3. class Test_Topo(Topo):
  4. def __init__(self):
  5. "Create P2P topology"
  6.  
  7. #Initialize topology
  8. Topo.__init__(self)
  9.  
  10. # Add hosts and switches
  11. h1 = self.addNode('h1')
  12. h2 = self.addNode('h2')
  13. s1 = self.addSwitch('s1')
  14.  
  15. # Add links
  16. self.addLink(h1, s1)
  17. self.addLink(h2, s1)
  18.  
  19. topos = {
  20. 'toptest' : (lambda: Test_Topo())
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement