NetworkLab_13MCA38

download NetworkLab_13MCA38

of 62

Transcript of NetworkLab_13MCA38

  • 8/10/2019 NetworkLab_13MCA38

    1/62

    Computer Networks Laboratory 13MCA38

    REVA INSTITUTE OFTECHNOLOGY AND MANAGEMENT

    Kattigenahalli, Jala Holi, Yelahan!a, "angalo#e $ %&' '&(

    De)a#t*ent o+ Mate# o+ Co*)-te#A))li.ation

    III Se*ete# MCA

    Lao#ato#/ Man-al

    Co*)-te# Net0o#! Lao#ato#/

    12MCA23Department of MCA, REVA ITM, an!"ore#$% 1

  • 8/10/2019 NetworkLab_13MCA38

    2/62

    Computer Networks Laboratory 13MCA38

    S-4e.t Co5e612MCA23 I7A Ma#!6 %'

    Ho-#89ee!6 2 E:a* Ma#!6 %'

    Total Ho-#6 (; E:a* Ho-#6 2

  • 8/10/2019 NetworkLab_13MCA38

    3/62

    Computer Networks Laboratory 13MCA38

    Then loo! at the otto* o+ the t#a.e +ile an5 =e#i+/ 0hethe# the#e i an/

    t#an*iion e/on5 the ti*e .al.-late57

    To =e#i+/ that the .lient ha 5o0nloa5e5 the enti#e +ile, )lot the "/te Re.ei=e5

    .-#=e +o# no5e @17 The /a:i i in Kit7 Con=e#t it to M" an5 =e#i+/ 0hethe# it

    a))#o:i*ate the )e.i+ie5 +ile ie7 TC< hea5e# 0o-l5 e++e.ti=el/ in.#eae the

    .o-nt o+ #e.ei=e5 /te at no5e @ 17

    '(

    (7 Si*-lating lin! e##o#

    Coni5e# the +ollo0ing net0o#! 5iag#a*

    He#e no5e @ ; a.t a a #o-te#7 An/ t#a++i. to o# +#o* the LAN )ae th#o-gh it7

    Coni5e# no5e @1 #-nning a FT< e#=e#, an5 no5e @ % i 5o0nloa5ing a +ile o+

    ie ( M"7 Ho0e=e#, the lin! et0een no5e @ ; an5 @ 2 i +a-lt7 It 5#o) )a.!et

    0ith a +i:e5 )#oailit/ o+ '7;7 I*)le*ent a lin! e##o# *o5el to #e+le.t thi7 It

    *a/ e note5 he#e that the +ile 5o0nloa5 ti*e 0ill e *o#e than the 0e ha5 in

    e:e#.ie @ ; o+ e:)e#i*ent @ 17 T#/ 5i++e#ent =al-e o+ the i*-lation ti*e to

    en-#e that the +ile ha een enti#el/ t#an+e##e57 I the )lot o+ /te #e.ei=e5 a

    linea# .-#=e o# nonlinea# 9h/

  • 8/10/2019 NetworkLab_13MCA38

    4/62

    Computer Networks Laboratory 13MCA38

    Coni5e# a 5-*ell to)olog/ 0ith eight no5e a ho0n a in the +ollo0ing

    +ig-#e7

    Coni5e# no5e@ ; an5 2 to e t0o #o-te# .onne.ting t0o 5i++e#ent net0o#!7

    9hen the an50i5th o+ the lin! ;2 i *-.h lo0e# than the -* o+ an50i5th

    o+ the othe# lin! in the net0o#!, it a.t a a

    ottlene.!7 A-*e no5e @ ' #-nning a FT< a))li.ation >o=e# TC

  • 8/10/2019 NetworkLab_13MCA38

    5/62

    Computer Networks Laboratory 13MCA38

    '&

    9#ite a TCL .#i)t to i*-late the +ollo0ing .ena#io 0ith n; i*-lato#7

    Coni5e# i: no5e, >a ho0n in the +ig-#e elo0? *o=ing 0ithin a +lat to)olog/

    o+ B''* : B''*7 The initial )oition o+ no5e a#e ' >1%',2''? ,1 >2'',%''?,;

    >%'',%''?,2 >2'',1''?,(>%'',1''? an5 %>&%',2''? #e)e.ti=el/7A TC< .onne.tion

    i initiate5 et0een no5e ' >o-#.e? an5 no5e % >5etination? th#o-gh no5e 2

    an5 no5e ( i7e the #o-te i '2(%7 At ti*e t 2 e.on5 the FT< a))li.ation

    #-n o=e# it7 A+te# ti*e t(7' e., no5e 2 >2'',1''? *o=e to0a#5 no5e 1

    >2'',%''? 0ith a )ee5 o+ %7'*8e.an5 a+te# o*e ti*e the )ath #ea!, then the

    5ata t#an*it 0ith a ne0 )ath =ia no5e 1 an5 no5e ;

    i7e the ne0 #o-te '1;%7The i*-lation lat +o# &' e.7 In the ao=e ai5

    .ae oth the #o-te ha e-al .ot

    Ue DSR a the #o-ting )#oto.ol an5 the IEEE 3';711 MAC )#oto.ol7

    No0 Anal/e the t#a.e +ile an5 5ete#*ine 0hen the -e o+ e.on5 #o-te

    .o**en.e, an5

  • 8/10/2019 NetworkLab_13MCA38

    6/62

    Computer Networks Laboratory 13MCA38

    No5e @ ' i a TC< o-#.e, an5 the .o##e)on5ing in! i at no5e @ &7 No5e @ 1

    i a UD< o-#.e >C"R t#a++i.? 0ith a n-ll agent atta.he5 to no5e @ B7 Thee t0o

    t#a++i. +lo0 th#o-gh the .o**on lin! ;27 The ai* o+ thi e:e#.ie i to e:a*ine

    ho0 TC< an5 UD< ha#e the an50i5th et0een the*el=e 0hen the #ate o+

    C"R t#a++i. i .hange57

    Set the TC< )a.!et ie to 1(&' "7 The UD< an5 C"R )a.!et ie a#e 1%'' "7

    All the lin! in the net0o#! ha=e a*e an50i5th >a/, ( M?, 5ela/ an5 -e-e

    t/)e7

    in! +o# TC< an5 UD< t#a++i.?

    No0, in.#e*ent the #ate -) to ( M, the lin! an50i5th, in te) o+ '7% M7

    R-n the

    i*-lation an5 )lot the g#a)h again7

    Ho0 5oe the g#a)h .hange a+te# ea.h #-n In )a#ti.-la#, 0hat the nat-#e o+

    the g#a)h 0hen the #ate o+ C"R t#a++i. i %' o+ the an50i5th

  • 8/10/2019 NetworkLab_13MCA38

    7/62

    Computer Networks Laboratory 13MCA38

    Department of MCA, REVA ITM, an!"ore#$% (

    INSTRUCTIONS TO COMPILE AND EXECUTE PROGRAMS

    01 T/)e the )#og#a* in an/ e5ito# an5 a=e it 0ith 7t.l e:tention02 To .o*)ile the )#og#a* -e n +ilena*e7t.l03 To .ont#-.t the g#a)h -e :g#a)h +ilena*e7t#

    0405

  • 8/10/2019 NetworkLab_13MCA38

    8/62

    Computer Networks Laboratory 13MCA38

    1. Write a TCL Scrit t! Si"#$ate t%e &et'!r( )e*cri+e) +e$!'

    C!&*i)er a *"a$$ &et'!r( 'it% ,i-e &!)e* &0&1&2&3 a&) &4 ,!r"i&/ a *tar t!!$!/.

    T%e &!)e &4 i* at t%e ce&ter. N!)e &0 i* a TCP S!#rce '%ic% tra&*"it* !c(et* t! &3a

    TCP Si&( t%r!#/% t%e &!)e &4. N!)e &1 i* a&!t%er Tra,,ic S!#rce a&) *e&)* UDP

    ac(et* t! N!)e &2 t%r!#/% &4. T%e )#rati!& !, t%e *i"#$ati!& ti"e i* 10 Sec!&)*

    et =al>to)? 1'7' @ti*e o+ i*-lation en5

    @C#eate a n i*-lato#

    et n ne0 Si*-lato#

    n .olo# 1 "l-e

    n .olo# ; Re5

    @O)en the NS t#a.e +ile

    et t#a.e+ile o)en )17t# 0

    n t#a.eall t#a.e+ile

    @O)en the NAM t#a.e +ile

    et na*+ile o)en )17na* 0

    n na*t#a.eall na*+ile

    @C#eate % no5e

    et n' n no5e

    et n1 n no5e

    et n; n no5e

    et n2 n no5e

    et n( n no5e

    @C#eate lael +o# no5e

    n' lael T.) So-#.e

    n2 lael T.)PDetination

    n1 lael U5) So-#.e

    n; lael U5) Detination

    @Gi=e ha)e to no5e

    n' ha)e -a#e

    n2 ha)e -a#e

    n( ha)e .i#.le

    Department of MCA, REVA ITM, an!"ore#$% 8

  • 8/10/2019 NetworkLab_13MCA38

    9/62

    Computer Networks Laboratory 13MCA38

    n1 ha)e he:agon

    n; ha)e he:agon

    @Gi=e .olo# to no5e

    n' .olo# g#een

    n2 .olo# #e5

    n1 .olo# g#een

    n; .olo# #e5

    n( .olo# la.!

    @C#eate lin! et0een no5e

    n 5-)le:lin! n' n( 1''7'M ('* D#o)Tail

    n -e-eli*it n' n( % @ 5e+a-lt -e-e li*it i %'

    n 5-)le:lin! n( n2 1''7'M ('* D#o)Tail

    n -e-eli*it n( n2 %

    n 5-)le:lin! n1 n( 1''7'M ('* D#o)Tail

    n -e-eli*it n1 n( %

    n 5-)le:lin! n( n; 1''7'M ('* D#o)Tail

    n -e-eli*it n( n; %

    n 5-)le:lin!o) n( n; -e-e+o# NAM?

    n 5-)le:lin!o) n( n' o#ient le+t5o0n

    n 5-)le:lin!o) n1 n( o#ient le+t-)

    n 5-)le:lin!o) n2 n( o#ient le+t5o0n

    n 5-)le:lin!o) n; n( o#ient #ight5o0n

    @Set-) a TC< .onne.tion

    et t.)' ne0 Agent8TC

  • 8/10/2019 NetworkLab_13MCA38

    10/62

    Computer Networks Laboratory 13MCA38

    @Set-) a UD< .onne.tion

    et -5)1 ne0 Agent8UD

  • 8/10/2019 NetworkLab_13MCA38

    11/62

    Computer Networks Laboratory 13MCA38

    n +l-ht#a.e

    .loe t#a.e+ile

    .loe na*+ile

    e:e. na* )17na*

    e:it '

    n at =al>to)? n na*en50i#ele =al>to)?

    n at =al>to)? +inih

    n at =al>to)? )-t 5one n halt

    n #-n

    OUTPUT

    Department of MCA, REVA ITM, an!"ore#$% 11

  • 8/10/2019 NetworkLab_13MCA38

    12/62

    Computer Networks Laboratory 13MCA38

    2.Setti&/ # a $!ca$ area &et'!r( 'it% &*2

    I& t%i* eerci*e !# 'i$$ +e *i"#$ati&/ a CSMACD +a*e) LAN 'it% &*2. C!&*i)er t%e LAN

    'it% *e-e& &!)e* t! +e a& i*!$ate) !&e i.e. &!t c!&&ecte) t! t%e I&ter&et. N!)e 0 i&

    t%e LAN act a* a UDP tra,,ic *!#rce a&) &!)e 6 i* t%e )e*ti&ati!& &!)e. A**#"e C7R

    tra,,ic t! +e ,$!'i&/ +et'ee& t%e &!)e*. T%e *i"#$ati!& $a*t* ,!r 25 *ec!&)*. I& Et%er&et

    a ac(et i* +r!a)ca*te) i& t%e *%are) "e)i#" a&) !&$ t%e )e*ti&ati!& &!)e accet*

    t%e ac(et. Ot%er &!)e* *i"$ )r! it. W%at *%!#$) +e t%e "+er !, %!* a ac(et

    ,r!" &!)e 0 t! &!)e 6 tra-e$8

    A))iti!&a$ Ta*(9

    S#!*e t%e a+!-e LAN i* t! +e c!&&ecte) t! t%e I&ter&et. A)) &!)e : i&t! t%e

    &et'!r( *! t%at it act a* t%e /ate'a. C!&&ect &!)e 0 a&) : 'it% a 1 M+ 'ire) $i&(.

    M!-e t%e UDP *!#rce t! &!)e :.

  • 8/10/2019 NetworkLab_13MCA38

    13/62

    Computer Networks Laboratory 13MCA38

    +o# Q et i ' Qi B Q in.# i Q

    et n>i? n no5e

    n>'? lael U5) So-#.e @

    n>&? lael U5) Sin!

    et lan n ne0Lan n>'? n>1? n>;? n>2? n>(? n>%? n>&? '7%M ('* LL W-e-e8D#o)Tail

    MAC83';P2 Channel

    et -5) ne0 Agent8UD'? nB 1'M ;'* D#o)Tail

    @ n 5-)le:lin!o) n>'? nB o#ient le+t

    n atta.hagent n>'? -5) @

    et in!' ne0 Agent8N-ll

    n atta.hagent n>&? in!'

    n .onne.t -5) in!'

    et .#' ne0 A))li.ation8T#a++i.8C"R

    .#' et )a.!etSieP 1'''

    .#' et inte#=alP '71

    .#' atta.hagent -5)

    -5) et +i5P 1

    n at '7'1 .#' ta#t

    n at ;'7' .#' to)

    n at ;%7' +inihn #-n

    Department of MCA, REVA ITM, an!"ore#$% 13

  • 8/10/2019 NetworkLab_13MCA38

    14/62

    Computer Networks Laboratory 13MCA38

    OUT

  • 8/10/2019 NetworkLab_13MCA38

    15/62

    Computer Networks Laboratory 13MCA38

    A55itional Ta!

    Department of MCA, REVA ITM, an!"ore#$% 1'

  • 8/10/2019 NetworkLab_13MCA38

    16/62

    Computer Networks Laboratory 13MCA38

    3. Write a TCL Scrit t! *i"#$ate a ;i$e Tra&*,er Wit% NS2

    C!&*i)er a C$ie&t a&) Ser-er. T%e Ser-er i* r#&&i&/ a ;TP A$icati!& O-er TCP. T%e

    C$ie&t *e&)* a re

  • 8/10/2019 NetworkLab_13MCA38

    17/62

    Computer Networks Laboratory 13MCA38

    @C#eate lin! et0een no5e

    n 5-)le:lin! . 1'M ;;* D#o)Tail

    @Gi=e no5e )oition >+o# NAM?

    n 5-)le:lin!o) . o#ient #ight

    @Set-) a TC< .onne.tion +o# no5e >e#=e#?

    et t.)' ne0 Agent8TC

  • 8/10/2019 NetworkLab_13MCA38

    18/62

    Computer Networks Laboratory 13MCA38

    n at 1%71 +inih

    n #-n

    A0! S.#i)t +o# +in5ing ti*e ta!en +o# 5ata t#an*iion>)27a0!?

    @ A9K .#i)t to .al.-late the ti*e #e-i#e5 to t#an+e# the 1' M" +ile +#o* the e#=e# to .lient

    "EGIN Q

    .o-nt'

    ti*e'

    totalP/tePent '

    totalP/teP#e.ei=e5'

    Qi+ > 1 # ( 1 % t.)?

    totalP/teP#e.ei=e5 Z &

    i+>1 Z 2 ' % t.)?

    totalP/tePent Z &

    END Q

    /te*>.lea#?

    )#int+>n T#an*iion ti*e #e-i#e5 to t#an+e# the +ile i l+,;?

    )#int+>n A.t-al 5ata ent +#o* the e#=e# i l+ M), >totalP/tePent?81''''''7'?

    )#int+>n Data Re.ei=e5 / the .lient i l+ M)n,>totalP/teP#e.ei=e5?81''''''7'?

    Department of MCA, REVA ITM, an!"ore#$% 18

  • 8/10/2019 NetworkLab_13MCA38

    19/62

    Computer Networks Laboratory 13MCA38

    @ A9K S.#i)t to .al.-late a*o-nt o+ 5ata #e.i=e5 +o# e=e#/ ti*e inte#=el>)217a0!?

    "EGIN Q

    .o-nt'

    ti*e'

    Q

    i+ > 1 # ( 1 % t.)?

    Q

    .o-nt Z &

    ti*e;

    )#int+>nl+tl+,ti*e,>.o-nt?81''''''7'?

    END Q

    Department of MCA, REVA ITM, an!"ore#$% 1)

  • 8/10/2019 NetworkLab_13MCA38

    20/62

    Computer Networks Laboratory 13MCA38

    OUT

  • 8/10/2019 NetworkLab_13MCA38

    21/62

    Computer Networks Laboratory 13MCA38

    (7 Si*-lating lin! e##o#

    Coni5e# the +ollo0ing net0o#! 5iag#a*

    He#e no5e @ ; a.t a a #o-te#7 An/ t#a++i. to o# +#o* the LAN )ae th#o-gh it7 Coni5e# no5e @1

    #-nning a FT< e#=e#, an5 no5e @ % i 5o0nloa5ing a +ile o+ ie ( M"7 Ho0e=e#, the lin! et0een

    no5e @ ; an5 @ 2 i +a-lt7 It 5#o) )a.!et 0ith a +i:e5 )#oailit/ o+ '7;7 I*)le*ent a lin! e##o#

    *o5el to #e+le.t thi7 It *a/ e note5 he#e that the +ile 5o0nloa5 ti*e 0ill e *o#e than the 0e ha5

    in e:e#.ie @ ; o+ e:)e#i*ent @ 17 T#/ 5i++e#ent =al-e o+ the i*-lation ti*e to en-#e that the +ile

    ha een enti#el/ t#an+e##e57 I the )lot o+ /te #e.ei=e5 a linea# .-#=e o# nonlinea# 9h/

  • 8/10/2019 NetworkLab_13MCA38

    22/62

    Computer Networks Laboratory 13MCA38

    et n' n no5e

    et n1 n no5e

    n1 ha)e -a#e

    n1 lael +t)Pe#=e#

    et n; n no5e

    n; .olo# g#een

    n; lael e##o#Pno5e

    et n2 n no5e

    n2 .olo# g#een

    n2 lael e##o#Pno5e

    et n( n no5e

    et n% n no5e

    n% lael +t)P.lient

    et n& n no5e

    @C#eatelin! et0een no5e

    n 5-)le:lin! n' n; 1''7'M 1'* D#o)Tail

    n -e-eli*it n' n; %'

    n 5-)le:lin! n' n1 1''7'M 1'* D#o)Tail

    n -e-eli*it n' n1 %'

    n 5-)le:lin! n1 n; 1''7'M 1'* D#o)Tail

    n -e-eli*it n1 n; %'

    n 5-)le:lin! n; n2 1''7'M 1'* D#o)Tail

    n -e-eli*it n; n2 %'

    @Gi=e no5e )oition >+o# NAM?

    n 5-)le:lin!o) n' n; o#ient #ight

    n 5-)le:lin!o) n' n1 o#ient #ight5o0n

    n 5-)le:lin!o) n1 n; o#ient #ight-)

    n 5-)le:lin!o) n; n2 o#ient #ight

    et e* ne0 E##o#Mo5el

    e* -nit )!t @ e##o# -nit >5e+a-lt6 )a.!et? >Othe# -nit6 ti*e, it?

    Department of MCA, REVA ITM, an!"ore#$% &&

  • 8/10/2019 NetworkLab_13MCA38

    23/62

    Computer Networks Laboratory 13MCA38

    e* et #ateP '7; @ e##o# #ate )#oailit/

    e* #an=a# ne0 Ran5o*Va#iale8Uni+o#* @ )e.i+/ the #= +o# gene#ating e##o#

    e* 5#o)ta#get ne0 Agent8N-ll @ .olle.t .o##-)te5 )a.!et an5 han5le

    @C#eate a LAN o+ +o-# no5e an5 #e.o#5 the t#a.e >e:6 .olliion., ho)h?

    n *a!elan t#a.e on n2 n( n% n& '7%M ('* LL W-e-e8D#o)Tail Ma.83';P2

    @Ao.iate a lin! lo *o5el et0een no5e n; an5 n2

    n lin!lo*o5el e* n; n2

    @Set-) a TC< .onne.tion

    et t.)' ne0 Agent8TC

  • 8/10/2019 NetworkLab_13MCA38

    24/62

    Computer Networks Laboratory 13MCA38

    Note6 #e)eat the e:)e#i*ent +o# 5i++e#ent i*-lation ti*ing an5 #e.o#5 the #ea5ing>i*-lation ti*e

    an5 total 5ata t#an*itte5?

    e:a*)le

    A0! S.#i)t +o# gene#ating total i*-lation ti*e an5 total 5ata t#an*itte5

    "EGIN Q .o-nt'

    Q

    i+> 1 # > ( ; [[ (2??

    Q .o-nt Z &

    END Q

    )#int+>l+tl+n,;,>.o-nt81''''''??

    Department of MCA, REVA ITM, an!"ore#$% &%

  • 8/10/2019 NetworkLab_13MCA38

    25/62

    Computer Networks Laboratory 13MCA38

    Si"#$ati!& ti"e T!ta$ Data Tra&*,erre)

    (37'&32 '7(;2&3'

    733B%' 17(;'2;'

    1(27(32'%3 17B'3(''

    1&271;%1%% 17B1(3''

    ;'27&%B131 17B;&&('

    ;%7;B212 ;7;&%&''

    2(7%13& ;7333B;'

    27&2&%; 27B&1;'

    (((73%B3(3 (71'B&3'

    G#a)h et0een Si*-lation ti*e an5 Data T#an+e#

    Department of MCA, REVA ITM, an!"ore#$% &'

  • 8/10/2019 NetworkLab_13MCA38

    26/62

    Computer Networks Laboratory 13MCA38

    A0! S.#i)t +o# gene#ating e-en.e no an5 no o+ #et#an*iion

    "EGINQ i'

    a1%''

    Q i+>15?

    Q +o#>i'i1%''iZZ?

    Q i+>11i?

    aiaiZ1

    ENDQ +o#>i'i1%''iZZ?

    Q )#int+>5t5n,i,ai?

    Department of MCA, REVA ITM, an!"ore#$% &$

  • 8/10/2019 NetworkLab_13MCA38

    27/62

    Computer Networks Laboratory 13MCA38

    OUT

  • 8/10/2019 NetworkLab_13MCA38

    28/62

    Computer Networks Laboratory 13MCA38

    5. Mea*#ri&/ Net'!r( Per,!r"a&ce*

    7!tt$e&ec( i& t%e &et'!r(

    C!&*i)er a )#"++e$$ t!!$!/ 'it% ei/%t &!)e* a* *%!'& a* i& t%e ,!$$!'i&/ ,i/#re.

    C!&*i)er &!)e* 2 a&) 3 t! +e t'! r!#ter* c!&&ecti&/ t'! )i,,ere&t &et'!r(*. W%e&

    t%e +a&)'i)t% !, t%e $i&( 2?3 i* "#c% $!'er t%a& t%e *#" !, +a&)'i)t%* !, t%e !t%er

    $i&(* i& t%e &et'!r( it act a* a +!tt$e&ec(.

    A**#"e &!)e 0 r#&&i&/ a ;TP a$icati!& !-er TCP a&) *e&)i&/ )ata t! &!)e 6.

    N!)e 1 i* *e&)i&/ C7R )ata &!)e :. A**#"e a$$ t%e $i&(* ecet 2?3 %a* a +a&)'i)t%

    !, 1 M+ r!a/ati!& )e$a !, 10"* a&) *ecti!& +e$!'

    7a*e) !& t%e a+!-e $!t* *#//e*t '%at *%!#$) +e t%e rec!""e&)e) +a&)'i)t% !, t%e

    $i&( 2?3. N!' $!t t%e e&)?t!?e&) )e$a +et'ee& &!)e* 0 a&) 6 ,!r t%e a+!-e c%!*e&

    -a$#e* !, $i&( 2?3 +a&)'i)t%. Re-i*it !#r re-i!#* a&*'er i.e. !ti"#" +a&)'i)t% !,

    $i&( 2?3 +a*e) !& t%e*e /ra%*. Mea*#ri&/ Net'!r( Per,!r"a&ce*

    Department of MCA, REVA ITM, an!"ore#$% &8

  • 8/10/2019 NetworkLab_13MCA38

    29/62

    Computer Networks Laboratory 13MCA38

  • 8/10/2019 NetworkLab_13MCA38

    30/62

    Computer Networks Laboratory 13MCA38

    n 5-)le:lin! n1 n; 17'M 1'* D#o)Tail

    n -e-eli*it n1 n; %

    n 5-)le:lin! n; n2 Q=M 1'* D#o)Tail

    n -e-eli*it n; n2 ;

    n 5-)le:lin! n2 n( 17'M 1'* D#o)Tail

    n -e-eli*it n2 n( %

    n 5-)le:lin! n2 n% 17'M 1'* D#o)Tail

    n -e-eli*it n2 n% %

    n 5-)le:lin! n% nB 17'M 1'* D#o)Tail

    n -e-eli*it n% nB %

    n 5-)le:lin! n( n& 17'M 1'* D#o)Tail

    n -e-eli*it n( n& %

    @Gi=e no5e )oition >+o# NAM?

    n 5-)le:lin!o) n; n' o#ient le+t-)

    n 5-)le:lin!o) n1 n; o#ient #ight-)

    n 5-)le:lin!o) n; n2 o#ient #ight

    n 5-)le:lin!o) n2 n( o#ient #ight-)

    n 5-)le:lin!o) n2 n% o#ient #ight5o0n

    n 5-)le:lin!o) n% nB o#ient #ight

    n 5-)le:lin!o) n( n& o#ient #ight

    @Set-) a TC< .onne.tion

    et t.)' ne0 Agent8TC

  • 8/10/2019 NetworkLab_13MCA38

    31/62

    Computer Networks Laboratory 13MCA38

    et n-llB ne0 Agent8N-ll

    n atta.hagent nB n-llB

    n .onne.t -5)1 n-llB

    -5)1 et )a.!etSieP 1%''

    t.)' et +i5P 1

    -5)1 et +i5P ;

    @Set-) a FT< A))li.ation o=e# TC< .onne.tion

    et +t)' ne0 A))li.ation8FT

  • 8/10/2019 NetworkLab_13MCA38

    32/62

    Computer Networks Laboratory 13MCA38

    O-t)-t

    Department of MCA, REVA ITM, an!"ore#$% 3&

  • 8/10/2019 NetworkLab_13MCA38

    33/62

    Computer Networks Laboratory 13MCA38

    @A9K .#i)t to .al.-late th#o-gh)-t +o# )e.i+i. an50i5th

    "EGIN Q

    .o-nt'

    ti*e'7'1

    Q

    i+ > 1 # 2 ; ( 2?

    Q

    .o-nt Z &

    ti*e;

    END Q

    )#int+> l+ t l+n , =a#1,>>.o-nt8ti*e? >381''''''7'?? ?

    "an50i5th Th#o-gh)-t

    '7%''''' '7;&(&'3

    '7B%'''' '7&213&%17'''''' '7&'(;'

    17;%'''' '7B&3&'

    17%''''' 17('1(

    17B%'''' 17('1B3

    ;7'''''' 17('212

    ;7;%'''' 17('(13

    ;7%''''' 17('%';

    Department of MCA, REVA ITM, an!"ore#$% 33

  • 8/10/2019 NetworkLab_13MCA38

    34/62

    Computer Networks Laboratory 13MCA38

    Department of MCA, REVA ITM, an!"ore#$% 3%

  • 8/10/2019 NetworkLab_13MCA38

    35/62

    Computer Networks Laboratory 13MCA38

    "EGIN Q

    h)i5 '

    Q

    e1

    t;

    +i53

    )i51;

    51'

    i+>)i5 X h)i5?

    h)i5 )i5

    i+> t)i5 '?

    t)i5t

    i+>+i5 1 e # ' 5&?

    Q

    et)i5t

    ele Q

    et)i5'

    END Q

    +o#>)i5' )i5h)i5 )i5ZZ? Q

    ta#t t)i5

    en5 et)i5

    )a.!etP5-#ation en5 ta#t

    i+> ta#t en5 ?

    )#int+>5tl+n,)i5,)a.!etP5-#ation?

    Department of MCA, REVA ITM, an!"ore#$% 3'

  • 8/10/2019 NetworkLab_13MCA38

    36/62

    Computer Networks Laboratory 13MCA38

    Department of MCA, REVA ITM, an!"ore#$% 3$

  • 8/10/2019 NetworkLab_13MCA38

    37/62

    Computer Networks Laboratory 13MCA38

    &7 9#ite a TCL .#i)t to i*-late the +ollo0ing .ena#io 0ith n; i*-lato#7

    Coni5e# i: no5e, >a ho0n in the +ig-#e elo0? *o=ing 0ithin a +lat to)olog/ o+ B''* : B''*7

    The initial )oition o+ no5e a#e ' >1%',2''? ,1 >2'',%''?,; >%'',%''?,2 >2'',1''?,(>%'',1''? an5

    %>&%',2''? #e)e.ti=el/7A TC< .onne.tion i initiate5 et0een no5e ' >o-#.e? an5 no5e %

    >5etination? th#o-gh no5e 2 an5 no5e ( i7e the #o-te i '2(%7 At ti*e t 2 e.on5 the FT+o# NAM?

    n 5-)le:lin!o) n' n2 o#ient #ight5o0n

    n 5-)le:lin!o) n1 n2 o#ient #ight

    n 5-)le:lin!o) n; n2 o#ient #ight-)

    n 5-)le:lin!o) n2 n( o#ient #ight

    n 5-)le:lin!o) n( n% o#ient #ight-)

    n 5-)le:lin!o) n( n& o#ient #ight5o0n

    n 5-)le:lin!o) n( nB o#ient #ight

    @Set-) a TC< .onne.tion

    et t.)' ne0 Agent8TC

  • 8/10/2019 NetworkLab_13MCA38

    45/62

    Computer Networks Laboratory 13MCA38

    et t.)1 ne0 Agent8TC

  • 8/10/2019 NetworkLab_13MCA38

    46/62

    Computer Networks Laboratory 13MCA38

    n at ('7' .#; to)

    @De+ine a +inih )#o.e5-#e

    )#o. +inih Q Q

    gloal n t#a.e+ile na*+ile =

    n +l-ht#a.e

    .loe t#a.e+ile

    .loe na*+ile

    @ e:e. na* )B7na*

    e:e. a0! + )B7a0! = =a#1= )B7t# XX )B17t#

    e:it '

    n at =al>to)? +inih

    n #-n

    OUT

  • 8/10/2019 NetworkLab_13MCA38

    47/62

    Computer Networks Laboratory 13MCA38

    A9K S.#i)t +o# .al.-lating n-*e# o+ .ongetion a.tion ta!en / TC

  • 8/10/2019 NetworkLab_13MCA38

    48/62

    Computer Networks Laboratory 13MCA38

    G#a)h +o# n-*e# o+ a.tion ta!en / Ne0#eno, Vega, TC< Thaho

    "an50i5th TC< Ne0#eno TC< Vega TC< Thaho

    '7%''''' 11B2 ' 1'&2

    '7B%'''' 11B& ' 1'(

    17'''''' 1;'' ' 11;2

    17;%'''' 1;&( ' 1'((

    17%''''' 1;13 ' 112'

    17B%'''' 11&& ' 1;''

    ;7'''''' 11&2 ' 1;(B

    ;7;%'''' 1'3 ' 1231

    ;7%''''' 11%B ' 1;;1

    ;7B%'''' 11'% ' 122;

    27'''''' 11(3 ' 1;&;

    27;%'''' 11'1 ' 123;

    27%''''' 1'BB ' 1;;;

    27B%'''' 111& ' 123%

    (7'''''' 11;& ' 12B3

    Department of MCA, REVA ITM, an!"ore#$% %8

  • 8/10/2019 NetworkLab_13MCA38

    49/62

    Computer Networks Laboratory 13MCA38

    Department of MCA, REVA ITM, an!"ore#$% %)

  • 8/10/2019 NetworkLab_13MCA38

    50/62

    Computer Networks Laboratory 13MCA38

    37 Si*-late a 0i#e5 net0o#! an5 5e*ont#ate Ditan.e Ve.to# Ro-ting algo#ith* 7

    et n ne0 Si*-lato#

    n .olo# 1 l-e

    n .olo# ; #e5

    et n+ o)en o-t7na* 0

    n na*t#a.eall n+

    et t# o)en o-t7t# 0

    n t#a.eall t#

    )#o. +inih Q Q

    gloal n+ n t#

    n +l-ht#a.e

    .loe t#

    .loe n+

    e:e. na* o-t7na*

    e:it '

    et n' n no5e

    et n1 n no5e

    et n; n no5e

    et n2 n no5e

    et n( n no5e

    et n% n no5e

    n 5-)le:lin! n' n1 1'M 1'* D#o)Tail

    n 5-)le:lin! n1 n2 (M 1'* D#o)Tail

    n 5-)le:lin! n; n1 1'M 1'* D#o)Tail

    n 5-)le:lin! n1 n( 1'M 1'* D#o)Tail

    n 5-)le:lin! n( n% 1'M 1'* D#o)Tailn 5-)le:lin! n% n2 1'M 1'* D#o)Tail

    n 5-)le:lin!o) n' n1 o#ient #ight5o0n

    n 5-)le:lin!o) n1 n2 o#ient #ight

    n 5-)le:lin!o) n; n1 o#ient #ight-)

    n 5-)le:lin!o) n1 n( o#ient #ight-)

    Department of MCA, REVA ITM, an!"ore#$% '*

  • 8/10/2019 NetworkLab_13MCA38

    51/62

    Computer Networks Laboratory 13MCA38

    n 5-)le:lin!o) n( n% o#ient #ight

    n 5-)le:lin!o) n% n2 o#ient #ight5o0n

    et t.) ne0 Agent8TC

  • 8/10/2019 NetworkLab_13MCA38

    52/62

    Computer Networks Laboratory 13MCA38

    O-t)-t

    Department of MCA, REVA ITM, an!"ore#$% '&

  • 8/10/2019 NetworkLab_13MCA38

    53/62

    Computer Networks Laboratory 13MCA38

    7 "an50i5th ha#ing et0een TC< an5 UDto)? +inih

    n #-n

    Department of MCA, REVA ITM, an!"ore#$% '$

  • 8/10/2019 NetworkLab_13MCA38

    57/62

    Computer Networks Laboratory 13MCA38

    O#t#t

    Department of MCA, REVA ITM, an!"ore#$% '(

  • 8/10/2019 NetworkLab_13MCA38

    58/62

    Computer Networks Laboratory 13MCA38

    A'( Scrit ,!r ca$c#$ati&/ t%r!#/%#t !, TCP a&) UDP

    "EGIN Q

    t.)Pin!'

    -5)Pin!'

    Q

    i+>1# ( (?Q

    t.)Pin! Z &

    i+>1# ( % ?Q

    -5)Pin! Z &

    END Q

    )#int+>l+tl+tl+n,=a#1,t.)Pin!81'''''',-5)Pin!81''''''?

    Department of MCA, REVA ITM, an!"ore#$% '8

  • 8/10/2019 NetworkLab_13MCA38

    59/62

    Computer Networks Laboratory 13MCA38

    Ne0#eno = UD