-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utp packet heap #702
base: master
Are you sure you want to change the base?
Utp packet heap #702
Conversation
this.logger.extend('PROCESS_CURRENT_PACKET')(`Packet ${this.currentPacket.header.seqNr} already processed.`) | ||
this.currentPacket = this.packetHeap.pop() | ||
return this.processCurrentPacket() | ||
} else if (this.currentPacket.header.seqNr > request.socket.reader!.nextDataNr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what makes selective acks basically never happen, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right -- this still lacks a way to respond to actual packet loss. This will just happen infinitely (or till other side sends a RESET).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit 774053c adds some logic to process out of order packets if there are 3 or more packets for that request in the heap. This preserves the reordering for the packet pair phenomenon, but still allows the selective ack
response to happen if we get more than 3 packets ahead.
Replaces uTP Packet Queue array with
Heap
fromheap-js
.Heap will sort packets waiting in queue so that out-of-order packets are reordered. This will cut back on unnecessary
Selective Ack
responses.When receiving streams, especially from
Trin
nodes, we often receive pairs of packets with identical timestamps, and regularly end up processing them in the wrong order.Selective Ack
function. We report every other packet at missing, even though it isn't. So We get multiples of every other packet and send extraACK
packets.The
processCurrentPacket
method was updated to skip repeat packets, and to requeue packets that arrive ahead of the current reader position. This update allows the packet-pair phenomenon to self correct.Also updated and improved some logs, and added a method to report the total number of open uTP streams.