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

Being refactored: ECN additions #1495

Closed
wants to merge 68 commits into from
Closed

Conversation

larseggert
Copy link
Collaborator

@larseggert larseggert commented Nov 21, 2023

This PR is getting too large. I'm in the process of refactoring it into smaller chunks:

Copy link
Member

@martinthomson martinthomson left a comment

Choose a reason for hiding this comment

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

I take it that this is groundwork for ECN

Cargo.toml Outdated Show resolved Hide resolved
neqo-helper/src/lib.rs Outdated Show resolved Hide resolved
neqo-helper/src/lib.rs Outdated Show resolved Hide resolved
neqo-helper/src/lib.rs Outdated Show resolved Hide resolved
neqo-common/src/datagram.rs Outdated Show resolved Hide resolved
neqo-common/src/datagram.rs Outdated Show resolved Hide resolved
neqo-helper/src/lib.rs Outdated Show resolved Hide resolved
neqo-helper/src/lib.rs Outdated Show resolved Hide resolved
@larseggert larseggert marked this pull request as ready for review December 12, 2023 13:44
@larseggert larseggert marked this pull request as draft December 12, 2023 13:44
@larseggert larseggert closed this Dec 12, 2023
@larseggert larseggert deleted the feat-ecn branch December 12, 2023 13:46
@larseggert larseggert restored the feat-ecn branch December 12, 2023 13:47
@larseggert larseggert reopened this Dec 12, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 12, 2023

Codecov Report

Attention: 98 lines in your changes are missing coverage. Please review.

Comparison is base (9e6cd93) 86.52% compared to head (edbbfb7) 86.49%.

Files Patch % Lines
neqo-common/src/socket.rs 85.35% 29 Missing ⚠️
neqo-interop/src/main.rs 0.00% 25 Missing ⚠️
neqo-server/src/main.rs 0.00% 17 Missing ⚠️
neqo-client/src/main.rs 0.00% 12 Missing ⚠️
neqo-common/src/datagram.rs 72.41% 8 Missing ⚠️
neqo-transport/src/qlog.rs 0.00% 6 Missing ⚠️
neqo-transport/src/connection/mod.rs 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1495      +/-   ##
==========================================
- Coverage   86.52%   86.49%   -0.03%     
==========================================
  Files         117      118       +1     
  Lines       38229    38531     +302     
==========================================
+ Hits        33079    33329     +250     
- Misses       5150     5202      +52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@larseggert larseggert force-pushed the feat-ecn branch 2 times, most recently from c0c6850 to fb5434d Compare December 18, 2023 13:32
martinthomson
martinthomson previously approved these changes Dec 19, 2023
Copy link
Member

@martinthomson martinthomson left a comment

Choose a reason for hiding this comment

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

I've a question for you and some suggestions, but I trust you to resolve those from here (and I don't want to block you while I'm on leave).

