Module capsules::net::sixlowpan
[−]
[src]
6loWPAN (IPv6 over Low-Power Wireless Networks) is standard for compressing and fragmenting IPv6 packets over low power wireless networks, particularly ones with MTUs (Minimum Transmission Units) smaller than 1280 octets, like IEEE 802.15.4. 6loWPAN compression and fragmentation are defined in RFC 4944 and RFC 6282.
This module implements 6LoWPAN transmission and reception, including compression, fragmentation, and reassembly. It allows a client to convert between a complete IPv6 packets and a series of Mac-layer frames, and vice versa. On the transmission end, IPv6 headers are compressed and packets fragmented if they are larger than the Mac layer MTU size. For reception, IPv6 packets are decompressed and reassembled from fragments and clients recieve callbacks for each full IPv6 packet.
Usage
Clients use the Sixlowpan struct to send packets while they implement the SixlowpanClient trait to receive IPv6 packets as well as to be notified when a packet transmission has completed. Sixlowpan can send one packet at a time, so any virtualization or multiplexing must be implemented elsewhere.
At a high level, clients interact with this module as shown in the diagrams below:
Transmit: +-----------+ |Upper Layer| +-----------+ | transmit_packet(..packet..) | v +---------+ |Sixlowpan| +---------+ ... +---------------+ |SixlowpanClient| +---------------+ ^ | send_done(..) | +---------+ |Sixlowpan| +---------+
Receive: +---------------+ |SixlowpanClient| +---------------+ ^ | receive(..buf..) | +---------+ |Sixlowpan| +---------+
Initialization: +-----------+ |Upper Layer| +-----------+ | set_client(client) | v +---------+ |Sixlowpan| +---------+
Examples
Examples of how to interface and use this layer are included in the file
boards/imix/src/lowpan_frag_dummy.rs
. Some set up is required in
the boards/imix/src/main.rs
file, but for the testing suite, a helper
initialization function is included in the lowpan_frag_dummy.rs
file.
Reexports
use core::cell::Cell; |
use ieee802154::device::MacDevice; |
use ieee802154::device::RxClient; |
use ieee802154::device::TxClient; |
use ieee802154::framer::Frame; |
use kernel::ReturnCode; |
use kernel::common::list::List; |
use kernel::common::list::ListLink; |
use kernel::common::list::ListNode; |
use kernel::common::take_cell::MapCell; |
use kernel::common::take_cell::TakeCell; |
use kernel::hil::radio; |
use kernel::hil::time; |
use kernel::hil::time::Frequency; |
use net::frag_utils::Bitmap; |
use net::ieee802154::Header; |
use net::ieee802154::KeyId; |
use net::ieee802154::MacAddress; |
use net::ieee802154::PanID; |
use net::ieee802154::SecurityLevel; |
use net::sixlowpan_compression; |
use net::sixlowpan_compression::is_lowpan; |
use net::sixlowpan_compression::ContextStore; |
use net::util::slice_to_u16; |
use net::util::u16_to_slice; |
Modules
lowpan_frag |
Structs
RxState |
Tracks the decompression and defragmentation of an IPv6 packet |
Sixlowpan |
Sends a receives IPv6 packets via 6loWPAN compression and fragmentation. |
TxState |
Tracks the global transmit state for a single IPv6 packet. |
Constants
FRAG_TIMEOUT |
Traits
SixlowpanClient |
Functions
get_frag_hdr | |
is_fragment | |
set_frag_hdr |