Changes between Initial Version and Version 1 of NetServTutorialInstruction


Ignore:
Timestamp:
10/28/11 12:57:49 (12 years ago)
Author:
jae@cs.columbia.edu
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NetServTutorialInstruction

    v1 v1  
     1= '''!NetServ tutorial: step-by-step instruction''' =
     2
     3== Preparation ==
     4
     51. Start the provided VM and login as the "GENI User".
     6
     72. Open Firefox and point it to the following URL:
     8
     9  [http://pc519.emulab.net/visual/index.html?id=50]
     10
     11  ''Please note that you must replace "'''50'''" with your own user number throughout this tutorial.''
     12
     133. You will see the traffic visualization in your browser as follows:
     14
     15  [[Image(traffic.jpg, 300px)]]
     16 
     17== Install !NetServ module ==
     18
     191. Open a terminal window, update !NetServ software, and go to your !NetServ user directory.
     20
     21{{{
     22cd /netserv-root
     23svn up
     24
     25cd tutorial/user50
     26ls -l
     27}}}
     28
     292. The following files have been prepared for each user:
     30
     31{{{
     32Makefile
     33NetServ/Example.java
     34example.mf
     35
     36upload.sh
     37setup.sh
     38remove.sh
     39
     40setup-request-1.txt
     41setup-request-2.txt
     42setup-request-3.txt
     43remove-request.txt
     44
     45request-signer
     46private-key-50.pem
     47public-key-50.pem
     48}}}
     49
     503. Build the Example module and upload it to the !NetServ repository.
     51
     52{{{
     53make
     54./upload.sh
     55}}}
     56
     574. Send a SETUP message to the !NetServ router to install the module.
     58
     59  While you are watching the browser window type the following command into the terminal window.
     60
     61{{{
     62./setup.sh 1
     63}}}
     64
     65  The traffic will be redirected to D2 (the node on the lower right) and !NetServ.Example will be added to the list of !NetServ modules currently installed.
     66
     675. The SETUP message looks like this:
     68
     69{{{
     70$ cat setup-request-1.txt
     71SETUP NetServ.Example_1.0.0 NETSERV/0.1
     72url: http://pc487.emulab.net/modules/user50/example.jar
     73user: user50
     74ttl:  600
     75filter-ipv4: 10.10.2.2
     76filter-proto: udp
     77filter-port: 20050
     78properties: debug = false, ip = 10.10.3.2
     79
     80}}}
     81
     826. Send a REMOVE message to the !NetServ router to remove the module.
     83
     84{{{
     85./remove.sh
     86}}}
     87
     887. The REMOVE message looks like this:
     89
     90{{{
     91$ cat remove-request.txt
     92REMOVE NetServ.Example_1.0.0 NETSERV/0.1
     93user: user50
     94
     95}}}
     96
     97== Develop !NetServ module ==
     98
     991. Open {{{Example.java}}} with gedit or your favorite editor.
     100
     101{{{
     102gedit NetServ/Example.java &
     103}}}
     104
     105  {{{Example.java}}} is a typical !NetServ packet processing module and it extends the !NetServ.!BuildingBlock.service.!PktProcessorActivator class.
     106
     1072. Modify {{{Example.java}}}.
     108
     109  Comment out processPkt() marked as scenario !#1, and uncomment processPkt() scenario !#2.
     110
     1113. Compile and upload the new version of the module.
     112
     113{{{
     114make
     115./upload.sh
     116}}}
     117
     1184. While you're watching the browser screen, install the module into the !NetServ router with the following command.
     119
     120{{{
     121./setup.sh 2
     122}}}
     123
     124  Note that the "2" argument will make the script send {{{setup-request-2.txt}}}, which includes two IP addresses in the properties header.
     125
     126{{{
     127$ cat setup-request-2.txt
     128SETUP NetServ.Example_1.0.0 NETSERV/0.1
     129url: http://pc487.emulab.net/modules/user50/example.jar
     130user: user50
     131ttl:  600
     132filter-ipv4: 10.10.2.2
     133filter-proto: udp
     134filter-port: 20050
     135properties: debug = false, ip = 10.10.2.2  10.10.3.2
     136
     137}}}
     138
     1395. Update the module properties by sending another SETUP message.
     140
     141  By sending a SETUP message for a module that is already installed, you can update its properties and refresh its TTL.
     142 
     143  Try sending {{{setup-request-3.txt}}} to the !NetServ router:
     144
     145{{{
     146./setup.sh 3
     147}}}
     148
     149  This SETUP request contains a non-existing IP address as the packet destination, which will make the !NetServ node drop the incoming packets.
     150
     151== (Optional) Run !NetServ node locally ==
     152
     1531. Open another terminal window and start the !NetServ router.
     154 
     155  Type the "GENI User" password when asked.
     156
     157{{{
     158cd /netserv-root/core/linux/
     159sudo su
     160.  setenv-i386-ubuntu
     161./run-controller.sh  conf-default.xml
     162}}}
     163
     164  The {{{conf-default.xml}}} file specifies a sample configuration for a single container.
     165
     1662. Open two more terminal windows (they don't have to be big).
     167
     168  On one window, start Netcat in server mode, listening on UDP port 22222:
     169
     170{{{
     171nc -u -l 22222
     172}}}
     173
     174  On the other window, start Netcat in client mode, connecting to the UDP port 22222 on the localhost:
     175
     176{{{
     177nc -u 127.0.0.1 22222
     178}}}
     179
     180  Test the chat-like connection by typing something in the Netcat client window. You should see the same characters appear on the server window.
     181
     1823. Open another terminal window and build the UDPEcho module.
     183
     184{{{
     185cd /netserv-root/apps/udpecho/modules
     186make
     187}}}
     188
     1894. Install the UDPEcho module into the local !NetServ router.
     190
     191{{{
     192cd test
     193./setup.sh
     194}}}
     195
     196  You can switch to the !NetServ router window and see the log output of the installation process.
     197
     1985. See UDPEcho in action!
     199
     200  Type something in the Netcat client window and see what happens.
     201  See also the debugging output from the UDPEcho module in the !NetServ router window.
     202
     2036. Remove the UDPEcho module.
     204
     205{{{
     206./remove.sh
     207}}}
     208
     209  Type something again in the Netcat client window and see what happens.
     210
     211== Please take a quick survey ==
     212
     213A ''very'' quick survey.  :-)
     214
     215  [https://spreadsheets.google.com/spreadsheet/viewform?formkey=dGxxWFA1ckwxdWxaYlR5M3NvdjA2REE6MQ]
     216
     217== Further information ==
     218
     219!NetServ home page:
     220
     221  [http://www.cs.columbia.edu/irt/project/netserv/]
     222
     223Mailing list:
     224
     225  [https://lists.cs.columbia.edu/cucslists/listinfo/netserv-users]
     226
     227Feedback or questions:
     228
     229  Jae Woo Lee <jae@cs.columbia.edu>
     230
     231  Roberto Francescangeli <francescangeli@diei.unipg.it>
     232