neqo-common/src/socket.rs Outdated Show resolved Hide resolved
neqo-common/src/socket.rs Outdated Show resolved Hide resolved
neqo-common/src/socket.rs Show resolved Hide resolved
neqo-common/src/datagram.rs Outdated Show resolved Hide resolved
neqo-common/src/socket.rs Outdated Show resolved Hide resolved
@@ -710,7 +711,9 @@ impl ServersRunner {
match self.server.process(dgram, self.args.now()) {
Output::Datagram(dgram) => {
let socket = self.find_socket(dgram.source());
emit_packet(socket, dgram);
if let Err(e) = emit_datagram(socket, &dgram) {
eprintln!("UDP write error: {}", e);
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to open an issue to track EAGAIN handling in these?

neqo-common/src/socket.rs Outdated Show resolved Hide resolved
neqo-common/src/socket.rs Outdated Show resolved Hide resolved
neqo-common/src/socket.rs Outdated Show resolved Hide resolved
neqo-common/src/socket.rs Outdated Show resolved Hide resolved
@larseggert
Copy link
Collaborator Author

@martinthomson could you re-review? Made a bunch of changes that make things work on all platforms again.

@larseggert larseggert marked this pull request as ready for review January 4, 2024 10:57
@larseggert larseggert added the blocked Blocked on something else label Jan 4, 2024
@larseggert
Copy link
Collaborator Author

Blocked until nix-rust/nix#2203 has shipped.

@larseggert larseggert force-pushed the feat-ecn branch 3 times, most recently from 4ce889b to f766192 Compare January 11, 2024 16:29
@larseggert larseggert force-pushed the feat-ecn branch 2 times, most recently from 50058c0 to cf3e00b Compare January 16, 2024 11:50
Comment on lines +19 to +23
nix = { git = "https://github.com/larseggert/nix.git", branch = "feat-tos", features = [
"socket",
"net",
"uio",
], optional = true }
Copy link
Member

Choose a reason for hiding this comment

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

OK, let's continue to block on this being integrated upstream. Worst case, we can take up your fork, but if this can be upstreamed, that's a lot easier.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's in progress. Depends on another PR upstream.

neqo-common/src/datagram.rs Outdated Show resolved Hide resolved
Comment on lines 255 to 256
*tos = 0xff;
*ttl = 0xff;
Copy link
Member

Choose a reason for hiding this comment

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

0 or 0xff? Consistency?

}

#[test]
fn test_bind_v4() {
Copy link
Member

Choose a reason for hiding this comment

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

I have a real aversion to tests called test_whatever. Keep in mind that this will be called ...::test::test_bind_v4

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ACK

@@ -412,7 +412,7 @@ impl LossRecoverySpace {
.sent_packets
.iter_mut()
// BTreeMap iterates in order of ascending PN
.take_while(|(&k, _)| Some(k) < largest_acked)
.take_while(|(&k, _)| largest_acked.is_none() || Some(k) < largest_acked)
Copy link
Member

Choose a reason for hiding this comment

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

This sort of change really needs to be in a separate patch so that we can look at the recovery tests in more detail.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I realized this is getting big. I will break it into individual chunks.

@larseggert larseggert marked this pull request as draft January 18, 2024 09:54
larseggert added a commit to larseggert/neqo that referenced this pull request Jan 18, 2024
This part of the refactor of mozilla#1495.

This doesn't include any ECN I/O or other logic, just adds the
required fields to the datagram header.
@larseggert larseggert changed the title Add TOS and TTL info to datagram objects Being refactored: ECN additions Jan 18, 2024
larseggert added a commit to larseggert/neqo that referenced this pull request Jan 22, 2024
This part of the refactor of mozilla#1495.

This doesn't include any ECN I/O or other logic, just adds the
required fields to the datagram header.
larseggert added a commit that referenced this pull request Jan 22, 2024
* Add TOS and TTL information to Datagrams

This part of the refactor of #1495.

This doesn't include any ECN I/O or other logic, just adds the
required fields to the datagram header.

* cargo fmt

* Add test

* Fix clippy

* Add an IpTos type as suggested by @martinthomson.

I might back this back out if it is not the direction we want to go in,
pending further discussion.

* Move IpTos things into their own source file

* Make IpTos use a single byte
@larseggert larseggert mentioned this pull request Jan 31, 2024
Closed
larseggert added a commit to larseggert/neqo that referenced this pull request Feb 14, 2024
Most of the remaining bits from mozilla#1495

Depends on mozilla#1604
@mxinden
Copy link
Collaborator

mxinden commented Feb 21, 2024

Crossposting mxinden#1 (review) here to ensure review on fork does not get lost.

mxinden pushed a commit to mxinden/neqo that referenced this pull request Feb 23, 2024
Most of the remaining bits from mozilla#1495

Depends on mozilla#1604
@larseggert
Copy link
Collaborator Author

Nothing left in this PR that would be of interest.

@larseggert larseggert closed this Mar 1, 2024
@larseggert larseggert deleted the feat-ecn branch March 1, 2024 07:30
larseggert added a commit to larseggert/neqo that referenced this pull request Mar 15, 2024
The remaining bits from mozilla#1495

The remaining todo item after this PR is to actually act on incoming
CE marks, i.e., trigger a congestion control action. See mozilla#1689
github-merge-queue bot pushed a commit that referenced this pull request Apr 16, 2024
* feat: Send and process ACK-ECN

The remaining bits from #1495

The remaining todo item after this PR is to actually act on incoming
CE marks, i.e., trigger a congestion control action. See #1689

* Modifier

* Fix botched merge

* Fix merge

* Rework

* Add more tests that hopefully cover all cases.

* WIP

* Tests passing

* More tests

* Minimize diff

* ci(interop): run ecn test

* Update neqo-transport/src/connection/tests/ecn.rs

Co-authored-by: Max Inden <mail@max-inden.de>
Signed-off-by: Lars Eggert <lars@eggert.org>

* Update neqo-transport/src/qlog.rs

Co-authored-by: Max Inden <mail@max-inden.de>
Signed-off-by: Lars Eggert <lars@eggert.org>

* Fix qns

* Reduce number of CONNECTION_CLOSE frames

If this makes ngtcp2 happy, refactor into separate PR.

* Update neqo-transport/src/ecn.rs

Co-authored-by: Max Inden <mail@max-inden.de>
Signed-off-by: Lars Eggert <lars@eggert.org>

* Update neqo-transport/src/ecn.rs

Co-authored-by: Max Inden <mail@max-inden.de>
Signed-off-by: Lars Eggert <lars@eggert.org>

* Update neqo-transport/src/ecn.rs

Co-authored-by: Max Inden <mail@max-inden.de>
Signed-off-by: Lars Eggert <lars@eggert.org>

* Fixes

* Update neqo-transport/src/connection/tests/ecn.rs

Co-authored-by: Martin Thomson <mt@lowentropy.net>
Signed-off-by: Lars Eggert <lars@eggert.org>

* Update neqo-transport/src/connection/tests/ecn.rs

Co-authored-by: Martin Thomson <mt@lowentropy.net>
Signed-off-by: Lars Eggert <lars@eggert.org>

* Update neqo-transport/src/connection/mod.rs

Co-authored-by: Martin Thomson <mt@lowentropy.net>
Signed-off-by: Lars Eggert <lars@eggert.org>

* Update neqo-transport/src/frame.rs

Co-authored-by: Martin Thomson <mt@lowentropy.net>
Signed-off-by: Lars Eggert <lars@eggert.org>

* Update neqo-transport/src/frame.rs

Co-authored-by: Martin Thomson <mt@lowentropy.net>
Signed-off-by: Lars Eggert <lars@eggert.org>

* Update neqo-transport/src/ecn.rs

Co-authored-by: Martin Thomson <mt@lowentropy.net>
Signed-off-by: Lars Eggert <lars@eggert.org>

* Some fixups from code review

* More code review fixups

* Check whether migration happened as expected.
Minor other tweaks.

* Consolidate all the `nodata` tests

---------

Signed-off-by: Lars Eggert <lars@eggert.org>
Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Martin Thomson <mt@lowentropy.net>
github-merge-queue bot pushed a commit that referenced this pull request Apr 23, 2024
* feat: Send and process ACK-ECN

The remaining bits from #1495

The remaining todo item after this PR is to actually act on incoming
CE marks, i.e., trigger a congestion control action. See #1689

* Modifier

* Fix botched merge

* Fix merge

* Rework

* Add more tests that hopefully cover all cases.

* WIP

* Tests passing

* More tests

* Minimize diff

* ci(interop): run ecn test

* Update neqo-transport/src/connection/tests/ecn.rs

Co-authored-by: Max Inden <mail@max-inden.de>
Signed-off-by: Lars Eggert <lars@eggert.org>

* Update neqo-transport/src/qlog.rs

Co-authored-by: Max Inden <mail@max-inden.de>
Signed-off-by: Lars Eggert <lars@eggert.org>

* Fix qns

* Reduce number of CONNECTION_CLOSE frames

If this makes ngtcp2 happy, refactor into separate PR.

* feat(transport): pass ECN CE marks to CC

Pass ECN CE marks received through FRAME_TYPE_ACK_ECN frames to the congestion
controler.

* Update ACK delay on ECN CE mark

---------

Signed-off-by: Lars Eggert <lars@eggert.org>
Co-authored-by: Lars Eggert <lars@eggert.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on something else
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants