Skip to content
Extraits de code Groupes Projets
Valider 5a2574f8 rédigé par Samuel de Meester de Ravestein's avatar Samuel de Meester de Ravestein
Parcourir les fichiers

stats for sender

parent dab1a749
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Fichier supprimé
Fichier supprimé
...@@ -114,61 +114,63 @@ void write_stats_to_file(const char * pathname, transfer_stats_t * stats_file) ...@@ -114,61 +114,63 @@ void write_stats_to_file(const char * pathname, transfer_stats_t * stats_file)
if (pathname == NULL || stats_file == NULL) if (pathname == NULL || stats_file == NULL)
return; return;
int fd = open(pathname, O_RDWR|O_CREAT|O_TRUNC); int fd = open(pathname, O_RDWR|O_CREAT|O_TRUNC, S_IRWXU);
if (fd == -1) if (fd == -1)
{ {
// We can use strerror cause here the error is known since we are using standard library open // We can use strerror cause here the error is known since we are using standard library open
DEBUG("%s", strerror(errno)); DEBUG("%s", strerror(errno));
return; return;
} }
int ret = 0;
char buffer[100]; char buffer[100];
sprintf((char *) &buffer, "data_sent:%llu\n", stats_file->data_sent); ret = sprintf((char *) &buffer, "data_sent:%llu\n", stats_file->data_sent);
write(fd, buffer, strlen(buffer)); ret = write(fd, buffer, strlen(buffer));
sprintf((char *) &buffer, "data_received:%llu\n", stats_file->data_received); ret = sprintf((char *) &buffer, "data_received:%llu\n", stats_file->data_received);
write(fd, buffer, strlen(buffer)); ret = write(fd, buffer, strlen(buffer));
sprintf((char *) &buffer, "data_truncated_received:%llu\n", stats_file->data_truncated_received); ret = sprintf((char *) &buffer, "data_truncated_received:%llu\n", stats_file->data_truncated_received);
write(fd, buffer, strlen(buffer)); ret = write(fd, buffer, strlen(buffer));
sprintf((char *) &buffer, "fec_sent:%llu\n", stats_file->fec_sent); ret = sprintf((char *) &buffer, "fec_sent:%llu\n", stats_file->fec_sent);
write(fd, buffer, strlen(buffer)); ret = write(fd, buffer, strlen(buffer));
sprintf((char *) &buffer, "fec_received:%llu\n", stats_file->fec_received); ret = sprintf((char *) &buffer, "fec_received:%llu\n", stats_file->fec_received);
write(fd, buffer, strlen(buffer)); ret = write(fd, buffer, strlen(buffer));
sprintf((char *) &buffer, "ack_sent:%llu\n", stats_file->ack_sent); ret = sprintf((char *) &buffer, "ack_sent:%llu\n", stats_file->ack_sent);
write(fd, buffer, strlen(buffer)); ret = write(fd, buffer, strlen(buffer));
sprintf((char *) &buffer, "ack_received:%llu\n", stats_file->ack_received); ret = sprintf((char *) &buffer, "ack_received:%llu\n", stats_file->ack_received);
write(fd, buffer, strlen(buffer)); ret = write(fd, buffer, strlen(buffer));
sprintf((char *) &buffer, "nack_received:%llu\n", stats_file->nack_received); ret = sprintf((char *) &buffer, "nack_received:%llu\n", stats_file->nack_received);
write(fd, buffer, strlen(buffer)); ret = write(fd, buffer, strlen(buffer));
sprintf((char *) &buffer, "packet_ignored:%llu\n", stats_file->packet_ignored); ret = sprintf((char *) &buffer, "packet_ignored:%llu\n", stats_file->packet_ignored);
write(fd, buffer, strlen(buffer)); ret = write(fd, buffer, strlen(buffer));
#ifdef __RECEIVER_UTILS_ #ifdef __RECEIVER_UTILS_
sprintf((char *) &buffer, "packet_duplicated:%llu\n", stats_file->packet_duplicated); ret = sprintf((char *) &buffer, "packet_duplicated:%llu\n", stats_file->packet_duplicated);
write(fd, buffer, strlen(buffer)); ret = write(fd, buffer, strlen(buffer));
sprintf((char *) &buffer, "packet_recovered:%llu\n", stats_file->packet_recovered); ret = sprintf((char *) &buffer, "packet_recovered:%llu\n", stats_file->packet_recovered);
write(fd, buffer, strlen(buffer)); ret = write(fd, buffer, strlen(buffer));
#endif #endif
#ifdef __SENDER_UTILS_H_ #ifdef __SENDER_UTILS_H_
ret = sprintf((char *) &buffer, "min_rtt:%llu ms\n", stats_file->min_rtt);
ret = write(fd, buffer, strlen(buffer));
sprintf((char *) &buffer, "min_rtt:%llu\n", stats_file->min_rtt); ret = sprintf((char *) &buffer, "max_rtt:%llu ms\n", stats_file->max_rtt);
write(fd, buffer, strlen(buffer)); ret = write(fd, buffer, strlen(buffer));
sprintf((char *) &buffer, "max_rtt:%llu\n", stats_file->max_rtt); ret = sprintf((char *) &buffer, "packet_retransmitted:%llu\n", stats_file->packet_retransmitted);
write(fd, buffer, strlen(buffer)); ret = write(fd, buffer, strlen(buffer));
sprintf((char *) &buffer, "packet_retransmitted:%llu\n", stats_file->packet_retransmitted);
write(fd, buffer, strlen(buffer));
#endif #endif
close(fd); close(fd);
ret--; // dump
DEBUG("Wrote the transfer statistics to %s.", pathname); DEBUG("Wrote the transfer statistics to %s.", pathname);
return; return;
} }
\ No newline at end of file
...@@ -39,7 +39,7 @@ typedef struct __attribute__((__packed__)) ...@@ -39,7 +39,7 @@ typedef struct __attribute__((__packed__))
unsigned long long int max_rtt; unsigned long long int max_rtt;
unsigned long long int packet_retransmitted; unsigned long long int packet_retransmitted;
#endif #endif
}transfer_stats_t; } transfer_stats_t;
/** /**
......
...@@ -46,17 +46,10 @@ int main(int argc, char **argv) { ...@@ -46,17 +46,10 @@ int main(int argc, char **argv) {
return print_usage(argv[0]); return print_usage(argv[0]);
} }
// DEBUG_DUMP("Some bytes", 11); // You can use it with any pointer type
ASSERT(fec_enabled == false);
ASSERT(stats_filename == NULL);
DEBUG("Sender has following arguments: \n\t\tfilename is %s,\n\t\tstats_filename is %s,\n\t\tfec_enabled is %d,\n\t\treceiver_ip is %s,\n\t\treceiver_port is %u", DEBUG("Sender has following arguments: \n\t\tfilename is %s,\n\t\tstats_filename is %s,\n\t\tfec_enabled is %d,\n\t\treceiver_ip is %s,\n\t\treceiver_port is %u",
filename, stats_filename, fec_enabled, receiver_ip, receiver_port); filename, stats_filename, fec_enabled, receiver_ip, receiver_port);
// Now let's code!
// Alright :-)
// *** Step 1: Create a socket AND connect *** // *** Step 1: Create a socket AND connect ***
struct sockaddr_in6 receiver_addr; struct sockaddr_in6 receiver_addr;
if (real_address(receiver_ip, &receiver_addr) != NULL) if (real_address(receiver_ip, &receiver_addr) != NULL)
...@@ -65,7 +58,7 @@ int main(int argc, char **argv) { ...@@ -65,7 +58,7 @@ int main(int argc, char **argv) {
return EXIT_FAILURE; return EXIT_FAILURE;
} }
// create_socket also create a connection using connection() !! // create_socket() also creates a connection using connect()
int socket_fd = create_socket(NULL, 0, &receiver_addr, receiver_port); int socket_fd = create_socket(NULL, 0, &receiver_addr, receiver_port);
if (socket_fd == -1) if (socket_fd == -1)
{ {
...@@ -106,7 +99,7 @@ int main(int argc, char **argv) { ...@@ -106,7 +99,7 @@ int main(int argc, char **argv) {
pfd[0].fd = socket_fd; pfd[0].fd = socket_fd;
pfd[0].events = POLLIN | POLLOUT; pfd[0].events = POLLIN | POLLOUT;
sender_state_t *state = state_new(); sender_state_t *state = state_new(fec_enabled);
if (state == NULL) if (state == NULL)
{ {
free(pfd); free(pfd);
...@@ -118,14 +111,15 @@ int main(int argc, char **argv) { ...@@ -118,14 +111,15 @@ int main(int argc, char **argv) {
struct timeval closing_pkt_sent_time; struct timeval closing_pkt_sent_time;
struct timeval curr_time; struct timeval curr_time;
while ((state->last_pkt_sent != CLOSING_PKT && state->last_pkt_sent != LAST_FEC) || state->s_window_size != MAX_WINDOW_SIZE) while ((state->fec_enabled && state->last_pkt_sent != LAST_FEC) || (state->s_window_size != MAX_WINDOW_SIZE) ||
(!state->fec_enabled && state->last_pkt_sent != CLOSING_PKT))
{ {
// Blocking system call // Blocking system call
int rvalue = poll(pfd, 1, -1); // -1 means that there are no setted time out int rvalue = poll(pfd, 1, -1); // -1 means that there are no setted time out
if (rvalue == -1) if (rvalue == -1)
{ {
free(pfd); free(pfd);
state_del(state); state_del(state, stats_filename);
close(socket_fd); close(socket_fd);
close(sending_fd); close(sending_fd);
ERROR("poll function failed"); ERROR("poll function failed");
...@@ -147,7 +141,7 @@ int main(int argc, char **argv) { ...@@ -147,7 +141,7 @@ int main(int argc, char **argv) {
if (rvalue == -1) if (rvalue == -1)
{ {
free(pfd); free(pfd);
state_del(state); state_del(state, stats_filename);
close(socket_fd); close(socket_fd);
close(sending_fd); close(sending_fd);
ERROR("handle_returning_pkt function failed"); ERROR("handle_returning_pkt function failed");
...@@ -169,7 +163,7 @@ int main(int argc, char **argv) { ...@@ -169,7 +163,7 @@ int main(int argc, char **argv) {
else else
{ {
free(pfd); free(pfd);
state_del(state); state_del(state, stats_filename);
close(socket_fd); close(socket_fd);
close(sending_fd); close(sending_fd);
ERROR("read_and_send function failed"); ERROR("read_and_send function failed");
...@@ -198,7 +192,7 @@ int main(int argc, char **argv) { ...@@ -198,7 +192,7 @@ int main(int argc, char **argv) {
else else
{ {
free(pfd); free(pfd);
state_del(state); state_del(state, stats_filename);
close(socket_fd); close(socket_fd);
close(sending_fd); close(sending_fd);
ERROR("checking_timer function failed"); ERROR("checking_timer function failed");
...@@ -207,9 +201,9 @@ int main(int argc, char **argv) { ...@@ -207,9 +201,9 @@ int main(int argc, char **argv) {
} }
} }
} }
DEBUG("Sender disconnected"); DEBUG("Sender disconnected");
free(pfd); free(pfd);
state_del(state); state_del(state, stats_filename);
close(sending_fd); close(sending_fd);
close(socket_fd); close(socket_fd);
return EXIT_SUCCESS; return EXIT_SUCCESS;
......
#include "sender_utils.h" #include "sender_utils.h"
sender_state_t *state_new() long long int time_milliseconds(struct timeval *time)
{
return ((long long int) time->tv_sec * 1000) + ((long long int) time->tv_usec / 1000);
}
sender_state_t *state_new(bool fec_enabled)
{ {
sender_state_t *state = (sender_state_t *) calloc(1, sizeof(sender_state_t)); sender_state_t *state = (sender_state_t *) calloc(1, sizeof(sender_state_t));
if (state == NULL) if (state == NULL)
...@@ -22,14 +27,21 @@ sender_state_t *state_new() ...@@ -22,14 +27,21 @@ sender_state_t *state_new()
state->map_seqnum_to_buffer_place[i] = OUT_OFF_WINDOW; state->map_seqnum_to_buffer_place[i] = OUT_OFF_WINDOW;
} }
state->last_pkt_sent = RANDOM_PKT; // default state->last_pkt_sent = RANDOM_PKT; // default
state->FEC = pkt_new(); state->fec_enabled = fec_enabled;
state->FEC_nbr = 0; if (fec_enabled)
{
state->FEC = pkt_new();
state->FEC_nbr = 0;
}
state->stats = calloc(sizeof(transfer_stats_t), 1);
return state; return state;
} }
void state_del(sender_state_t *state) void state_del(sender_state_t *state, const char * pathname)
{ {
// To be clean, we free the pkt that might not have been freed (in case of an error or timeout) write_stats_to_file(pathname, state->stats);
// To be sure, we free the pkt that might not have been freed (in case of an error or timeout)
for (uint8_t i = 0; i < WINDOW_SIZE; i++) for (uint8_t i = 0; i < WINDOW_SIZE; i++)
{ {
if (state->buffer[i] != NULL) if (state->buffer[i] != NULL)
...@@ -37,7 +49,11 @@ void state_del(sender_state_t *state) ...@@ -37,7 +49,11 @@ void state_del(sender_state_t *state)
pkt_del(state->buffer[i]); pkt_del(state->buffer[i]);
} }
} }
pkt_del(state->FEC); if (state->fec_enabled)
{
pkt_del(state->FEC);
}
free(state->stats);
free(state); free(state);
} }
...@@ -53,7 +69,7 @@ bool can_send(sender_state_t *state) ...@@ -53,7 +69,7 @@ bool can_send(sender_state_t *state)
// it was the end of the file (so that I can set a timer for timeout) // it was the end of the file (so that I can set a timer for timeout)
return state->s_window_size == MAX_WINDOW_SIZE; return state->s_window_size == MAX_WINDOW_SIZE;
} }
else if (state->last_pkt_sent == CLOSING_PKT) else if (state->fec_enabled && (state->last_pkt_sent == CLOSING_PKT))
{ {
return true; return true;
} }
...@@ -88,7 +104,8 @@ int send_pkt(sender_state_t *state, pkt_t *pkt, uint8_t position, int socket_fd) ...@@ -88,7 +104,8 @@ int send_pkt(sender_state_t *state, pkt_t *pkt, uint8_t position, int socket_fd)
state->buffer[position] = pkt; state->buffer[position] = pkt;
struct timeval time; struct timeval time;
gettimeofday(&time, NULL); gettimeofday(&time, NULL);
state->timers[position] = time.tv_sec; state->timers[position] = time;
state->stats->data_sent++;
return 0; return 0;
} }
...@@ -102,6 +119,7 @@ int handle_returning_ack_nack(sender_state_t *state, int socket_fd) ...@@ -102,6 +119,7 @@ int handle_returning_ack_nack(sender_state_t *state, int socket_fd)
pkt_status_code pkt_status = pkt_decode(buffer, read_bytes, pkt); pkt_status_code pkt_status = pkt_decode(buffer, read_bytes, pkt);
if (pkt_status != PKT_OK) if (pkt_status != PKT_OK)
{ {
state->stats->packet_ignored++;
pkt_del(pkt); pkt_del(pkt);
DEBUG("Decode function on a received pkt failed with status: %d so we discard the pkt", pkt_status); DEBUG("Decode function on a received pkt failed with status: %d so we discard the pkt", pkt_status);
return 0; return 0;
...@@ -114,6 +132,7 @@ int handle_returning_ack_nack(sender_state_t *state, int socket_fd) ...@@ -114,6 +132,7 @@ int handle_returning_ack_nack(sender_state_t *state, int socket_fd)
// Handling NACK: // Handling NACK:
if (pkt_type == PTYPE_NACK) if (pkt_type == PTYPE_NACK)
{ {
state->stats->nack_received++;
uint8_t place = state->map_seqnum_to_buffer_place[seqnum]; uint8_t place = state->map_seqnum_to_buffer_place[seqnum];
if (place == OUT_OFF_WINDOW) if (place == OUT_OFF_WINDOW)
{ {
...@@ -130,6 +149,7 @@ int handle_returning_ack_nack(sender_state_t *state, int socket_fd) ...@@ -130,6 +149,7 @@ int handle_returning_ack_nack(sender_state_t *state, int socket_fd)
// Handling ACK: // Handling ACK:
else else
{ {
state->stats->ack_received++;
DEBUG("The ACK with the seqnum: %d has been received", seqnum); DEBUG("The ACK with the seqnum: %d has been received", seqnum);
uint8_t seqnum_nack = seqnum; uint8_t seqnum_nack = seqnum;
uint8_t seqnum_ack = seqnum == 0 ? MAX_SEQNUM_SIZE : seqnum - 1; uint8_t seqnum_ack = seqnum == 0 ? MAX_SEQNUM_SIZE : seqnum - 1;
...@@ -166,6 +186,18 @@ int handle_returning_ack_nack(sender_state_t *state, int socket_fd) ...@@ -166,6 +186,18 @@ int handle_returning_ack_nack(sender_state_t *state, int socket_fd)
// A do while is necessary here in case we want to make a full revolution (ack from 1 to 1 not included for example) // A do while is necessary here in case we want to make a full revolution (ack from 1 to 1 not included for example)
do do
{ {
struct timeval time;
gettimeofday(&time, NULL);
unsigned long long int delta_time = time_milliseconds(&time) - time_milliseconds(&state->timers[state->tail]);
if (state->stats->min_rtt == 0 || state->stats->min_rtt > delta_time)
{
state->stats->min_rtt = delta_time;
}
if (state->stats->max_rtt < delta_time)
{
state->stats->max_rtt = delta_time;
}
pkt_t *n_pkt = state->buffer[state->tail]; pkt_t *n_pkt = state->buffer[state->tail];
seqnum = pkt_get_seqnum(n_pkt); seqnum = pkt_get_seqnum(n_pkt);
state->map_seqnum_to_buffer_place[seqnum] = OUT_OFF_WINDOW; state->map_seqnum_to_buffer_place[seqnum] = OUT_OFF_WINDOW;
...@@ -195,9 +227,8 @@ int checking_timer(sender_state_t *state, int socket_fd) ...@@ -195,9 +227,8 @@ int checking_timer(sender_state_t *state, int socket_fd)
if (state->buffer[state->tail] != NULL) if (state->buffer[state->tail] != NULL)
{ {
gettimeofday(&time, NULL); gettimeofday(&time, NULL);
time_t curr_time = time.tv_sec;
// When the timer is over, we send the packet back // When the timer is over, we send the packet back
if ((curr_time - state->timers[state->tail]) >= TIMER_LIMIT) if ((time_milliseconds(&time) - time_milliseconds(&state->timers[state->tail])) >= TIMER_LIMIT)
{ {
pkt_t *pkt = state->buffer[state->tail]; pkt_t *pkt = state->buffer[state->tail];
DEBUG("The pkt with seqnum: %d has timeout", pkt_get_seqnum(pkt)); DEBUG("The pkt with seqnum: %d has timeout", pkt_get_seqnum(pkt));
...@@ -268,13 +299,14 @@ int send_FEC(sender_state_t *state, int socket_fd) ...@@ -268,13 +299,14 @@ int send_FEC(sender_state_t *state, int socket_fd)
} }
memset(state->FEC, 0, sizeof(pkt_t)); memset(state->FEC, 0, sizeof(pkt_t));
state->FEC_nbr = 0; state->FEC_nbr = 0;
state->stats->fec_sent++;
return 0; return 0;
} }
int read_and_send(sender_state_t *state, int sending_fd, int socket_fd) int read_and_send(sender_state_t *state, int sending_fd, int socket_fd)
{ {
// Checking whether I need to send a PTYPE_FEC or PTYPE_DATA // Checking whether I need to send a PTYPE_FEC or PTYPE_DATA
if (state->FEC_nbr == 4 || state->last_pkt_sent == CLOSING_PKT) if ((state->fec_enabled) && (state->FEC_nbr == 4 || state->last_pkt_sent == CLOSING_PKT))
{ {
return send_FEC(state, socket_fd); return send_FEC(state, socket_fd);
} }
...@@ -328,7 +360,10 @@ int read_and_send(sender_state_t *state, int sending_fd, int socket_fd) ...@@ -328,7 +360,10 @@ int read_and_send(sender_state_t *state, int sending_fd, int socket_fd)
pkt_set_crc2(pkt, crc2); pkt_set_crc2(pkt, crc2);
if (send_pkt(state, pkt, state->head, socket_fd) == -1) return -1; if (send_pkt(state, pkt, state->head, socket_fd) == -1) return -1;
construct_FEC(state, pkt); if (state->fec_enabled)
{
construct_FEC(state, pkt);
}
state->map_seqnum_to_buffer_place[pkt_get_seqnum(pkt)] = state->head; state->map_seqnum_to_buffer_place[pkt_get_seqnum(pkt)] = state->head;
state->head = (state->head + 1) % WINDOW_SIZE; state->head = (state->head + 1) % WINDOW_SIZE;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#define SEQNUM_RANGE 256 #define SEQNUM_RANGE 256
#define TIMER_LIMIT 2 // It's in seconds, in this network, the latency to send is = [0, 2s] #define TIMER_LIMIT 2000 // It's in milli seconds, in this network, the latency to send is = [0, 2000ms]
#define SENDER_INACTIVE_TIMEOUT 30 // Only waits 30sec for the ACK of the CLOSING_PKT (the very last sended pkt) #define SENDER_INACTIVE_TIMEOUT 30 // Only waits 30sec for the ACK of the CLOSING_PKT (the very last sended pkt)
#define WINDOW_SIZE 31 #define WINDOW_SIZE 31
#define OUT_OFF_WINDOW 255 #define OUT_OFF_WINDOW 255
...@@ -38,31 +38,35 @@ typedef enum { ...@@ -38,31 +38,35 @@ typedef enum {
typedef struct state { typedef struct state {
uint8_t r_window_size; // receiver buffer space uint8_t r_window_size; // receiver buffer space
uint8_t s_window_size; // sender (our) buffer space uint8_t s_window_size; // sender (our) buffer space
time_t timers[WINDOW_SIZE]; // Time in seconds (corresponds to the timers of the sended pkt) struct timeval timers[WINDOW_SIZE]; // Time in seconds (corresponds to the timers of the sended pkt)
pkt_t *buffer[WINDOW_SIZE]; // When the buffer fields are not used, they MUST be se to NULL pkt_t *buffer[WINDOW_SIZE]; // When the buffer fields are not used, they MUST be se to NULL
uint8_t head; // place last element insert +1 in the buffer (free place) | Head and tail are used to know uint8_t head; // place last element insert +1 in the buffer (free place) | Head and tail are used to know
uint8_t tail; // place oldest element insert in the buffer | the start and end of the sender window (of the sended pkt) uint8_t tail; // place oldest element insert in the buffer | the start and end of the sender window (of the sended pkt)
uint8_t next_seqnum; uint8_t next_seqnum;
uint8_t map_seqnum_to_buffer_place[SEQNUM_RANGE]; // Default value is: OUT_OFF_WINDOW uint8_t map_seqnum_to_buffer_place[SEQNUM_RANGE]; // Default value is: OUT_OFF_WINDOW
last_sended_pkt_t last_pkt_sent; // Can either be: RANDOM_PKT, LAST_DATA_PKT, CLOSING_PKT or LAST_FEC last_sended_pkt_t last_pkt_sent; // Can either be: RANDOM_PKT, LAST_DATA_PKT, CLOSING_PKT or LAST_FEC
bool fec_enabled;
pkt_t *FEC; // The pkt FEC in construction pkt_t *FEC; // The pkt FEC in construction
uint8_t FEC_nbr; // The number of PTYPE_DATA stacked on FEC uint8_t FEC_nbr; // The number of PTYPE_DATA stacked on FEC
transfer_stats_t *stats;
} sender_state_t; } sender_state_t;
/** /**
* @brief Creation of the UNIQUE structure representing the sender state. * @brief Creation of the UNIQUE structure representing the sender state.
* *
* @return sender_state_t* : The structure reprensting the state of the sender. * @param fec_enabled : bool: variable telling whether the FEC are enabled or not
* @return sender_state_t* : The structure representing the state of the sender.
*/ */
sender_state_t *state_new(); sender_state_t *state_new(bool fec_enabled);
/** /**
* @brief Deletion if the structure representing the sender state. * @brief Deletion if the structure representing the sender state.
* *
* @param state : The variable representing the sender (state). * @param state : The variable representing the sender (state).
* @param pathname
*/ */
void state_del(sender_state_t *state); void state_del(sender_state_t *state, const char * pathname);
/** /**
* @brief Checking if the sender is allowed to send a NEW pkt * @brief Checking if the sender is allowed to send a NEW pkt
......
...@@ -33,7 +33,7 @@ port1=$(comm -23 <(seq 65000 65200 | sort) <(ss -Htan | awk '{print $4}' | cut - ...@@ -33,7 +33,7 @@ port1=$(comm -23 <(seq 65000 65200 | sort) <(ss -Htan | awk '{print $4}' | cut -
port2=$(comm -23 <(seq 65000 65200 | sort) <(ss -Htan | awk '{print $4}' | cut -d':' -f2 | sort -u) | shuf | head -n 1) port2=$(comm -23 <(seq 65000 65200 | sort) <(ss -Htan | awk '{print $4}' | cut -d':' -f2 | sort -u) | shuf | head -n 1)
# We first launch the link simulator # We first launch the link simulator
./linksimulator/link_sim -p $port2 -P $port1 -l 25 -d 0 -e 20 -c 10 \ ./linksimulator/link_sim -p $port2 -P $port1 -l 25 -d 0 -e 20 -c 30 \
&>${TEST_OUTPUT_FILES}/adv_${BSN_PRE}_link.log & link_pid=$! &>${TEST_OUTPUT_FILES}/adv_${BSN_PRE}_link.log & link_pid=$!
# We launch the receiver and capture its output # We launch the receiver and capture its output
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter