SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
1
Trema Test
@otahi
2015-12-12
Tremaday #8
Run Run
る
ん
る
ん
る
ん
る
ん
2
Self Introduction
● @otahi
– A network engineer?
● Trying to be an SDN engineer
● Charged in (mainly) DC internal network
– Programmer?
● Almost Weekends and early mornings only
– Favorite language
● Ruby
3
Trema and Test
“Trema is an OpenFlow controller programming
framework that provides everything needed to
create OpenFlow controllers in Ruby. It provides a
high-level OpenFlow library and also a network
emulator that can create OpenFlow-based
networks for testing on your PC. This self-
contained environment helps streamlines the
entire process of development and testing.”
https://github.com/trema/trema
4
Problems?
● How can I test my OFC?
– You can test your OFC with Trema and test
frameworks like Serverspec and Infrataster.
● Do I need to create test cases for each
environment of a testing network and a real
network?
– No. You can use common test cases for both.
5
Environment
● You can build a test environment with Trema
and a few commands
VM
vhost1
192.168.8.4
vhost2
192.168.8.5
nshost1
192.168.8.6
nshost2
192.168.8.7
OFC
Trema
OFS
Open vSwitch
eth0
DHCP/NAT
Simple
Hub
brsimple_hub
192.168.8.2
sshd
sshd
6
Build Environment 1/2
● You can build a test environemnt as follows
● Required
– Vagrant, Virtual Box, Rsync
$ git clone https://github.com/otahi/trema-netns-test.git
$ cd trema-netns-test
$ vagrant up
$ vagrant ssh
$ cd trema
$ ./bin/trema run simple_hub.rb -c simple_hub.conf -d
$ sudo ip addr replace 192.168.8.2/24 dev brsimple_hub
$ ./bin/trema netns nshost1 /usr/sbin/sshd
$ ./bin/trema netns nshost2 /usr/sbin/sshd
7
Build Environment 2/2
vswitch('simple_hub') { dpid 0x1 }
vhost('vhost1') { ip '192.168.8.4' }
vhost('vhost2') { ip '192.168.8.5' }
netns('nshost1') {
ip '192.168.8.6'
netmask '255.255.255.0'
route net: '0.0.0.0', gateway: '192.168.8.1'
}
netns('nshost2') {
ip '192.168.8.7'
netmask '255.255.255.0'
route net: '0.0.0.0', gateway: '192.168.8.1'
}
link 'simple_hub', 'vhost1'
link 'simple_hub', 'vhost2'
link 'simple_hub', 'nshost1'
link 'simple_hub', 'nshost2'
● You can build a test environment with this conf.
8
Built Environment 1/2
$ ifconfig | grep -e 'Link encap' -e 'inet addr'
brsimple_hub Link encap:Ethernet HWaddr 0a:63:71:69:eb:49
inet addr:192.168.8.2 Bcast:0.0.0.0 Mask:255.255.255.0
eth0 Link encap:Ethernet HWaddr 08:00:27:40:7d:2a
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
simple_hub_1 Link encap:Ethernet HWaddr ea:dc:33:ae:50:7a
simple_hub_2 Link encap:Ethernet HWaddr 42:a3:f2:5c:2f:24
simple_hub_3 Link encap:Ethernet HWaddr 22:1a:4f:18:74:d4
simple_hub_4 Link encap:Ethernet HWaddr 92:e8:04:ae:55:2b
vhost1 Link encap:Ethernet HWaddr f2:96:47:32:e8:b6
vhost2 Link encap:Ethernet HWaddr 9a:32:02:e3:e9:b9
$
9
Built Environment 2/2
$ sudo ovs-vsctl show
ac87c935-cd2f-4e74-80f2-4a6954d059e4
Bridge brsimple_hub
Controller "tcp:127.0.0.1:6653"
is_connected: true
fail_mode: secure
Port brsimple_hub
Interface brsimple_hub
type: internal
Port "simple_hub_3"
Interface "simple_hub_3"
Port "simple_hub_2"
Interface "simple_hub_2"
Port "simple_hub_1"
Interface "simple_hub_1"
Port "simple_hub_4"
Interface "simple_hub_4"
ovs_version: "2.0.2"
$
10
Test target
● The test target is very simple hub.
class SimpleHub < Trema::Controller
def switch_ready(dpid)
send_flow_mod_add(
dpid,
match: Match.new,
actions: SendOutPort.new(:flood)
)
end
end
11
Run Tests
1. Tests with vhosts
1.Tests with packet counter
2. Tests with netns hosts
1.Tests with ping command
2. Tests with test frameworks
3. Tests your real network
12
Run Test with vhost
● Send packet
● Check packet counter
$ ./bin/trema send_packets --source vhost1 --dest vhost2 
--npackets 10
$ ./bin/trema show_stats vhost2
Packets received:
192.168.8.2 -> 192.168.8.3 = 10 packets
$
13
Run Test with netns 1/2
● Ping!!
$./bin/trema netns nshost1 -- ping -c1 192.168.8.7
PING 192.168.8.7 (192.168.8.7) 56(84) bytes of data.
64 bytes from 192.168.8.7: icmp_seq=1 ttl=64 time=0.989 ms
--- 192.168.8.7 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.989/0.989/0.989/0.000 ms
$
– `trema netns nshost1` runs a shell
● available
– `trema netns nshost1 command` runs a command
● available from version 0.9.0
14
Run Test with netns 2/2
● Send packet
● Check captured packet
$ ssh 192.168.8.6 nc -zv 192.168.8.7 80
nc: connect to 192.168.8.7 port 80 (tcp) failed: Connection refused
$
$ ssh -t 192.168.8.7 sudo tcpdump -n port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on nshost2, link-type EN10MB (Ethernet), capture size 65535 bytes
23:49:53.373696 IP 192.168.8.6.56359 > 192.168.8.7.80: Flags [S], seq 2713544332, win 29200, options [mss
1460,sackOK,TS val 1613252 ecr 0,nop,wscale 6], length 0
23:49:53.373753 IP 192.168.8.7.80 > 192.168.8.6.56359: Flags [R.], seq 0, ack 2713544333, win 0, length 0
^C
2 packets captured
2 packets received by filter
0 packets dropped by kernel
Connection to 192.168.8.7 closed.
$
15
Use Test Framework 1/4
● Serverspec
describe interface('nshost1') do
it { should exist }
end
describe host('192.168.8.7') do
it { should be_reachable }
end
16
Use Test Framework 2/4
● Serverspec
$ bundle exec rake spec:192.168.8.6
Interface "nshost1"
should exist
Host "192.168.8.7"
should be reachable
Finished in 1.5 seconds (files took 0.28661 seconds to load)
2 examples, 0 failures
$
17
Use Test Framework 3/4
● Infrataster
describe server(:'192.168.8.6') do
describe firewall(server(:'192.168.8.7')) do
it { is_expected.to be_reachable }
it { is_expected.to be_reachable.dest_port(80) }
it { is_expected.to be_reachable.tcp.dest_port(80) }
end
end
18
Use Test Framework 4/4
● Infrataster
$ bundle exec rake spec:simple_hub
server '192.168.8.6'
via firewall
should reach to server '192.168.8.7'
should reach to server '192.168.8.7' dest_port: 80
should reach to server '192.168.8.7' tcp dest_port: 80
Finished in 5.47 seconds (files took 0.53734 seconds to load)
3 examples, 0 failures
$
19
Real Network Test
● You can apply your netns test cases to real
network tests.
$ bundle exec rake spec:192.168.8.6
Interface "nshost1"
should exist
Host "192.168.8.7"
should be reachable
Finished in 1.5 seconds (files took 0.28661 seconds to load)
2 examples, 0 failures
$
$ bundle exec rake spec:simple_hub
server '192.168.8.6'
via firewall
should reach to server '192.168.8.7'
should reach to server '192.168.8.7' dest_port: 80
should reach to server '192.168.8.7' tcp dest_port: 80
Finished in 5.47 seconds (files took 0.53734 seconds to load)
3 examples, 0 failures
$
20
Conclusion
● You can create and test your OFC with Trema.
● You can create tests effectively with test
frameworks.
● You can run common tests for both
environment of a testing network and a real
network.
See also: https://github.com/otahi/trema-netns-test/
21
Thank you!

Contenu connexe

Tendances

David container security-with_falco
David container security-with_falcoDavid container security-with_falco
David container security-with_falcoLorenzo David
 
Monitoring with Syslog and EventMachine
Monitoring with Syslog and EventMachineMonitoring with Syslog and EventMachine
Monitoring with Syslog and EventMachineWooga
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudAndrea Righi
 
Possibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented ProgrammingPossibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented Programmingkozossakai
 
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021Valeriy Kravchuk
 
How to Root 10 Million Phones with One Exploit
How to Root 10 Million Phones with One ExploitHow to Root 10 Million Phones with One Exploit
How to Root 10 Million Phones with One ExploitJiahong Fang
 
Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslogamiable_indian
 
Kernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easyKernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easyAnne Nicolas
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)Brendan Gregg
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemCyber Security Alliance
 
Systems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting StartedSystems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting StartedBrendan Gregg
 
Asynchronous Io Programming
Asynchronous Io ProgrammingAsynchronous Io Programming
Asynchronous Io Programmingl xf
 
Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqRuben Tan
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debuggingHao-Ran Liu
 
Bypassing ASLR Exploiting CVE 2015-7545
Bypassing ASLR Exploiting CVE 2015-7545Bypassing ASLR Exploiting CVE 2015-7545
Bypassing ASLR Exploiting CVE 2015-7545Kernel TLV
 
