]> granicus.if.org Git - esp-idf/blob - components/lwip/Kconfig
mesh: bugfix and add two APIs
[esp-idf] / components / lwip / Kconfig
1 menu "LWIP"
2
3 config L2_TO_L3_COPY
4     bool "Enable copy between Layer2 and Layer3 packets"
5     default n
6     help
7         If this feature is enabled, all traffic from layer2(WIFI Driver) will be
8         copied to a new buffer before sending it to layer3(LWIP stack), freeing
9         the layer2 buffer.
10         Please be notified that the total layer2 receiving buffer is fixed and 
11         ESP32 currently supports 25 layer2 receiving buffer, when layer2 buffer 
12         runs out of memory, then the incoming packets will be dropped in hardware. 
13         The layer3 buffer is allocated from the heap, so the total layer3 receiving
14         buffer depends on the available heap size, when heap runs out of memory,  
15         no copy will be sent to layer3 and packet will be dropped in layer2. 
16         Please make sure you fully understand the impact of this feature before 
17         enabling it.
18
19 config LWIP_IRAM_OPTIMIZATION
20     bool "Enable LWIP IRAM optimization"
21     default n
22     help
23         If this feature is enabled, some functions relating to RX/TX in LWIP will be
24         put into IRAM, it can improve UDP/TCP throughput by >10% for single core mode,
25         it doesn't help too much for dual core mode. On the other hand, it needs about
26         10KB IRAM for these optimizations.
27
28         If this feature is disabled, all lwip functions will be put into FLASH.
29
30 config LWIP_MAX_SOCKETS
31     int "Max number of open sockets"
32     range 1 16
33     default 10
34     help
35         Sockets take up a certain amount of memory, and allowing fewer
36         sockets to be open at the same time conserves memory. Specify
37         the maximum amount of sockets here. The valid value is from 1
38         to 16.
39
40 config USE_ONLY_LWIP_SELECT
41     bool "Support LWIP socket select() only"
42     default n
43     help
44         The virtual filesystem layer of select() redirects sockets to
45         lwip_select() and non-socket file descriptors to their respective driver
46         implementations. If this option is enabled then all calls of select()
47         will be redirected to lwip_select(), therefore, select can be used
48         for sockets only.
49
50 config LWIP_SO_REUSE
51     bool "Enable SO_REUSEADDR option"
52     default y
53     help
54         Enabling this option allows binding to a port which remains in
55         TIME_WAIT.
56
57 config LWIP_SO_REUSE_RXTOALL
58     bool "SO_REUSEADDR copies broadcast/multicast to all matches"
59     depends on LWIP_SO_REUSE
60     default y
61     help
62         Enabling this option means that any incoming broadcast or multicast
63         packet will be copied to all of the local sockets that it matches
64         (may be more than one if SO_REUSEADDR is set on the socket.)
65
66         This increases memory overhead as the packets need to be copied,
67         however they are only copied per matching socket. You can safely
68         disable it if you don't plan to receive broadcast or multicast
69         traffic on more than one socket at a time.
70
71 config LWIP_SO_RCVBUF
72     bool "Enable SO_RCVBUF option"
73     default n
74     help
75         Enabling this option allows checking for available data on a netconn.
76
77 config LWIP_DHCP_MAX_NTP_SERVERS
78     int "Maximum number of NTP servers"
79     default 1
80     range 1 16
81     help
82         Set maximum number of NTP servers used by LwIP SNTP module.
83         First argument of sntp_setserver/sntp_setservername functions
84         is limited to this value.
85
86 config LWIP_IP_FRAG
87     bool "Enable fragment outgoing IP packets"
88     default n
89     help
90         Enabling this option allows fragmenting outgoing IP packets if their size
91         exceeds MTU.
92
93 config LWIP_IP_REASSEMBLY
94     bool "Enable reassembly incoming fragmented IP packets"
95     default n
96     help
97         Enabling this option allows reassemblying incoming fragmented IP packets.
98
99 config LWIP_STATS
100     bool "Enable LWIP statistics"
101     default n
102     help
103         Enabling this option allows LWIP statistics
104
105 config LWIP_ETHARP_TRUST_IP_MAC
106     bool "Enable LWIP ARP trust"
107     default n
108     help
109         Enabling this option allows ARP table to be updated.
110
111         If this option is enabled, the incoming IP packets cause the ARP table to be
112         updated with the source MAC and IP addresses supplied in the packet.
113         You may want to disable this if you do not trust LAN peers to have the
114         correct addresses, or as a limited approach to attempt to handle
115         spoofing. If disabled, lwIP will need to make a new ARP request if
116         the peer is not already in the ARP table, adding a little latency.
117         The peer *is* in the ARP table if it requested our address before.
118         Also notice that this slows down input processing of every IP packet!
119
120         There are two known issues in real application if this feature is enabled:
121          - The LAN peer may have bug to update the ARP table after the ARP entry is aged out.
122            If the ARP entry on the LAN peer is aged out but failed to be updated, all IP packets
123            sent from LWIP to the LAN peer will be dropped by LAN peer.
124          - The LAN peer may not be trustful, the LAN peer may send IP packets to LWIP with 
125            two different MACs, but the same IP address. If this happens, the LWIP has problem
126            to receive IP packets from LAN peer.
127
128         So the recommendation is to disable this option. 
129         Here the LAN peer means the other side to which the ESP station or soft-AP is connected.
130
131 config TCPIP_RECVMBOX_SIZE
132     int "TCPIP task receive mail box size"
133     default 32
134     range 6 64
135     help
136         Set TCPIP task receive mail box size. Generally bigger value means higher throughput
137         but more memory. The value should be bigger than UDP/TCP mail box size.
138
139 config LWIP_DHCP_DOES_ARP_CHECK
140     bool "DHCP: Perform ARP check on any offered address"
141     default y
142     help
143         Enabling this option performs a check (via ARP request) if the offered IP address
144         is not already in use by another host on the network.
145
146 menu "DHCP server"
147
148 config LWIP_DHCPS_LEASE_UNIT
149     int "Multiplier for lease time, in seconds"
150     range 1 3600
151     default 60
152     help
153         The DHCP server is calculating lease time multiplying the sent 
154         and received times by this number of seconds per unit. 
155         The default is 60, that equals one minute.
156
157 config LWIP_DHCPS_MAX_STATION_NUM
158     int "Maximum number of stations"
159     range 1 64
160     default 8
161     help
162         The maximum number of DHCP clients that are connected to the server.
163         After this number is exceeded, DHCP server removes of the oldest device
164         from it's address pool, without notification.
165
166 endmenu # DHCPS
167
168 menuconfig LWIP_AUTOIP
169     bool "Enable IPV4 Link-Local Addressing (AUTOIP)"
170     default n
171     help
172         Enabling this option allows the device to self-assign an address
173         in the 169.256/16 range if none is assigned statically or via DHCP.
174
175         See RFC 3927.
176
177 config LWIP_AUTOIP_TRIES
178     int "DHCP Probes before self-assigning IPv4 LL address"
179     range 1 100
180     default 2
181     depends on LWIP_AUTOIP
182     help
183         DHCP client will send this many probes before self-assigning a
184         link local address.
185
186         From LWIP help: "This can be set as low as 1 to get an AutoIP
187         address very quickly, but you should be prepared to handle a
188         changing IP address when DHCP overrides AutoIP." (In the case of
189         ESP-IDF, this means multiple SYSTEM_EVENT_STA_GOT_IP events.)
190
191 config LWIP_AUTOIP_MAX_CONFLICTS
192     int "Max IP conflicts before rate limiting"
193     range 1 100
194     default 9
195     depends on LWIP_AUTOIP
196     help
197         If the AUTOIP functionality detects this many IP conflicts while
198         self-assigning an address, it will go into a rate limited mode.
199
200 config LWIP_AUTOIP_RATE_LIMIT_INTERVAL
201     int "Rate limited interval (seconds)"
202     range 5 120
203     default 20
204     depends on LWIP_AUTOIP
205     help
206         If rate limiting self-assignment requests, wait this long between
207         each request.
208
209 menuconfig LWIP_NETIF_LOOPBACK
210     bool "Support per-interface loopback"
211     default y
212     help
213         Enabling this option means that if a packet is sent with a destination
214         address equal to the interface's own IP address, it will "loop back" and
215         be received by this interface.
216
217 config LWIP_LOOPBACK_MAX_PBUFS
218     int "Max queued loopback packets per interface"
219     range 0 16
220     default 8
221     depends on LWIP_NETIF_LOOPBACK
222     help
223          Configure the maximum number of packets which can be queued for
224          loopback on a given interface. Reducing this number may cause packets
225          to be dropped, but will avoid filling memory with queued packet data.
226
227 menu "TCP"
228
229 config LWIP_MAX_ACTIVE_TCP
230     int "Maximum active TCP Connections"
231     range 1 1024
232     default 16
233     help
234         The maximum number of simultaneously active TCP
235         connections. The practical maximum limit is
236         determined by available heap memory at runtime.
237
238         Changing this value by itself does not substantially
239         change the memory usage of LWIP, except for preventing
240         new TCP connections after the limit is reached.
241
242 config LWIP_MAX_LISTENING_TCP
243     int "Maximum listening TCP Connections"
244     range 1 1024
245     default 16
246     help
247         The maximum number of simultaneously listening TCP
248         connections. The practical maximum limit is
249         determined by available heap memory at runtime.
250
251         Changing this value by itself does not substantially
252         change the memory usage of LWIP, except for preventing
253         new listening TCP connections after the limit is reached.
254
255
256 config TCP_MAXRTX
257     int "Maximum number of retransmissions of data segments"
258     default 12
259     range 3 12
260     help
261         Set maximum number of retransmissions of data segments.
262
263 config TCP_SYNMAXRTX
264     int "Maximum number of retransmissions of SYN segments"
265     default 6
266     range 3 12
267     help
268         Set maximum number of retransmissions of SYN segments.
269
270 config TCP_MSS
271     int "Maximum Segment Size (MSS)"
272     default 1436
273     range 1220 1436
274     help
275         Set maximum segment size for TCP transmission.
276
277         Can be set lower to save RAM, the default value 1436 will give best throughput.
278
279 config TCP_MSL
280     int "Maximum segment lifetime (MSL)"
281     default 60000
282     help
283         Set maximum segment lifetime in in milliseconds.
284
285 config TCP_SND_BUF_DEFAULT
286     int "Default send buffer size"
287     default 5744  # 4 * default MSS
288     range 2440 65535
289     help
290         Set default send buffer size for new TCP sockets.
291
292         Per-socket send buffer size can be changed at runtime
293         with lwip_setsockopt(s, TCP_SNDBUF, ...).
294
295         This value must be at least 2x the MSS size, and the default
296         is 4x the default MSS size.
297
298         Setting a smaller default SNDBUF size can save some RAM, but
299         will decrease performance.
300
301 config TCP_WND_DEFAULT
302     int "Default receive window size"
303     default 5744 # 4 * default MSS
304     range 2440 65535
305     help
306         Set default TCP receive window size for new TCP sockets.
307
308         Per-socket receive window size can be changed at runtime
309         with lwip_setsockopt(s, TCP_WINDOW, ...).
310
311         Setting a smaller default receive window size can save some RAM,
312         but will significantly decrease performance.
313
314 config TCP_RECVMBOX_SIZE
315     int "Default TCP receive mail box size"
316     default 6
317     range 6 64
318     help
319         Set TCP receive mail box size. Generally bigger value means higher throughput
320         but more memory. The recommended value is: TCP_WND_DEFAULT/TCP_MSS + 2, e.g. if 
321         TCP_WND_DEFAULT=14360, TCP_MSS=1436, then the recommended receive mail box size is 
322         (14360/1436 + 2) = 12.
323
324         TCP receive mail box is a per socket mail box, when the application receives packets
325         from TCP socket, LWIP core firstly posts the packets to TCP receive mail box and the 
326         application then fetches the packets from mail box. It means LWIP can caches maximum 
327         TCP_RECCVMBOX_SIZE packets for each TCP socket, so the maximum possible cached TCP packets
328         for all TCP sockets is TCP_RECCVMBOX_SIZE multiples the maximum TCP socket number. In other
329         words, the bigger TCP_RECVMBOX_SIZE means more memory.
330         On the other hand, if the receiv mail box is too small, the mail box may be full. If the 
331         mail box is full, the LWIP drops the packets. So generally we need to make sure the TCP
332         receive mail box is big enough to avoid packet drop between LWIP core and application.
333
334 config TCP_QUEUE_OOSEQ
335     bool "Queue incoming out-of-order segments"
336     default y
337     help
338         Queue incoming out-of-order segments for later use.
339
340         Disable this option to save some RAM during TCP sessions, at the expense
341         of increased retransmissions if segments arrive out of order.
342
343 config ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES
344     bool "Keep TCP connections when IP changed"
345     default n
346     help
347         This option is enabled when the following scenario happen:
348         network dropped and reconnected, IP changes is like: 192.168.0.2->0.0.0.0->192.168.0.2
349         
350         Disable this option to keep consistent with the original LWIP code behavior.
351
352
353 choice TCP_OVERSIZE
354     prompt "Pre-allocate transmit PBUF size"
355     default TCP_OVERSIZE_MSS
356     help
357         Allows enabling "oversize" allocation of TCP transmission pbufs ahead of time,
358         which can reduce the length of pbuf chains used for transmission.
359
360         This will not make a difference to sockets where Nagle's algorithm
361         is disabled.
362
363         Default value of MSS is fine for most applications, 25% MSS may save
364         some RAM when only transmitting small amounts of data. Disabled will
365         have worst performance and fragmentation characteristics, but uses
366         least RAM overall.
367
368 config TCP_OVERSIZE_MSS
369      bool "MSS"
370 config TCP_OVERSIZE_QUARTER_MSS
371      bool "25% MSS"
372 config TCP_OVERSIZE_DISABLE
373      bool "Disabled"
374
375 endchoice
376
377 endmenu # TCP
378
379 menu "UDP"
380
381 config LWIP_MAX_UDP_PCBS
382     int "Maximum active UDP control blocks"
383     range 1 1024
384     default 16
385     help
386         The maximum number of active UDP "connections" (ie
387         UDP sockets sending/receiving data).
388         The practical maximum limit is determined by available
389         heap memory at runtime.
390
391 config UDP_RECVMBOX_SIZE
392     int "Default UDP receive mail box size"
393     default 6
394     range 6 64
395     help
396         Set UDP receive mail box size. The recommended value is 6.
397
398         UDP receive mail box is a per socket mail box, when the application receives packets 
399         from UDP socket, LWIP core firstly posts the packets to UDP receive mail box and the
400         application then fetches the packets from mail box. It means LWIP can caches maximum
401         UDP_RECCVMBOX_SIZE packets for each UDP socket, so the maximum possible cached UDP packets 
402         for all UDP sockets is UDP_RECCVMBOX_SIZE multiples the maximum UDP socket number. In other
403         words, the bigger UDP_RECVMBOX_SIZE means more memory.
404         On the other hand, if the receiv mail box is too small, the mail box may be full. If the
405         mail box is full, the LWIP drops the packets. So generally we need to make sure the UDP
406         receive mail box is big enough to avoid packet drop between LWIP core and application.
407
408 endmenu # UDP
409
410 config TCPIP_TASK_STACK_SIZE
411     int "TCP/IP Task Stack Size"
412     default 2048
413     # for high log levels, tcpip_adapter API calls can end up
414     # a few calls deep and logging there can trigger a stack overflow
415     range 2048 65536 if LOG_DEFAULT_LEVEL < 4
416     range 2560 65536 if LOG_DEFAULT_LEVEL >= 4
417     help
418        Configure TCP/IP task stack size, used by LWIP to process multi-threaded TCP/IP operations.
419        Setting this stack too small will result in stack overflow crashes.
420
421 menuconfig PPP_SUPPORT
422     bool "Enable PPP support (new/experimental)"
423     default n
424     help
425         Enable PPP stack. Now only PPP over serial is possible.
426
427         PPP over serial support is experimental and unsupported.
428
429 config PPP_PAP_SUPPORT
430    bool "Enable PAP support"
431    depends on PPP_SUPPORT
432    default n
433    help
434        Enable Password Authentication Protocol (PAP) support
435
436 config PPP_CHAP_SUPPORT
437    bool "Enable CHAP support"
438    depends on PPP_SUPPORT
439    default n
440    help
441        Enable Challenge Handshake Authentication Protocol (CHAP) support
442
443 config PPP_MSCHAP_SUPPORT
444    bool "Enable MSCHAP support"
445    depends on PPP_SUPPORT
446    default n
447    help
448        Enable Microsoft version of the Challenge-Handshake Authentication Protocol (MSCHAP) support
449
450 config PPP_MPPE_SUPPORT
451    bool "Enable MPPE support"
452    depends on PPP_SUPPORT
453    default n
454    help
455        Enable Microsoft Point-to-Point Encryption (MPPE) support
456
457 config PPP_DEBUG_ON
458    bool "Enable PPP debug log output"
459    depends on PPP_SUPPORT
460    default n
461    help
462        Enable PPP debug log output
463
464 menu "ICMP"
465
466 config LWIP_MULTICAST_PING
467    bool "Respond to multicast pings"
468    default n
469
470 config LWIP_BROADCAST_PING
471    bool "Respond to broadcast pings"
472    default n
473
474 endmenu # ICMP
475
476 menu "LWIP RAW API"
477
478 config LWIP_MAX_RAW_PCBS
479     int "Maximum LWIP RAW PCBs"
480     range 1 1024
481     default 16
482     help
483         The maximum number of simultaneously active LWIP
484         RAW protocol control blocks. The practical maximum
485         limit is determined by available heap memory at runtime.
486
487 endmenu  # LWIP RAW API
488
489 endmenu