Sie sind auf Seite 1von 5

STEPS FOR UDP-SERVER AND BORDER ROUTER SIMULATION:

1. Be a super user using the command:


su or sudo su
2. Open the Cooja Simulator, using the following command:
cd <path-to-contiki-folder>/tools/cooja/
3. Run the below command to get the Cooja Simulator on your system:
ant run
4. Steps for the new simulation:
(a) Click on File. Select New simulation
(b) Enter Simulation name. Click on create.

Now, you can see the following windows:


Network window: to view the mote position, ID, etc
Simulation control: to control the speed limit while the simulation,
start/pause/reload the simulation
Notes: if any
Mote output: output will be displayed once the simulation
starts/reloads
Timeline: to have the timeline output of the simulation

5. To add the border router:


(a) Click on the Motes. Select Add motes in that
(b) Click on Create new mote type. Select sky mote from the list

(c) Browse and select the border-router.c file using the below path to
compile/simulate
Path: <path-to-contiki-folder> examples ipv6
rpl-border-router border-router.c
(d) Press on clean and then click Compile.
(e) After compilation, click on the Create button.
(f) A window asking for the number of new motes will appear. Enter the
number of border router required. In our case, it is 1. Click on the Add motes
button. You can see the mote in the Network window.

6. To add UDP server:


(a) Repeat the steps 5.(a) and 5.(b).
(b) Now browse and select the udp-server.c file using the below path:
<path-to-contiki-folder> examples udp-ipv6 udp-server.c
(c) Repeat the steps 5.(d) and 5.(e)
(d) In the network window, you can see the mote 2

Repeat the above steps but choose udp-client.c, instead of udp-server.c file

8. To add bridge for the communication between UDP servers and border
router:
(a) Open another terminal
(b) Follow the command given below:
cd <path-to-contiki-folder>/examples/ipv6/rpl-border-router/
(a) Right click on the mote 1. Click on the Mote tools for sky 1. From the list,
click on Serial Socket (SERVER) (Sky 1).
(b) Start the Simulation now, by clicking the Start button in the Simulation
control window
(c) Open another terminal. Follow the command given below:
cd <path-to-contiki-folder>/examples/ipv6/rpl-border-router/
(d) Run the below command:
make connect-router-cooja

(e) You can see the simulation between the border router and the servers.

(f) You can check whether motes are reachable or not using ping6 command:
ping6 aaaa::212:7401:1:101
ping6 aaaa::212:7402:2:202
ping6 aaaa::212:7403:3:303
(g) You can also try with 'nc' command:
nc -6 -u -p 3001 aaaa::212:7402:2:202 3000

Das könnte Ihnen auch gefallen