Configuring Syslog by Octavio
Configuring Syslog by OctavioConfiguring Syslog by Octavio
Configuring Syslog by OctavioRowell Dionicio
 
Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics
Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit BasicsNetwork Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics
Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit BasicsBishop Fox
 
Linux network stack
Linux network stackLinux network stack
Linux network stackTakuya ASADA
 
Troubleshooting common oslo.messaging and RabbitMQ issues
Troubleshooting common oslo.messaging and RabbitMQ issuesTroubleshooting common oslo.messaging and RabbitMQ issues
Troubleshooting common oslo.messaging and RabbitMQ issuesMichael Klishin
 
Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFBrendan Gregg
 

Tendances (20)

David container security-with_falco
David container security-with_falcoDavid container security-with_falco
David container security-with_falco
 
Monitoring with Syslog and EventMachine
Monitoring with Syslog and EventMachineMonitoring with Syslog and EventMachine
Monitoring with Syslog and EventMachine
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloud
 
Possibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented ProgrammingPossibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented Programming
 
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
 
How to Root 10 Million Phones with One Exploit
How to Root 10 Million Phones with One ExploitHow to Root 10 Million Phones with One Exploit
How to Root 10 Million Phones with One Exploit
 
Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslog
 
Kernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easyKernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easy
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande Modem
 
Systems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting StartedSystems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting Started
 
Asynchronous Io Programming
Asynchronous Io ProgrammingAsynchronous Io Programming
Asynchronous Io Programming
 
Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromq
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
Bypassing ASLR Exploiting CVE 2015-7545
Bypassing ASLR Exploiting CVE 2015-7545Bypassing ASLR Exploiting CVE 2015-7545
Bypassing ASLR Exploiting CVE 2015-7545
 
Configuring Syslog by Octavio
Configuring Syslog by OctavioConfiguring Syslog by Octavio
Configuring Syslog by Octavio
 
Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics
Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit BasicsNetwork Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics
Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics
 
Linux network stack
Linux network stackLinux network stack
Linux network stack
 
Troubleshooting common oslo.messaging and RabbitMQ issues
Troubleshooting common oslo.messaging and RabbitMQ issuesTroubleshooting common oslo.messaging and RabbitMQ issues
Troubleshooting common oslo.messaging and RabbitMQ issues
 
Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPF
 

