4 ms·
> What tasks of a TCP stack actually need to coordinate between processes, or in other words, actually need a kernel? In short: You want to have something tha
by Matthias247 6y ago
> What tasks of a TCP stack actually need to coordinate between processes, or in other words, actually need a kernel?
In short: You want to have something that does the multiplexing and demultiplexing of packet streams that belong to different applications. E.g. all packets arrive from a common NIC, but depending on the target port they have to a different application.
And on the sending side you want to have some fairness, and common congestion control. If all applications could write directly to the TX path of the NIC it could easily be that packets from one particular application which has less CPU time would commonly get dropped.
In addition for that having a common place like the Kernel allows for some nice monitoring/instrumentation purposes. And it makes sure peers get a reasonable response (even if that's only a RST) if the application is not started.