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

#3851 ping frame added in handshake #3935

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SahibYar
Copy link

@SahibYar SahibYar commented Jul 1, 2023

Ping Frame added when packet is nil and handShake is not confirmed yet.

Commenting this line took 108 seconds to complete all tests
image

With this line took 82 seconds to complete all tests
image

@google-cla
Copy link

google-cla bot commented Jul 1, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Member

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

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

I'd prefer to make this change in the packet packer instead of the connection.

Also please don't just modify random files that are unrelated to this PR.

@SahibYar
Copy link
Author

SahibYar commented Jul 2, 2023

Updated as per PR comments, similar pattern of time consumption for all tests.

When lines were commented, it took 116 seconds
image

When lines were not commented, it took 90 seconds on my machine
image

packet_packer.go Outdated
@@ -331,9 +331,14 @@ func (p *packetPacker) PackCoalescedPacket(onlyAck bool, maxPacketSize protocol.
initialHdr, initialPayload = p.maybeGetCryptoPacket(maxPacketSize-protocol.ByteCount(initialSealer.Overhead()), protocol.EncryptionInitial, onlyAck, true, v)
if initialPayload.length > 0 {
size += p.longHeaderPacketLength(initialHdr, initialPayload, v) + protocol.ByteCount(initialSealer.Overhead())

if size >= maxPacketSize-protocol.MinCoalescedPacketSize {
Copy link
Member

Choose a reason for hiding this comment

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

This if doesn’t seem correct:

  1. You’re not allowed to add a PING if ackOnly is set.
  2. You should only add a PING if there’s no other frames in the packet.

Copy link
Author

Choose a reason for hiding this comment

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

You should only add a PING if there’s no other frames in the packet.

is it a bug in our code ? because I confirmed this from rfc9000#section-17.2.2-8 which says

The payload of an Initial packet includes a CRYPTO frame (or frames) containing a cryptographic handshake message, ACK frames, or both. PING, PADDING, and CONNECTION_CLOSE frames of type 0x1c are also permitted.

Copy link
Member

Choose a reason for hiding this comment

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

Why do you think it’s a bug? All these frames are permitted, but we’re only concerned with the situation where we only happen to have an ACK frame to send.

@marten-seemann marten-seemann added this to the v0.38 milestone Jul 21, 2023
@marten-seemann marten-seemann removed this from the v0.38 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants