Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPL Mode of Operation 0, Mode of Operation 1 and Mode of Operation 2 #869

Draft
wants to merge 107 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
6a0c432
add feature flags for RPL MOPs
thvdveld Aug 10, 2023
fd4b5bd
trickle: remove now and rand from default and new
thvdveld Aug 10, 2023
e74d10e
add Eq to SequenceCounter
thvdveld Aug 10, 2023
f97f137
add Default Instance ID constant
thvdveld Aug 10, 2023
a86a44c
make TrickleTimer public
thvdveld Aug 10, 2023
b0c5349
add RPL configuration builder
thvdveld Aug 10, 2023
d495504
remove redundant information in RPL structs
thvdveld Aug 10, 2023
893a7ec
fixup! remove redundant information in RPL structs
thvdveld Aug 10, 2023
5aada70
add CI tests for RPL MOPs
thvdveld Aug 10, 2023
df38e25
fix tests with wrong feature flag
thvdveld Aug 10, 2023
f55a501
fixup! fix tests with wrong feature flag
thvdveld Aug 10, 2023
a586d46
make RPL options owned, instead of byte slices
thvdveld Aug 10, 2023
35d1572
fixup! remove redundant information in RPL structs
thvdveld Aug 10, 2023
ce15062
add `poll_rpl` and `poll_at_rpl` logic
thvdveld Aug 10, 2023
f44c10b
fix(ipv6hbh): remove wrong lifetime
thvdveld Oct 16, 2023
40343e7
fix(ipv6rout): parse IPv6 addresses
thvdveld Oct 16, 2023
f4b5d06
fix(trickle): be consistent with naming function
thvdveld Oct 16, 2023
52662d7
fix(relation): add logging, add iterator
thvdveld Oct 16, 2023
7c85748
fix(instanceid): add is_local, is_global
thvdveld Oct 16, 2023
d59c959
fix(parents): add purging
thvdveld Oct 16, 2023
5462174
update RPL structs
thvdveld Oct 16, 2023
5c150d3
add rpl processing
thvdveld Oct 16, 2023
2283477
remove hacky way to get next header compression
thvdveld Oct 16, 2023
f5debe1
rewrite poll_rpl
thvdveld Oct 17, 2023
c9dcf97
add create functions for RplRepr's
thvdveld Oct 17, 2023
90ca5d3
split rpl wire enum repr in structs
thvdveld Oct 17, 2023
13b6be8
replace if let some with let else
thvdveld Oct 17, 2023
ed34a43
remove unused unwraps
thvdveld Oct 18, 2023
06d6248
only schedule DAO when not MOP0
thvdveld Oct 18, 2023
a1e0540
remove unwrap when scheduling DAO
thvdveld Oct 18, 2023
19f78e8
correctly increment DTSN in non-storing
thvdveld Oct 18, 2023
ca04632
remove stale relations when poll_rpl
thvdveld Oct 18, 2023
3f6ae00
remove old parents when not heard after 2 max trickle
thvdveld Oct 18, 2023
89f048b
put limit on source route hops
thvdveld Oct 18, 2023
4ae384d
correclty handle incoming DAOs
thvdveld Oct 18, 2023
8926cb5
keep track of path lifetime in relation table
thvdveld Oct 18, 2023
bf7bdaa
Remove logging
thvdveld Oct 22, 2023
49563e5
rewrite if for DTSN increment when purging
thvdveld Oct 22, 2023
d0cc591
temporarily enable rpl-mop-3
thvdveld Oct 22, 2023
e4bf01b
add RPL config in 6LoWPAN example
thvdveld Oct 22, 2023
bf84371
use vec instead of linearmap for parent set
thvdveld Oct 22, 2023
c0ad743
move SequenceCounter to wire/rpl.rs
thvdveld Oct 22, 2023
45c5c2d
RPL: imm. drop packet when rank error detected
thvdveld Nov 7, 2023
4e30f16
rpl: better useage of feature flags
thvdveld Nov 7, 2023
54313fb
fix tests
thvdveld Nov 7, 2023
4304613
RPL: reset DIS timer and DODAG when no parent
thvdveld Nov 8, 2023
6376935
RPL: no DODAG unwrap when searching for next hop
thvdveld Nov 8, 2023
a058f77
rpl: no unwrap when looking for parent address
thvdveld Nov 8, 2023
9d4f8a1
6LoWPAN: getter for Ext. Header header length
thvdveld Nov 8, 2023
56d43fc
rpl: add integration tests
thvdveld Nov 8, 2023
51bcb13
rpl: require all rpl features for int. tests
thvdveld Nov 9, 2023
95aa23b
hbh: remove feature flag for processing hbh
thvdveld Nov 9, 2023
e118c7b
hhb: add missing feature flag for hbh IpPacket field
thvdveld Nov 9, 2023
d38ee1f
rpl: check that DAO and DAO-ACK is transmitted
thvdveld Nov 9, 2023
910baf9
rpl: don't forward DAO in MOP1 when not root
thvdveld Nov 9, 2023
66aa9a7
fix(rpl): correct dst addr for resp on unicast DIS
thvdveld Nov 9, 2023
66c5138
rpl: update comments
thvdveld Nov 9, 2023
402650b
fix(rpl): fix dst addr for resp on optionless DIO
thvdveld Nov 9, 2023
45e2b5f
rpl: correctly add hbh to data packets
thvdveld Nov 10, 2023
1956656
rpl: test check for hbh/source routing
thvdveld Nov 10, 2023
d4a3fc1
chore: cleanup warnings
thvdveld Nov 10, 2023
6e373c3
rpl: add hbh to DAO-ACKs, even for 1 hop
thvdveld Nov 10, 2023
3dea665
rpl: no-path fix rank value and count INFINITE rank dio
thvdveld Nov 10, 2023
bce14f8
rpl: only send NO-PATH DAOs once
thvdveld Nov 13, 2023
379f90e
6lowpan: `as_sixlowpan_next_header` on IpProtocol
thvdveld Nov 13, 2023
4cec242
rpl: reset trickle timer when selecting new parent
thvdveld Nov 13, 2023
d9e2241
sim: split the simulator in smaller files
thvdveld Nov 13, 2023
2ba2bb8
Basic test for changing parent
dianadeac Nov 10, 2023
6876e32
Finalize test for node changing parent
dianadeac Nov 13, 2023
1fb2d31
fix: update merged test
thvdveld Nov 13, 2023
02b517b
chore: get rid of warnings
thvdveld Nov 13, 2023
58ddf87
rpl: move wire into directory
thvdveld Nov 15, 2023
860000b
rpl: split mod into multiple files
thvdveld Nov 15, 2023
ea25c50
docs(rpl): update documentation in wire
thvdveld Nov 16, 2023
d22bd61
rpl: prefix vec use bytes instead of addresses
thvdveld Nov 16, 2023
bc74255
Tests for parent leaving network and reaction to the incrementation o…
dianadeac Nov 16, 2023
b3c4ca4
Merge branch 'rpl-tests' into 'rpl'
thvdveld Nov 16, 2023
9a42422
rpl: don't panic when hop limit is <= 1
thvdveld Nov 17, 2023
aef7922
ipv6: add entry to neighbor table
thvdveld Nov 29, 2023
2b26f2f
Add test for behaviour when increasing version number
dianadeac Dec 1, 2023
005c6fc
Fix down flag not set correctly when packet not going through root
dianadeac Dec 6, 2023
2b1ca2e
rpl: move poll_rpl to interface/rpl.rs
thvdveld Dec 4, 2023
766a9a1
rpl: purge -> flush for relations
thvdveld Dec 4, 2023
cc431d0
rpl: flush relations in own function
thvdveld Dec 4, 2023
56a1238
fixup! rpl: flush relations in own function
thvdveld Dec 4, 2023
8b17900
ipv6route-rpl: remove static buffer
thvdveld Dec 6, 2023
706b363
update payload length when adding source routing header
thvdveld Dec 6, 2023
7975964
remove into()
thvdveld Dec 6, 2023
58434c3
rpl: reduce resolution for some tests
thvdveld Dec 8, 2023
817eaf7
ipv6route: compress routes in SRH
thvdveld Dec 8, 2023
d685669
fix build and tests
thvdveld Jan 2, 2024
6adb62e
fix compilation
thvdveld Jan 18, 2024
7e65f98
pass hbh repr to forward function
thvdveld Jan 18, 2024
2e807d0
6lowpan: rewrite compression of IPv6
thvdveld Jan 19, 2024
b45979b
sixlowpan: IpPayload::Raw compress when UDP
thvdveld Jan 23, 2024
14b1c67
Merge branch 'sixlowpan-dispatch-rewrite' into rpl
thvdveld Jan 23, 2024
932d873
Merge branch 'main' into rpl
thvdveld Mar 18, 2024
91ad44f
remove unused 6lowpan/rpl function
thvdveld Mar 18, 2024
c570346
fix compilation errors for other features
thvdveld Mar 18, 2024
c7629e4
make SixlowpanPacket private
thvdveld Mar 18, 2024
b761f58
make clippy happy
thvdveld Mar 18, 2024
3e04208
don't pass link address up the stack
thvdveld Mar 18, 2024
ad6431c
put source header processing in own fn
thvdveld Mar 18, 2024
4e60e47
use parent addr if no next hop for dst ip
thvdveld Mar 20, 2024
48cda98
only fill neighbor table when receiving DIS/DIO
thvdveld Mar 21, 2024
9a55e18
remove println
thvdveld Mar 21, 2024
8438f9e
fix unwraps for tests
thvdveld Mar 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 18 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ defmt = ["dep:defmt", "heapless/defmt-03"]
"proto-ipsec-ah" = []
"proto-ipsec-esp" = []

"rpl-mop-0" = ["proto-rpl"]
"rpl-mop-1" = ["proto-rpl"]
"rpl-mop-2" = ["proto-rpl"]
"rpl-mop-3" = ["proto-rpl"]

"socket" = []
"socket-raw" = ["socket"]
"socket-udp" = ["socket"]
Expand Down Expand Up @@ -96,7 +101,8 @@ default = [
"proto-ipv4", "proto-igmp", "proto-dhcpv4", "proto-ipv6", "proto-dns",
"proto-ipv4-fragmentation", "proto-sixlowpan-fragmentation",
"socket-raw", "socket-icmp", "socket-udp", "socket-tcp", "socket-dhcpv4", "socket-dns", "socket-mdns",
"packetmeta-id", "async"
"packetmeta-id", "async",
"rpl-mop-0", "rpl-mop-1", "rpl-mop-2", "rpl-mop-3"
]

# Private features
Expand Down Expand Up @@ -261,6 +267,13 @@ rpl-parents-buffer-count-8 = [] # Default
rpl-parents-buffer-count-16 = []
rpl-parents-buffer-count-32 = []

rpl-max-options-1 = []
rpl-max-options-2 = [] # Default
rpl-max-options-4 = []
rpl-max-options-8 = []
rpl-max-options-16 = []
rpl-max-options-32 = []

