1 ===================================
2 Testing OF-config support with LINC
3 ===================================
5 This page describes how to setup LINC and test Ryu OF-config with it.
7 The procedure is as follows.
8 Although all the procedure is written for reader's convenience,
9 please refer to LINC document for latest informations of LINC.
11 https://github.com/FlowForwarding/LINC-Switch
15 * install Erlang environment
17 * configure LINC switch
20 * run Ryu test_of_config app
22 For getting/installing Ryu itself, please refer to http://osrg.github.io/ryu/
25 Install Erlang environment
26 ==========================
28 Since LINC is written in Erlang, you need to install Erlang execution
29 environment. Required version is R15B+.
31 The easiest way is to use binary package from
32 https://www.erlang-solutions.com/downloads/download-erlang-otp
34 The distribution may also provide Erlang package.
40 install necessary packages for build
41 ------------------------------------
43 install necessary build tools
44 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 # apt-get install git-core bridge-utils libpcap0.8 libpcap-dev libcap2-bin uml-utilities
52 # yum install git sudo bridge-utils libpcap libpcap-devel libcap tunctl
54 Note that on RedHat/CentOS 5.x you need a newer version of libpcap::
56 # yum erase libpcap libpcap-devel
57 # yum install flex byacc
58 # wget http://www.tcpdump.org/release/libpcap-1.2.1.tar.gz
59 # tar xzf libpcap-1.2.1.tar.gz
62 # make && make install
64 get LINC repo and built
65 ^^^^^^^^^^^^^^^^^^^^^^^
69 % git clone git://github.com/FlowForwarding/LINC-Switch.git
71 Then compile everything::
77 At the time of this writing, test_of_config fails due to a bug of LINC. You can try this test with LINC which is built by the following methods.
84 % git reset --hard f772af4b765984381ad024ca8e5b5b8c54362638
92 edit LINC switch configuration file. ``rel/linc/releases/0.1/sys.config``
93 Here is the sample sys.config for test_of_config.py to run.
99 {capable_switch_ports,
100 [{port,1,[{interface,"linc-port"}]},
101 {port,2,[{interface,"linc-port2"}]},
102 {port,3,[{interface,"linc-port3"}]},
103 {port,4,[{interface,"linc-port4"}]}]},
104 {capable_switch_queues,
106 {queue,991,[{min_rate,10},{max_rate,120}]},
107 {queue,992,[{min_rate,10},{max_rate,130}]},
108 {queue,993,[{min_rate,200},{max_rate,300}]},
109 {queue,994,[{min_rate,400},{max_rate,900}]}
114 {controllers,[{"Switch0-Default-Controller","127.0.0.1",6633,tcp}]},
115 {controllers_listener,{"127.0.0.1",9998,tcp}},
116 {queues_status,enabled},
117 {ports,[{port,1,{queues,[]}},{port,2,{queues,[991,992]}}]}]}
121 {controllers,[{"Switch7-Controller","127.0.0.1",6633,tcp}]},
122 {controllers_listener,disabled},
123 {queues_status,enabled},
124 {ports,[{port,4,{queues,[]}},{port,3,{queues,[993,994]}}]}]}
131 {'writable-running',{1,0}}]},
132 {callback_module,linc_ofconfig},
133 {sshd_ip,{127,0,0,1}},
135 {sshd_user_passwords,[{"linc","linc"}]}]},
138 [{lager_console_backend,debug},
140 [{"log/error.log",error,10485760,"$D0",5},
141 {"log/console.log",info,10485760,"$D0",5}]}]}]},
143 [{sasl_error_logger,{file,"log/sasl-error.log"}},
145 {error_logger_mf_dir,"log/sasl"},
146 {error_logger_mf_maxbytes,10485760},
147 {error_logger_mf_maxfiles,5}]},
148 {sync,[{excluded_modules,[procket]}]}].
154 As the above sys.config requires some network interface, create them::
156 # ip link add linc-port type veth peer name linc-port-peer
157 # ip link set linc-port up
158 # ip link add linc-port2 type veth peer name linc-port-peer2
159 # ip link set linc-port2 up
160 # ip link add linc-port3 type veth peer name linc-port-peer3
161 # ip link set linc-port3 up
162 # ip link add linc-port4 type veth peer name linc-port-peer4
163 # ip link set linc-port4 up
165 After stopping LINC, those created interfaces can be deleted::
167 # ip link delete linc-port
168 # ip link delete linc-port2
169 # ip link delete linc-port3
170 # ip link delete linc-port4
173 Starting LINC OpenFlow switch
174 =============================
178 # rel/linc/bin/linc console
181 Run Ryu test_of_config app
182 ==========================
184 Run test_of_config app::
186 # ryu-manager --verbose ryu.tests.integrated.test_of_config ryu.app.rest
188 If you don't install ryu and are working in the git repo directly::
190 # PYTHONPATH=. ./bin/ryu-manager --verbose ryu.tests.integrated.test_of_config ryu.app.rest