MoonBit wireless frame, link simulation, security, routing, and 6LoWPAN toolkit
moon update
moon run cmd/mainlet source = @sixlowpan.Ipv6Address::link_local_from_eui64(
Bytes::from_array([(0x00).to_byte(), (0x01).to_byte(), (0x02).to_byte(), (0x03).to_byte(),
(0x04).to_byte(), (0x05).to_byte(), (0x06).to_byte(), (0x07).to_byte()]),
).unwrap()
let destination = @sixlowpan.Ipv6Address::link_local_from_eui64(
Bytes::from_array([(0x10).to_byte(), (0x11).to_byte(), (0x12).to_byte(), (0x13).to_byte(),
(0x14).to_byte(), (0x15).to_byte(), (0x16).to_byte(), (0x17).to_byte()]),
).unwrap()
let udp = @sixlowpan.UdpDatagram {
source_port: 61616,
destination_port: 61617,
checksum: 0U,
payload: Bytes::from_array([(0x68).to_byte(), (0x69).to_byte()]),
}
let packet = @sixlowpan.Ipv6Packet {
traffic_class: 0,
flow_label: 0U,
next_header: 17,
hop_limit: 64,
src: source,
dst: destination,
payload: udp.encode_with_ipv6_checksum(source, destination).unwrap(),
}
let compressed = @sixlowpan.compress_ipv6_packet(
packet,
@sixlowpan.CompressionConfig::default(),
).unwrap()
let decoded = @sixlowpan.decompress_iphc_packet(compressed).unwrap()| Package | Responsibility |
|---|---|
| src/bitstream | Bit packing, reading, alignment, and endianness |
| src/integrity | CRC, checksum, parity, and corruption helpers |
| src/frame | 802.15.4, BLE, LoRaWAN, and Zigbee frame codecs |
| src/filter | PAN and destination filtering |
| src/mac | CSMA/CA, ACK/retry, superframe, GTS, and MAC commands |
| src/channel | Loss, delay, jitter, fading, noise, and collision simulation |
| src/phy | DSSS, ISM channel, link-budget, and BER models |
| src/topology | Positions, path loss, RSSI/LQI, and graph helpers |
| src/mesh | AODV-Jr and RPL routing primitives |
| src/security | AES-128, AES-CCM*, MIC, CTR, and replay protection |
| src/sixlowpan | IPv6, IPHC, UDP NHC, fragmentation, and reassembly |
| src/visualization | ASCII topology and PCAP/PCAPNG exporters |
| src/energy | Radio states, energy accounting, and battery estimates |
| src/cli | Trace parsing, summaries, and CLI reporting |
| cmd/main | Executable demonstration |
| test | Unit, boundary, integration, and benchmark tests |
moon fmt
git diff --exit-code
moon update
moon info
git diff --exit-code
moon check --deny-warn --target all
moon build --target all
moon test --deny-warn --target all
moon bench --target native --release -p testMoonBit wireless frame, link simulation, security, routing, and 6LoWPAN toolkit