Skip to content
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

Add OnPacketReceived to pseudocode #3653

Merged
merged 9 commits into from
May 19, 2020
15 changes: 15 additions & 0 deletions draft-ietf-quic-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,21 @@ Pseudocode for OnPacketSent follows:
SetLossDetectionTimer()
~~~

## On Receiving a Packet

When a packet is received, it may allow the server to send
if the server was previously amplification limited.

Psuedocode for OnPacketReceived follows:
ianswett marked this conversation as resolved.
Show resolved Hide resolved

~~~
OnPacketReceived(packet):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would drop the argument to this. Because this needs to be a datagram not a packet.

That means the function at the end should be called ProcessPackets(datagram) if you keep it. But I would suggest that you don't need to do packet processing in this logic: this is just a function where the loss recovery code is told about what is happening in the main code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. You don't need to process packets in here, just say up above that this function is called even if the received packet is undecryptable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method renamed and comment updated.

// If this packet unblocks the server, arm the
martinthomson marked this conversation as resolved.
Show resolved Hide resolved
ianswett marked this conversation as resolved.
Show resolved Hide resolved
// timer to ensure forward progress resumes
ianswett marked this conversation as resolved.
Show resolved Hide resolved
if (server was at anti-amplification limit):
SetLossDetectionTimer()
DecryptAndProcessFrames()
ianswett marked this conversation as resolved.
Show resolved Hide resolved
~~~

## On Receiving an Acknowledgment

Expand Down