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

Non-random Test Data risks compression #161

Open
aaronmbr opened this issue Mar 31, 2015 · 0 comments
Open

Non-random Test Data risks compression #161

aaronmbr opened this issue Mar 31, 2015 · 0 comments

Comments

@aaronmbr
Copy link
Contributor

Original issue 161 created by aaronmbr on 2014-10-06T21:06:02.000Z:

Reading the source, I noticed that the data that NDT sends in S2C and C2s tests is nonrandom.

From the Flash client:
// Prepare the data to send to the server.
for (var i:int = 0; i < NDTConstants.PREDEFINED_BUFFER_SIZE; i++) {
_dataToSend.writeByte(i);
}
https://code.google.com/p/ndt/source/browse/trunk/flash-client/src/TestC2S.as#&nbsp;168

From the C client:
// ....Fill buffer upto NDTConstants.PREDEFNED_BUFFER_SIZE packets
pkts = 0;
k = 0;
for (i = 0; i < (64*KILO_BITS); i++) { // again buffer sizes differ.
// Since the actual transmitted byte count is timed, it doesn't appear
// that it is causing specific problems.
while (!isprint(k & 0x7f))
k++;
buff[i] = (k++ % 0x7f);
}
https://code.google.com/p/ndt/source/browse/trunk/src/test_c2s_clt.c#&nbsp;141

Because we're sending buffers of sequential bytes (and in the case of the C client, only printable ASCII characters), there is a risk that boxes on the network will compress the data and skew measurements.

We should modify the code for data generation so that we use a pseudorandom number generator with a periodicity of at least 64k, then take the last byte of each generated number as the next byte to place in the send buffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant