WIP donar

This commit is contained in:
Quentin 2019-09-15 09:48:30 +02:00
parent d14c40b700
commit cd02554eba

View file

@ -245,27 +245,27 @@ void classify(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct b
int64_t remote_delta = 0, local_delta = 0, owd_difference = 0;
remote_delta = li[i].delta_t;
local_delta = thunderc->rcv_delta_t_per_link[i];
if (remote_delta > 10000) continue; // Too many time elapsed for useful comparison
//
if (remote_delta > 1000) continue; // Too many time elapsed for useful comparison
owd_difference = local_delta - remote_delta;
if (owd_difference <= thunderc->allowed_jitter_ms && owd_difference >= -thunderc->allowed_jitter_ms) continue;
struct block_info *bi = malloc(sizeof(struct block_info));
if (owd_difference < -thunderc->allowed_jitter_ms) {
bi->i = link_id;
bi->app_ctx = app_ctx;
bi->missing = thunderc->received_pkts_on_link[link_id];
} else if (owd_difference > thunderc->allowed_jitter_ms) {
bi->i = i;
bi->app_ctx = app_ctx;
bi->missing = thunderc->received_pkts_on_link[i];
} else if (owd_difference > thunderc->allowed_jitter_ms) {
bi->i = link_id;
bi->app_ctx = app_ctx;
bi->missing = thunderc->received_pkts_on_link[link_id];
} else {
fprintf(stderr, "Algorithm is wrong\n");
exit(EXIT_FAILURE);
}
//printf(" Packet Too Late - Blocked link %d (expected: at least %dms ago, received: %ldms ago)\n", i, li[i].delta_t - thunderc->allowed_jitter_ms, thunderc->rcv_delta_t_per_link[i]);
printf(" Packet Too Late - Blocked link %d owd_diff=%ld, local_delta=%ld, remote_delta=%ld\n", i, owd_difference, local_delta, remote_delta);
on_block(ctx, bi);
}
}
@ -399,7 +399,10 @@ void algo_thunder_init(struct evt_core_ctx* ctx, struct algo_ctx* app_ctx, struc
thunderc->total_links = app_ctx->ap.links;
thunderc->selected_link = thunderc->total_links - 1;
thunderc->allowed_jitter_ms = 200;
for (int i = 0; i < MAX_LINKS; i++) thunderc->received_pkts_on_link[i] = 1;
for (int i = 0; i < thunderc->total_links; i++) {
thunderc->received_pkts_on_link[i] = 1;
thunderc->rcv_delta_t_per_link[i] = 0;
}
union abstract_packet links = {};
//fprintf(stderr, "Total links %d\n", thunderc->total_links);