Commit Graph

46 Commits

Author SHA1 Message Date
Simon Duquennoy
90b886aa71 Csma: comply with IEEE 802.15.4 2016-04-25 08:52:48 -06:00
Billy Kozak
ca0f32f45b Use collisions for csma backoff and retry
The collision count is now used in the calculation fot the CSMA
backoff and transmission will fail after a certain number of
collisisons.
2016-04-25 08:00:56 -06:00
Billy Kozak
467f28286c The CSMA driver no longer throttles queued packets
Fix for #1166

Updated the CSMA driver so it no longer applies a time delay for
sending queued packets which were sent without error.
2015-09-18 09:35:29 -06:00
Simon Duquennoy
333e076b24 Disable PACKETBUF_ATTR_PACKET_TYPE in the non-Rime case by default 2015-05-06 16:36:15 +02:00
Nicolas Tsiftes
6fb7dd238e Merge pull request #648 from cetic/pr-csma-fixes
High throughput fixes for csma and sixlowpan
2014-10-21 12:17:03 +02:00
Laurent Deru
7cbd59df03 Add per neighbor packet throttle 2014-08-13 10:11:02 +02:00
Laurent Deru
91d84a3086 Improve csma debug traces 2014-08-13 10:11:02 +02:00
kkrentz
c396a85364 llsec: Added a layer in between NETSTACK_MAC and NETSTACK_NETWORK for implementing link layer security 2014-08-04 01:09:57 -07:00
Adam Dunkels
5b1a9f5bc2 Bugfix: when a packet is sent by the RDC layer, we should count the number of transmissions made because a single callback can pertain to multiple transmissions at the RDC layer. 2014-03-24 08:36:18 +01:00
Adam Dunkels
45265249fc Changed the name of the rimeaddr module to linkaddr 2014-01-29 20:12:24 +01:00
Benoît Thébaudeau
14db3382af csma: Initialize sequence number with random value
According to IEEE 802.15.4 (§5.1.6.1, §6.4.2), the MAC sequence numbers should
be initialized to random values. This was already the case in
framer-802154.c:create(), but not in csma.c:send_packet(), sometimes causing
false detections of duplicate MAC-layer packets in other devices when a device
was restarted too quickly. This patch decreases the probability of such an
event.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
2013-11-25 13:01:11 +01:00
Simon Duquennoy
03dcca15cb Implement a truncated exponential backoff for csma 2013-11-14 15:02:36 +01:00
Adam Dunkels
09f30e875d Bugfix: when a CSMA callback is received, we should remove the packet
that was transmitted and not just the first packet that happens to be on
the output queue.
2013-05-25 12:13:07 +02:00
Adam Dunkels
f2fbb4b49d Defensive programming: make sure that we don't fail completely if we get a callback for a NULL pointer 2013-03-18 11:22:04 +01:00
Adam Dunkels
0670a8e1e2 Minor code style fixes to the contikimac and nullrdc code 2013-03-18 11:22:01 +01:00
Adam Dunkels
944537fccf Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
simonduq
dd8576830e Added bursts support in CSMA/ContikiMAC, and CFS-swapping in
queuebuf. Exemplified in examples/udp-stream.
2011-09-27 16:47:03 +02:00
Niclas Finne
e8a96dc202 Bug fix: update packet attributes in queued packets in CSMA instead of doing a full packetbuf copy after transmissions. The lower layers often add their own headers to packetbuf. 2011-06-15 16:10:07 +02:00
Adam Dunkels
74f1754d88 Bugfix: energy consumption for retransmissions was miscounted 2011-04-13 14:10:39 +02:00
adamdunkels
fa524fabd7 Bugfix: q->buf was not tested for NULL, as it should be. Fix by Simon Duquennoy. 2011-01-25 14:24:38 +00:00
adamdunkels
808c21fbfa Bugfix: default should be 3 MAC-level retransmissions if collissions or loss occurs 2011-01-18 16:03:57 +00:00
adamdunkels
26e3b6fdc0 Bugfix by Simon Duquennoy: don't transmit packet until previous packet has been sent by the RDC layer. 2011-01-13 19:06:22 +00:00
adamdunkels
4a89cc9db3 Rework of the new CSMA in-order code that fixes a number of smalllish bugs in the in-order code. 2010-12-16 22:44:02 +00:00
adamdunkels
952dfc9384 Rework of the CSMA layer: instead of using one timer per packet, the module now uses one central timer and a queue of outgoing packets. This helps to keep packets in order, which is extremely useful for TCP transfers, and reduces the amount of congestion since consecutive packets now are spaced in time if there is a collision. Based on the observations and ideas of Simon Duquennoy. 2010-12-14 07:57:14 +00:00
adamdunkels
8fa7bf6c31 Always restore the queuebuf to the packetbuf before calling the upper layers. Reduce the waiting time between successive MAC layer retransmissions. 2010-10-24 21:07:00 +00:00
nifi
e2b4956a7f Bug fix: release the packet and notify the sender if RDC returned an error 2010-10-14 19:08:39 +00:00
adamdunkels
ae88ed04f1 Moved the definition of the channel check rate used by the radio duty
cycling layer. This definition was previously held in net/mac/mac.h,
with the name MAC_CONF_CHANNEL_CHECK_RATE. But since the rate is used
by the radio duty cycling layer, it makes more sense to change its
name to reflect this. Also, the configuration option should be tied to
the netstack configuration instead.

