!"#$%&'(')"*#+',-."/0123/-'%-0' !1./"*%4
5617*',86**' 9*7*':%;%*' <8617*=#*7*>?%@A-*2.BC/B7D' E%3/-%4',-83.1.#'/+',-+/"$%3/-'%-0'F/$$1-*2%3/-8' !#26-/4/CG'
HHIJKILM 1
(N(EOL-0' P1.1"#',-.#"-#.'!#8.Q#0'R/"?86/D
!"#$%&'(')"*#+',-."/0123/-'%-0' !1./"*%4 - - PowerPoint PPT Presentation
(N(EOL-0' P1.1"#',-.#"-#.'!#8.Q#0'R/"?86/D !"#$%&'(')"*#+',-."/0123/-'%-0' !1./"*%4 5617*',86**' 9*7*':%;%*' <8617*=#*7*>?%@A-*2.BC/B7D' E%3/-%4',-83.1.#'/+',-+/"$%3/-'%-0'F/$$1-*2%3/-8'
HHIJKILM 1
(N(EOL-0' P1.1"#',-.#"-#.'!#8.Q#0'R/"?86/D
HHIJKILM 2
HHIJKILM 3
HHIJKILM 4
P/";%"0*-C'9-C*-# F/-."/4'P1-23/-
HHIJKILM 5
P4/;'.%Q4#
HHIJKILM 6
P/";%"0*-C'9-C*-# F/-."/4'P1-23/- P/";%"0*-C'9-C*-# P/";%"0*-C'9-C*-#
HHIJKILM 7
P4/;'.%Q4# P4/;'.%Q4# P4/;'.%Q4#
\%.26 ,-8."123/- 5.%38328 \%.26 ,-8."123/- 5.%38328 \%.26 ,-8."123/- 5.%38328
HHIJKILM 8
P4/;'.%Q4# P/";%"0*-C'9-C*-# P/1-0 P/1-0
F/-."/4'P1-23/-
HHIJKILM 9
P4/;'.%Q4# P/";%"0*-C'9-C*-#
F/-."/4'P1-23/- E/.'+/1-0 N%2?#.',-' $#88%C#
HHIJKILM 10
P4/;'.%Q4# F/-."/4'P1-23/-
HHIJKILM 11
HHIJKILM 12
HHIJKILM 13
N%C#'HM' HHIJKILM
E#.;/"?'8#.1D' !"%k2'C#-#"%3/-' b*%C-/8#' N"/0123/-'#-Z*"/-$#-.' b#Q1C' b#Q1C' b#Q1C' b#Q1C' 5/f;%"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-2"#%8*-C'2/Z#"%C#v'
– E#.;/"?'b5i'%-0'86#44'u%Z%*4%Q4#'Q1.'1D0%.#0'+"#^1#-.4Gv'
– \/014#'$%-%C#"'u!B)Bbv'
– !"#$%56%"?' – E#.;/"?'0#Q1CC#"'uD4%--#0v'
– N8#10/'6/8.'u%Z%*4%Q4#'%-0'$/"#'+1-23/-8'D4%--#0v' – o*".1%4'8;*.26'u%Z%*4%Q4#'%-0'$/"#'+1-23/-8'D4%--#0v'
HHIJKILM 22
N%C#'LM' HHIJKILM
!"#$%'b5i'*-.#"D"#.#"'
ZT/8.' Z5;*.26' 5;*.26' T/8.' \/014#I/Q7#2.'2"#%3/-='2/-aC1"%3/-='%-0'$%-%C#$#-.
F/"#'$/014#'
SD#-P4/;='#.2t
F/"#'$/014#' c8#"'$/014#' 56#44' 52"*D.'a4#' c8#"'$/014#' c8#"'$/014#' 9$14%3/-'-#.;/"?'I' D6G8*2%4'-#.;/"? \#88#-C#"' E#.;/"?'0#Q1CC#"'I'!"#$%56%"?'
i/CC*-C'I'8-%D86/. i/CC*-C'I'8-%D86/.
SD#-P4/;'2/-."/44#"
N%C#'Lx' HHIJKILM
– c8#"'$/014#8='2/"#'$/014#8'y'D"/2#88' – \#88#-C#"'y'$#88%C*-C'%$/-C'$/014#8'/-'0*z#"#-.'D"/2#88#8I6/8.8' – N"/.#23-C'%'2/-."/44#"'+"/$'8/$#/-#'*-8.%44*-C'1-8.%Q4#'$/014#8BBB' – bG-%$*2%44G'26%-C*-C'2/0#'_;*.6/1.'6%Z*-C'./'8./D`'*-'.6#'2/-."/44#"'
\#88#-C#"' j/13-Cs' 8;*.26' !/D/4/CG' b*82/Z#"G' 5;*.26' $%-%C#"' 5;*.26' N%2?#.'*-' a4.#"' !"#$%'b5i' !"#$%' 56%"?'
F/"#'$/014#8' c8#"'$/014#8'
jNF'$/-*./"*-C'
E#.;/"?' 0#Q1CC#"'
b#Q1CC*-C' b#Z#4/D$#-.' %-0' /D#"%3/-'
!"#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C#'Om' HHIJKILM
HHIJKILM 41
– i#%"-'6/;'./'Q1*40'%-0'"1-'!"#$%'%-0'*.8'8%$D4#'%DD4*2%3/-8' – i#%"-'6/;'./'2/-aC1"#'.6#'*-.#C"%.#0'-#.;/"?'#$14%./"'%-0'%DD4*2%3/-8' – i#%"-'6/;'./'18#'Å."#$%w'2/$$%-0';6*26'%44/;8'G/1'./'*-.#"%2.';*.6'!"#$%=' *.8'%DD4*2%3/-='%-0'-#.;/"?'#$14%./"'
– T/;'./'/Q.%*-'%-0'Q1*40'!"#$%' – T/;'./'"1-'!"#$%'%DD4*2%3/-8' – F/-aC1"*-C'-#.;/"?'#$14%./"'%-0'%DD4*2%3/-8' – Å."#$%w'2/$$%-0'/Z#"Z*#;'
i*-1h'#-Z*"/-$#-.' '
N%C#'ML'
– cQ1-.1'HHBJM'_*OKlI%$0lM`' – cQ1-.1'HJBHJ'_*OKlI%$0lM`' – cQ1-.1'HJBJM'n'i!5'_*OKlI%$0lM`' – b#Q*%-'dEcIi*-1h'lBJ'_*OKlI%$0lM`'
N%C#'MO'
$ git clone git://github.com/trema/trema.git $ cd trema $ ./build.rb $ sudo apt-get install git gcc make ruby ruby-dev rubygems libpcap-dev
!6#"#'*8'-/'"#4#%8#'Z#"8*/-'%.'.6*8'$/$#-.B'R#'81CC#8.'G/1'./'C#.'.6#'4%.#8.'Z#"8*/-B
N%C#'MM'
$ sudo apt-get install git gcc make ruby ruby-dev rubygems libpcap-dev $ git clone git://github.com/trema/trema.git $ cd trema $ ./build.rb
N%C#'Mx'
N%C#'Ml'
$ ./trema run ./objects/examples/dumper/dumper
[switch_ready] datapath_id: 0xabc [features_reply] datapath_id: 0xabc transaction_id: 0x660c0001 n_buffers: 256 n_tables: 2 capabilities: 0x87 actions: 0x7ff port_no: 65534 hw_addr: da:ad:cd:76:d8:3f name: vsw_0xabc !
(DD4*2%3/-'#h#21.%Q4#' _Q*-%"G'/"'"1QG'82"*D.` F/-aC1"%3/-'a4#
N%C#'Mm'
$ ./trema run ./objects/examples/dumper/dumper
^C terminated
N%C#'MK'
$ ./trema run ./objects/examples/dumper/dumper
$ ./trema killall
N%C#'Mr'
$ ./trema run ./objects/examples/learning_switch/learning_switch
$ ./trema run ./objects/examples/multi_learning_switch/multi_learning_switch
$ ./trema run ./objects/examples/repeater_hub/repeater_hub
N%C#'xJ'
$ ./trema run ./objects/examples/dumper/dumper
,.'*8'-/.'D/88*Q4#'./'%44/;'2/--#23/-8'/-4G'+"/$'%1.6/"*Y#0'8;*.26#8'%.'.6*8'$/$#-.B')1.' 8344'%DD4*2%3/-'2%-'*C-/"#'%-G'#Z#-.8'+"/$'1-%1.6/"*Y#0'_1-?-/;-`'8;*.26#8B b#.%*4#0'2/-aC1"%3/-'a4#'8."12.1"#'*8'#hD4%*-#0'4%.#"B 9Z#-'*+'G/1'6%Z#'%-'#$14%./"'2/-aC1"%3/-'*-'2/-aC1"%3/-'a4#='8#21"#'26%--#4'2/--#23/-8' %"#'%22#D.#0B
N%C#'xH'
$ LOGGING_LEVEL=debug ./trema run ./objects/examples/dumper/dumper
,"#-,61='$"")"='26"'='')-,$='#'%)='/"'*$F+G'*8'%44/;#0'./'8#.B'#'%)'*8'0#+%14.B
$ kill –USR1 `cat tmp/dumper.pid`
N%C#'xL'
$ ./trema run ./objects/examples/dumper/dumper –c ./src/examples/dumper/dumper.conf ^C $ ./trema run ./objects/examples/dumper/dumper –c ./src/examples/dumper/dumper.conf –d $ cat tmp/log/dumper.log $ ./trema killall
N%C#'xO'
N%C#'xM'
vswitch("dumper") { datapath_id "0xabc" } vhost("host1") vhost("host2") link "dumper", "host1" link "dumper", "host2"
]/1'2%-'%88*C-'%-G'61$%->"#%0%Q4#'-%$#'./'8;*.26'I'6/8.B \(F'%-0',N'%00"#88#8'%"#'%1./$%32%44G'%88*C-#0'*+'G/1'/$*.'.6#$B T/;'./'*-.#"%2.';*.6'#$14%.#0'-#.;/"?'*8'*-."/012#0'4%.#"B 6/8.H 6/8.L 01$D#"'_'Jh%Q2'`
N%C#'xx'
vswitch("dumper") { datapath_id "0xabc" } vhost("host1") { ip "172.16.0.1" netmask "255.255.255.0" mac "00:00:00:01:00:01" } vhost("host2") { ip "172.16.0.2" netmask "255.255.255.0" mac "00:00:00:01:00:02" } link "dumper", "host1" link "dumper", "host2"
N%C#'xl'
vswitch("switch1") { datapath_id "0x1" } vswitch("switch2") { datapath_id "0x2" } vswitch("switch3") { datapath_id "0x3" } vhost("host1") vhost("host2") vhost("host3") link "switch1", "host1" link "switch2", "host2" link "switch3", "host3" link "switch1", "switch2" link "switch2", "switch3"
6/8.H 8;*.26H'_'JhH'` 6/8.L 6/8.O 8;*.26L'_'JhL'` 8;*.26O'_'JhO'`
N%C#'xm'
vswitch("dumper") { datapath_id "0xabc" } vhost("host1") vhost("host2") link "dumper", "host1" link "dumper", "host2" app { path "./objects/examples/dumper/dumper" }
$ ./trema run -c ./src/examples/dumper/dumper.conf
N%C#'xK'
6/8.H 8;*.26H'_'JhH'` 6/8.L 8;*.26O'_'JhO'` 8;*.26L'_'JhL'` 8;*.26M'_'JhM'`
N%C#'xr'
vswitch("switch1") { datapath_id "0x1" } vswitch("switch2") { datapath_id "0x2" } vswitch("switch3") { datapath_id "0x3" } vswitch("switch3") { datapath_id "0x4" } vhost("host1") vhost("host2") link "switch1", "switch2" link "switch1", "switch3" link "switch2", "switch4" link "switch3", "switch4" link "switch3", "host1" link "switch4", "host2"
N%C#'lJ'
$ ./trema help usage: ./trema <COMMAND> [OPTIONS ...] Trema command-line tool Type './trema help <COMMAND>' for help on a specific command. Available commands: run - runs a trema application. killall - terminates all trema processes. send_packets - sends UDP packets to destination host. show_stats - shows stats of packets. reset_stats - resets stats of packets. dump_flows - print all flow entries.
(4"#%0G'#hD4%*-#0
N%C#'lH'
$ ./trema send_packets --source host1 --dest host2
S-4G'/-#'cbN'D%2?#.'*8'8#-.'/1.'QG'0#+%14.B
$ ./trema send_packets --source host1 --dest host2 --pps 1000
$ ./trema send_packets --source host1 --dest host2 --duration 10
N/".'-1$Q#"'*8';"%D%"/1-0'*+'*.'/Z#"W/;8B
N%C#'lL'
$ ./trema help send_packets Usage: ./trema send_packets [OPTIONS ...]
N%C#'lO'
$ ./trema show_stats host1 --tx $ ./trema show_stats host1 --rx
$ ./trema help show_stats Usage: ./trema show_stats [OPTIONS ...]
$ ./trema reset_stats host1
N%C#'lM'
$ ./trema dump_flows dumper
N%C#'lx'
N%C#'ll'
$ ./trema run ./objects/examples/learning_switch/learning_switch -c ./src/examples/learning_switch/learning_switch.conf -d $ ./trema send_packets --source host1 --dest host2 $ ./trema show_stats host2 --rx ip_dst,tp_dst,ip_src,tp_src,n_pkts,n_octets 192.168.0.2,1,192.168.0.1,1,1,50 $ ./trema dump_flows lsw Jul 24 17:51:01|00001|ofctl|INFO|connecting to unix:/home/y-chiba/trema/tmp/vsw_0xabc.mgmt stats_reply (xid=0xc3d5ecea): flags=none type=1(flow) $ ./trema send_packets --source host2 --dest host1 $ ./trema show_stats host1 --rx ip_dst,tp_dst,ip_src,tp_src,n_pkts,n_octets 192.168.0.1,1,192.168.0.2,1,1,50 $ ./trema dump_flows lsw Jul 24 17:51:13|00001|ofctl|INFO|connecting to unix:/home/y-chiba/trema/tmp/vsw_0xabc.mgmt stats_reply (xid=0xffa1cd04): flags=none type=1(flow) cookie=0x1, duration_sec=7s, duration_nsec=339000000ns, table_id=1, priority=65535, n_packets=1, n_bytes=64, idle_timeout=60,udp,in_port=2,dl_vlan=65535,dl_vlan_pcp=0,dl_src=00:00:00:01:00:02,dl_dst=00:00: 00:01:00:01,nw_src=192.168.0.2,nw_dst=192.168.0.1,tp_src=1,tp_dst=1,actions=output:1
N%C#'lm'
75