Giter Site home page Giter Site logo

rplicmp's Introduction

A python module for handling ICMP messaging for the RPL protocol

This module allows easy creation of ICMPv6 socket in Python tailored to send RPL messages. Non-RPL message (message type != 155) are filtered out and are thus not received by the socket. The RplSocket object contains a send() and receive() methods to send and receives raw ICMP messages (i.e. you have to build the header by yourself).

How to install

The source directory contains a make file with a rpm target. This target created a RPM package that will be located in the dist directory that makes deployment of the library easier.

I'm not very sure what is the proper way to install Cython packages because I use exclusively the RPM built for my own needs. My best guess is that the following line should suffice:

python setup.py install

Dependencies

Examples of code

Building a simple RPL ICMP client

import RplIcmp
import random
from time import sleep
r = RplIcmp.RplSocket("eth0")
message_header = "\x9b\x01\x00\x00"
while True:
	message = "".join([ chr(random.randrange(255)) for x in range(100) ])
	r.send("fe80::1", message_header + message)
	print "sent one message"
	sleep(0.1)
    ```


### Building a simple RPL ICMP server

```python
import RplIcmp
r = RplIcmp.RplSocket("eth0")
while True:
    (msg, from_node, to, iface) = r.receive()
    print "received a message from %s" % from_node

Caveats

ICMPv6 filtering does not seem to work if the packet is actually smaller than the ICMPv6 header size. Such kind of message will then be received and must be handled by any application that uses this library.

Authors

Acknowledgment

This work was supported by the Secure Smart Grid project at the Advanced Networking Technologies Division, NIST.

Conditions Of Use

This software was developed by employees of the National Institute of Standards and Technology (NIST), and others. This software has been contributed to the public domain. Pursuant to title 15 Untied States Code Section 105, works of NIST employees are not subject to copyright protection in the United States and are considered to be in the public domain. As a result, a formal license is not needed to use this software.

This software is provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT AND DATA ACCURACY. NIST does not warrant or make any representations regarding the use of the software or the results thereof, including but not limited to the correctness, accuracy, reliability or usefulness of this software.

rplicmp's People

Contributors

wpwrak avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

rplicmp's Issues

Improve the build system or change the build instruction

It has been reported that when using the "python setup.py install" method directly, caplib.o and icmplib.o are not build and thus the linking fails. All is fine when make it used first.

It should be made clearer, or fixed.

Compilation issue in RplIcmp

Hi,

I have been trying since many days to run simpleRPL on a raspberry to enable the RPL communication between raspberry pis. One of requested library for simpleRPL program is RPLIcmp. After running the python setup.py install, I received the error message Error:arm-linux-gnueabihf-gcc: error: caplib.c: No such file or directory. The same error occurs also for icmp.c file. I can compile them separately as written in Makefile, and call the same installation command. Eventhougth everything seems fine, the example that is given in the wiki, in which rpl client and server communication is established, doesn't work. There is any message exchange between server and client. Do you know what could be the reason? is this a compilation issue of rplicmp?

BR
Cem

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.