# END AUTOGENERATED CONFIG FEATURES

[[example]]
Expand Down Expand Up @@ -316,5 +329,9 @@ required-features = ["std", "medium-ieee802154", "phy-raw_socket", "proto-sixlow
name = "dns"
required-features = ["std", "medium-ethernet", "medium-ip", "phy-tuntap_interface", "proto-ipv4", "socket-dns"]

[[test]]
name = "rpl"
required-features = ["std", "medium-ieee802154", "proto-sixlowpan", "rpl-mop-0", "rpl-mop-1", "rpl-mop-2", "rpl-mop-3"]

[profile.release]
debug = 2
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ static CONFIGS: &[(&str, usize)] = &[
("DNS_MAX_NAME_SIZE", 255),
("RPL_RELATIONS_BUFFER_COUNT", 16),
("RPL_PARENTS_BUFFER_COUNT", 8),
("RPL_MAX_OPTIONS", 2),
// END AUTOGENERATED CONFIG FEATURES
];

Expand Down
5 changes: 4 additions & 1 deletion ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ FEATURES_TEST=(
"std,medium-ip,proto-ipv6,socket-icmp,socket-tcp"
"std,medium-ieee802154,proto-sixlowpan,socket-udp"
"std,medium-ieee802154,proto-sixlowpan,proto-sixlowpan-fragmentation,socket-udp"
"std,medium-ieee802154,proto-rpl,proto-sixlowpan,proto-sixlowpan-fragmentation,socket-udp"
"std,medium-ieee802154,rpl-mop-0,proto-sixlowpan,proto-sixlowpan-fragmentation,socket-udp"
"std,medium-ieee802154,rpl-mop-1,proto-sixlowpan,proto-sixlowpan-fragmentation,socket-udp"
"std,medium-ieee802154,rpl-mop-2,proto-sixlowpan,proto-sixlowpan-fragmentation,socket-udp"
"std,medium-ieee802154,rpl-mop-3,proto-sixlowpan,proto-sixlowpan-fragmentation,socket-udp"
"std,medium-ip,proto-ipv4,proto-ipv6,socket-tcp,socket-udp"
"std,medium-ethernet,medium-ip,medium-ieee802154,proto-ipv4,proto-ipv6,socket-raw,socket-udp,socket-tcp,socket-icmp,socket-dns,async"
"std,medium-ieee802154,medium-ip,proto-ipv4,socket-raw"
Expand Down
2 changes: 1 addition & 1 deletion examples/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn main() {

let socket = sockets.get_mut::<tcp::Socket>(tcp_handle);
socket
.connect(iface.context(), (address, port), 49500)
.connect(iface.context_mut(), (address, port), 49500)
.unwrap();

let mut tcp_active = false;
Expand Down
2 changes: 1 addition & 1 deletion examples/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn main() {

let socket = sockets.get_mut::<dns::Socket>(dns_handle);
let query = socket
.start_query(iface.context(), name, DnsQueryType::A)
.start_query(iface.context_mut(), name, DnsQueryType::A)
.unwrap();

loop {
Expand Down
2 changes: 1 addition & 1 deletion examples/httpclient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn main() {
iface.poll(timestamp, &mut device, &mut sockets);

let socket = sockets.get_mut::<tcp::Socket>(tcp_handle);
let cx = iface.context();
let cx = iface.context_mut();

state = match state {
State::Connect if !socket.is_active() => {
Expand Down
2 changes: 1 addition & 1 deletion examples/loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ fn main() {
}

let mut socket = sockets.get_mut::<tcp::Socket>(client_handle);
let cx = iface.context();
let cx = iface.context_mut();
if !socket.is_open() {
if !did_connect {
debug!("connecting");
Expand Down
4 changes: 4 additions & 0 deletions examples/sixlowpan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ fn main() {
};
config.random_seed = rand::random();
config.pan_id = Some(Ieee802154Pan(0xbeef));
#[cfg(feature = "proto-rpl")]
{
config.rpl_config = None;
}

let mut iface = Interface::new(config, &mut device, Instant::now());
iface.update_ip_addrs(|ip_addrs| {
Expand Down
1 change: 1 addition & 0 deletions gen_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def feature(name, default, min, max, pow2=None):
feature("dns_max_name_size", default=255, min=64, max=255, pow2=True)
feature("rpl_relations_buffer_count", default=16, min=1, max=128, pow2=True)
feature("rpl_parents_buffer_count", default=8, min=2, max=32, pow2=True)
feature("rpl_max_options", default=2, min=1, max=32, pow2=True)

# ========= Update Cargo.toml

Expand Down
4 changes: 3 additions & 1 deletion src/iface/interface/ieee802154.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ impl InterfaceInner {
return None;
}

self.current_frame = Some(ieee802154_repr);

match ieee802154_frame.payload() {
Some(payload) => {
self.process_sixlowpan(sockets, meta, &ieee802154_repr, payload, _fragments)
Expand All @@ -51,7 +53,7 @@ impl InterfaceInner {
ll_dst_a: Ieee802154Address,
tx_token: Tx,
meta: PacketMeta,
packet: Packet,
packet: PacketV6,
frag: &mut Fragmenter,
) {
let ll_src_a = self.hardware_addr.ieee802154_or_panic();
Expand Down