#include #include #include #include typedef struct results_by_phase{ double k_arrival[2]; double k_delta; double k_estimate; double u_arrival[2]; double u_delta; double u_estimate; } results_by_phase_t; results_by_phase_t phase_array[MAX_n_replies]; /* Should be max_phase */ /*........................................................................*/ void print_estimates(void){ /* Prints the estimate fields of the phase_rrray */ int i; printf("The End-to-End bottleneck bandwidth estimates\n"); printf("according to the packet pair algorithm are:\n"); for (i=0;i0) &&(phase_array[i].k_arrival[1]>0)){ phase_array[i].k_delta= phase_array[i].k_arrival[1]- phase_array[i].k_arrival[0]; phase_array[i].u_delta= phase_array[i].u_arrival[1]- phase_array[i].u_arrival[0]; } } } /*........................................................................* * * * Bandwidth Inference Functions * * * *........................................................................*/ /*........................................................................*/ double BW_e2e(void){ /* Use phase_array to estimate BW using the packet-pair technique * * fill_phase_array should be called before calling this function */ int i; for (i=0;i0){ phase_array[i].k_estimate=markers_size[0]*8/phase_array[i].k_delta; phase_array[i].u_estimate=markers_size[0]*8/phase_array[i].u_delta; } } }