Ring Buffer Memory Management for Network Packet Retransmission
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Managing retransmission and memory consumption in gateway devices is complex due to scattered buffers and out-of-sequence packet reception, leading to high processing complexity and unnecessary memory accesses.
Innovation Solution
Implementing a system that uses a ring buffer with sequence number tracking and flags to identify consumed packets, reducing the need for extensive memory access by marking and reclaiming memory based on sequence numbers and flags, thereby simplifying retransmission handling and memory management.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If buffers are scattered throughout memory for retransmission purposes, then memory allocation flexibility is improved, but processing complexity increases
Solution Approach 1:
The patent combines multiple scattered buffers into a single ring buffer structure. This merging approach maintains the flexibility of having multiple buffers while simplifying management by using a unified circular data structure with sequential allocation, thereby reducing processing complexity while preserving adaptability.
Solution Approach 2:
The ring buffer serves multiple functions: it acts as both a storage structure for retransmission packets and a management structure that simplifies allocation and deallocation. This universal structure handles both the flexibility requirement and the complexity reduction goal simultaneously.
2Adaptability or versatility
If packets are received out of sequence and inserted into ring buffer in received order, then packet reception flexibility is improved, but memory consumption tracking difficulty increases
Solution Approach 1:
The patent implements a sweep and mark procedure that examines each item in the ring buffer, marks consumed items, and then clears them. This feedback mechanism tracks memory consumption by systematically checking each buffer item's status and updating consumption records based on acknowledgment packets received.
Solution Approach 2:
The ring buffer is pre-allocated with a fixed size and structure before packet reception begins. This preliminary setup establishes clear boundaries and initialization states, making it easier to track memory consumption by knowing exactly what portions are available and what have been used.
3Measurement precision
If sweep and mark procedure examines each ring buffer item, then memory consumption accuracy is improved, but number of memory accesses increases
Solution Approach 1:
The sweep and mark procedure examines each item in the ring buffer to accurately determine memory consumption. While this comprehensive examination ensures precise tracking of consumed and available buffer space, it necessarily requires accessing each memory location, resulting in a higher number of memory accesses.
4Device complexity
If ring buffer is used to store transmitted packets, then buffer management simplicity is improved, but determining buffer consumption becomes difficult
Solution Approach 1:
The system uses feedback from acknowledgment packets to determine buffer consumption. When an ACK is received, the system marks the corresponding buffer items as consumed and updates the consumption tracking, thereby solving the difficulty of determining how much buffer space is available while maintaining simple ring buffer management.
Data Source
AI summary
A method of handling retransmission and memory consumption tracking of data packets includes storing data packets from different data channels in respective transmitter ring buffers allocated to the data channels when the data packets are not marked for retransmission, and facilitating retransmission of data packets from a specified ring buffer corresponding to a retransmission sequence number. The method also may include storing received data packets out of sequence in respective receiver ring buffers, marking a descriptor indicating a tail location of the stored data packets, and reclaiming memory space in the ring buffer based on the marked descriptor. The method may include storing a payload address associated with received data packets, marking a descriptor associated with the payload address to indicate the stored data packets have been consumed for processing, and reclaiming memory space when a register contains an indication of the stored payload address based on the marked descriptor.


