Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Network and Device Configuration

Number of RX

...

& TX Buffers to Configure

The number of large receive, small transmit and large transmit buffers configured for a specific interface depend on several factors.

...

Receive and transmit queue size MUST must be properly configured to optimize performance. It represents the number of bytes that can be queued by one socket. It's important that all socket are not able to queue more data than what the device can hold in its buffers. The size should be also a multiple of the maximum segment size (MSS) to optimize performance. UDP MSS is 1470 and TCP MSS is 1460. RX

RX and TX maximum queue size is configured using #define in net_cfg.h, see Socket Layer Configuration.

RX and TX queue size can be reduce at run time using socket option API . The (NetTCP_ConnCfgRxWinSize()NetTCP_ConnCfgTxWinSize()).

the following listing shows a calculation example: 

 

Once number and size of the transmit and receive buffers are configured, as explained in the previous section, the last thing that need to be done is to configure the TCP Transmit and Receive Window sizes. These parameters are found in the net_cfg.h file in the TRANSMISSION CONTROL PROTOCOL LAYER CONFIGURATION section.

...

    Number of TCP connection  : 2
    Number of UDP connection  : 0
    Number of RX large buffer : 10
    Number of TX Large buffer : 6
    Number of TX small buffer : 2
    Size of RX large buffer   : 1518
    Size of TX large buffer   : 1518
    Size of TX small buffer   : 60
 
    TCP MSS RX                = 1460
    TCP MSS TX large buffer   = 1460
    TCP MSS TX small buffer   = 0
 
    Maximum receive  window   = (10 * 1460)           = 14600 bytes
    Maximum transmit window   = (6  * 1460) + (2 * 0) = 8760  bytes
 
 
    RX window size per socket = (14600 / 2) =  7300 bytes
    TX window size per socket = (8760  / 2) =  4380 bytes

 

Reducing the Number of Transitory Errors (NET_ERR_TX)

...