1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

293 Commits

Author SHA1 Message Date
PeterKietzmann
9389d5b90f net/gnrc/sixlowpan/frag/rb:Move size macro to 'CONFIG_' namespace 2020-01-17 18:09:19 +01:00
PeterKietzmann
89af238eec net/gnrc/sixlowpan/frag/fb:Move size macro to 'CONFIG_' namespace 2020-01-17 18:09:19 +01:00
PeterKietzmann
b5ea3122e7 net/gnrc/sixlowpan:Move queue size macro to 'CONFIG_' namespace 2020-01-17 18:09:19 +01:00
PeterKietzmann
de99b99b35 Kconfig: Expose gnrc/sixlowpan configurations 2020-01-17 18:09:14 +01:00
fc45c2cc83
Merge pull request #12848 from miri64/gnrc_sixlowpan_frag_rb/fix/interval-fixes
gnrc_sixlowpan_frag_vrb: fix issues with interval marker inherited from base
2020-01-15 20:57:49 +01:00
Martine S. Lenders
d9ecc0b9bb
gnrc_sixlowpan_frag_vrb: append intervals of given base if entry exists
Otherwise the list in `base->ints` will get lost.
2020-01-15 15:00:03 +01:00
Martine S. Lenders
e1ae44b536
gnrc_sixlowpan_frag_stats: actualize pseudo-module
Having the definitions sit in the `net/gnrc/sixlowpan/frag.h` header
does not make much sense, when using Selective Fragment Forwarding
(and the fragmentation buffer already includes a
`net/gnrc/sixlowpan/frag/stats.h` header), so they are moved to their
own header. Since with this change it makes more sense to have the
statistics stored in their own sub-module, the pseudo-module is also
actualized.
2019-12-18 15:45:03 +01:00
Martine S. Lenders
3bf426e6fc
gnrc_sixlowpan_iphc: factor-out IPv6 header decoding into own function 2019-12-10 15:46:51 +01:00
Martine S. Lenders
8ce3c745c8
gnrc_sixlowpan_iphc: add extension header encoding 2019-12-10 15:31:56 +01:00
Martine S. Lenders
a0a334a491
gnrc_sixlowpan_iphc: factor-out IPv6 header encoding into own function 2019-12-10 15:29:06 +01:00
Martine S. Lenders
3273602f24
tests: provide test application for IPHC+VRB behavior 2019-12-10 13:59:41 +01:00
Martine Lenders
a689f51e9a
gnrc_sixlowpan_iphc: add rudimentary forwarding routine 2019-12-10 13:56:33 +01:00
Martine S. Lenders
e31394536b
gnrc_sixlowpan_iphc: factor encoding out of sending function 2019-12-10 13:56:05 +01:00
Martine S. Lenders
556d71a7da
gnrc_sixlowpan_iphc: create VRB entry from uncompressed header
... when VRB is available
2019-12-10 13:56:02 +01:00
Martine S. Lenders
0251d6585e
gnrc_sixlowpan_frag_rb: error when interval buffer is full 2019-11-29 18:00:54 +01:00
Martine S. Lenders
3fe1bf59a4
gnrc_sixlowpan_frag_rb: fix memory-leak in _rm_by_datagram()
This fits with the semantics of this function which doesn't provide or
uses any state of the reassembly buffer provided by the user, but finds
the entry itself and then removes it. This gives the user no chance to
remove the packet in the reassembly buffer entry, so
`gnrc_sixlowpan_frag_rb_rm_by_datagram()` has to release the packet
(other than `gnrc_sixlowpan_frag_rb_remove()` where not releasing the
packet is desired as it might be handed up to an upper layer).
2019-11-29 15:38:13 +01:00
d4f3747705 sys/net: fix typos 2019-11-23 22:39:38 +01:00
Martine Lenders
02295ce5c7
Merge pull request #12593 from miri64/gnrc_sixlowpan_frag_rb/enh/deletion-timer
gnrc_sixlowpan_frag_rb: allow for deletion timer after completion
2019-11-12 17:54:15 +01:00
Martine S. Lenders
11669d9bdc gnrc_sixlowpan_frag_rb: add missing \n at end of DEBUG line 2019-11-12 17:06:52 +01:00
Martine S. Lenders
40138fdce8 gnrc_sixlowpan_frag_rb: allow for deletion timer after completion
This allows to set a timer between the completion of a datagram in the
reassembly buffer and the deletion of the corresponding reassembly
buffer entry. This allows to ignore potentially late incoming link-layer
duplicates of fragments of the datagram that then will have the
reassembly buffer entry be blocked.

