Open dl1com opened 4 years ago
I started to implement an ARQ scheme based on the selective repeat algorithm. I think selective repeat ARQ with a sender window will give us a better throughput. The idea of waiting until one frame is received and requesting retransmission of all missing fragments on a frame per frame basis gives us high waiting times especially if the number of fragments per frame is low.
Working branch: https://github.com/HAMNET-Access-Protocol/HNAP4PlutoSDR/tree/arq_scheme The following has been implemented:
dl_data
and ul_data
headers. They have to contain a flag whether ARQ mode shall be used. Otherwise we cannot achieve the parallel usage of an acknowledged mode (AM) and unacknowledged mode (UM) on a per frame basis. This is highly desired in order to better serve UDP and TCP applications.dl_data_ack
and ul_data_ack
is introduced. They are 16bits long, contain the sequence and fragnr that is acknowledged. There is space for an ACK_type flag. This allows us to send ACK and NAK messages. The latter is not implemented yet, could be a further enhancement to reduce the number of ack transmissions. Module: mac_messagesShall we include a retransmission limit at the sender side? The difficulty with this is how can the receiver notice that the sender "gave up" to finish the transmission of a certain sequence. The current implementation expects that the sender window is small enough to avoid any sequence numbering ambiguities and that the sender retries transmissions until everything is received. If the first assumption is not valid anymore, this leads to partially received frames in the rx buffer, that are never released and therefore might be mixed up with later received frames.
Shall we include a retransmission limit at the sender side? The difficulty with this is how can the receiver notice that the sender "gave up" to finish the transmission of a certain sequence. The current implementation expects that the sender window is small enough to avoid any sequence numbering ambiguities and that the sender retries transmissions until everything is received. If the first assumption is not valid anymore, this leads to partially received frames in the rx buffer, that are never released and therefore might be mixed up with later received frames.
@hgn Any comments/experiences on this? A short search on this topic brought up this paper: https://onlinelibrary.wiley.com/doi/pdf/10.1002/ecja.10181 (I don't have access to it, though).
@lukasostendorf Is packet ordering still maintained in AM? From what I see in the code, all fragments of a frame have to be transmitted successfully before sending the fragments of the next frame, is this correct?
I propose to add a selective acknowledgement algorithm (see also https://en.wikipedia.org/wiki/Retransmission_(data_networks)). Some thoughts on this:
Receiver:
arq_response
for now) upon receive of the fragment where the final_flag is set to indicate the missing fragments to the sender.arq_response
message contains the sequence number of thedl_data
message and a bit field, which indicates the successfully received fragments to the sender. The size of the bit field is ceil(MAX_FRAGNR/8) bytes.arq_response
message is triggered. This handles the case where the last fragment is lost.Sender:
arq_response
message, the sender transmits the indicated fragments to the receiver and increases a retry counter for this framearq_response
after a given timeout?It should be configurable whether ARQ mode is used, or for which type(s) of data it is used (e.g. UDP traffic vs. TCP traffic).
Possible optimizations (later work):
arq_response
from it.