examples for uIPv6

This commit is contained in:
julienabeille 2008-10-14 10:01:52 +00:00
parent e7b38010a2
commit f5f0044578
19 changed files with 390 additions and 0 deletions

View file

@ -0,0 +1,8 @@
all: example-udp-receiver
APPS=udp
DEFAULT_TARGET=minimal-net
UIP_CONF_IPV6=1
CONTIKI = ../..
include $(CONTIKI)/Makefile.include

View file

@ -0,0 +1,32 @@
This example features a simple application listening for udp packets on port
0xF0B0 (src F0B1). It must be used in conjonction with a node running
udp-sender-ipv6 example.
We use this example to test UDP, and most particularly UDP header compression
with IPv6 and 6lowpan support. When IPv6 is used over an 802.15.4 link,
6lowpan acts as teh adaptation layer between IPv6 and MAC. In particular, it
can compress packet headers. IP header is compressed, as well as UDP header.
With both HC1 and HC01 header compression schemes, UDP 16-bit ports are
compressed to 4 bits if they are between F0B0 and F0BF.
sender behavior:
The sender is implemented in apps/udp/udp-sender.c and acts the following way:
it waits 15 seconds (to be sure the node configures a global address, in case
a router on the link sends router advertisements usable for address
autoconfiguration) , then sends 5 UDP packets to the receiver address
entered staticvally in apps/udp/udp-sender.c.
receiver behavior:
When receiving a packet, the receiver answers with a simmilar packet.
To run this example, contiki-conf.h must have at least the following flags
values:
#define UIP_CONF_UDP 1
#define UIP_CONF_IPV6 1
You must configure addresses in apps/udp/udp-sender.c and apps/udp/udp-receiver.c
which match your platforms addresses.

View file

@ -0,0 +1,34 @@
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*
* $Id: example-udp-receiver.c,v 1.1 2008/10/14 10:01:52 julienabeille Exp $
*/
#include "udp.h"
AUTOSTART_PROCESSES(&udp_process_receiver);