主要有两大网络协议栈uIPRime这两大协议栈(network stack):

The uIP TCP/IP stack, which provides us with IPv4 networking。

The uIPv6 stack, which provides IPv6 networking。

The Rime stack, which is a set of custom lightweight networking protocols designed for low-power wireless networks.

 

uIPuIPv6可以归并为一类即uIP,看过一些资料,目前很火的是uIPv6,基本都是用这个版本,下边是uIPv6网络协议栈的示意图:

Contiki Network Stack

图1 网络协议栈示例(uIPv6

参考:http://anrg.usc.edu/contiki/index.php/Network_Stack#RDC_Layer

 

网络协议栈主要分四层(大):Network Layer,MAC Layer,RDC Layer,Radio Layer。

其中Network Layer可为uIP、uIPv6和Rime,可通过NETSTACK_NETWORK更改

#define NETSTACK_NETWORK rime_driver
/* NETSTACK_CONF_NETWORK specifies the network layer and can be either
   sicslowpan_driver, for IPv6 networking, or rime_driver, for the
   custom Rime network stack. */

设置为rime协议栈。

 

rime协议栈和uIP协议栈的关系:

Contiki Network Stack

 

图2 Rime和uIP协议栈关系

参考:http://blog.chinaunix.net/attachment/attach/91/12/80/039112803aa3e2106582d32bab61bb8339fdd4950.pdf 

 

Having a functional TCP/IP stack and some applications running on top of it is good, but not enough. The uIP stack requires a lower layer (according to the OSI model) in order to communicate with peers. We'll distinguish two different types of peers:

nodes: communication between nodes is achieved with a wireless link. The uIP stack needs to be able to send and receive packets. Depending on the uIP version, Contiki follows different directions.
When it comes to IPv6, Contiki chose to follow a route-over configuration. Therefore, uIP6 uses a simple MAC layer called sicslowmac. Beside header compression provided by the 6loWPAN module, it just forwards the packet to/from the radio.
However, for IPv4, Contiki chose a mesh-under configuration. This is done with the Rime communication stack. Rime provide mesh routing and route discovery, therefore uIP uses it to forward packets on the network. From the IP point of view, all the nodes of the sensor network form a local subnetwork, even though multiple radio hops may be required.
gateways: to reach a network entity outside the wireless sensor network, a gateway is required. It's a system that will make the link between the wireless sensors network and another network. It will typically be a PC in most experiments, although it could be many embedded system. The connection between a PC and a mote is a serial link. IP packets are sent between these two using SLIP, which stands for Serial Line IP. On the computer side, a program must run to do the interface between the serial line and a network interface. Depending on the uIP stack version, the functionality is not the same.
With uIPv6, a node will be loaded with a very simple program that forwards every packet from the radio to the serial link and vice versa. It doesn't do any address comparison, there is no IP stack on it, besides the header compression/decompression mechanism (6loWPAN). This node will just be seen from the PC point of view as an ethernet network interface, thus that's the PC that does all the work.
With uIPv4 it works differently. The node connected to the PC will act as a gateway, with all the IP stack in it. Every time it has a packet to send, it will check its IP address: if it belongs to the wireless sensor network subnet range, then it will send it using its radio, otherwise it will send it to the PC using the serial link. The PC runs a program that create a IP network interface.
关于uIP的一些论述,不确定是否是对的。

相关文章: