Commit graph

145 commits

Author SHA1 Message Date
adamdunkels 9be1a65211 Don't set the RELIABLE flag on incoming packets with the ack requested flag set, since it is set on most packets even if they aren't reliable 2010-03-16 18:11:58 +00:00
adamdunkels b1feac5a00 Bugfixes in low-power streaming mode, and re-added support for announcements. These now use the low-power streaming mode so that active listening for announcments have a radio duty cycle of 16% rather than 100% 2010-03-16 18:11:13 +00:00
adamdunkels 7bab9316da Two major changes:
* Low-power streaming. Experimental support for a low-power mode which
  allows rapid exchange of packets with a 16% duty cycle. Does not
  seem to function correctly yet though.

* Phase locking. When the phase of a neighbor has been detected, the
  sender assumes that the neighbor will keeps it phase and does not
  send more strobes than necessary to hit the receiver's channel
  check - even if the receiver does not acknowledge the reception of
  the strobes when it should have been awake. Instead, the sender
  stops strobing and tries again at a later time.
2010-03-14 22:59:23 +00:00
oliverschmidt def540e6c0 Avoid newlines in macro expansions as cc65 doesn't support them between the macro name and the open parenthesis of the arguments.
There were btw other even longer lines with expansions of the same macro already present.
2010-03-14 12:13:54 +00:00
nifi 2cf0fb9cce Changed to use short address mode with short rime addresses 2010-03-12 14:49:21 +00:00
adamdunkels 4b60301727 Don't set the ack flag for broadcast packets 2010-03-09 20:40:11 +00:00
adamdunkels 17f6b3a324 Simplified the structure of the code 2010-03-09 20:38:55 +00:00
adamdunkels d0e6436a20 Don't call up the netstack if the transmission was deferred 2010-03-09 20:37:02 +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
adamdunkels 79722b4247 Rework of the timing conditions of ContikiMAC: the old timing did not work well on real hardware, the new one seems to work better 2010-03-09 13:19:05 +00:00
nvt-se 96eb20d235 forward arguments even if REXMIT is not set 2010-03-04 14:17:43 +00:00
nifi 5e43a6998b Replaced old framer (framer_get/framer_set) with new NETSTACK style configuration. Added nullrdc-framer that is a nullrdc with framer support. 2010-03-01 13:30:21 +00:00
nifi 0c084b8c68 added random init of sequence number 2010-03-01 13:17:01 +00:00
adamdunkels 410d860a93 Improved handling of neighbor phase estimation: instead of busy-waiting while waiting for neighbor's phase, the new code schedules a timer just before neighbor wakes up 2010-02-28 20:19:47 +00:00
adamdunkels e6fceb7200 Added MAC-layer return value to indicate that a packet transmission was deferred 2010-02-28 20:18:30 +00:00
adamdunkels e06acc4525 Prod the watchdog if waiting for along time 2010-02-28 14:15:16 +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
adamdunkels ed88f487c8 Improved detection of link-layer ACKs; increased the time ContikiMAC waits when it has detected a link-layer ACK; increased the number of silence periods required to detect a CCA false positive 2010-02-28 08:33:21 +00:00
nifi b50d47fb80 added missing function in sicslowmac_driver 2010-02-23 22:45:11 +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
nifi c20047f657 Changed the network stack to use different structures for the different layers (network_driver, mac_driver, rdc_driver, radio_driver). This helps to avoid incorrect configuration. 2010-02-23 20:09:11 +00:00
adamdunkels bb62749de7 Made debug printfs optional 2010-02-23 18:49:58 +00:00
adamdunkels 0ab2ba433f Bugfix: the wrong callback pointer was passed to higher layers. 2010-02-23 18:49:45 +00:00
adamdunkels ed52586e18 Rework of parts of the ContikiMAC code based on input from experimental results. When channel check is triggered because of a false positive, the new version checks the radio several times to make sure that there really is an incoming packet. Otherwise, the radio is switched off. Cleaned up and removed old unused code. Added a few temporary debugging mechanisms and functions. 2010-02-23 18:49:05 +00:00
adamdunkels 0b2b7bcdba Removed inadvertedly left-over include file 2010-02-18 23:52:34 +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 f8c804e28b ntikiMAC: a new radio duty cycling mechanism that uses a combination
of link-layer and MAC-layer mechanisms to achieve a very low power
consumption: during idle listening the radio is switched off between
99.2% and 99.6% of the time. One unicast transmission typically adds
between 0.07% and 1.2% additional radio time, depending on packet
size.

