mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-22 10:21:04 +00:00
The TCP connection state "ESTABLISHED" (in the router "OPEN") is a privileged one for peers because it lasts very long without any peer interaction (in the NIC router it's only 10 minutes, but RFCs recommend not less than 2 hours and 4 minutes). Furthermore, TCP connections in this state are normally not available for early-drop on resource exhaustion. This means that this state binds resources to a connection potentially for a long time without the option of regaining them under stress. Therefore, this state should be entered with care. Up to now, the router marked a TCP connection with this state as soon as it had seen one matching packet in both directions, which is rather quick. However, implementing a very precise tracking of the exact TCP states of both peers and only marking the connection "ESTABLISHED" when both peers are "ESTABLISHED" is a difficult task with lots of corner cases. That said, this commit implements a compromise. The router now has two flags for each peer of a TCP connection - FIN sent and FIN acked - and sets them according to the observed TCP flags. The "ESTABLISHED" state is entered only when FIN acked is set for both peers (without having observed an RST or FIN flag meanwhile). Ref #4729
This source-code repository contains genuine low-level OS components and interfaces of Genode. It solely depends on the framework's base API.