En vedette

ΑΣΚΗΣΗ ΣΤΗΝ ΦΥΣΗ
ΑΣΚΗΣΗ ΣΤΗΝ ΦΥΣΗ ΑΣΚΗΣΗ ΣΤΗΝ ΦΥΣΗ
ΑΣΚΗΣΗ ΣΤΗΝ ΦΥΣΗ gymnasiovelou
 
Td Wealth Monthly Perspectives - 2016-08 - The Politics of it All
Td Wealth Monthly Perspectives - 2016-08 - The Politics of it AllTd Wealth Monthly Perspectives - 2016-08 - The Politics of it All
Td Wealth Monthly Perspectives - 2016-08 - The Politics of it AllNader Nasr, CFP®, CIM®
 
ΖΥΓΙΕΣ ΚΑΙ ΚΟΜΠΑΝΙΕΣ
ΖΥΓΙΕΣ ΚΑΙ ΚΟΜΠΑΝΙΕΣΖΥΓΙΕΣ ΚΑΙ ΚΟΜΠΑΝΙΕΣ
ΖΥΓΙΕΣ ΚΑΙ ΚΟΜΠΑΝΙΕΣgymnasiovelou
 
Φύση και άσκηση - Αλιεία
Φύση και άσκηση - ΑλιείαΦύση και άσκηση - Αλιεία
Φύση και άσκηση - Αλιείαgymnasiovelou
 
Autismo-programa-de-educacao-individualizada-PEI
Autismo-programa-de-educacao-individualizada-PEIAutismo-programa-de-educacao-individualizada-PEI
Autismo-programa-de-educacao-individualizada-PEIRosane Domingues
 
Shot list and call sheet being done over holidays
Shot list and call sheet being done over holidaysShot list and call sheet being done over holidays
Shot list and call sheet being done over holidaysBlast127
 
Η ΛΙΜΝΗ ΣΤΥΜΦΑΛΙΑ
Η ΛΙΜΝΗ ΣΤΥΜΦΑΛΙΑΗ ΛΙΜΝΗ ΣΤΥΜΦΑΛΙΑ
Η ΛΙΜΝΗ ΣΤΥΜΦΑΛΙΑgymnasiovelou
 
Indi now flat plans front page
Indi now flat plans front pageIndi now flat plans front page
Indi now flat plans front pageBlast127
 
Η ψυχαγωγία στη λίμνη της Στυμφαλίας σήμερα
Η ψυχαγωγία στη λίμνη της Στυμφαλίας σήμεραΗ ψυχαγωγία στη λίμνη της Στυμφαλίας σήμερα
Η ψυχαγωγία στη λίμνη της Στυμφαλίας σήμεραgymnasiovelou
 
Contents page
Contents pageContents page
Contents pageBlast127
 
Prueba de relación de hojas nombres
Prueba de relación de hojas nombres Prueba de relación de hojas nombres
Prueba de relación de hojas nombres Karianamawcinitt
 
Prueba de relación de hojas nombres
Prueba de relación de hojas nombres Prueba de relación de hojas nombres
Prueba de relación de hojas nombres Karianamawcinitt
 
Contents page
Contents pageContents page
Contents pageBlast127
 
Certificate for iv
Certificate for ivCertificate for iv
Certificate for ivpriyanaka19
 
Έκθεση δράσεων (τέχνη και γεωμετρία)
Έκθεση δράσεων (τέχνη και γεωμετρία) Έκθεση δράσεων (τέχνη και γεωμετρία)
Έκθεση δράσεων (τέχνη και γεωμετρία) gymnasiovelou
 

En vedette (20)

ΑΣΚΗΣΗ ΣΤΗΝ ΦΥΣΗ
ΑΣΚΗΣΗ ΣΤΗΝ ΦΥΣΗ ΑΣΚΗΣΗ ΣΤΗΝ ΦΥΣΗ
ΑΣΚΗΣΗ ΣΤΗΝ ΦΥΣΗ
 
