# Tutorial 3 - Basic Mobility ## Overview This tutorial will cover using a 3 node scenario in CORE with basic mobility. Mobility can be provided from a NS2 file or by including mobility commands in a gRPC script. ## Files Below is the list of files used for this tutorial. * movements1.txt - a NS2 mobility input file * scenario.xml - 3 node CORE xml scenario file (wireless) * scenario.py - 3 node CORE gRPC python script (wireless) * printout.py - event listener ## Running with XML file using NS2 Movement This section will cover running this sample tutorial using the XML scenario file, leveraging an NS2 file for mobility. * Make sure the **core-daemon** is running a terminal ```shell sudop core-daemon ``` * In another terminal run the GUI ```shell core-gui ``` * Observe the format of the N2 file, cat movements1.txt. Note that this file was manually developed. ```shell $node_(1) set X_ 208.1 $node_(1) set Y_ 211.05 $node_(1) set Z_ 0 $ns_ at 0.0 "$node_(1) setdest 208.1 211.05 0.00" $node_(2) set X_ 393.1 $node_(2) set Y_ 223.05 $node_(2) set Z_ 0 $ns_ at 0.0 "$node_(2) setdest 393.1 223.05 0.00" $node_(4) set X_ 499.1 $node_(4) set Y_ 186.05 $node_(4) set Z_ 0 $ns_ at 0.0 "$node_(4) setdest 499.1 186.05 0.00" $ns_ at 1.0 "$node_(1) setdest 190.1 225.05 0.00" $ns_ at 1.0 "$node_(2) setdest 393.1 225.05 0.00" $ns_ at 1.0 "$node_(4) setdest 515.1 186.05 0.00" $ns_ at 2.0 "$node_(1) setdest 175.1 250.05 0.00" $ns_ at 2.0 "$node_(2) setdest 393.1 250.05 0.00" $ns_ at 2.0 "$node_(4) setdest 530.1 186.05 0.00" $ns_ at 3.0 "$node_(1) setdest 160.1 275.05 0.00" $ns_ at 3.0 "$node_(2) setdest 393.1 275.05 0.00" $ns_ at 3.0 "$node_(4) setdest 530.1 186.05 0.00" $ns_ at 4.0 "$node_(1) setdest 160.1 300.05 0.00" $ns_ at 4.0 "$node_(2) setdest 393.1 300.05 0.00" $ns_ at 4.0 "$node_(4) setdest 550.1 186.05 0.00" $ns_ at 5.0 "$node_(1) setdest 160.1 275.05 0.00" $ns_ at 5.0 "$node_(2) setdest 393.1 275.05 0.00" $ns_ at 5.0 "$node_(4) setdest 530.1 186.05 0.00" $ns_ at 6.0 "$node_(1) setdest 175.1 250.05 0.00" $ns_ at 6.0 "$node_(2) setdest 393.1 250.05 0.00" $ns_ at 6.0 "$node_(4) setdest 515.1 186.05 0.00" $ns_ at 7.0 "$node_(1) setdest 190.1 225.05 0.00" $ns_ at 7.0 "$node_(2) setdest 393.1 225.05 0.00" $ns_ at 7.0 "$node_(4) setdest 499.1 186.05 0.00" ``` * In the GUI menu bar select **File->Open...**, and select this tutorials **scenario.xml** file * You can now click play to start the session * Select the play button on the Mobility Player to start mobility * Observe movement of the nodes * Note that OSPF routing protocol is included in the scenario to build routing table so that routes to other nodes are known and when the routes are discovered, ping will work