Commit graph

1153 commits

Author SHA1 Message Date
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 515a391ee4 Removed left-over debug printfs 2010-02-15 23:31:05 +00:00
dak664 bb9afb4fb1 Remove compiler warning 2010-02-15 20:49:38 +00:00
adamdunkels 4bb0375251 Buffer name definition bugfix 2010-02-15 19:23:54 +00:00
adamdunkels 9bb149ca13 Bugfix by Raimondas Sasnauskas: TCP SYN duplicate receptions in the SYN_RCVD state was not correctly handled 2010-02-15 18:03:07 +00:00
adamdunkels d67d1f7340 Major bugfix, found by Raimondas Sasnauskas: the TCP periodic timer was not started when a new connection request arrived. If there were no other active TCP connections, this means that the SYNACK would never be retransmitted, potentially leading to a forever stale TCP connection. 2010-02-09 12:58:53 +00:00
adamdunkels 4a522c96dd Added debugging statements for packet drops 2010-02-08 21:59:49 +00:00
adamdunkels 2b6a651233 Added missing include, made debug statement more explicit 2010-02-08 21:59:21 +00:00
adamdunkels 2eba08e8f6 Made queuebuf statistics configurable, and off by default 2010-02-08 21:10:32 +00:00
nvt-se f4d19560fc Fixed a performance problem by not allowing GC while doing merges of files and micro logs. 2010-02-08 14:08:14 +00:00
oliverschmidt c284092a53 - Set cursor in ctk_draw_init() to top left corner as it is called for re-initialization on Contiki exit. 2010-02-07 21:43:03 +00:00
oliverschmidt 1d1f3a23af - No need for textcolor() before cclear().
- Set textcolor() in ctk_draw_init() to some reasonable value as it is called for re-initialization on Contiki exit.
2010-02-07 21:38:01 +00:00
adamdunkels b98f7d891f Bugfix: added missing queuebuf allocation 2010-02-06 20:50:24 +00:00
adamdunkels 671216c558 No need to clear the headers now that we explicitly save a queuebuf when sending fragments 2010-02-06 17:07:43 +00:00
adamdunkels b6647b5630 Turns out that with cxmac, clearing the header after sending a packet is not enough to make fragmentation work. Instead, we allocate a queuebuf and restore the packet after from the queuebuf after sending it. 2010-02-06 09:42:49 +00:00
adamdunkels 494e692d0b Bugfix: clear the header after sending a packet solves a problem with fragmentation; also prod the watchdog since fragment transmissions can take a long time with some low-power MAC protocol 2010-02-06 07:49:58 +00:00
adamdunkels a68b4c40c4 Added a function to clear only the header part of the packetbuf 2010-02-06 07:48:52 +00:00
oliverschmidt e88d209214 Adjusted process name to title case. 2010-02-05 19:13:05 +00:00
nifi a1199721a6 Changed to use separate Contiki event type for ICMP6 notifications 2010-02-05 12:43:36 +00:00
oliverschmidt 5e66abda50 Initialize lastport in all cases it is defined. 2010-02-04 21:33:51 +00:00
adamdunkels d8b0625e21 Bugfix: lastport must be defines both when UIP_ACTIVE_OPEN or UIP_UDP are defined (thanks Oliver!) 2010-02-04 21:14:45 +00:00
adamdunkels 7bcb106fa9 Disable the stream mode for TCP packets since it does not seem to work reliably with cxmac 2010-02-04 18:57:33 +00:00
adamdunkels 13f6673d04 Bugfix: drop incoming TCP and UDP packets where port numbers are zero 2010-02-04 11:17:42 +00:00
adamdunkels d7b7b05d0e Moved the neigbor_init() call to the collect module, since it is the only one that currently uses it 2010-02-03 20:38:33 +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 4bffd277f5 Don't set the stream bit on outgoing TCP packets for now - it doesn't seem to play well with IPv6 and X-MAC 2010-02-03 16:44:19 +00:00
adamdunkels 36db5eb70b Added debug printout 2010-02-03 01:18:24 +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 4bc4f033e8 Increase the trickle resend interval for router advertisements 2010-02-03 01:13:17 +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 f66cd6d44e Increased the forwarding queue to six packets to improve collection robustness 2010-02-02 21:44:05 +00:00
adamdunkels e21c1a39d3 Removed unused code; a number of fixed by Anthony Asterisk 2010-02-02 21:13:27 +00:00
adamdunkels 901a128e7f Reconfigured the timeouts to work better on top of a power-cycling radio mechanism 2010-02-02 21:12:29 +00:00
adamdunkels 28052c655f Removed exit() calls that were unadvertedtly left in from testing 2010-02-02 21:10:38 +00:00
adamdunkels 0db31db624 Moved declarations to the start of each function 2010-02-02 21:09:06 +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 88c661b0c2 Rewrote the netif time code so that is avoids the use of floating point numbers; some code style fixes 2010-02-02 16:32:03 +00:00
oliverschmidt 3f142f0718 Convert '@' correctly from PETSCII to ASCII - by leaving it alone. 2010-01-31 23:46:19 +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
oliverschmidt 9e809ef5a4 Provide optional prototypes for all three keyboard input related functions. 2010-01-31 12:48:46 +00:00
adamdunkels 4938df5c05 Update to Contiki version number 2.4 2010-01-29 18:03:55 +00:00
adamdunkels 388c5d4244 Made the sicslowpan MAC layer reachable from outside modules 2010-01-28 13:50:51 +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