Td Wealth Monthly Perspectives - 2016-08 - The Politics of it All
Td Wealth Monthly Perspectives - 2016-08 - The Politics of it AllTd Wealth Monthly Perspectives - 2016-08 - The Politics of it All
Td Wealth Monthly Perspectives - 2016-08 - The Politics of it All
 
Correo electronico
Correo electronicoCorreo electronico
Correo electronico
 
ΖΥΓΙΕΣ ΚΑΙ ΚΟΜΠΑΝΙΕΣ
ΖΥΓΙΕΣ ΚΑΙ ΚΟΜΠΑΝΙΕΣΖΥΓΙΕΣ ΚΑΙ ΚΟΜΠΑΝΙΕΣ
ΖΥΓΙΕΣ ΚΑΙ ΚΟΜΠΑΝΙΕΣ
 
Φύση και άσκηση - Αλιεία
Φύση και άσκηση - ΑλιείαΦύση και άσκηση - Αλιεία
Φύση και άσκηση - Αλιεία
 
Nomina 2
Nomina 2Nomina 2
Nomina 2
 
Autismo-programa-de-educacao-individualizada-PEI
Autismo-programa-de-educacao-individualizada-PEIAutismo-programa-de-educacao-individualizada-PEI
Autismo-programa-de-educacao-individualizada-PEI
 
Shot list and call sheet being done over holidays
Shot list and call sheet being done over holidaysShot list and call sheet being done over holidays
Shot list and call sheet being done over holidays
 
Η ΛΙΜΝΗ ΣΤΥΜΦΑΛΙΑ
Η ΛΙΜΝΗ ΣΤΥΜΦΑΛΙΑΗ ΛΙΜΝΗ ΣΤΥΜΦΑΛΙΑ
Η ΛΙΜΝΗ ΣΤΥΜΦΑΛΙΑ
 
Indi now flat plans front page
Indi now flat plans front pageIndi now flat plans front page
Indi now flat plans front page
 
Η ψυχαγωγία στη λίμνη της Στυμφαλίας σήμερα
Η ψυχαγωγία στη λίμνη της Στυμφαλίας σήμεραΗ ψυχαγωγία στη λίμνη της Στυμφαλίας σήμερα
Η ψυχαγωγία στη λίμνη της Στυμφαλίας σήμερα
 
Contents page
Contents pageContents page
Contents page
 
Prueba de relación de hojas nombres
Prueba de relación de hojas nombres Prueba de relación de hojas nombres
Prueba de relación de hojas nombres
 
Prueba de relación de hojas nombres
Prueba de relación de hojas nombres Prueba de relación de hojas nombres
Prueba de relación de hojas nombres
 
Libro15 19 kjmv grafica
Libro15 19 kjmv graficaLibro15 19 kjmv grafica
Libro15 19 kjmv grafica
 
Contents page
Contents pageContents page
Contents page
 
Peso y estatura
Peso y estaturaPeso y estatura
Peso y estatura
 
Certificate for iv
Certificate for ivCertificate for iv
Certificate for iv
 
Έκθεση δράσεων (τέχνη και γεωμετρία)
Έκθεση δράσεων (τέχνη και γεωμετρία) Έκθεση δράσεων (τέχνη και γεωμετρία)
Έκθεση δράσεων (τέχνη και γεωμετρία)
 
Kariana m.
Kariana m.Kariana m.
Kariana m.
 

Similaire à Run Run Trema Test

Network Automation Tools
Network Automation ToolsNetwork Automation Tools
Network Automation ToolsEdwin Beekman
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Andriy Berestovskyy
 
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDNOpenStack Korea Community
 
20151222_Interoperability with ML2: LinuxBridge, OVS and SDN
20151222_Interoperability with ML2: LinuxBridge, OVS and SDN20151222_Interoperability with ML2: LinuxBridge, OVS and SDN
20151222_Interoperability with ML2: LinuxBridge, OVS and SDNSungman Jang
 
Dockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and NovaDockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and Novaclayton_oneill
 
Linux Networking Commands
Linux Networking CommandsLinux Networking Commands
Linux Networking Commandstmavroidis
 
Network Test Automation - Net Ops Coding 2015
Network Test Automation - Net Ops Coding 2015Network Test Automation - Net Ops Coding 2015
Network Test Automation - Net Ops Coding 2015Hiroshi Ota
 
Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1Yongyoon Shin
 
05 module managing your network enviornment
05  module managing your network enviornment05  module managing your network enviornment
05 module managing your network enviornmentAsif
 
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...idsecconf
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsHisaki Ohara
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefMatt Ray
 
Razor, the Provisioning Toolbox - PuppetConf 2014
Razor, the Provisioning Toolbox - PuppetConf 2014Razor, the Provisioning Toolbox - PuppetConf 2014
Razor, the Provisioning Toolbox - PuppetConf 2014Puppet
 
Evaluation of OpenFlow in RB750GL
Evaluation of OpenFlow in RB750GLEvaluation of OpenFlow in RB750GL
Evaluation of OpenFlow in RB750GLToshiki Tsuboi
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 PresentationSreenivas Makam
 
Hardware accelerated switching with Linux @ SWLUG Talks May 2014
Hardware accelerated switching with Linux @ SWLUG Talks May 2014Hardware accelerated switching with Linux @ SWLUG Talks May 2014
Hardware accelerated switching with Linux @ SWLUG Talks May 2014Nat Morris
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabMichelle Holley
 

Similaire à Run Run Trema Test (20)

Network Automation Tools
Network Automation ToolsNetwork Automation Tools
Network Automation Tools
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
 
Linux router
Linux routerLinux router
Linux router
 
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
 
20151222_Interoperability with ML2: LinuxBridge, OVS and SDN
20151222_Interoperability with ML2: LinuxBridge, OVS and SDN20151222_Interoperability with ML2: LinuxBridge, OVS and SDN
20151222_Interoperability with ML2: LinuxBridge, OVS and SDN
 
Dockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and NovaDockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and Nova
 
Linux Networking Commands
Linux Networking CommandsLinux Networking Commands
Linux Networking Commands
 
Network Test Automation - Net Ops Coding 2015
Network Test Automation - Net Ops Coding 2015Network Test Automation - Net Ops Coding 2015
Network Test Automation - Net Ops Coding 2015
 
Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1
 
05 module managing your network enviornment
05  module managing your network enviornment05  module managing your network enviornment
05 module managing your network enviornment
 
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructions
 
ADCSS 2022
ADCSS 2022ADCSS 2022
ADCSS 2022
 
Linux network tools (Maarten Blomme)
Linux network tools (Maarten Blomme)Linux network tools (Maarten Blomme)
Linux network tools (Maarten Blomme)
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and Chef
 
Razor, the Provisioning Toolbox - PuppetConf 2014
Razor, the Provisioning Toolbox - PuppetConf 2014Razor, the Provisioning Toolbox - PuppetConf 2014
Razor, the Provisioning Toolbox - PuppetConf 2014
 
Evaluation of OpenFlow in RB750GL
Evaluation of OpenFlow in RB750GLEvaluation of OpenFlow in RB750GL
Evaluation of OpenFlow in RB750GL
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 Presentation
 