ContikiMAC uses the standard IEEE 802.15.4 message format and adds no
additional headers.

ContikiMAC is simple: it uses periodic two-shot channel sampling
during idle listening to keep the radio on-time down. Transmissions
are done with repeated transmissions until a link-layer ACK is
received.
2010-02-18 21:26:15 +00:00
adamdunkels f5c48751b5 Reworked 802.15.4 header creation and parsing so that it works regardless of the size of the rimeaddr_t typedef 2010-02-18 21:00:28 +00:00
adamdunkels 2fbf21b2b3 Refactored the phase optimization functionality into a separate module 2010-02-18 20:58:59 +00:00
adamdunkels 75e1c0c8c7 Include contiki-conf.h to let the MAC channel check rate be configurable 2010-02-03 16:45:12 +00:00
adamdunkels 06d17c7e1c Remove unused rtimer code 2010-02-03 16:44:43 +00:00
adamdunkels e419eb3cc5 Retransmit packet if it didn't receive a MAC layer ack 2010-02-03 01:17:54 +00:00
adamdunkels d68af249ec Added a MAC layer return value that informs the caller that a packet did not receive a MAC layer acknowledgement 2010-02-03 01:17:32 +00:00
adamdunkels 181213124b Added a configuration option for setting the MAC channel check rate (which must be a power of two). The configuration is independent of the MAC protocol. 2010-02-02 23:28:58 +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 cc2be0f111 Remove compiler warnings 2010-02-02 16:33:07 +00:00
adamdunkels 1a13d25d33 Revised version of the X-MAC implementation that uses a ctimer instead
of an rtimer for the periodic radio duty cycling. The benefit of this
implementation is that it leaves an rtimer free for user tasks. The
drawback is a slightly higher idle power consumption. This new version
is based on the current rtimer-based X-MAC.
2010-01-31 18:44:23 +00:00
adamdunkels e4168db633 Bugfix: deallocate queuebuf only if there was no collision 2010-01-31 13:55:36 +00:00
adamdunkels 2ae7ed827c Increase the default X-MAC channel check rate to 4 Hz instead of 2 Hz 2010-01-28 13:40:47 +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
adamdunkels 7ad93e5d18 Added a field to the struct mac interface:
channel_check_interval(). This function returns the interval by which
the duty cycling mechanism checks the radio channel for activity. It
is used by higher layer mechanisms to determine suitable timeouts for
retransmissions.
2010-01-25 11:43:32 +00:00
adamdunkels 743e93e650 Do not remove encounters - there is no need to, as they are only an optimization 2010-01-14 20:14:03 +00:00
adamdunkels 2f105e933a Variable xmac_is_on was used both in interrupt and non-interrupt contexts and needs to be volatile 2009-12-06 23:29:38 +00:00
adamdunkels 53457eb1f0 Fixed compilation warning 2009-12-06 17:10:54 +00:00
adamdunkels 8bcc838d8a Bugfix: don't set the 'we are sending' flag until we are actually sending 2009-12-06 17:05:45 +00:00
adamdunkels 6897270289 Bugfix to the Contiki LPP encounter timing code: encounters are now
properly timed.
2009-12-06 13:18:32 +00:00
adamdunkels 822149f943 Significant improvements to the Contiki X-MAC:
* the code is simplified, particularly the duty cycling logic
* old unused code has been removed
* Contiki X-MAC now listens before sending a strobe to avoid MAC-level
  collisions
* broadcasts are sent directly, without strobes, reducing the power
  consumption of receivers
* turn off radio for 1 ms between sending a strobe and expecting the
  strobe ack
2009-12-06 13:16:59 +00:00