So the new configuration option is called
NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE.
2010-10-03 20:37:32 +00:00
nifi
21828ad782 Changed the retransmission time to be based on the configured MAC channel check rate when the RDC has no channel check interval. 2010-06-16 10:08:30 +00:00
adamdunkels
3fa8ffda1a Moved the modules packetbuf, queuebuf, and packetqueue from net/rime to net/, since they are not Rime-specific 2010-06-14 19:19:16 +00:00
adamdunkels
8f8393aadc Moved ctimer.[ch] from their old and illogical location in core/net/rime to a more appropriate place in core/sys 2010-06-14 07:34:36 +00:00
adamdunkels
91ff8574ad Improved handling of duplicate packets 2010-04-08 09:32:56 +00:00
nifi
9508d2c4d7 * Added configurable default number of transmissions for CSMA to use when not specified using packetbuf attributes (CSMA_CONF_MAX_MAC_TRANSMISSIONS).
* Renamed packetbuf attribute PACKETBUF_ATTR_MAX_MAC_REXMIT to PACKETBUF_ATTR_MAX_MAC_TRANSMISSIONS where value 0 (attribute not set) means that default number of transmissions should be used.
2010-03-26 12:29:29 +00:00
adamdunkels
17f6b3a324 Simplified the structure of the code 2010-03-09 20:38:55 +00:00
adamdunkels
edda6dd86c Minor bugfix: don't subtract collisions and deferrals from the number of transmissions 2010-03-09 13:23:58 +00:00
adamdunkels
2c3d3e3d73 Bugfix: handle deferred transmissions correctly (don't count them) 2010-03-09 13:20:08 +00:00
nvt-se
96eb20d235 forward arguments even if REXMIT is not set 2010-03-04 14:17:43 +00:00
adamdunkels
74da90a06b Don't count collisions as transmissions 2010-02-28 10:07:17 +00:00
adamdunkels
b6b4941871 Made the number of MAC-layer retransmissions configurable on a per-packet basis, via a packet attribute 2010-02-28 08:35:16 +00:00
nifi
1cfcc8a73a Removed the combined name of CSMA and NETSTACK_RDC. The name of NETSTACK_RDC can be accessed separately if needed. 2010-02-23 20:42:45 +00:00
adamdunkels
0ab2ba433f Bugfix: the wrong callback pointer was passed to higher layers. 2010-02-23 18:49:45 +00:00
adamdunkels
e34eb54960 A work-in-progress rework of the Contiki MAC and radio layers. The
main ideas are:

* Separates the Contiki low-layer network stack into four layers:
  network (e.g. sicslowpan / rime), Medium Access Control MAC
  (e.g. CSMA), Radio Duty Cycling RDC (e.g. ContikiMAC, X-MAC), and
  radio (e.g. cc2420).
* Introduces a new way to configure the network stack. Four #defines
  that specify what mechanism/protocol/driver to use at the four
  layers: NETSTACK_CONF_NETWORK, NETSTACK_CONF_MAC, NETSTACK_CONF_RDC,
  NETSTACK_CONF_RADIO.
* Adds a callback mechanism to inform the MAC and network layers about
  the fate of a transmitted packet: if the packet was not possible to
  transmit, the cause of the failure is reported, and if the packets
  was successfully transmitted, the number of tries before it was
  finally transmitted is reported.
* NULL-protocols at both the MAC and RDC layers: nullmac and nullrdc,
  which can be used when MAC and RDC functionality is not needed.
* Extends the radio API with three new functions that enable more
  efficient radio duty cycling protocols: channel check, pending
  packet, and receiving packet.
* New initialization mechanism, which takes advantage of the NETSTACK
  #defines.
2010-02-18 21:48:39 +00:00
adamdunkels
e419eb3cc5 Retransmit packet if it didn't receive a MAC layer ack 2010-02-03 01:17:54 +00:00
adamdunkels
fcf60e9260 Removed the csma_init declaration in the mac_driver struct since it isn't needed and it breaks sdcc 2010-02-02 20:45:58 +00:00
adamdunkels
e4168db633 Bugfix: deallocate queuebuf only if there was no collision 2010-01-31 13:55:36 +00:00
adamdunkels
8430dab039 Typecast to fix nightly build problem 2010-01-27 07:36:31 +00:00
adamdunkels
4f3e8d565c Added a simple CSMA (Carrier Sense Multiple Access) mechanism that
works on top of an underlying duty cycling mechanism. The CSMA layer
retransmits packets that could not be sent because of a collision was
detected.
2010-01-25 11:46:44 +00:00