Skip to content
This repository has been archived by the owner on Feb 14, 2020. It is now read-only.

ndt.go: send at least one MSG_RESULT back #18

Merged
merged 1 commit into from
Jan 7, 2017
Merged

Conversation

bassosimone
Copy link
Member

@bassosimone bassosimone commented Jan 7, 2017

The specification doesn't explicitly state that the server MUST send to the client at least one MSG_RESULT message. But, looking into the sequence diagram that is part of the specification, this is CLEARLY implied.

As such, botticelli was broken because it was violating the protocol.

The proper fix would be to read Web100 variables, compute a number of metrics and send those back to the client. But, botticelli has not reached this point of maturity yet.

As a fix, I implemented sending back a single variable formatted as the NDT code would expect, so that it does not crash, but named using a clearly nonstandard name such that it's not used.

Bug reported by @nkinkade, thanks!

The [specification](https://github.com/ndt-project/ndt/wiki/NDTProtocol)
doesn't explicitly state that the server MUST send to the client
at least one MSG_RESULT message. But, looking into the sequence
diagram that is part of the specification, this is CLEARLY implied.

As such, botticelli was broken because it was violating the protocol.

The proper fix would be to read Web100 variables, compute a number
of metrics and send those back to the client. But, botticelli has
not reached this point of maturity yet.

As a fix, I implemented sending back a single variable formatted as
the NDT code would expect, so that it does not crash, but named using
a clearly nonstandard name such that it's not used.

Bug reported by @nkinkade, thanks!
@bassosimone bassosimone added the bug label Jan 7, 2017
@bassosimone bassosimone merged commit 91d4444 into develop Jan 7, 2017
@bassosimone bassosimone deleted the fix/ndt_client branch January 7, 2017 14:24
nkinkade added a commit to m-lab/ndt that referenced this pull request May 9, 2017
* Don't assume server supports all test types

The NDT client assumes that the server supports all test types and the
official NDT server respects this assumption.

However, the [neubot/botticelli](https://github.com/neubot/botticelli)
server only implements TEST_META, TEST_S2C, and TEST_S2C.

Therefore, when using the NDT client with a botticelli server, the
client crahes in processing the results of the TEST_MID that however
has not been executed.

Fix by making sure that, when processing results, we use a bitmak where
only bits corresponding to tests that run are actually set.

(There is also another reason why NDT client crashes when testing with
botticelli, addressed by neubot/botticelli#18.)

Problems between NDT client and botticelli reported by @nkinkade, thanks!

* web100clt.c: make results parsing more robust

1) Do not assume that the first line we receive contains a space

2) Do not assume that the first line we receive contains an integer

3) Be robust to the case where input is an empty string

4) Do not assume that after the first token delimited by space we
   will find a second token delimited by newline

Tested under the following conditions:

a) web100clt -n ndt.iupui.mlab1.trn01.measurement-lab.org that sends
   back all variables and checked via printf() that the variables that
   are parsed by the new code are the ones received in resultstr

b) web100clt -n neubot.mlab.mlab1.mil01.measurement-lab.org that at
   the moment is running botticelli v0.0.5 (which is buggy and doesn't
   send any MSG_RESULTS messages) and make sure it does not crash

c) web100clt -n neubot.mlab.mlab1.trn01.measurement-lab.org that at
   the moment is running botticelli v0.0.6 (which sends a single
   dummy variable not considered by NDT) and make sure it doesn't crash

Note that a) and c) did not changed after this patch. What this patch
changes is the behavior in case b).

xref: neubot/botticelli#18.

* Add travis config to build with measurementlab/ndt-builder

* Fetch docker image from mlab-pub

* Add log_first_n, cleanup

* Add missing #include and make some functions static.

* remove confusing I2util discovery

* remove web100 dependent test from TESTS

* remove unused tcp_stat_setbuf decl that breaks strict lint

* Add log_first_n, cleanup

* Add missing #include and make some functions static.

* Add travis config to build with measurementlab/ndt-builder

* Fetch docker image from mlab-pub

* remove confusing I2util discovery

* remove web100 dependent test from TESTS

* remove unused tcp_stat_setbuf decl that breaks strict lint

* Temp workaround for builder

* Remove logfile after test (#88)

* Made the unit tests create the logfile in /tmp

* Clarified the test code
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant