RF24Ethernet - TCP/IP over RF24Network v1.6.17
TMRh20 - Pushing the practical limits of RF24 modules
Loading...
Searching...
No Matches
uIP Configuration

User configuration options

uIP has a number of configuration options that can be overridden for each project. These are kept in a project-specific uip-conf.h file and all configuration names have the prefix UIP_CONF. Some of these options are specific to RF24Ethernet.

#define UIP_CONF_MAX_CONNECTIONS   1
 Maximum number of TCP connections.
 
#define UIP_CONF_MAX_LISTENPORTS   1
 Maximum number of listening TCP ports.
 
#define UIP_CONF_BUFFER_SIZE   MAX_PAYLOAD_SIZE - 2
 uIP buffer size.
 
#define UIP_CONNECTION_TIMEOUT   45000
 Optional: Uncomment to disable
 
#define UIP_CONF_LLH_LEN   0
 SLIP/TUN - 14 for Ethernet/TAP & 0 for TUN/SLIP.
 
#define UIP_CONF_UDP   0
 UDP support on or off (required for DNS)
 

Advanced Operation

For advanced configuration of RF24Ethernet

#define UIP_TIMER_DIVISOR   16
 Adjust the rate at which the IP stack performs periodic processing.
 
#define UIP_CONF_ACTIVE_OPEN   1
 
#define UIP_CONF_UDP_CHECKSUMS   0
 UDP checksums on or off.
 
#define UIP_CONF_EXTERNAL_BUFFER
 uIP User Output buffer size
 
#define OUTPUT_BUFFER_SIZE   UIP_CONF_BUFFER_SIZE - UIP_CONF_LLH_LEN - UIP_TCPIP_HLEN
 
#define UIP_WINDOW_REOPEN_DELAY   3550
 Optional: Used with UIP_CONNECTION_TIMEOUT
 

Detailed Description

User Configuration Options

Macro Definition Documentation

◆ UIP_CONF_MAX_CONNECTIONS

#define UIP_CONF_MAX_CONNECTIONS   1

Maximum number of TCP connections.

Examples
InteractiveServer_Mesh.ino, and SLIP_InteractiveServer.ino.

Definition at line 59 of file uip-conf.h.

◆ UIP_CONF_MAX_LISTENPORTS

#define UIP_CONF_MAX_LISTENPORTS   1

Maximum number of listening TCP ports.

Definition at line 62 of file uip-conf.h.

◆ UIP_CONF_BUFFER_SIZE

#define UIP_CONF_BUFFER_SIZE   MAX_PAYLOAD_SIZE - 2

uIP buffer size.

Note
For simplicity, this is automatically set to the MAX_PAYLOAD_SIZE configured in the RF24Network_conf.h file, but can be configured independently of RF24Network if desired.
Remarks
  1. Nodes can use different buffer sizes, direct TCP communication is limited to the smallest ie: A RPi can be configured to use 1500byte TCP windows, with Arduino nodes using only 120byte TCP windows.
  2. Routing nodes handle traffic at the link-layer, so the MAX_PAYLOAD_SIZE is not important, unless they are running RF24Ethernet.
  3. Nodes running RF24Ethernet generally do not need to support RF24Network user payloads. Edit RF24Network_config.h and uncomment #define DISABLE_USER_PAYLOADS. This will free memory not used with RF24Ethernet.
  4. The user buffers are automatically configured to (Buffer Size - Link Layer Header Size - TCP Header Size) so using RF24Mesh will decrease payloads by 14 bytes.
  5. Larger buffer sizes increase throughput for individual nodes, but can impact other network traffic.
  6. Max usable value is 512

Definition at line 82 of file uip-conf.h.

◆ UIP_CONNECTION_TIMEOUT

#define UIP_CONNECTION_TIMEOUT   45000

Optional: Uncomment to disable

Adjust the length of time after which an open connection will be timed out.

If uIP is polling the established connection, but an ack or data is not received for this duration in ms, kill the connection.

Definition at line 90 of file uip-conf.h.

Referenced by RF24Client::connect().

◆ UIP_CONF_LLH_LEN

#define UIP_CONF_LLH_LEN   0

SLIP/TUN - 14 for Ethernet/TAP & 0 for TUN/SLIP.

Ethernet headers add an additional 14 bytes to each payload.

RF24Mesh generally needs to be used if setting this to 0 and using a TUN or SLIP interface

Definition at line 99 of file uip-conf.h.

◆ UIP_CONF_UDP

#define UIP_CONF_UDP   0

UDP support on or off (required for DNS)

Note
DNS support typically requires larger payload sizes (250-300). It seems that DNS servers will typically respond with a single address if requesting an address of www.google.com vs google.com, and this will work with the default payload size

Definition at line 107 of file uip-conf.h.

◆ UIP_TIMER_DIVISOR

#define UIP_TIMER_DIVISOR   16

Adjust the rate at which the IP stack performs periodic processing.

The periodic timer will be called at a rate of 1 second divided by this value

Increase this value to reduce response times and increase throughput during user interactions.

Note
: Increasing this value will increase throughput for individual nodes, but can impact other network traffic.

Definition at line 127 of file uip-conf.h.

◆ UIP_CONF_ACTIVE_OPEN

#define UIP_CONF_ACTIVE_OPEN   1

If operating solely as a server, disable the ability to open TCP connections as a client by setting to 0 Saves memory and program space.

Definition at line 133 of file uip-conf.h.

◆ UIP_CONF_UDP_CHECKSUMS

#define UIP_CONF_UDP_CHECKSUMS   0

UDP checksums on or off.

Definition at line 136 of file uip-conf.h.

◆ UIP_CONF_EXTERNAL_BUFFER

#define UIP_CONF_EXTERNAL_BUFFER

uIP User Output buffer size

The output buffer size determines the max length of strings that can be sent by the user, and depends on the uip buffer size

Must be <= UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN

Note
Must be an odd number or the TCP/IP sequence gets out of order with payloads larger than 511 bytes I think this might be a bug or missing feature of the uip stack

Definition at line 148 of file uip-conf.h.

◆ OUTPUT_BUFFER_SIZE

#define OUTPUT_BUFFER_SIZE   UIP_CONF_BUFFER_SIZE - UIP_CONF_LLH_LEN - UIP_TCPIP_HLEN

Definition at line 153 of file uip-conf.h.

Referenced by main_page(), and stats_page().

◆ UIP_WINDOW_REOPEN_DELAY

#define UIP_WINDOW_REOPEN_DELAY   3550

Optional: Used with UIP_CONNECTION_TIMEOUT

If an open connection is not receiving data, the connection will be restarted.

Adjust the initial delay period before restarting a connection that has already been restarted

For small payloads (96-120 bytes) with a fast connection, this value can be as low as ~750ms or so. When increasing the uip buffer size, this value should be increased, or the window may be reopened while the requested data is still being received, hindering traffic flow.

Definition at line 167 of file uip-conf.h.