The current sender buffer is simply a linked list, although there's often a need for accessing a packet basing on its sequence number, which means in the current implementation a linear search.
Create a better solution, possibly based on a circular buffer.