This was noted in this [discussion] for classic 6LoWPAN reassembly (and
minimal fragment forwarding) and is recommended in the current
[selective fragment recovery draft][SFR draft].

[discussion]: https://mailarchive.ietf.org/arch/msg/6lo/Ez0tzZDqawVn6AFhYzAFWUOtJns
[SFR draft]: https://tools.ietf.org/html/draft-ietf-6lo-fragment-recovery-07#section-6
2019-11-12 17:06:52 +01:00
Martine Lenders
ca37cde142 gnrc_sixlowpan_frag_fb: introduce function to get entry by tag 2019-11-04 20:04:39 +01:00
Martine Lenders
8c3dc66ad8 gnrc_sixlowpan_frag: factor-out and rename fragmentation buffer
The name `fragment_msg` or `frag_msg`/`msg_frag` always to me was a bit
misplaced, as it basically implements an asynchronous fragmentation
buffer and doesn't necessarily have anything to do with messages.
This change

1. changes the name to `fb` (for fragmentation buffer)
2. factors its code out to its own sub-module so it can be re-used by
   other 6LoWPAN fragmentation schemes like [Selective Fragment
   Recovery]

[Selective Fragment Recovery]: https://tools.ietf.org/html/draft-ietf-6lo-fragment-recovery-05
2019-11-04 20:04:37 +01:00
Martine Lenders
79c8fc5405
Merge pull request #12599 from miri64/gnrc_sixlowpan_frag/enh/remove-code-dup
gnrc_sixlowpan_frag: various optimizations and clean-ups on sending
2019-11-04 19:54:33 +01:00
Martine Lenders
2a1e002d6d
Merge pull request #12627 from miri64/gnrc_sixlowpan_iphc_nhc/enh/frag+iphc-payload_len
gnrc_sixlowpan_iphc_nhc: determine UDP hdr length from RB
2019-11-01 19:47:08 +01:00
Martine S. Lenders
f33111a9c2 gnrc_sixlowpan_iphc: remove duplicate gnrc_netif_hdr_get_netif()
The interface is already fetched in the beginning of the function and
doesn't change during its run, so getting the interface again at this
point is just redundant.
2019-11-01 18:29:44 +01:00
Martine S. Lenders
806f33fce4 gnrc_sixlowpan_iphc_nhc: determine UDP hdr length from RB
When decoding IPHC in a fragmented datagram, relying on the size of the
allocated space for the decoded packet is wrong when fragments are
forwarded and decoded on an intermediate node (for which the reassembly
buffer's space is used): Using the full datagram size for allocation in
this case would be wasteful, so the allocated space is only marginally
larger than the fragment's compressed form.
This in turn results in the wrong UDP payload size being chosen and
even worse being forwarded to the subsequent nodes.

This change uses the (virtual) reassembly buffer's `datagram_size`
instead of relying on the allocated space for the encoded
datagram/fragment.
2019-11-01 13:18:00 +01:00
Martine S. Lenders
dba2f9e5ea gnrc_sixlowpan_frag: remove code duplication on fragment creation 2019-10-29 15:34:24 +01:00
Martine S. Lenders
d5e21f35c3 gnrc_sixlowpan_frag: copy netif header directly 2019-10-29 15:34:24 +01:00
Martine Lenders
796d6a3167 gnrc_sixlowpan: move garbage collect msg type to reassembly buffer 2019-10-24 12:41:29 +02:00
Martine Lenders
f228dedcf4 gnrc_sixlowpan_frag_rb: fix comment typo 2019-10-19 16:30:45 +02:00
Martine S. Lenders
5bf9892bb3 gnrc_sixlowpan_frag_rb: add new functions for SFR 2019-10-19 16:30:45 +02:00
Martine S. Lenders
184e91780a gnrc_sixlowpan_frag_rb: explain second _rbuf_add() call more detailed 2019-10-18 11:14:13 +02:00
Martine S. Lenders
f8d75d7add gnrc_sixlowpan_frag_rb: behavioral change to add()
Rather than dispatching the packet automatically once it is complete,
`gnrc_sixlowpan_frag_rb_add()` now only returns success, and leaves it
to the caller to dispatch the packet.
2019-10-18 09:02:32 +02:00
Martine S. Lenders
a229755abe gnrc_sixlowpan_frag_rb: return status on dispatch_when_complete() 2019-10-18 09:02:32 +02:00
Martine S. Lenders
b086453347 gnrc_sixlowpan_frag_rb: return pointer to entry on add() 2019-10-18 09:02:32 +02:00
Martine S. Lenders
3a4ebe98c3 gnrc_sixlowpan_frag_rb: get index instead of pointer with _rbuf_get() 2019-10-18 09:02:31 +02:00
Martine Lenders
2a74d32ea9 gnrc_sixlowpan_frag_rb: seperate out classic frag specific code 2019-10-15 10:40:50 +02:00
Martine S. Lenders
f6686e92f1 gnrc_sixlowpan_frag_vrb: add gnrc_sixlowpan_frag_vrb_from_route()
This adds a new VRB function that receives a header with forwarding
information and creates a VRB entry from it. Currently, only IPv6 is
supported.
2019-10-07 18:16:47 +02:00
Martine S. Lenders
c6781af281 gnrc_sixlowpan_frag_vrb: rename addr_str variable 2019-10-07 17:52:09 +02:00
Martine Lenders
04f59d6609 gnrc_sixlowpan_frag_vrb: re-use now unused super::dst for out_dst 2019-09-30 12:46:15 +02:00
Martine Lenders
45f7966364 gnrc_sixlowpan_frag_vrb: fix for draft update
Due to some changes to the minimal forwarding draft and in preparation
for Selective Fragment Recovery some changes to the VRB API were
needed. Now the index of a VRB entry is only (L2 src, tag) not as
before (L2 src, L2 dst, length, tag).

I know that the current `rbuf_base` causes waste, as all the fields not
used by the new index are effectively not used by the VRB. I'd like to
fix that however in a later change, since that also requires some
modifications of the classic reassembly buffer, and thus would
complicate the review and testing of the change.

Sources for the index change:
- https://tools.ietf.org/html/draft-ietf-6lo-minimal-fragment-04#section-1
- https://mailarchive.ietf.org/arch/browse/6lo/?gbt=1&index=DLCTxC2X4bRNtYPHhtEkavMWlz4
2019-09-29 18:31:43 +02:00
Martine Lenders
e9ff46b2ea gnrc_sixlowpan_frag_rb: unify naming scheme 2019-09-28 12:11:54 +02:00
Martine Lenders
178f4af108 gnrc_sixlowpan_frag_rb: remove legacy defines 2019-09-28 12:07:24 +02:00
Martine Lenders
972e4938bc gnrc_sixlowpan_frag_rb: use existing name scheme for private functions 2019-09-28 11:51:18 +02:00
Martine S. Lenders
49bd8678ed gnrc_sixlowpan_frag_rb: remove public around former private functions 2019-09-28 11:51:18 +02:00
Martine S. Lenders
ec495528fe gnrc_sixlowpan_frag: move private RB functions to RB module 2019-09-28 11:51:18 +02:00
Martine S. Lenders
b5545fe334 gnrc_sixlowpan: include reassembly buffer only where needed 2019-09-27 21:11:36 +02:00
Martine S. Lenders
1f7770da5c gnrc_sixlowpan_frag: move public rbuf functions to their own module 2019-09-27 19:09:52 +02:00
Martine Lenders
dca3408167 gnrc_sixlowpan_frag_stats: initial import of frag statistics 2019-09-11 10:30:29 +02:00
Hauke Petersen
02df6ab13f
Merge pull request #11000 from miri64/gnrc_sixlowpan_frag/new/vrb
gnrc_sixlowpan_frag: initial import of the VRB
2019-08-07 17:33:01 +02:00
Martine Lenders
1f1ff16e3c gnrc_sixlowpan_frag: include VRB in normal GC 2019-08-07 16:19:36 +02:00
Martine Lenders
26a526eaee gnrc_sixlowpan_frag: initial import of the VRB
VRB = virtual reassembly buffer
2019-08-07 16:18:19 +02:00
Martine Lenders
3ee75c3ca9 gnrc_sixlowpan_iphc: assure ctx != NULL for dst compression
For the source address compression it was already done the same way in
12bcc46f15
2019-06-20 16:18:23 +02:00
Cenk Gündoğan
3f4259af07
Merge pull request #11061 from miri64/gnrc_sixlowpan_frag/new/hint
gnrc_sixlowpan_frag: Initial import of a fragment size hint feature
2019-05-28 23:09:15 +02:00
Martine Lenders
2534cfb3fa gnrc_sixlowpan_frag: Initial import of a fragment size hint feature
This allows for sending of fragments smaller than the restrictions set
by the link-layer PDU. E.g. to put some slack for IPHC into the first
fragment (see https://tools.ietf.org/html/draft-ietf-6lo-fragment-recovery-02#section-4.1).
2019-05-28 21:03:51 +02:00
Martine Lenders
a8c81debf8 gnrc_sixlowpan_frag: use rbuf base class whenever possible 2019-05-28 18:07:42 +02:00
Martine Lenders
5e7803d506 gnrc_sixlowpan_frag: add datagram size to base type 2019-05-28 18:07:42 +02:00
Martine Lenders
52e4247798 gnrc_sixlowpan_frag: introduce reassembly buffer base class 2019-05-28 18:07:42 +02:00
Martine Lenders
495eaa36a6 gnrc_sixlowpan_frag: remove unnecessary type indirection
The members of `rbuf_t` and `gnrc_sixlowpan_rbuf_t` are now identical
so we can remove the internal type.
2019-05-28 18:07:42 +02:00
Martine Lenders
8cc5d94956 gnrc_sixlowpan_frag: add arrival time to public type
The arrival time is also needed for the VRB's garbage collection.
2019-05-28 18:07:42 +02:00
Martine Lenders
b84e496563 gnrc_sixlowpan_frag: add intervals to public type
The fragment intervals are also required by the VRB, so make them part
of the public representation of a reassembly buffer.
2019-05-28 18:07:42 +02:00
Martine Lenders
a3061ab2cc gnrc_sixlowpan_frag: expose fragment interval type
For the [VRB] I also need to track which the intervals of the fragments
already received (mostly for finding out when I am able to get rid of a
VRB entry, see [this conversation][VRB entry removal]), so to be able to
incorporate it into the common type for both reassembly buffer and VRB I
need to expose that type first.

[VRB]: https://tools.ietf.org/html/draft-ietf-lwig-6lowpan-virtual-reassembly-00
[VRB entry removal]: https://mailarchive.ietf.org/arch/msg/6lo/bTm2REo4PpVcMFH04mF_SlPvS_M
2019-05-28 18:07:41 +02:00
Martine Lenders
8fe12bc82c
Merge pull request #11021 from miri64/gnrc_sixlowpan_frag/enh/multiple-send
gnrc_sixlowpan_frag: allow send of multiple datagrams simultaneously
2019-05-27 11:54:26 +02:00
Martine Lenders
93050d29c0 gnrc_sixlowpan_frag: unify common operations 2019-05-27 10:35:31 +02:00
Martine Lenders
04472d3fbe gnrc_sixlowpan_frag: reorder stack variables for better stack usage 2019-05-27 10:35:31 +02:00
Martine Lenders
b6f19c0bcb gnrc_sixlowpan_frag: allow send of multiple datagrams simultaneously 2019-05-27 10:35:31 +02:00
Martine Lenders
7e26a22723 gnrc_sixlowpan_frag: fix timeout config macro name 2019-05-24 17:39:35 +02:00
Martine Lenders
1cac697a62 gnrc_sixlowpan_frag: make aggresive override configurable 2019-04-25 09:37:34 +02:00
Martine Lenders
a55320a10a gnrc_sixlowpan_frag: expose tag progression functionality
The VRB also needs to be able to generate new tags for forwarding. This
exposes the tag generation.
2019-04-18 16:40:12 +02:00
Martine Lenders
43dedfcd2c gnrc_sixlowpan_frag/rbuf: document undocumented functions
This adds documentation for the following undocumented functions:

- rbuf_rm()
- rbuf_entry_empty()
2019-04-18 14:19:53 +02:00
Martine Lenders
1550390adb gnrc_sixlowpan_frag: expose reassembly buffer configuration
Both values are not standardized so there is no sense keeping these
values not configurable
2019-04-18 14:19:53 +02:00
Peter Kietzmann
f6efecc3f0
Merge pull request #11063 from miri64/gnrc_sixlowpan_frag/enh/msg-send-to-6lo
gnrc_sixlowpan_frag: encapsulate msg_send_to_self()
2019-03-26 21:26:04 +01:00
Martine Lenders
3582dedd4e gnrc_sixlowpan_iphc: check ptr != NULL in compressible check
Not only does this leave open a risk to crash the node for the check
in `_compressible()` but also is the `tmp` check below getting confused
when `ptr` is `NULL`, since `gnrc_pktbuf_start_write()` returns `NULL`
in that case.
2019-03-12 16:48:33 +01:00
Martine Lenders
931b179d14 gnrc_sixlowpan_frag: encapsulate msg_send_to_self()
This makes it easier to access this functionality for test cases e.g.
from the `main` thread.
2019-03-08 19:32:46 +01:00
Marian Buschsieweke
8dbd3b24d1
Merge pull request #11124 from miri64/gnrc_sixlowpan/fix/debug-pri
gnrc_sixlowpan: don't use PRIx8
2019-03-08 10:25:27 +01:00
Martine Lenders
449d4559a7 gnrc_sixlowpan_frag: replace printf with DEBUG 2019-03-07 18:17:07 +01:00
Martine Lenders
f6d3290507 gnrc_sixlowpan: don't use PRIx8
With newlib nano-specs the debug output without this change will be

    6lo: dispatch 0hx ... is not supported

With this PR this will provide a correct output, e.g.

    6lo: dispatch 0x3f ... is not supported
2019-03-07 12:45:27 +01:00
Martine Lenders
b27f12bc1f gnrc_sixlowpan_frag: remove redundant PID member
The interface ID is actually also provided in `pkt` so providing it in
the `gnrc_sixlowpan_msg_frag_t` struct is redundant.
2019-02-15 11:23:18 +01:00
Marian Buschsieweke
194d340a64
net/sixlowpan: Fixed calculation of fragment size
Fragment size calculation previously failed for devices that are able to
transmit bigger layer 2 PDUs that 802.15.4 devices. This commit fixes the issue.
2019-02-12 09:45:31 +01:00
Martine Lenders
43c2c728c9 gnrc_sixlowpan_iphc: fix _compressible()
When either `gnrc_sixlowpan_iphc_nhc` or `gnrc_udp` is not compiled
in `_compressible()` never returns `true`. This causes the
`dispatch` snip in `gnrc_sixlowpan_iphc_send()` to be of length 0,
meaning `dispatch->data` is `NULL`, causing possible crashes when
trying to send IPv6 packets over 6LoWPAN without NHC or UDP.
2019-02-05 15:22:41 +01:00
b8565e492d
Merge pull request #10851 from miri64/tests/feat/gnrc_sixlowpan_frag-tests
tests: provide unittests for gnrc_sixlowpan_frag/rbuf
2019-01-25 17:55:28 +01:00
Martine Lenders
7d9ef9f78c gnrc_sixlowpan_frag/rbuf: add offset assertion to rbuf_add()
`gnrc_sixlowpan_frag` internally derives the offset value directly
from the fragment header, so for normal usage within GNRC this
assertion is redundant, but to make the tests of `rbuf_add` 100%
water-tide I added it.
2019-01-25 16:57:09 +01:00
Martine Lenders
879321d68a gnrc_sixlowpan: stop type-finding loop when type is found
Currently the loop just continues to run after a viable type is found.
In #10851 this lead to a crash of the tests, when the dependency of
`gnrc_sixlowpan` to `gnrc_ipv6` was removed.
2019-01-25 12:04:30 +01:00
Martine Lenders
1370099435 gnrc_sixlowpan_frag/rbuf: provide helper functions for testing 2019-01-23 20:00:07 +01:00
Martine Lenders
4c1d1424c0 gnrc_sixlowpan_frag: release for fragment too big error case
The fragment is released for all other error cases, just not this one.
2019-01-23 18:05:37 +01:00
Martine Lenders
01370511df gnrc_sixlowpan_frag: drop received duplicates
Otherwise duplicate fragments are added to the number of already
received datagram bytes in L153 leading to possible race-conditions.
2019-01-15 20:09:49 +01:00
Martine Lenders
7452f48c26 gnrc_sixlowpan_frag: unroll recursion
While the recursion in `gnrc_sixlowpan_frag` shouldn't be infinite we
still should avoid using recursions in general (also to be able to
statically analyze stack usage). This unrolls the recursion.
2019-01-08 09:03:22 +01:00
Gunar Schorcht
d3f78a5a40
Merge pull request #10679 from miri64/gnrc_sixlowpan_frag/fix/send-check-msg-queue
gnrc_sixlowpan_frag: check if own message queue is full
2018-12-30 15:48:26 +01:00
Martine Lenders
e8da744e6d gnrc_sixlowpan_frag: release packet when frag hdr can't be marked
Otherwise, there will be leaks ;-).
2018-12-30 01:05:34 +01:00
Martine Lenders
a409603f84 gnrc_sixlowpan_frag: release packet when rbuf is full
Otherwise, there will be leaks ;-).
2018-12-30 00:59:04 +01:00
Martine Lenders
9e3cdebae1 gnrc_sixlowpan_frag: check if own message queue is full
When issueing the sending of the next fragment the current version of
`gnrc_sixlowpan_frag` doesn't check if the queue is full. This leads to
leakage of the packet buffer, since when it is full, the package never
gets released.

