Design Article
Building better memory management for high performance wired/wireless networks: Part 1
Khaled Elsayed and Mohamed Galal
3/11/2010 10:22 PM EST
However, due to the typically associated memory fragmentation and potential havocs that could result from wrong usage of these functions, the embedded development community has recognized the general wisdom that using dynamic allocation is to be discouraged if not completely banned.
This is particularly true for mission-critical and safety-critical embedded systems where response times need to be predictable and bounded. The typical solution used is to allocate, during system initialization, a fixed size pool or stack of buffers.
After that, the buffer allocations are requested from the pool. This allows for an almost constant processing time. However, there are also several problems with this method.
The buffer size is typically chosen as the maximum possible request size foreseen by the intended application, e.g. the maximum transfer unit (MTU) of a protocol data unit (PDU). This results in low overall memory utilization due to the fact that many requests will require far lower memory than the buffer size.
Network designs' memory allocation problems
This problem is magnified in protocol stacks embedded within high-speed network interface cards. Typically such stacks process variable-size protocol data units (PDUs)/service data units (SDUs) on their input and output ports requiring high-speed processing.
One of the key factors for realizing the required high-speed processing of PDUs/SDUs is an efficient buffer management scheme. In many instances, a communication link raw capacity is bottlenecked by the processing delays at the network interface cards or the host processor hardware or operating system.
In this article we'll describe what we think is an efficient memory management system designed specifically for high-speed network interface cards particularly data link layers (layer 2 of the protocol stack).
We specifically target layer 2 implementations as these are good candidates for software implementation on embedded processors. Our variable-buffer scheme is based on structuring a memory area into equal sized units, which we call a partition. A pool is defined to have the configuration , where N is the number of partitions and S is the size of the partition in bytes.
Full details about this scheme, which has been implemented in SySDSoft's LTE and WiMAX protocol stacks are described later in this Part 1 of two articles.
Later in Part 2 in this series, we detail the results of various tests and demonstrations we have performed to compare network implementations based on variable-size versus more traditional fixed size memory pools. In general our conclusion is that this scheme exhibits excellent performance in LTE and WiMax protocol stacks.




KC Wong
6/4/2010 4:00 AM EDT
Dear authors,
Does this "variable-size Memory Pools" implementation cater for fragmentation problem and deterministic execution time ?
Or, they have been trade-off for the better memory utilization ?
It looks to me it is a first-fit memory allocator, isn't it ?
Sign in to Reply