apsun / loliOS

Lightweight & operational Linux-inspired OS.
33 stars 1 forks source link

TCP deadlock if window update is lost #34

Closed apsun closed 3 years ago

apsun commented 3 years ago

Consider:

local -> remote "SEQ=0, LEN=1500" (received) remote -> local "ACK=1500, WND=0" (received - inbox is now empty, new writes are rejected) remote -> local "ACK=1500, WND=1500" (lost)

Since we don't attempt to send anything when the window is full, we will deadlock. According to the TCP RFC, we should try to send probing packets even when the window is full to periodically check if the window has reopened.

apsun commented 3 years ago

Fixed in f727bf6f6ad7ebe53149d9a8e56bac0bf3f63714