| 36 | |
| 37 | === Folder structure |
| 38 | |
| 39 | scu |
| 40 | | |
| 41 | +-- lib |
| 42 | | Contains Bouncy Castle java library |
| 43 | | |
| 44 | +-- scu-contrib |
| 45 | | Contains developed TinyOS code for Secure Code Update |
| 46 | | |
| 47 | +-- tinyos-2.x |
| 48 | | Contains a minimal TinyOS source tree, necessary for compilation and running of the developed software |
| 49 | | |
| 50 | +-- init_variables.sh |
| 51 | | Inits environment variables |
| 52 | +-- quick_start.sh |
| 53 | Simple script that execute a guided step-by step deployment, followed by a Secure Code Update operation. |
| 54 | |
| 55 | === Shortest HOWTO: |
| 56 | |
| 57 | Execute quick_start.sh and follow instructions. |
| 58 | The scripts executes automatically all the steps described below, asking for the path and the id of the application that must be disseminated |
| 59 | |
| 60 | |
| 61 | === Short HOWTO: |
| 62 | |
| 63 | * First of all, open a shell console in this folder and init the environment variables executing |
| 64 | |
| 65 | source init_variables.sh |
| 66 | |
| 67 | * Then you can compile the tools used for Secure Code Update, executing |
| 68 | |
| 69 | java net.tinyos.signet.SecureSynapseInterface -compile-tools |
| 70 | |
| 71 | * Now the nodes of the network can be deployed, i.e., the keys necessary for security operations must be installed in the nodes' external flash memory, and the Synapse bootloader along with SecureSynapse must be installed in the nodes' application flash memory. The command to execute is |
| 72 | |
| 73 | java net.tinyos.signet.SecureSynapseInterface -deploy <auth. security param.> <T-TimeSA T parameter> <encryption security param> <DoS protection security param> [-keep-keys] [-use-authentication] [-use-encryption] [-use-dos-protection] |
| 74 | |
| 75 | A typical setting is -deploy 80 30 128 128 -use-authentication -use-encryption -use-dos-protection. |
| 76 | |
| 77 | This command will generate the keys, and install all necessary stuff on the nodes detected by motelist command |
| 78 | These nodes will be given id starting from 1, in order of serial number. |
| 79 | |
| 80 | * Now all nodes can be disconnected from the pc, keeping the base station connected. If more than 1 nodes are connected, the one with the minimum serial number will be used as a base station. The command to execute in order to start the dissemination is |
| 81 | |
| 82 | java net.tinyos.signet.SecureSynapseInterface -dissem <application path> <block size> <application id> [-use-key-refresh [-low-overhead]] [-format-nodes] [-format-bs] [-use-authentication] [-use-encryption] [-use-dos-protection] |
| 83 | |
| 84 | Block size MUST currently be set to 800 to match Synapse configuration. Application path points to the directory containing the "build" directory of the application to disseminate. Application ID is a hexadecimal, 16-bit long, user-defined ID. If "-use-key-refresh" option is given, some keys are disseminated in order to replace the keys used for the signature. If "-low-overhead" option is given, just a fraction of the keys are updated, in order to minimize the overhead. |
| 85 | Nodes must be formatted after deployment, using the "-format-nodes" option. The base station must be formatted at least the first time, using the option "-format-bs". |
| 86 | |
| 87 | So a typical setting for the first invocation of this command is |
| 88 | |
| 89 | java net.tinyos.signet.SecureSynapseInterface -dissem <app path> 800 1 -format-bs -format-nodes -use-authentication -use-encryption -use-dos-protection |
| 90 | |
| 91 | The application to disseminate will be transfered to the base station node, SecureSynapse will be installed and first of all the nodes will be formatted, then the dissemination will start. When the dissemination finishes, the disseminated application will be loaded. |