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

Use server-side measurements during upload test #75

Merged
merged 6 commits into from
May 17, 2022

Conversation

robertodauria
Copy link
Contributor

@robertodauria robertodauria commented May 13, 2022

This change makes the client compute the upload rate via the TCPInfo objects periodically sent by the server.

Client-side measurements had been used in the initial implementation since counterflow message processing wasn't implemented yet (see #38) and server-side measurement were not available.

Ideally this should use AppInfo to consistently compute application-level rates in both download and upload, but AppInfo isn't currently sent by ndt-server. For now, showing a server-side network-level measurement is better than a client-side application-level measurement which will be overestimated on slow links (see #74).


This change is Reviewable

@coveralls
Copy link

coveralls commented May 13, 2022

Pull Request Test Coverage Report for Build 153

  • 21 of 23 (91.3%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.09%) to 94.041%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/ndt7-client/internal/emitter/humanreadable.go 18 20 90.0%
Totals Coverage Status
Change from base Build 143: 0.09%
Covered Lines: 647
Relevant Lines: 688

💛 - Coveralls

// Upload comes from the client-side Measurement during the upload test.
// The upload rate comes from the receiver (the server). Currently
// ndt-server only provides network-level throughput via TCPInfo.
// TODO: Use AppInfo for application-level measurements when available.
Copy link
Contributor

Choose a reason for hiding this comment

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

If the spec does not explain in a clear enough way what "when available" means, then I think it may be worth clarifying the spec. The underlying source of concern is that, when you have some L4 connection terminator, you are not really speaking with the server at TCP level. So the server may assume the bandwidth is much higher so that, basically, at the end of the day, you very seldomly receive any useful AppInfo data.

This issue is basically the head-of-line blocking issue with TCP that IIUC should be fixed with QUIC (which, however, may have other issues that we don't know yet).

Copy link
Contributor

Choose a reason for hiding this comment

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

To further clarify, I just wanted to provide historical content around why the spec says SHOULD but not MUST. I am now wondering whether perhaps we should further explain why it's SHOULD and not MUST explicitly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there is an L4 terminator, and the server does not get a Measurement object as often as we would like, should the client still include AppInfo in its Measurements? I think none of the clients, nor the server, currently does that.

I don't think there's any harm in including AppInfo with server measurements, either. If the client is able to get some Measurements (and thus, TCPInfo), it will also be able to get AppInfo. If no counterflow message can go through, the clients cannot display the rate in any case -- unless we keep client-side measurements as a fallback for such a situation.

Summarizing my understanding here -- please let me know if it's wrong:

  • During the download measurement, the client's counterflow messages might not get to the server in case there is an L4 terminator on the path. The server can still use its own TCPInfo (specifically, the acked bytes which are hard to falsify) to calculate the rate. The client will just use the number of bytes received / elapsed time.
  • During the upload measurement, the server's counterflow messages might not get to the client. In this case, the client does not have TCPInfo (nor AppInfo) to show the rate at which it's uploading.
  • If there's no L4 terminator on the path, adding AppInfo is beneficial in every case, since it allows both client and server to know application-level rates at the receiver.
  • If there's an L4 terminator, and measurement messages can't go through, adding AppInfo does not make things worse than they are.

Is that correct? If so, I think the AppInfo object should be treated as mandatory, at least for our reference server and clients. I'm not sure if we should change the spec, but it seems to me that since both TCPInfo and AppInfo are optional that would mean that a server can potentially not give any feedback to the client during the upload by design, and that feels wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

We discussed this further in private with @robertodauria and concluded that the spec SHOULD (<- no pun intended) be modified to say that "the server MUST send AppInfo during the upload [...]" and further explain why this information is important in the interest of accurate app-level data collection at the sender. Because the sender (i.e., the client) can always piggy-back ACKs for the data from the server to the client, I see much less of a head of line blocking hazard for counter-flow messages so, IIUC, they should also arrive ~timely.

@robertodauria
Copy link
Contributor Author

I have updated all the unit tests and likely fixed a few in the process (t.Fatalf cannot be called from a goroutine), the build completed successfully.

Copy link
Contributor

@stephen-soltesz stephen-soltesz left a comment

Choose a reason for hiding this comment

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

:lgtm: - with two planned TODOs for updates to the version and spec.

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @bassosimone)


cmd/ndt7-client/main.go line 278 at r1 (raw file):

Previously, bassosimone (Simone Basso) wrote…

We discussed this further in private with @robertodauria and concluded that the spec SHOULD (<- no pun intended) be modified to say that "the server MUST send AppInfo during the upload [...]" and further explain why this information is important in the interest of accurate app-level data collection at the sender. Because the sender (i.e., the client) can always piggy-back ACKs for the data from the server to the client, I see much less of a head of line blocking hazard for counter-flow messages so, IIUC, they should also arrive ~timely.

Is this also planned for a future PR?

Copy link
Contributor Author

@robertodauria robertodauria left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @bassosimone)


cmd/ndt7-client/main.go line 278 at r1 (raw file):

Previously, stephen-soltesz (Stephen Soltesz) wrote…

Is this also planned for a future PR?

It's documented on an issue (m-lab/ndt-server#358) -- implementing this change likely means two PRs, one to modify the spec and one to actually add AppInfo to the object sent by ndt-server.

Once we have AppInfo, I plan on changing the client(s) again to use it.

@robertodauria robertodauria merged commit 98a4279 into master May 17, 2022
@robertodauria robertodauria deleted the sandbox-roberto-server-side-measurement branch May 17, 2022 20:34
nosnilmot added a commit to nosnilmot/ndt7-client-ios that referenced this pull request Feb 14, 2023
For download test, prefer measurements of bytes confirmed received by
client

For upload test, prefer measurements of bytes confirmed recevied by
server

See also: m-lab/ndt7-client-go#75
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.

4 participants