1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:55:09 +00:00

Kernel: Implement outgoing TCP retransmission and better ACK handling

This approach is a bit naiive - whenever we send a packet out, we
check to see if there are any other packets we should try to send.
This works well enough for a busy connection but not very well for a
quiet one. Ideally we would check for not-acked packets on some kind
of timer, and use the length of this not-acked list as feedback to
throttle the writes coming from userspace.
This commit is contained in:
Conrad Pankoff 2019-09-08 17:38:08 +10:00 committed by Andreas Kling
parent b8e3c7ef01
commit 117d8db2a2
3 changed files with 90 additions and 28 deletions

View file

@ -374,12 +374,7 @@ void handle_tcp(const IPv4Packet& ipv4_packet)
kprintf("handle_tcp: got socket; state=%s\n", socket->tuple().to_string().characters(), TCPSocket::to_string(socket->state()));
#endif
if (tcp_packet.ack_number() != socket->sequence_number()) {
kprintf("handle_tcp: ack/seq mismatch: got %u, wanted %u\n", tcp_packet.ack_number(), socket->sequence_number());
return;
}
socket->record_incoming_data(ipv4_packet.payload_size());
socket->receive_tcp_packet(tcp_packet, ipv4_packet.payload_size());
switch (socket->state()) {
case TCPSocket::State::Closed: