Home

WARNING: This page may be outdated!

Network Packet Sniffing Tool (CS7962 - Spring 2005)

This tool is for monitoring packets in the Radio network for Lab3 of the Embedded Systems class. Please note that this is a Java tool and has been tested on the Windows machines in the lab. The packet formats that were agreed upon are listed below. All fields are of 16 bits.

 

1)I have modified the provided 'net.tinyos.tools.Listen' tool to cater to our needs.Download the following Java source and class files.

   a) Listen1.java
       Listen1.class
       Dump1.java
       Dump1.class
   b)Copy the Listen1.java and Listen1.class files into the following directory
         /opt/tinyos-1.x/tools/java/net/tinyos/tools/
   c)Copy the Dump1.java and Dump1.class files into the following directory
         /opt/tinyos-1.x/tools/java/net/tinyos/message/

2)I have also provided a nesC program which simply listens for packets on the network and sends them over the USB to the PC. Download the following dump.tgz file.

   a)Copy the dump.tgz file into your TinyOS home folder in the Cygwin shell.

   b)Untar the file using the following command.

         tar zxvf dump.tgz

   c)In the newly created "dump" directory, type

         make telosb install

     and install the application onto one of your motes.

3)To use the tool do the following(assuming a mote is on COM4 running the "dump" application) :

     $export MOTECOM=serial@COM4:telos
     $java net.tinyos.tools.Listen1

  NOTE :
  -It is 'Listen1' and NOT 'Listen'

4)Try sending the packets which you sent out in the first part of the Lab3 assignment using your second mote. If all is fine you should see the following output :

    $ java net.tinyos.tools.Listen1
      serial@COM4:57600: resynchronising

    Payld_Len = 4d 04h Dest_Addr = 7E00h Handler_ID = 0Ah Group_ID = 7Dh
    Pkt_Type  = 6d 0006h
    Source_id = 20d 0014h

5)From the output you should be able to identify the first four fields as being part of the TinyOS AM header.

  NOTE :
  -All the Hex values are printed in Little Endian format and in UPPERCASE letters.
  -The Payld_Len field is printed in Decimal as well as Hex.
  -All Decimal values are suffixed by a LOWERCASE 'd'. All Hex values are suffixed by a LOWERCASE 'h'.
  -Here the Payload length is 4 bytes because in the first lab experiment only 2 16-bit fields were being transmitted.

6)The Payload part of the TinyOS Packet starts from the 5th field viz. Pkt_Type.
   There are 6 fields maximum in the Packet format agreed upon. They are :
    - Pkt_Type
    - Source_id
    - TTL
    - Dest_id
    - Temp
    - Light
  Over here the Pkt_Type field contains the value of the "Destination Address" of the Lab3-1 assignment and the Source_id contains the value of the initial "TTL" value of
  20. Note that the values are being printed in Hex as well as Decimal.

7)I am including a sample output in case all the 6 fields are being transmited in a packet. The output would be as shown.

    $ java net.tinyos.tools.Listen1
      serial@COM4:57600: resynchronising

    Payld_Len = 12d 0Ch Dest_Addr = 7E00h Handler_ID = 0Ah Group_ID = 7Dh
    Pkt_Type  = 904d  (Slave's Response Packet) 8803h
    Source_id = 705d C102h  TTL = 0d 0000h   Dest_id = 706d C202h   Temp = 72.22666d 394Ch Light = 23d 1700h

  NOTE :
  -All the Payload bytes are assumed to be transmitted and received in the Little Endian format.
  -The tool is displaying the temperature in decimal and assuming data is sent out in the 8.8Fixed Point Format as per the specifications.
  -The light values should range from 0 to 100 in decimal if you have calibrated it accordingly.
  -Also in the payload Decimal as well as Hex values are being printed.
  -If required the Hex value display can be suppressed. If you are interested in doing so please get in touch with me. I can tell what changes are to be made.
    
8)Apologies to anyone not using Java tools and working on non-Windows machines.

Home


Mail me at : vchakra AT cs DOT utah DOT edu
Last modified: Thu Feb 17 23:23:12 MDT 2005