R ^U b'tes:; Q;.; >R lo
ink enca:ocal ooback inet add&:M=O.;.;.M 3ask:=<<.;.;.; inetP add&: ::M/M=) Scoe:Xost ]T 99T>4!$ ?]777_ 3^]:P<
7
7|Page collisions:; tx`ueuelen:M ?U b'tes:==G Q==G.; >R ^U b'tes:==G Q==G.; >R mininetB h= i2con2ig -a h=-eth; ink enca:6the&net X\add& ;;:;;:;;:;;:;;:;= inet add&:M;.;.;.= >cast:M;.=<<.=<<.=<< 3ask:=<<.;.;.; inetP add&: 2e);::=;;:22:2e;;:=/PG Scoe:ink ]T >?94#!4S^ ?]777_ 3]^!4S^ 3^]:M<;; 3et&ic:M ?U ackets:
R ^U b'tes:; Q;.; >R lo R ^U b'tes:; Q;.; >R lo R ^U b'tes:MJ;G< QMJ.; $>R lo R ^U b'tes:P<;P QP.< $>R R ^U b'tes:P<;P QP.< $>R
ink enca:ocal ooback inet add&:M=O.;.;.M 3ask:=<<.;.;.; inetP add&: ::M/M=) Scoe:Xost ]T 99T>4!$ ?]777_ 3^]:P<
mininetB hJ i2con2ig -a hJ-eth; ink enca:6the&net X\add& ;;:;;:;;:;;:;;:;J inet add&:M;.;.;.J >cast:M;.=<<.=<<.=<< 3ask:=<<.;.;.; inetP add&: 2e);::=;;:22:2e;;:J/PG Scoe:ink ]T >?94#!4S^ ?]777_ 3]^!4S^ 3^]:M<;; 3et&ic:M ?U ackets:
ink enca:ocal ooback inet add&:M=O.;.;.M 3ask:=<<.;.;.; inetP add&: ::M/M=) Scoe:Xost ]T 99T>4!$ ?]777_ 3^]:P<
mininetB sM i2con2ig -a en;sJ ink enca:6the&net X\add& ;):;;:=O:P2:c;:P inet add&:M=.MP).<.M;G >cast:M=.MP).<.=<< 3ask:=<<.=<<.=<<.; inetP add&: 2e);::=MM:G2eO:);c:)P))/PG Scoe:ink ]T >?94#!4S^ ?]777_ 3]^!4S^ 3^]:M<;; 3et&ic:M ?U ackets:MGP e&&o&s:; d&oed:; o+e&&uns:; 2&ame:; ^U ackets:J;<< e&&o&s:; d&oed:; o+e&&uns:; ca&&ie&:; collisions:; tx`ueuelen:M;;; ?U b'tes:=M=;JPJJ Q=M.= 3>R ^U b'tes:=P<=G; Q=P<.= $>R en;s)
ink enca:6the&net X\add& ;):;;:=O:a):;:PP inet add&:M=.MP).
@
6|Page 3ask:=<<.=<<.=<<.; inetP add&: 2e);::MO
ink enca:ocal ooback inet add&:M=O.;.;.M 3ask:=<<.;.;.; inetP add&: ::M/M=) Scoe:Xost ]T 99T>4!$ ?]777_ 3^]:P<
o+s-s'stem ink enca:6the&net X\add& =e:aO:cG:<=:Je:)2 >?94#!4S^ 3]^!4S^ 3^]:M<;; 3et&ic:M ?U ackets:; e&&o&s:; d&oed:; o+e&&uns:; 2&ame:; ^U ackets:; e&&o&s:; d&oed:; o+e&&uns:; ca&&ie&:; collisions:; tx`ueuelen:M;;; ?U b'tes:; Q;.; >R ^U b'tes:; Q;.; >R sM
ink enca:6the&net X\add& ea:;b:2b:c:d2:Ga >?94#!4S^ 3]^!4S^ 3^]:M<;; 3et&ic:M ?U ackets:; e&&o&s:; d&oed:; o+e&&uns:; 2&ame:; ^U ackets:; e&&o&s:; d&oed:; o+e&&uns:; ca&&ie&:; collisions:; tx`ueuelen:M;;; ?U b'tes:; Q;.; >R ^U b'tes:; Q;.; >R
sM-ethM
ink enca:6the&net X\add&
sM-eth=
ink enca:6the&net X\add& )=:)<:b):2O:
sM-ethJ
ink enca:6the&net X\add& dP:ac:a<:O:Ma:Ja inetP add&: 2e);::dGac:a<22:2eO:MaJa/PG Scoe:ink ]T >?94#!4S^ ?]777_ 3]^!4S^ 3^]:M<;; 3et&ic:M ?U ackets:M< e&&o&s:; d&oed:; o+e&&uns:; 2&ame:; ^U ackets:
5
8|Page ?U b'tes:; Q;.; >R
^U b'tes:P<;P QP.< $>R
mininetB mininetB c; i2con2ig -a en;sJ ink enca:6the&net X\add& ;):;;:=O:P2:c;:P inet add&:M=.MP).<.M;G >cast:M=.MP).<.=<< 3ask:=<<.=<<.=<<.; inetP add&: 2e);::=MM:G2eO:);c:)P))/PG Scoe:ink ]T >?94#!4S^ ?]777_ 3]^!4S^ 3^]:M<;; 3et&ic:M ?U ackets:M
ink enca:6the&net X\add& ;):;;:=O:a):;:PP inet add&:M=.MP).
ink enca:ocal ooback inet add&:M=O.;.;.M 3ask:=<<.;.;.; inetP add&: ::M/M=) Scoe:Xost ]T 99T>4!$ ?]777_ 3^]:P<
o+s-s'stem ink enca:6the&net X\add& =e:aO:cG:<=:Je:)2 >?94#!4S^ 3]^!4S^ 3^]:M<;; 3et&ic:M ?U ackets:; e&&o&s:; d&oed:; o+e&&uns:; 2&ame:; ^U ackets:; e&&o&s:; d&oed:; o+e&&uns:; ca&&ie&:; collisions:; tx`ueuelen:M;;; ?U b'tes:; Q;.; >R ^U b'tes:; Q;.; >R sM
ink enca:6the&net X\add& ea:;b:2b:c:d2:Ga >?94#!4S^ 3]^!4S^ 3^]:M<;; 3et&ic:M ?U ackets:; e&&o&s:; d&oed:; o+e&&uns:; 2&ame:; ^U ackets:; e&&o&s:; d&oed:; o+e&&uns:; ca&&ie&:; collisions:; tx`ueuelen:M;;; ?U b'tes:; Q;.; >R ^U b'tes:; Q;.; >R
sM-ethM
ink enca:6the&net X\add&
A
9|Page sM-eth=
ink enca:6the&net X\add& )=:)<:b):2O:
sM-ethJ
ink enca:6the&net X\add& dP:ac:a<:O:Ma:Ja inetP add&: 2e);::dGac:a<22:2eO:MaJa/PG Scoe:ink ]T >?94#!4S^ ?]777_ 3]^!4S^ 3^]:M<;; 3et&ic:M ?U ackets:M< e&&o&s:; d&oed:; o+e&&uns:; 2&ame:; ^U ackets:<) e&&o&s:; d&oed:; o+e&&uns:; ca&&ie&:; collisions:; tx`ueuelen:M;;; ?U b'tes:; Q;.; >R ^U b'tes:PM= QP. $>R
mininetB
Bước 7. "hc hiện *i l/( 1 t,ưn* 3n* #D4 t,5n $inin%t c; <=t n>i đ=n +ont,oll%, 'D! ?@ dAn* cn* cA h t,C $inidit. Kh;i <0ng !iniB9it % sudo 'thon mininet/examles/miniedit.'
%h&c hi'n h;i t+o ) topo m+ng giả lập trên !iniB9it/
C
E|Page %h&c hi'n r"n !ininet/ %h&c hi'n ?t n2i các O, DEi Fontroller/ sudo sudo sudo sudo sudo sudo
o+s-+sctl o+s-+sctl o+s-+sctl o+s-+sctl o+s-+sctl o+s-+sctl
set-cont&olle& set-cont&olle& set-cont&olle& set-cont&olle& set-cont&olle& set-cont&olle&
sM s= sJ sG s< sP
tc:M=O.;.;.M:PPJJ tc:M=O.;.;.M:PPJJ tc:M=O.;.;.M:PPJJ tc:M=O.;.;.M:PPJJ tc:M=O.;.;.M:PPJJ tc:M=O.;.;.M:PPJJ
%h&c hi'n chec ?t n2i : netstat -an g&e PPJJ tc tc tc tc tc tc tcP tcP tcP tcP tcP tcP tcP
; ; ; ; ; ; ; ; ; ; ; ; ;
; ; ; ; ; ; ; ; ; ; ; ; ;
M=O.;.;.M:G<=OG M=O.;.;.M:G<=); M=O.;.;.M:G<=)G M=O.;.;.M:G<=O) M=O.;.;.M:G<=)= M=O.;.;.M:G<=OP :::PPJJ M=O.;.;.M:PPJJ M=O.;.;.M:PPJJ M=O.;.;.M:PPJJ M=O.;.;.M:PPJJ M=O.;.;.M:PPJJ M=O.;.;.M:PPJJ
M=O.;.;.M:PPJJ M=O.;.;.M:PPJJ M=O.;.;.M:PPJJ M=O.;.;.M:PPJJ M=O.;.;.M:PPJJ M=O.;.;.M:PPJJ :::N M=O.;.;.M:G<=)G M=O.;.;.M:G<=O) M=O.;.;.M:G<=OP M=O.;.;.M:G<=OG M=O.;.;.M:G<=); M=O.;.;.M:G<=)=
6S^4>SX6# 6S^4>SX6# 6S^4>SX6# 6S^4>SX6# 6S^4>SX6# 6S^4>SX6# S^67 6S^4>SX6# 6S^4>SX6# 6S^4>SX6# 6S^4>SX6# 6S^4>SX6# 6S^4>SX6#
%h&c hi'n ?t n2i
LoMc cN th tr"y cập t remote ho1t thông Q"a <ịa chR !áy ảo/ http:33)S8/)5C/@/)67:C)C)3in9e$/html %h&c hi'n
S
10 | P a g e
Giao 9i'n topology :
)6
11 | P a g e Giao 9i'n .o9e1:
Bước 6 : $inin%t Flow anal)tic? oVnloa9 DW cWi
(get htt://(((.inmon.com/&oducts/sLlo(-?^/s2lo(-&t.ta&.g@ ta& -x+@2 s2lo(-&t.ta&.g@ cd s2lo(-&t ./sta&t.sh =;MO-;J-=M^=J:MG:;;O;; 7L9: istening, sLlo( o&t PJGJ =;MO-;J-=M^=J:MG:M;;O;; 7L9: istening, X^^T o&t );;)
%h&c hi'n chec ?t n2i : minhnh=GAminhnh=G-5i&tual>ox:HI netstat -an g&e );;) tcP ; ; :::);;) :::N tcP ; O M=.MP).<.M;J:);;) M=.MP).<.M=):
S^67 6S^4>SX6#
%h&c hi'n 1tart !ininet topo sudo mn --custom ext&as/s2lo(.' --link tc,b(KM; --too t&ee,dethK=,2anoutK= NNN 7o de2ault 9enLlo( cont&olle& 2ound 2o& de2ault s(itchF
))
12 | P a g e NNN Lalling back to 95S >&idge NNN !&eating net(o&k NNN 4dding cont&olle& NNN 4dding hosts: hM h= hJ hG NNN 4dding s(itches: sM s= sJ NNN 4dding links: QM;.;;3bitR NNN 6&&o&: ?^76^7$ ans(e&s: QM;.;;3bitR NNN 6&&o&: ?^76^7$ ans(e&s: QsM, s=R QM;.;;3bitR NNN 6&&o&: ?^76^7$ di&ecto&' QM;.;;3bitR NNN 6&&o&: ?^76^7$ ans(e&s: QsM, sJR QM;.;;3bitR NNN 6&&o&: ?^76^7$ di&ecto&' QM;.;;3bitR NNN 6&&o&: ?^76^7$ ans(e&s: Qs=, hMR QM;.;;3bitR NNN 6&&o&: ?^76^7$ di&ecto&' QM;.;;3bitR NNN 6&&o&: ?^76^7$ ans(e&s: Qs=, h=R QM;.;;3bitR NNN 6&&o&: ?^76^7$ di&ecto&' QM;.;;3bitR NNN 6&&o&: ?^76^7$ ans(e&s: QsJ, hJR QM;.;;3bitR NNN 6&&o&: ?^76^7$ di&ecto&' QM;.;;3bitR NNN 6&&o&: ?^76^7$ ans(e&s: QsJ, hGR NNN !on2igu&ing hosts hM h= hJ hG NNN Sta&ting cont&olle&
7o such 2ile o& di&ecto&' 7o such 2ile o& di&ecto&' ans(e&s: 7o such 2ile o& 7o such 2ile o& di&ecto&' ans(e&s: 7o such 2ile o& 7o such 2ile o& di&ecto&' ans(e&s: 7o such 2ile o& 7o such 2ile o& di&ecto&' ans(e&s: 7o such 2ile o& 7o such 2ile o& di&ecto&' ans(e&s: 7o such 2ile o& 7o such 2ile o& di&ecto&'
NNN Sta&ting J s(itches sM s= sJ ...QM;.;;3bitR QM;.;;3bitR QM;.;;3bitR QM;.;;3bitR QM;.;;3bitR QM;.;;3bitR QM;.;;3bitR QM;.;;3bitR NNN 6nabling sLlo(: sM s= sJ NNN Sending toolog' NNN Sta&ting !: mininetB ie&2 hM hJ NNN e&2: testing ^!T band(idth bet(een hM and hJ NNN ?esults: Z.JP 3bits/secZ, ZM;.< 3bits/secZ mininetB mininetB mininetB mininetB mininetB mininetB ie&2 hM hJ NNN e&2: testing ^!T band(idth bet(een hM and hJ NNN ?esults: Z.GP 3bits/secZ, ZM;.M 3bits/secZ mininetB ingall NNN Ting: testing ing &eachabilit' hM -B h= hJ hG h= -B hM hJ hG hJ -B hM h= hG
)8
1& | P a g e hG -B hM h= hJ NNN ?esults: ;V d&oed QM=/M= &ecei+edR mininetB hM ing -2 hJ T7_ M;.;.;.J QM;.;.;.JR
%h&c hi'n m; tr*nh 9"y't DW chec lư" lư[ng : http:33)S8/)5C/@/)6>:C66C3agent13html
FN th m; r0ng 1ZloV bUng cách <ịnh ngh\a các ZloV < theo 9]i lư" lư[ng trên giao 9i'n Veb realtime/ #!/usr/bin/env python import requests import json rt = 'http://127.0.0.1:8008' flo = '"eys':'lin":inputifine$%ipsour&e%ipestintion'%'vlue':'bytes'( requests.put)rt*'/flo/pir/json'%t=json.umps)flo++ threshol = 'metri&':'pir'%'vlue':1000000/8%'by,lo':-rue%'timeout':1( requests.put)rt*'/threshol/elephnt/json'%t=json.umps)threshol++ eventurl = rt*'/events/jsonthreshol=elephntm$vents=10timeout=30' event = 41 hile 1 == 1: r = requests.5et)eventurl * 6event=6 * str)event++ if r.sttus&oe != 200: bre" events = r.json)+ if len)events+ == 0: &ontinue
)>
1 | P a g e
event = events096event69 events.reverse)+ for e in events: print e'floey'9
LưEng 9^n <ịnh ngh\a ZloV : http:33blog/14loV/com386)>36C3re1t4loV/html http:3314loV-rt/com3Vriting_application1/php
)7