gopkg.in/dedis/onet.v2@v2.0.0-20181115163211-c8f3724038a7/simul/platform/MININET.md (about) 1 Navigation: [DEDIS](https://github.com/dedis/doc/tree/master/README.md) :: 2 [Onet](../../README.md) :: 3 [Simulation](../README.md) :: 4 Mininet Simulation 5 6 # Mininet Simulation 7 8 Mininet allows to have a better control over the delay and bandwidth restrictions 9 during the simulation. While [Deterlab](DETERLAB.md) only has these restrictions 10 between servers, but not necessarily between all nodes, Mininet will set up the 11 same restriction between any two nodes that communcate with each other. 12 13 The Mininet simulation uses http://mininet.org/ to simulate a network where each 14 host represents a cothority node. It has been extensively tested on the 15 hardware of https://iccluster.epfl.ch, but should theoretically also run on 16 other kinds of hardware. As it needs to set up the mininet environment, it is 17 more fragile than the Deterlab simulations. But server availability in EPFL 18 is often better than on Deterlab. 19 20 Each T3-server on the iccluster is a 24-core server with 256GB of RAM and can 21 run around 300 cothority nodes simultaneously. So if you want to run a 22 simulation with 2000 nodes, you need at least 7 servers. 23 24 Unfortunately we still have the restriction that _all servers need to be on the 25 same subnet_! We know about the situation and hope to have a solution ready 26 sometime in the near future. 27 28 ## Setting up ICCluster 29 30 Supposing you want to run your simulation using the iccluster-network, you 31 first need to reserve the machines. You have to do so one day in advance, as 32 it is not possible to reserve the machines on the same day. Once the machines 33 are ready, you need to install them. 34 35 1. In the ICCluster-admin interface, you need to go to `My Servers` -> `Setup`. 36 2. Chose the servers you reserved - take care, as there might be servers from 37 other people in the same lab! 38 3. `Choose a boot option` - please take _Ubuntu xenial 1604_ for best results 39 4. `Customization` - chose a password (it can be very simple) for the setup. 40 5. Optional: For easiest results, tick `Own %url-post-install-script%` and add 41 the following line to `My Servers` -> `Environment` -> `%url-post-install-script%`: 42 `https://raw.githubusercontent.com/dedis/onet/master/simul/platform/mininet/install_mininet.sh` 43 This will directly install mininet on the servers, else the simulation will have 44 to do so for you. 45 6. `Run Setup` and confirm the setup. THIS WILL DELETE ALL DATA ON THE SERVERS! 46 47 ### Verifying everything is correctly set up 48 49 To ping server #33, you have to do the following: 50 51 ```bash 52 ping iccluster033.iccluster.epfl.ch 53 ``` 54 55 If you are outside of EPFL, you need to use the VPN, as iccluster is only 56 reachable from inside EPFL. 57 58 You can also connect to the server with 59 60 ```bash 61 ssh root@iccluster033.iccluster.epfl.ch 62 ``` 63 64 and enter your password that you gave in the `Customization` step above. 65 66 ## Running a simulation 67 68 Now you are finally ready to run your simulation. We suppose that you have 69 your simulation running successfully under [Localhost](LOCALHOST.md). Then 70 all you need to do is: 71 72 ```bash 73 go build && ./simul -platform mininet simul.toml 74 ``` 75 76 If it is the first time the simulation is run, it will ask you whether you want 77 to use iccluster or not. If you reply `Y` (or simply press `Enter`), you can 78 give the names of the servers you reserved and installed. An example is: 79 `31 32 33`. You don't need to enter leading `0`s, this will be automatically added, 80 as well as the `icculster.epfl.ch`. 81 82 During the first run, the simulation will make sure that mininet is correctly 83 installed on the servers and will try to install it if not. 84 85 ### Debugging an installation 86 87 If something goes wrong, you can always try to run the 88 `$GOPATH/src/github.com/dedis/onet/simul/platform/mininet/setup_iccluster.sh` 89 bash file to have mininet correctly installed. A simple test is to ssh to the 90 remote machine and to run 91 92 ```bash 93 mn -c 94 ``` 95 96 which should remove all running mininet sessions and return to the command line. 97 98 ### Monitor port occupied 99 100 Sometimes the ssh-forwarding is misbehaving, and you cannot run your simulation. 101 The simplest solution is to restart the servers (not reinstall, just restart). 102 A faster option is to ssh to the first server and check if you can find the rogue 103 `sshd` process. Take care, there is a `sshd`-process that listens for incoming 104 connections - if you kill that one, you will have to restart the server, as you 105 won't have access to it... 106 107 ### Network problems 108 109 An important restriction so far is the need of all servers to be on the same 110 subnet. To verify if this is the case, you can use the `host` or `dig` 111 command and verify that is the case. 112 113 ### Other problems 114 115 You can always run the simulation with `-debug 3` to get more information and 116 eventually see what is going wrong: 117 118 ```bash 119 go build && ./simul -platform mininet -debug 3 simul.toml 120 ``` 121 122 Then you will see more details of what is happening and eventually see what 123 you need to change.