How to create a mininet topology with 3 nodes (A, B and C) and traffic goes through B like A <-> B <-> C

75 views Asked by At

I'd like to create a topology in Python with Mininet, that has three nodes, A, B, and C. When A/C sends packets to C/A, packets are always routed via B. Please help! Thanks a lot in advance!

1

There are 1 answers

0
Misho Janev On

Is there anything in particular that you find difficult with this? Have you tried creating what you are suggesting does it not work and if not why not? The documentation is clear on how such a thing should be done, for example:

class ThreeNodes( Topo ):
"A <-> B <-> C"
def build( self ):
    s1 = self.addSwitch('s1')
    s2 = self.addSwitch('s2')
    a = self.addHost('a')
    b = self.addHost('b')
    c = self.addHost('c')

    self.addLink(a, s1)
    self.addLink(s1, b)
    self.addLink(b, s2)
    self.addLink(s2, c)