This change adds a checks and error exits in case the queue is full.
2018-12-29 22:54:52 +01:00
Martine Lenders
d5bbf45d32 gnrc_sixlowpan_frag: reduce code duplication in send 2018-12-29 22:54:14 +01:00
Cenk Gündoğan
79de5ae6e6 sixlowpan: minor fixes for non-ipv6 usage 2018-12-18 21:32:54 +01:00
Martine Lenders
a7e3791f3b gnrc_sixlowpan_iphc: allow address compression for non-IEEE802.15.4 2018-12-07 13:03:40 +01:00
Martine Lenders
d94ba6c7d1 gnrc_sixlowpan_iphc: use gnrc_netif_hdr_get_netif() function 2018-12-05 14:08:32 +01:00
Martine Lenders
868a856cbc gnrc_sixlowpan: use gnrc_netif_hdr_get_netif() function 2018-12-05 14:08:32 +01:00
05b6af466c sys: add missig <string.h> includes 2018-09-20 23:47:40 +02:00
Martine Lenders
a9d0f20c7e
Merge pull request #8626 from miri64/gnrc_sixlowpan_iphc/enh/clean-up-nhc
gnrc_sixlowpan_iphc: cleanup NHC encoding
2018-08-17 10:13:34 +02:00
Martine Lenders
0a9793c49b gnrc_sixlowpan_iphc: cleanup NHC encoding 2018-08-16 16:55:28 +02:00
Joakim Nohlgård
3cc088689e 6lo: Speling correction in comment 2018-08-14 10:08:52 +02:00