Hardware accelerated switching with Linux @ SWLUG Talks May 2014
Hardware accelerated switching with Linux @ SWLUG Talks May 2014Hardware accelerated switching with Linux @ SWLUG Talks May 2014
Hardware accelerated switching with Linux @ SWLUG Talks May 2014
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Dernier (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Run Run Trema Test

  • 1. 1 Trema Test @otahi 2015-12-12 Tremaday #8 Run Run る ん る ん る ん る ん
  • 2. 2 Self Introduction ● @otahi – A network engineer? ● Trying to be an SDN engineer ● Charged in (mainly) DC internal network – Programmer? ● Almost Weekends and early mornings only – Favorite language ● Ruby
  • 3. 3 Trema and Test “Trema is an OpenFlow controller programming framework that provides everything needed to create OpenFlow controllers in Ruby. It provides a high-level OpenFlow library and also a network emulator that can create OpenFlow-based networks for testing on your PC. This self- contained environment helps streamlines the entire process of development and testing.” https://github.com/trema/trema
  • 4. 4 Problems? ● How can I test my OFC? – You can test your OFC with Trema and test frameworks like Serverspec and Infrataster. ● Do I need to create test cases for each environment of a testing network and a real network? – No. You can use common test cases for both.
  • 5. 5 Environment ● You can build a test environment with Trema and a few commands VM vhost1 192.168.8.4 vhost2 192.168.8.5 nshost1 192.168.8.6 nshost2 192.168.8.7 OFC Trema OFS Open vSwitch eth0 DHCP/NAT Simple Hub brsimple_hub 192.168.8.2 sshd sshd
  • 6. 6 Build Environment 1/2 ● You can build a test environemnt as follows ● Required – Vagrant, Virtual Box, Rsync $ git clone https://github.com/otahi/trema-netns-test.git $ cd trema-netns-test $ vagrant up $ vagrant ssh $ cd trema $ ./bin/trema run simple_hub.rb -c simple_hub.conf -d $ sudo ip addr replace 192.168.8.2/24 dev brsimple_hub $ ./bin/trema netns nshost1 /usr/sbin/sshd $ ./bin/trema netns nshost2 /usr/sbin/sshd
  • 7. 7 Build Environment 2/2 vswitch('simple_hub') { dpid 0x1 } vhost('vhost1') { ip '192.168.8.4' } vhost('vhost2') { ip '192.168.8.5' } netns('nshost1') { ip '192.168.8.6' netmask '255.255.255.0' route net: '0.0.0.0', gateway: '192.168.8.1' } netns('nshost2') { ip '192.168.8.7' netmask '255.255.255.0' route net: '0.0.0.0', gateway: '192.168.8.1' } link 'simple_hub', 'vhost1' link 'simple_hub', 'vhost2' link 'simple_hub', 'nshost1' link 'simple_hub', 'nshost2' ● You can build a test environment with this conf.
  • 8. 8 Built Environment 1/2 $ ifconfig | grep -e 'Link encap' -e 'inet addr' brsimple_hub Link encap:Ethernet HWaddr 0a:63:71:69:eb:49 inet addr:192.168.8.2 Bcast:0.0.0.0 Mask:255.255.255.0 eth0 Link encap:Ethernet HWaddr 08:00:27:40:7d:2a inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 simple_hub_1 Link encap:Ethernet HWaddr ea:dc:33:ae:50:7a simple_hub_2 Link encap:Ethernet HWaddr 42:a3:f2:5c:2f:24 simple_hub_3 Link encap:Ethernet HWaddr 22:1a:4f:18:74:d4 simple_hub_4 Link encap:Ethernet HWaddr 92:e8:04:ae:55:2b vhost1 Link encap:Ethernet HWaddr f2:96:47:32:e8:b6 vhost2 Link encap:Ethernet HWaddr 9a:32:02:e3:e9:b9 $
  • 9. 9 Built Environment 2/2 $ sudo ovs-vsctl show ac87c935-cd2f-4e74-80f2-4a6954d059e4 Bridge brsimple_hub Controller "tcp:127.0.0.1:6653" is_connected: true fail_mode: secure Port brsimple_hub Interface brsimple_hub type: internal Port "simple_hub_3" Interface "simple_hub_3" Port "simple_hub_2" Interface "simple_hub_2" Port "simple_hub_1" Interface "simple_hub_1" Port "simple_hub_4" Interface "simple_hub_4" ovs_version: "2.0.2" $
  • 10. 10 Test target ● The test target is very simple hub. class SimpleHub < Trema::Controller def switch_ready(dpid) send_flow_mod_add( dpid, match: Match.new, actions: SendOutPort.new(:flood) ) end end
  • 11. 11 Run Tests 1. Tests with vhosts 1.Tests with packet counter 2. Tests with netns hosts 1.Tests with ping command 2. Tests with test frameworks 3. Tests your real network
  • 12. 12 Run Test with vhost ● Send packet ● Check packet counter $ ./bin/trema send_packets --source vhost1 --dest vhost2 --npackets 10 $ ./bin/trema show_stats vhost2 Packets received: 192.168.8.2 -> 192.168.8.3 = 10 packets $
  • 13. 13 Run Test with netns 1/2 ● Ping!! $./bin/trema netns nshost1 -- ping -c1 192.168.8.7 PING 192.168.8.7 (192.168.8.7) 56(84) bytes of data. 64 bytes from 192.168.8.7: icmp_seq=1 ttl=64 time=0.989 ms --- 192.168.8.7 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.989/0.989/0.989/0.000 ms $ – `trema netns nshost1` runs a shell ● available – `trema netns nshost1 command` runs a command ● available from version 0.9.0
  • 14. 14 Run Test with netns 2/2 ● Send packet ● Check captured packet $ ssh 192.168.8.6 nc -zv 192.168.8.7 80 nc: connect to 192.168.8.7 port 80 (tcp) failed: Connection refused $ $ ssh -t 192.168.8.7 sudo tcpdump -n port 80 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on nshost2, link-type EN10MB (Ethernet), capture size 65535 bytes 23:49:53.373696 IP 192.168.8.6.56359 > 192.168.8.7.80: Flags [S], seq 2713544332, win 29200, options [mss 1460,sackOK,TS val 1613252 ecr 0,nop,wscale 6], length 0 23:49:53.373753 IP 192.168.8.7.80 > 192.168.8.6.56359: Flags [R.], seq 0, ack 2713544333, win 0, length 0 ^C 2 packets captured 2 packets received by filter 0 packets dropped by kernel Connection to 192.168.8.7 closed. $
  • 15. 15 Use Test Framework 1/4 ● Serverspec describe interface('nshost1') do it { should exist } end describe host('192.168.8.7') do it { should be_reachable } end
  • 16. 16 Use Test Framework 2/4 ● Serverspec $ bundle exec rake spec:192.168.8.6 Interface "nshost1" should exist Host "192.168.8.7" should be reachable Finished in 1.5 seconds (files took 0.28661 seconds to load) 2 examples, 0 failures $
  • 17. 17 Use Test Framework 3/4 ● Infrataster describe server(:'192.168.8.6') do describe firewall(server(:'192.168.8.7')) do it { is_expected.to be_reachable } it { is_expected.to be_reachable.dest_port(80) } it { is_expected.to be_reachable.tcp.dest_port(80) } end end
  • 18. 18 Use Test Framework 4/4 ● Infrataster $ bundle exec rake spec:simple_hub server '192.168.8.6' via firewall should reach to server '192.168.8.7' should reach to server '192.168.8.7' dest_port: 80 should reach to server '192.168.8.7' tcp dest_port: 80 Finished in 5.47 seconds (files took 0.53734 seconds to load) 3 examples, 0 failures $
  • 19. 19 Real Network Test ● You can apply your netns test cases to real network tests. $ bundle exec rake spec:192.168.8.6 Interface "nshost1" should exist Host "192.168.8.7" should be reachable Finished in 1.5 seconds (files took 0.28661 seconds to load) 2 examples, 0 failures $ $ bundle exec rake spec:simple_hub server '192.168.8.6' via firewall should reach to server '192.168.8.7' should reach to server '192.168.8.7' dest_port: 80 should reach to server '192.168.8.7' tcp dest_port: 80 Finished in 5.47 seconds (files took 0.53734 seconds to load) 3 examples, 0 failures $
  • 20. 20 Conclusion ● You can create and test your OFC with Trema. ● You can create tests effectively with test frameworks. ● You can run common tests for both environment of a testing network and a real network. See also: https://github.com/otahi/trema-netns-test/