Network Component  Version 7.3
MDK Middleware for IPv4 and IPv6 Networking
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Resource Requirements

This section describes the resource requirements of the Network component. The actual requirements depend on the features used in the application. Therefore, the numbers provided here are guidelines only and the actual numbers may differ.

Stack Requirements

The Network Core receives events sent from the interrupt service routine (ISR) of the Ethernet (or Serial) Driver. The stack requirements for the ISR are typically less than 512 Bytes. The total stack space required for ISR depends on the interrupt nesting and therefore on the priority settings of these ISR. The stack requirements for ISR is configured in the startup_device.s file located under the Device component class.

Option (under section Stack Configuration) Increase Value by
Stack Size (in Bytes) + 512 for Ethernet (or Serial) Driver
Note
When using a CMSIS-RTOS, the Stack Size in the startup_device.s file configures only the stack space that is used by exception and interrupt service routines of the drivers. The stack size requirements depend on the maximum nesting of exception and ISR execution and therefore on the priority settings of the various interrupt and exception sources.

User code that calls API functions of the Network Component should have a minimum of 512 Bytes of stack space available. Since API functions are frequently called from threads, the thread stack size should be at least 512 Bytes (see below).

Heap Requirements

The mbed TLS component requires 90 kB of heap memory. The heap requirements are configured in the startup_device.s file located under the Device component class.

Option (under section Stack Configuration) Increase Value to at least
Heap Size (in Bytes) 0x16000

CMSIS-RTOS Requirements

The Network component uses CMSIS-RTOS threads. The Network Core thread is always started. Each Network interface starts its own thread when the interface is enabled. Thread execution starts with netInitialize. All threads run on an user-provided stack.

The following table lists the components, the default thread name and priority, the default stack size and the configuration file with OS Resource Settings for stack size adjustments.

Component Thread Name Default Priority Default Stack Size Configuration File
::Network:Core netCore_Thread osPriorityNormal 1024 Bytes Net_Config.c
::Network:Interface:ETH netETH_Thread osPriorityAboveNormal 512 Bytes Net_Config_ETH.h
::Network:Interface:PPP netPPP_Thread osPriorityAboveNormal 512 Bytes Net_Config_PPP.h
::Network:Interface:SLIP netSLIP_Thread osPriorityAboveNormal 512 Bytes Net_Config_SLIP.h
::Security:mbed TLS netTLS_Thread osPriorityNormal 4096 Bytes TLS_mbed.c

For the Network Component, the number of threads and stack size requirements are calculated as follows:

  • Number of Threads: sum up the number of used Components.
  • Total stack size: sum up the Default Stack Sizes of the related threads.

The thread requirements need to be reflected in the CMSIS-RTOS configuration. Refer to the CMSIS-RTOS Reference for further details.

For CMSIS-RTOS RTX, the threads requirements are configured in the RTX_Conf_CM.c file located under the CMSIS component class:

Option (under section Thread Configuration) Value
Number of concurrent running threads + Number of Threads
Number of threads with user-provided stack size + Number of Threads
Total stack size [bytes] for threads with user-provided stack size + Total stack size

System Configuration

The ::Network:Core component requires User Timers to be selected. The Timer Thread Stack is commonly used by all threads working with User Timers. Depending on the application and the further usage of the timers, the Timer Thread stack size needs to be increased accordingly.

Signals

When using BSD sockets in blocking mode, the signal (1<<15) in that thread is reserved for the Network library. A user thread, when blocked on BSD sockets, is waiting for the signal 0x8000 to resume. The event, which has caused the thread to resume, is provided internally in the library. Therefore, signal 0x8000 must not be used by the user application in that thread.

Memory Requirements

The following table shows the memory requirements for read-only (Flash) and read-write (RAM) memory. These numbers may be used to estimate the total size requirements of the application, but the actual numbers depend on compiler optimizations and target processor and may be therefore slightly different.

Component RO Memory [Bytes] RW Memory (Data) [Bytes]
::Network:Core (with IPv4, IPv6) 6.4 k 0.4 k + Memory Pool size (configured in Net_Config.c)
::Network:Interface:ETH (with ARP,NDP,IGMP,DHCP,NBNS) 11.4 k 0.7 k
::Network:Interface:PPP (with CHAP/PAP and Modem) 8.8 k 0.5 k
::Network:Interface:SLIP (with Modem) 2.7 k 0.4 k
::Network:Socket:UDP 1.4 k 0.1 k
::Network:Socket:TCP 5.8 k 0.6 k
::Network:Socket:BSD (without UDP/TCP) 3.8 k 0.2 k
::Network:Service:DNS Client 1.3 k 0.3 k
::Network:Service:FTP Client 2.5 k < 0.1 k
::Network:Service:FTP Server 5.2 k 0.1 k
::Network:Service:SMTP Client 1.6 k < 0.1 k
::Network:Service:SNMP Agent 2.7 k < 0.1 k
::Network:Service:SNTP Client 0.6 k < 0.1 k
::Network:Service:TFTP Client 1.4 k < 0.1 k
::Network:Service:TFTP Server 2.2 k 0.1 k
::Network:Service:Telnet Server 3.1 k 0.4 k
::Network:Service:Web Server (HTTP Server) 7.2 k 0.4 k
Ethernet MAC Driver 1 .. 4 k 0 .. 10 k
Ethernet PHY Driver < 1 k < 0.1 k