Contiki 3.x
contiki-default-conf.h
1 /*
2  * Copyright (c) 2012, Thingsquare, http://www.thingsquare.com/.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the copyright holder nor the names of its
14  * contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28  * OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  */
31 
32 #ifndef CONTIKI_DEFAULT_CONF_H
33 #define CONTIKI_DEFAULT_CONF_H
34 
35 /*---------------------------------------------------------------------------*/
36 /* Netstack configuration
37  *
38  * The netstack configuration is typically overridden by the platform
39  * configuration, as defined in contiki-conf.h
40  */
41 
42 /* NETSTACK_CONF_RADIO specifies the radio driver. The radio driver
43  typically depends on the radio used on the target hardware. */
44 #ifndef NETSTACK_CONF_RADIO
45 #define NETSTACK_CONF_RADIO nullradio_driver
46 /* #define NETSTACK_CONF_RADIO cc2420_driver */
47 #endif /* NETSTACK_CONF_RADIO */
48 
49 /* NETSTACK_CONF_FRAMER specifies the over-the-air frame format used
50  by Contiki radio packets. For IEEE 802.15.4 radios, use the
51  framer_802154 driver. */
52 #ifndef NETSTACK_CONF_FRAMER
53 #define NETSTACK_CONF_FRAMER framer_nullmac
54 /* #define NETSTACK_CONF_FRAMER framer_802154 */
55 #endif /* NETSTACK_CONF_FRAMER */
56 
57 /* NETSTACK_CONF_RDC specifies the Radio Duty Cycling (RDC) layer. The
58  nullrdc_driver never turns the radio off and is compatible with all
59  radios, but consumes a lot of power. The contikimac_driver is
60  highly power-efficent and allows sleepy routers, but is not
61  compatible with all radios. */
62 #ifndef NETSTACK_CONF_RDC
63 #define NETSTACK_CONF_RDC nullrdc_driver
64 /* #define NETSTACK_CONF_RDC contikimac_driver */
65 #endif /* NETSTACK_CONF_RDC */
66 
67 /* NETSTACK_CONF_MAC specifies the Medium Access Control (MAC)
68  layer. The nullmac_driver does not provide any MAC
69  functionality. The csma_driver is the default CSMA MAC layer, but
70  is not compatible with all radios. */
71 #ifndef NETSTACK_CONF_MAC
72 #define NETSTACK_CONF_MAC nullmac_driver
73 /* #define NETSTACK_CONF_MAC csma_driver */
74 #endif /* NETSTACK_CONF_MAC */
75 
76 /* NETSTACK_CONF_LLSEC specifies the link layer security driver. */
77 #ifndef NETSTACK_CONF_LLSEC
78 #define NETSTACK_CONF_LLSEC nullsec_driver
79 #endif /* NETSTACK_CONF_LLSEC */
80 
81 /* NETSTACK_CONF_NETWORK specifies the network layer and can be either
82  sicslowpan_driver, for IPv6 networking, or rime_driver, for the
83  custom Rime network stack. */
84 #ifndef NETSTACK_CONF_NETWORK
85 #define NETSTACK_CONF_NETWORK rime_driver
86 /* #define NETSTACK_CONF_NETWORK sicslowpan_driver */
87 #endif /* NETSTACK_CONF_NETWORK */
88 
89 /* NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE specifies the channel check
90  rate of the RDC layer. This defines how often the RDC will wake up
91  and check for radio channel activity. A higher check rate results
92  in higher communication performance at the cost of a higher power
93  consumption. */
94 #ifndef NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE
95 #define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
96 #endif /* NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE */
97 
98 /*---------------------------------------------------------------------------*/
99 /* Packet buffer size options.
100  *
101  * The packet buffer size options can be tweaked on a per-project
102  * basis to reduce memory consumption.
103  */
104 
105 /* QUEUEBUF_CONF_NUM specifies the number of queue buffers. Queue
106  buffers are used throughout the Contiki netstack but the
107  configuration option can be tweaked to save memory. Performance can
108  suffer with a too low number of queue buffers though. */
109 #ifndef QUEUEBUF_CONF_NUM
110 #define QUEUEBUF_CONF_NUM 8
111 #endif /* QUEUEBUF_CONF_NUM */
112 /*---------------------------------------------------------------------------*/
113 /* uIPv6 configuration options.
114  *
115  * Many of the uIPv6 configuration options can be overriden by a
116  * project-specific configuration to save memory.
117  */
118 
119 /* NETSTACK_CONF_WITH_IPV6 specifies whether or not IPv6 should be used. If IPv6
120  is not used, IPv4 is used instead. */
121 #ifndef NETSTACK_CONF_WITH_IPV6
122 #define NETSTACK_CONF_WITH_IPV6 0
123 #endif /* NETSTACK_CONF_WITH_IPV6 */
124 
125 /* UIP_CONF_BUFFER_SIZE specifies how much memory should be reserved
126  for the uIP packet buffer. This sets an upper bound on the largest
127  IP packet that can be received by the system. */
128 #ifndef UIP_CONF_BUFFER_SIZE
129 #define UIP_CONF_BUFFER_SIZE 128
130 #endif /* UIP_CONF_BUFFER_SIZE */
131 
132 /* UIP_CONF_ROUTER specifies if the IPv6 node should be a router or
133  not. By default, all Contiki nodes are routers. */
134 #ifndef UIP_CONF_ROUTER
135 #define UIP_CONF_ROUTER 1
136 #endif /* UIP_CONF_ROUTER */
137 
138 /* UIP_CONF_IPV6_RPL specifies if RPL is to be used for IPv6
139  routing. */
140 #ifndef UIP_CONF_IPV6_RPL
141 #define UIP_CONF_IPV6_RPL 1
142 #endif /* UIP_CONF_IPV6_RPL */
143 
144 /* If RPL is enabled also enable the RPL NBR Policy */
145 #if UIP_CONF_IPV6_RPL
146 #ifndef NBR_TABLE_FIND_REMOVABLE
147 #define NBR_TABLE_FIND_REMOVABLE rpl_nbr_policy_find_removable
148 #endif /* NBR_TABLE_FIND_REMOVABLE */
149 #endif /* UIP_CONF_IPV6_RPL */
150 
151 /* RPL_CONF_MOP specifies the RPL mode of operation that will be
152  * advertised by the RPL root. Possible values: RPL_MOP_NO_DOWNWARD_ROUTES,
153  * RPL_MOP_NON_STORING, RPL_MOP_STORING_NO_MULTICAST, RPL_MOP_STORING_MULTICAST */
154 #ifndef RPL_CONF_MOP
155 #define RPL_CONF_MOP RPL_MOP_STORING_NO_MULTICAST
156 #endif /* RPL_CONF_MOP */
157 
158 /* UIP_CONF_MAX_ROUTES specifies the maximum number of routes that each
159  node will be able to handle. */
160 #ifndef UIP_CONF_MAX_ROUTES
161 #define UIP_CONF_MAX_ROUTES 20
162 #endif /* UIP_CONF_MAX_ROUTES */
163 
164 /* RPL_NS_CONF_LINK_NUM specifies the maximum number of links a RPL root
165  * will maintain in non-storing mode. */
166 #ifndef RPL_NS_CONF_LINK_NUM
167 #define RPL_NS_CONF_LINK_NUM 20
168 #endif /* RPL_NS_CONF_LINK_NUM */
169 
170 /* UIP_CONF_UDP specifies if UDP support should be included or
171  not. Disabling UDP saves memory but breaks a lot of stuff. */
172 #ifndef UIP_CONF_UDP
173 #define UIP_CONF_UDP 1
174 #endif /* UIP_CONF_UDP */
175 
176 /* UIP_CONF_MAX_CONNECTIONS specifies the maximum number of
177  simultaneous TCP connections. */
178 #ifndef UIP_CONF_MAX_CONNECTIONS
179 #define UIP_CONF_MAX_CONNECTIONS 8
180 #endif /* UIP_CONF_MAX_CONNECTIONS */
181 
182 /* UIP_CONF_TCP specifies if TCP support should be included or
183  not. Disabling TCP saves memory. */
184 #ifndef UIP_CONF_TCP
185 #define UIP_CONF_TCP 1
186 #endif /* UIP_CONF_TCP */
187 
188 /* UIP_CONF_MAX_CONNECTIONS specifies the maximum number of
189  simultaneous TCP connections. */
190 #ifndef UIP_CONF_MAX_CONNECTIONS
191 #define UIP_CONF_MAX_CONNECTIONS 8
192 #endif /* UIP_CONF_MAX_CONNECTIONS */
193 
194 
195 /* UIP_CONF_TCP_SPLIT enables a performance optimization hack, where
196  each maximum-sized TCP segment is split into two, to avoid the
197  performance degradation that is caused by delayed ACKs. */
198 #ifndef UIP_CONF_TCP_SPLIT
199 #define UIP_CONF_TCP_SPLIT 0
200 #endif /* UIP_CONF_TCP_SPLIT */
201 
202 /* NBR_TABLE_CONF_MAX_NEIGHBORS specifies the maximum number of neighbors
203  that each node will be able to handle. */
204 #ifndef NBR_TABLE_CONF_MAX_NEIGHBORS
205 #define NBR_TABLE_CONF_MAX_NEIGHBORS 8
206 #endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */
207 
208 /* UIP_CONF_ND6_SEND_RA enables standard IPv6 Router Advertisement.
209  * We enable it by default when IPv6 is used without RPL. */
210 #ifndef UIP_CONF_ND6_SEND_RA
211 #define UIP_CONF_ND6_SEND_RA (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
212 #endif /* UIP_CONF_ND6_SEND_RA */
213 
214 /* UIP_CONF_ND6_SEND_NA enables standard IPv6 Neighbor Discovery Protocol.
215  We enable it by default when IPv6 is used without RPL.
216  With RPL, the neighbor cache (link-local IPv6 <-> MAC address mapping)
217  is fed whenever receiving DIO and DAO messages. This is always sufficient
218  for RPL routing, i.e. to send to the preferred parent or any child.
219  Link-local unicast to other neighbors may, however, not be possible if
220  we never receive any DIO from them. This may happen if the link from the
221  neighbor to us is weak, if DIO transmissions are suppressed (Trickle
222  timer) or if the neighbor chooses not to transmit DIOs because it is
223  a leaf node or for any reason. */
224 #ifndef UIP_CONF_ND6_SEND_NA
225 #define UIP_CONF_ND6_SEND_NA (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
226 #endif /* UIP_CONF_ND6_SEND_NA */
227 
228 /*---------------------------------------------------------------------------*/
229 /* 6lowpan configuration options.
230  *
231  * These options change the behavior of the 6lowpan header compression
232  * code (sicslowpan). They typically depend on the type of radio used
233  * on the target platform, and are therefore platform-specific.
234  */
235 
236 /* SICSLOWPAN_CONF_FRAG specifies if 6lowpan fragmentation should be
237  used or not. Fragmentation is on by default. */
238 #ifndef SICSLOWPAN_CONF_FRAG
239 #define SICSLOWPAN_CONF_FRAG 1
240 #endif /* SICSLOWPAN_CONF_FRAG */
241 
242 /* SICSLOWPAN_CONF_MAC_MAX_PAYLOAD is the maximum available size for
243  frame headers, link layer security-related overhead, as well as
244  6LoWPAN payload. By default, SICSLOWPAN_CONF_MAC_MAX_PAYLOAD is
245  127 bytes (MTU of 802.15.4) - 2 bytes (Footer of 802.15.4). */
246 #ifndef SICSLOWPAN_CONF_MAC_MAX_PAYLOAD
247 #define SICSLOWPAN_CONF_MAC_MAX_PAYLOAD (127 - 2)
248 #endif /* SICSLOWPAN_CONF_MAC_MAX_PAYLOAD */
249 
250 /* SICSLOWPAN_CONF_COMPRESSION_THRESHOLD sets a lower threshold for
251  when packets should not be compressed. This is used by ContikiMAC,
252  which requires packets to be larger than a given minimum size. */
253 #ifndef SICSLOWPAN_CONF_COMPRESSION_THRESHOLD
254 #define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 0
255 /* #define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63 */
256 #endif /* SICSLOWPAN_CONF_COMPRESSION_THRESHOLD */
257 
258 /* SICSLOWPAN_CONF_COMPRESSION specifies what 6lowpan compression
259  mechanism to be used. 6lowpan hc06 is the default in Contiki. */
260 #ifndef SICSLOWPAN_CONF_COMPRESSION
261 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
262 #endif /* SICSLOWPAN_CONF_COMPRESSION */
263 
264 /*---------------------------------------------------------------------------*/
265 /* ContikiMAC configuration options.
266  *
267  * These are typically configured on a per-platform basis.
268  */
269 
270 /* CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION specifies if ContikiMAC
271  should optimize for the phase of neighbors. The phase optimization
272  may reduce power consumption but is not compatible with all timer
273  settings and is therefore off by default. */
274 #ifndef CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION
275 #define CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION 0
276 #endif /* CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION */
277 
278 
279 #endif /* CONTIKI_DEFAULT_CONF_H */