Split debugging info related to ACK's and packet retransmissions

This commit is contained in:
gardners 2013-08-30 14:56:22 +09:30 committed by Jeremy Lakeman
parent f02e55c443
commit 33ad9ae0bc
3 changed files with 13 additions and 9 deletions

View File

@ -228,6 +228,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
STRUCT(debug)
ATOM(bool_t, verbose, 0, boolean,, "")
ATOM(bool_t, ack, 0, boolean,, "")
ATOM(bool_t, dnaresponses, 0, boolean,, "")
ATOM(bool_t, dnahelper, 0, boolean,, "")
ATOM(bool_t, queues, 0, boolean,, "")

View File

@ -576,8 +576,8 @@ int overlay_queue_ack(struct subscriber *neighbour, struct network_destination *
if (!destination->max_rtt || rtt > destination->max_rtt)
destination->max_rtt = rtt;
if (config.debug.overlayframes)
DEBUGF("Packet %p to %s sent by seq %d, acked with seq %d",
if (config.debug.ack)
DEBUGF("DROPPED DUE TO ACK: Packet %p to %s sent by seq %d, acked with seq %d",
frame, alloca_tohex_sid(neighbour->sid), frame_seq, ack_seq);
// drop packets that don't need to be retransmitted
@ -589,8 +589,8 @@ int overlay_queue_ack(struct subscriber *neighbour, struct network_destination *
}else if (seq_delta < 128 && frame->destination && frame->delay_until>now){
// retransmit asap
if (config.debug.overlayframes)
DEBUGF("Requeue packet %p to %s sent by seq %d due to ack of seq %d", frame, alloca_tohex_sid(neighbour->sid), frame_seq, ack_seq);
if (config.debug.ack)
DEBUGF("RE-TX DUE TO NACK: Requeue packet %p to %s sent by seq %d due to ack of seq %d", frame, alloca_tohex_sid(neighbour->sid), frame_seq, ack_seq);
frame->delay_until = now;
overlay_calc_queue_time(&overlay_tx[i], frame);
}

View File

@ -740,9 +740,9 @@ static int send_neighbour_link(struct neighbour *n)
else
flags|=FLAG_BROADCAST;
if (config.debug.linkstate && config.debug.verbose)
if (config.debug.ack)
DEBUGF("LINK STATE; Sending ack to %s for seq %d", alloca_tohex_sid(n->subscriber->sid), n->best_link->ack_sequence);
append_link_state(frame->payload, flags, n->subscriber, my_subscriber, n->best_link->neighbour_interface, 1,
n->best_link->ack_sequence, n->best_link->ack_mask, -1);
if (overlay_payload_enqueue(frame))
@ -752,7 +752,7 @@ static int send_neighbour_link(struct neighbour *n)
n->last_update = now;
}
n->next_neighbour_update = n->last_update + n->best_link->interface->destination->tick_ms;
if (config.debug.linkstate && config.debug.verbose)
if (config.debug.ack)
DEBUGF("Next update for %s in %lldms", alloca_tohex_sid(n->subscriber->sid), n->next_neighbour_update - gettime_ms());
OUT();
return 0;
@ -961,8 +961,11 @@ int link_state_ack_soon(struct subscriber *subscriber){
if (neighbour->using_us
&& subscriber->reachable & REACHABLE_DIRECT
&& subscriber->destination){
if (neighbour->next_neighbour_update > now + subscriber->destination->min_rtt)
if (neighbour->next_neighbour_update > now + subscriber->destination->min_rtt){
neighbour->next_neighbour_update = now + subscriber->destination->min_rtt;
if (config.debug.ack)
DEBUGF("Asking for next ACK Real Soon Now");
}
}
update_alarm(neighbour->next_neighbour_update);
OUT();
@ -1286,7 +1289,7 @@ int link_receive(struct overlay_frame *frame, overlay_mdp_frame *mdp)
neighbour->last_update_seq = -1;
}else if(seq_delta < 128){
// send another ack asap
if (config.debug.linkstate && config.debug.verbose)
if (config.debug.ack)
DEBUGF("LINK STATE; neighbour %s missed ack %d, queue another", alloca_tohex_sid(sender->sid), neighbour->last_update_seq);
neighbour->next_neighbour_update=now+5;
update_alarm(neighbour->next_neighbour_update);