Skip to content

dayDPTR/dsr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic Source Routing protocol implementation

This is experimental implementation of DSR for simple wireless networks. Created with nRF24L01 and RFM12 radio modules and simple uC's in mind.

Dynamic source routing protocol is used as a network layer in mesh-type networks architecture. This particular implementation is loosely based on following document for IPv4 networks:

DSR protocol

WIP

DSR options

This implementation defines 7 types of DSR headers (options):

  1. Route error (RERR)
  2. Route request (RREQ)
  3. Route reply (RREP)
  4. Acknowledge request (AREQ)
  5. Acknowledge reply (AREP)
  6. Route (ROUT)
  7. Data (DATA)

In general each option has this form of header:

+------+--------+-----------------------------------------+
| TYPE | LENGTH | {option dependent variable length part} |
|  1   |   1    |                  1 - N                  |
+------+--------+-----------------------------------------+

Several options can create single packet. They are concatenated.

Requirements for lower level layers:

  • Source and target addresses
  • Length of whole payload

Route error

+------+--------+----------+--------+--------+
| TYPE | LENGTH | ERR_TYPE | SOURCE | TARGET |
|  1   |   1    |    1     |   1    |   1    |
+------+--------+----------+--------+--------+
  • TYPE = 0x01
  • May appear more than once in single packet

Route request

+------+--------+--------------------------------+
| TYPE | LENGTH |   ID   | TARGET | ADDRESS_LIST |
|  1   |   1    |   1    |   1    |    0 - N     |
+------+--------+--------------------------------+
  • TYPE = 0x02
  • May appear only once in single packet
  • ADDRESS_LIST - on requester node this field is empty. It's getting filled by every node this option travels through.

Route reply

+------+--------+--------------+
| TYPE | LENGTH | ADDRESS_LIST |
|  1   |   1    |    1 - N     |
+------+--------+--------------+
  • TYPE = 0x03
  • May appear more than once in single packet

Acknowledge request

+------+--------+--------+
| TYPE | LENGTH |   ID   |
|  1   |   1    |   1    |
+------+--------+--------+
  • TYPE = 0x04
  • May appear only once in single packet

Acknowledge reply

+------+--------+--------+------------+------------+
| TYPE | LENGTH |   ID   | ACK_SOURCE | ACK_TARGET |
|  1   |   1    |   1    |     1      |     1      |
+------+--------+--------+------------+------------+
  • TYPE = 0x05
  • May appear more than once in single packet

Route

+------+--------+-----------+--------------+
| TYPE | LENGTH | SEGS_LEFT | ADDRESS_LIST |
|  1   |   1    |     1     |    1 - N     |
+------+--------+-----------+--------------+
  • TYPE = 0x06
  • May appear only once in single packet

Data

+------+--------+--------+
| TYPE | LENGTH |  DATA  |
|  1   |   1    | 1 - N  |
+------+--------+--------+
  • TYPE = 0x07
  • May appear only once in single packet

About

Dynamic Source Routing library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 99.2%
  • Makefile 0.8%