RF24Ethernet - TCP/IP over RF24Network  1.6b
TMRh20 - Pushing the practical limits of RF24 modules
UipConfiguration

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
 
#define UIP_CONF_MAX_LISTENPORTS   1
 
#define UIP_CONF_BUFFER_SIZE   MAX_PAYLOAD_SIZE
 
#define UIP_CONNECTION_TIMEOUT   30000
 
#define UIP_CONF_LLH_LEN   0
 
#define UIP_CONF_UDP   0
 

Advanced Operation

For advanced configuration of RF24Ethernet

#define UIP_TIMER_DIVISOR   16
 
#define UIP_CONF_ACTIVE_OPEN   1
 
#define UIP_CONF_UDP_CHECKSUMS   0
 
#define UIP_CONF_EXTERNAL_BUFFER
 
#define OUTPUT_BUFFER_SIZE   UIP_CONF_BUFFER_SIZE - 1 - UIP_CONF_LLH_LEN - UIP_TCPIP_HLEN
 
#define UIP_WINDOW_REOPEN_DELAY   5150
 

Detailed Description

User Configuration Options /*

Macro Definition Documentation

#define UIP_CONF_MAX_CONNECTIONS   1

Maximum number of TCP connections.

Examples:
InteractiveServer_Mesh.ino, and SLIP_InteractiveServer.ino.

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

#define UIP_CONF_MAX_LISTENPORTS   1

Maximum number of listening TCP ports.

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

#define UIP_CONF_BUFFER_SIZE   MAX_PAYLOAD_SIZE

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.

Notes:

  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 81 of file uip-conf.h.

#define UIP_CONNECTION_TIMEOUT   30000

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 89 of file uip-conf.h.

#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 98 of file uip-conf.h.

#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 106 of file uip-conf.h.

#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 126 of file uip-conf.h.

#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.

#define UIP_CONF_UDP_CHECKSUMS   0

UDP checksums on or off

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

#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 150 of file uip-conf.h.

#define OUTPUT_BUFFER_SIZE   UIP_CONF_BUFFER_SIZE - 1 - UIP_CONF_LLH_LEN - UIP_TCPIP_HLEN
Examples:
HTML.h.

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

#define UIP_WINDOW_REOPEN_DELAY   5150

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 169 of file uip-conf.h.