Skip to main content
. 2023 Jan 10;23(2):819. doi: 10.3390/s23020819
Algorithm 3 Procedure to insert a new packet Uj and release a packet concurrently.

   Release S1 to output and insert packet Uj in pipeline

   if Cexp==S1 and Uj arrives

       Find k such that Si<Us for 1ik1, and Si>Us for ik

       ObufS1

       for 1<ik1 in parallel

          Pi1Pi; Pk1Uj                  ▹ Shift P2 to Pk1 to the left; Insert Uj at Pk1

          Cexp++                                                   ▹ Increment expected in-sequence counter