Topology in mininet

Embed Size (px)

Citation preview

  • 8/19/2019 Topology in mininet

    1/11

    Table of Contents

    1 Mininet Features..................................................................................................................................... 11.1 Flexibility:....................................................................................................................................... 11.2 Applicability:................................................................................................................................... 11.3 Interactivity..................................................................................................................................... 11.4 Scalability........................................................................................................................................ 11.5 Share-ability.................................................................................................................................... 1

    2 Characteristics ! Mininet....................................................................................................................... 23 "e!ault # p l $y..................................................................................................................................... 24 %uilt In # p l $ies.................................................................................................................................. 3

    4.1 &inear............................................................................................................................................... 34.2 Sin$le............................................................................................................................................... 44.3 'everse(.......................................................................................................................................... 54.4 # rus................................................................................................................................................ 54.5 #ree.................................................................................................................................................. )

    5 Cust * # p l $y.................................................................................................................................... )) C nclusi n.............................................................................................................................................. +%ibli $raphy............................................................................................................................................. 1,

  • 8/19/2019 Topology in mininet

    2/11

    MININET FOR SDNFeatures, Characteristics, Default and Custom Topologies

    Mininet is a net r e*ulat r hich creates a net r ! virtual h sts/ s itches/ c ntr ller an( lin sn a sin$le &inux ernel. Mininet is an pen s urce pr 0ect an( un(er active (evel p*ent.

    1 Mininet Features#he *ininet c nsists ! ! ll in$ !eatures:

    1.1 Flexibility:

    #he *ininet can be use( t * (el i(e ran$e ! net r inclu(in$ ne t p l $ies an( !uncti nalities.#he *ininet can be run in al* st all p pular peratin$ syste* usin$ the *ininet virtual i*a$e. Ina((iti n/ the *ininet supp rt *any type ! c ntr llers Fl (li$ht pen!l c ntr ller/ pen"ayli$htplat! r*/ / p x etc an( the s uthb un( A6Is besi(e pen!l .

    1.2 Applicability:#he pr t type net r e*ulate( in the *ininet can be (epl ye( in a har( are base( net r / ith nchan$es t c (e ! c n!i$urati n. Since the real har( are are base( n the &inux ernel an( s ( es*ininet s the *ininet is applicable ! r real ti*e i*ple*entati n.

    1.3 Interacti ity#he c *p nents in the net r built in the *ininet have sa*e real ti*e behavi r as the real har( aresyste*. 7ari us attributes ! the c ntr ller/ s itches/ h sts an( lin s can be speci!ie( s that thenet r ul( be as realistic as p ssible.

    1.! Scalability8sin$ *ininet/ e can buil( the net r !r * the s*all si9es t the ne ith hun(re(s ! s itches.

    'ealistic. 8sin$ the pr $ra**in$ structures in pyth n lan$ua$es/ lar$e net r can als be (esi$ne(usin$ iterati n.

    1." S#are$ability#he pr t types an( al$ rith* (evel pe( in the *ininet can be share( ith ther c llab rat rs. "ue t

    1

  • 8/19/2019 Topology in mininet

    3/11

    the pen s urce/ the lar$er c **unity can r n the pr 0ect an( share their n le($e an(c ntribute. #he pr t type (esi$ne( by ne can be run an( * (i!ie( by thers as ell.

    2 %#aracteristics &' Mininet#he *ininet as (esi$ne( ! r the net r e*ulati n ! the pen s !t are stan(ar(. ther e*ulati nt ls still exist/ h ever the *ininet is the * st i(ely use( an( p pular as ell. #he ! ll in$characteristics ! the *ininet *a e it very applicable.

    A. In *ininet the net r can be instantiate( ith a c **an(-line launcher *n . #he net rcan be be au$*ente( usin$ para*eters by speci!yin$ variables an( para*eters li e cust */ t p l $y/*ac/ arp/ s itch/ c ntr ller etc.

    e$. sudo mn - - switch ovsk - - controller remote

    %. A pyth n A6I can be use( t cust *i9e/ chan$e attribute an( scale the net r s.C. A net r can be initiali9e( usin$ the para*etri9e( t p l $ies usin$ # p subclass. #hec ** n t p l $ies are sin$le/ linear/ tree etc.

    e$. sudo mn - - topo tree, depth=2, fanout=4

    sudo mn - - topo linear,3

    ". #he c **an( line inter!ace C&I has been pr vi(e( in the *ininet t test the net r / viethe net r para*eters li e I6/ MAC etc/ t c n!i$ure etc. #he C&I can be activate( ith the pyth nA6I as ell.

    ;. A!ter !inishin$ r ith *ininet/ the cleanin$ !uncti n has been pr vi(e( t !ree the syste*res urce/ (elete te*p rary !ile an( 0un s. #he !uncti n can be achieve( usin$ si*ple c **an( as! ll s:

    e$. sudo mn -c r/ sudo mn - -clean

    F. #he re* te c ntr ller can be inc rp rate( in the *ininet that all s t use (i!!erent in( !cust * c ntr ller. Fl (li$ht/ pen"ayli$ht c ntr ller are p pular nes besi(es the built in an(p x c ntr ller.

    3 De'ault T&p&l&(y#he (e!ault t p l $y ! the *ininet I is the *ini*al t p l $y c nsistin$ ! 1 c ntr ller c, / 1s itch s1 an( t h sts h1 < h2 as sh n in the !i$ure bel . #he c **an( ! r net r ith(e!ault t p l $y is :

    2

  • 8/19/2019 Topology in mininet

    4/11

    = sudo mn

    #he lin s ! the t p l $y ul( be h1-eth, > - - - ? s1-eth1 an( h2-eth, > - - - ? s1-eth1.

    ! )uilt In T&p&l&(ies%esi(e the (e!ault t p l $ies/ there are s *e built in t p l $ies in the *ininet hich can beinstantiate( as a para*eters in the c **an( line.

    !.1 *inear#he linear t p l $y c nsists ! s itches ith n h sts per s itch. F r exa*ple:

    = sudo mn --topo linear,k,n

    ul( $ive the ! ll in$ t p l $ies. @3/ n@2

    3

    Figure 1: Default Topology

  • 8/19/2019 Topology in mininet

    5/11

    !.2 Sin(le#he t p l $y c nsists ! a sin$le s itch c nnectin$ t the h sts. F r exa*ple/

    = sudo mn – topo single,k

    ul( $ive the ! ll in$ t p l $y ith @ 3 .

    4

    Figure 2: Linear Topology

    Figure 3: Single Topology

  • 8/19/2019 Topology in mininet

    6/11

    *ininet? lin s

    h1-eth,>-?s1-eth1

    h2-eth,>-?s1-eth2

    h3-eth,>-?s1-eth3

    #he t p l $y has been (e!ine( in the class *ininet.t p .Sin$leS itch# p .

    !.3 Re erse+#he t p l $y is sa*e as the sin$le s itch t p l $y/ except the reverse( p rts. #he l est nu*bere(h st is c nnecte( t the hi$hest nu*bere( p rt. #he lin s ! r the c **an( ill be as sh n:

    = sudo mn –topo reversed,3

    ?lin s

    h1-eth,> -- ?s1-eth3h2-eth,> -- ?s1-eth2

    h3-eth, > -- ?s1-eth1

    #he t p l $y has been (e!ine( in the class *ininet.t p .Sin$leS itch'everse(# p .

    !.! T&rus#he # rus t p l $y c nsists ! 2" t rus li e t p l $ies ith l ps. S this t p l $y ( esn t r iththe (e!ault c ntr ller an( any ethernet bri($e ith ut Spannin$ #ree 6r t c l S#6 enable(. #he t rusnet r *ust be use( ith the S#6 in the s itch. F r exa*ple:

    = sudo mn -- topo torus,k,n – switch lxbr, stp=1

    In *ininet/ the (i*ensti n ! t rus * *ust be $reater than 3 3. Bith t rus/3/3 the net r illhave ! ll in$ t p l $y:

    sts: h1x1 h1x2 h1x3 h2x1 h2x2 h2x3 h3x1 h3x2 h3x3

    S itches: s1x1 s1x2 s1x3 s2x1 s2x2 s2x3 s3x1 s3x2 s3x3

    &in s:

    h1x1/ s1x1 h1x2/ s1x2 h1x3/ s1x3 h2x1/ s2x1 h2x2/ s2x2 h2x3/ s2x3 h3x1/ s3x1 h3x2/s3x2 h3x3/ s3x3

    s1x1/ s1x2 s1x1/ s2x1 s1x2/ s1x3 s1x2/ s2x2 s1x3/ s1x1 s1x3/ s2x3

    s2x1/ s2x2 s2x1/ s3x1 s2x2/ s2x3 s2x2/ s3x2 s2x3/ s2x1 s2x3/ s3x3

    5

  • 8/19/2019 Topology in mininet

    7/11

    s3x1/ s1x1 s3x1/ s3x2 s3x2/ s1x2 s3x2/ s3x3 s3x3/ s1x3 s3x3/ s3x1

    !." Tree#he tree t p l $y in *ininet $ives a tree net r ith a speci!ie( (epth an( !an ut. #he inlinec **an( ! r the tree t p l $y is as ! ll s:

    = sudo mn –topo tree,depth=k,fanout=n

    ere/ the (epth represent the len$th ! vertical chain ! s itches hile !an ut re!ers t the nu*ber !h st per s itch. #he ! ll in$ !i$ure sh s the tree t p l $y ith (epth 3 an( !an ut 2.

    #he t p l $y has been (e!ine( in the *ininet.t p lib.#ree# p in *ininet 6yth n A6I.

    " %ust&, T&p&l&(y#he cust * t p l $y can be built in the *ininet usin$ the pyth n A6I. In pyth n !ile ! r the cust *t p l $y/ the ne # p l $y class has t be (e!ine(. #he ne class has t be the subclass ! the built inclass # p (e!ine( in *ininet.t p .# p .

    6

    Figure 4: Tree Topology with depth 3 and fanout 2

  • 8/19/2019 Topology in mininet

    8/11

    #he cust * t p l $ies can be create( usin$ the *eth (s li e a(( st / a((S itch / a((C ntr ller /a((&in etc ! the class *ininet.net.Mininet. #he net r ith cust * t p l $y ill have ! ll in$pattern ! use:

    = su( *n Dcust * >path t the pyth n !ile .py? --t p t p Ena*e / ar$u*entsG

    F ll in$ pyth n !ile creates a t p l $y ith *esh a$$re$ate s itches an( linear access s itches.

    #! /usr/ in/python

    #usage: n "" usto $path"to"file% ""topo aatopo& &n&' ((((

    fro ininet(topo i port Topo

    fro ininet(net i port )ininet

    lass )yTopo*Topo+:

    ,,

    def --init--*self& n.ggr 2& n. ess 2& n0ost 2& opts+:

    ,,, n.ggr nu er of aggregation swit h&

    n. ess nu er of a ess swit h per aggregation swit h

    n0ost no of host per a ess swit h ,,,

    Topo(--init--*self& opts+

    aggrSwit hList

    a essSwit hList

    for i in range*1& *n.ggr 1++:

    aggrSwit h self(addSwit h*5g6d5 6 i+

    last. essSwit h 7one

    for 8 in range*1& *n. ess 1++:

    a essSwit h self(addSwit h*5s6dg6d5 6 *8&i++

    self(addLin'*a essSwit h& aggrSwit h+

    7

  • 8/19/2019 Topology in mininet

    9/11

    for ' in range*1& *n0ost 1++:

    host self(add0ost*5h6ds6dg6d5 6 *'& 8& i++

    self(addLin'*host& a essSwit h+

    if last. essSwit h:

    self(addLin'*last. essSwit h&a essSwit h+

    last. essSwit h a essSwit h

    for pre9ious.ggrSwit h in aggrSwit hList:

    self(addLin'*pre9ious.ggrSwit h& aggrSwit h+

    aggrSwit hList(append*aggrSwit h+

    topos 5aatopo5: )yTopo;

    #he net r create( usin$ the c **an( as:

    = sudo mn –custom !mininet!aatopo"p# –topo aatopo,3,2,2 – switch lxbr, stp=1

    ill be as sh n:

    8

    Figure

  • 8/19/2019 Topology in mininet

    10/11

    - %&nclusi&n#he *ininet is a versatile pen s urce plat! r* ! r si*ulati n the net r . Its !eatures can be a((e( as

    ell (ue t its pen s urce nature. Als the !uture a((iti ns an( (irecti ns are als *enti ne( s surely* re !eatures are (ue t c *e. "ue t its a(aptability ith ther c ntr ller/ the *ininet is $ettin$ * re!uncti nalities.

    #he *ininet pr vi(es built in !uncti nalities ! r the p pular t p l $ies. In a((iti n t the * ret p l $ies can be (esi$ne( as per necessity in pyth n. #he ther p pular t p l $ies can be su$$este( tinc rp rate( as the built in. #here are sa*ple t p l $ies $iven in the exa*ples ! l(er ! the *ininetinstallati n.

  • 8/19/2019 Topology in mininet

    11/11

    )ibli&(rap#y1. Mininet #ea*. )ininet >9er9iew nlineG. Available: http:HH*ininet. r$H vervie H

    2. Mininet #ea*. )ininet ?al'through nlineG. Available: http:HH*ininet. r$H al thr u$hH

    3. %. &ant9/ %. eller an( . Mc e n. . 7etwor' in a Laptop: @apid Arototyping for Software Defined 7etwor's / Stan! r( 8niversity/ Stan! r(/ ct 2,1,.

    4. %. &ant9/ . an(i$ l/ %. eller an( 7. Jeya u*ar. Bntrodu tion to )ininet nlineG. Available:https:HH$ithub.c *H*ininetH*ininetH i iHIntr (ucti n-t -Mininet 15 Sept/ 2,15G

    5. Mininet #ea*. )ininet Aython .AB @eferen e )anual( .9aila le :

    http:HH*ininet. r$HapiHhierarchy.ht*l

    1!

    http://mininet.org/overview/http://mininet.org/walkthrough/https://github.com/mininet/mininet/wiki/Introduction-to-Mininethttp://mininet.org/api/hierarchy.htmlhttp://mininet.org/overview/http://mininet.org/walkthrough/http://mininet.org/api/hierarchy.htmlhttps://github.com/mininet/mininet/wiki/Introduction-to-Mininet