272 | | ---- |
273 | | = III Installation = #III |
274 | | The following are the installation steps and basic usage for the software that are found on the image. For more information, refer to their respective pages; Floodlight and Mininet in particular have very thorough docs. |
275 | | |
276 | | Quick links: [[BR]] |
277 | | [#floodlight 3.1 Floodlight][[BR]] |
278 | | [#mn 3.2 Mininet][[BR]] |
279 | | [#cbench 3.3 CBench] [[BR]] |
280 | | [#loft 3.4 liboftrace] [[BR]] |
281 | | [#ws 3.5 Wireshark] [[BR]] |
282 | | [#fvisor 3.6 FlowVisor] [[BR]] |
283 | | |
284 | | Note, the following examples are for Ubuntu, since that's what is used at WINLAB. A quick search will often bring up hints/steps for CentOS/RHEL and OSX, but for the most part, you will have to experiment a bit. |
285 | | |
286 | | == 3.1 Floodlight == #floodlight |
287 | | docs: http://docs.projectfloodlight.org/display/floodlightcontroller/Floodlight+Documentation [[BR]] |
288 | | |
289 | | For the most part the following is a repetition of some of the things there. Truth be told, if you plan to modify/develop on Floodlight it is better to just install it on a local machine where you can use eclipse (either that, or you can try to X11 forward, but that doesn't always go well). |
290 | | === dependencies === |
291 | | {{{ |
292 | | sudo apt-get install git-core build-essential default-jdk ant python-dev eclipse |
293 | | }}} |
294 | | === installation === |
295 | | The following fetches and builds the latest stable release: |
296 | | {{{ |
297 | | git clone git://github.com/floodlight/floodlight.git |
298 | | cd floodlight |
299 | | git checkout fl-last-passed-build |
300 | | ant |
301 | | }}} |
302 | | To import as a project on Eclipse, run the following while in the same directory: |
303 | | {{{ |
304 | | ant eclipse |
305 | | }}} |
306 | | === run === |
307 | | Assuming everything worked out: |
308 | | {{{ |
309 | | java -jar target/floodlight.jar |
310 | | }}} |
311 | | from the floodlight/ directory launches Floodlight. It will output a bunch of messages while it searches for, loads, and initializes modules. You can refer to the output attached below for what it should look like - there may be warnings, but they should be harmless. |
312 | | |
313 | | This command also launches in the foreground, so you can either launch it in a terminal multiplexer like `screen` or `tmux`, or with a `1>logfile 2>&1 &` tacked to the end. The former is probably recommended. |
314 | | === development === |
315 | | Tutorials and other information can be found here: http://docs.projectfloodlight.org/display/floodlightcontroller/For+Developers |
316 | | |
317 | | == 3.2 Mininet == #mn |
318 | | website: http://mininet.org/ [[BR]] |
319 | | It is highly recommended to run trough the docs, especially the following: |
320 | | * FAQs: https://github.com/mininet/mininet/wiki/FAQ |
321 | | * Getting Started: http://mininet.org/download/ Getting Started |
322 | | * Sample Workflow: http://mininet.org/sample-workflow/ Sample Workflow |
323 | | * Walkthrough: http://mininet.org/walkthrough/ |
324 | | |
325 | | If you post to the list especially before you read the FAQ's, you will likely just be asked if you have checked them. |
326 | | |
327 | | === installation/build === |
328 | | The [https://github.com/mininet/mininet/downloads/ VM] is the recommended way to run Mininet on your machine. [[BR]] |
329 | | The following is for a native install (as on the node image). |
330 | | |
331 | | The method differs for different versions of Ubuntu. The following is for 12.04. For others, refer to [http://www.projectfloodlight.org/getting-started/ this] page. |
332 | | The following also takes care of the dependencies. |
333 | | {{{ |
334 | | sudo apt-get install mininet/precise-backports |
335 | | }}} |
336 | | Then disable `ovs-controller`: |
337 | | {{{ |
338 | | sudo service openvswitch-controller stop |
339 | | sudo update-rc.d openvswitch-controller disable |
340 | | }}} |
341 | | You may also need to start open Vswitch: |
342 | | {{{ |
343 | | sudo service openvswitch-switch start |
344 | | }}} |
345 | | You can verify that it works with the following: |
346 | | {{{ |
347 | | sudo mn --test pingall |
348 | | }}} |
349 | | This sets up a 2-host, 1-switch topology and pings between the hosts. The output looks similar to this: |
350 | | {{{ |
351 | | *** Creating network |
352 | | *** Adding controller |
353 | | *** Adding hosts: |
354 | | h1 h2 |
355 | | *** Adding switches: |
356 | | s1 |
357 | | *** Adding links: |
358 | | (h1, s1) (h2, s1) |
359 | | *** Configuring hosts |
360 | | h1 h2 |
361 | | *** Starting controller |
362 | | *** Starting 1 switches |
363 | | s1 |
364 | | *** Ping: testing ping reachability |
365 | | h1 -> h2 |
366 | | h2 -> h1 |
367 | | *** Results: 0% dropped (0/2 lost) |
368 | | *** Stopping 2 hosts |
369 | | h1 h2 |
370 | | *** Stopping 1 switches |
371 | | s1 ... |
372 | | *** Stopping 1 controllers |
373 | | c0 |
374 | | *** Done |
375 | | completed in 0.460 seconds |
376 | | }}} |
377 | | === run === |
378 | | There are many flags and options associated with launching Mininet. `mn --help` will display them. [[BR]] |
379 | | For example, to start the same topology as the pingall test, but with a controller running separately from Mininet: |
380 | | {{{ |
381 | | # mn --topo=single,2 --controller=remote,ip=10.18.1.1 --mac |
382 | | *** Creating network |
383 | | *** Adding controller |
384 | | *** Adding hosts: |
385 | | h1 h2 |
386 | | *** Adding switches: |
387 | | s1 |
388 | | *** Adding links: |
389 | | (h1, s1) (h2, s1) |
390 | | *** Configuring hosts |
391 | | h1 h2 |
392 | | *** Starting controller |
393 | | *** Starting 1 switches |
394 | | s1 |
395 | | *** Starting CLI: |
396 | | mininet> |
397 | | }}} |
398 | | * --topo=single,2 : one switch with two hosts |
399 | | * --controller=remote,ip=10.18.1.1 : controller at 10.18.1.1 |
400 | | * --mac : non-random MAC addresses |
401 | | Some useful ones are: |
402 | | * controller external to Mininet, at IP addr and port p: |
403 | | {{{ |
404 | | --controller=remote,ip=[addr],port=[p] |
405 | | }}} |
406 | | * non-random host MAC addresses (starting at 00:00:00:00:00:01 for h1) |
407 | | {{{ |
408 | | --mac |
409 | | }}} |
410 | | === usage === |
411 | | You can find available commands for the command line by typing `?` at the prompt. `exit` quits Mininet. [[BR]] |
412 | | Some basic examples: |
413 | | * display topology: |
414 | | {{{ |
415 | | mininet> net |
416 | | c0 |
417 | | s1 lo: s1-eth1:h1-eth0 s1-eth2:h2-eth0 |
418 | | h1 h1-eth0:s1-eth1 |
419 | | h2 h2-eth0:s1-eth2 |
420 | | }}} |
421 | | * display host network info: |
422 | | {{{ |
423 | | mininet> h1 ifconfig |
424 | | h1-eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:01 |
425 | | inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0 |
426 | | inet6 addr: fe80::200:ff:fe00:1/64 Scope:Link |
427 | | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
428 | | RX packets:135 errors:0 dropped:124 overruns:0 frame:0 |
429 | | TX packets:7 errors:0 dropped:0 overruns:0 carrier:0 |
430 | | collisions:0 txqueuelen:1000 |
431 | | RX bytes:8906 (8.9 KB) TX bytes:558 (558.0 B) |
432 | | |
433 | | lo Link encap:Local Loopback |
434 | | inet addr:127.0.0.1 Mask:255.0.0.0 |
435 | | inet6 addr: ::1/128 Scope:Host |
436 | | UP LOOPBACK RUNNING MTU:16436 Metric:1 |
437 | | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 |
438 | | TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 |
439 | | collisions:0 txqueuelen:0 |
440 | | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) |
441 | | }}} |
442 | | * ping host 1 from host 2 |
443 | | {{{ |
444 | | mininet> h2 ping h1 |
445 | | PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data. |
446 | | 64 bytes from 10.0.0.1: icmp_req=1 ttl=64 time=10.0 ms |
447 | | ^C |
448 | | --- 10.0.0.1 ping statistics --- |
449 | | 1 packets transmitted, 1 received, 0% packet loss, time 0ms |
450 | | rtt min/avg/max/mdev = 10.026/10.026/10.026/0.000 ms |
451 | | }}} |
452 | | === scripting === |
453 | | Mininet has a Python API, whose docs can be found online: http://mininet.org/api/ [[BR]] |
454 | | Examples can also be found here: https://github.com/mininet/mininet/tree/master/examples |
455 | | |
456 | | Once you write a script, you can run it as a script: |
457 | | {{{ |
458 | | python mn_script.py |
459 | | }}} |
460 | | |
461 | | == 3.3 Cbench == #cbench |
| 273 | ==== 3.3 Cbench ==== #cbench |