VERB_DEBUG_CHATTER("[SrcMab %s] Received packet TCP seq %u, current seq is %u, this is a TCP retransmission, send it with high priority", _now.unparse().c_str(),
VERB_DEBUG_CHATTER("[SrcMab %s] Current arm is null for %s, kill packet", _now.unparse().c_str(), mab_sit.unparse().c_str());
return false;
}
_current_arm[mab_sit]->_tb.refill();
if(_current_arm[mab_sit]->_tb.contains(len)) {
VERB_DEBUG_CHATTER("[SrcMab %s] TokenBucket is of size %d, can send packet of size %d", _now.unparse().c_str(), _current_arm[mab_sit]->_tb.size(), len);
return true;
}
VERB_DEBUG_CHATTER("[SrcMab %s] TokenBucket is of size %d, less than size of packet %d", _now.unparse().c_str(), _current_arm[mab_sit]->_tb.size(), len);
VERB_DEBUG_CHATTER("[SrcMab] Received packet %p, mab sit %s, force %d, dequeued %d, keep %d, mark %d (marked %d), stop %d, can send %d", p_in, mab_sit.unparse().c_str(),
VERB_DEBUG_CHATTER("[SrcMab %s] TokenBucket is of size %d, less than size of packet %d, kill it", _now.unparse().c_str(), _current_arm[mab_sit]->_tb.size(), len);
_killed_too_much += len;
p_in->kill();
return false;
}
else {
VERB_DEBUG_CHATTER("[SrcMab %s] TokenBucket is of size %d, less than size of packet %d, enqueue it (size is %d, capacity %d)",
VERB_DEBUG_CHATTER("[SrcMab %s] TokenBucket is of size %d, less than size of packet %d, return (keep packet)", _now.unparse().c_str(), _current_arm[mab_sit]->_tb.size(), len);
}
return false;
}
}
VERB_DEBUG_CHATTER("[SrcMab %s] New TB size %d", _now.unparse().c_str(), _current_arm[mab_sit]->_tb.size());
// if((!assigned && randi<=sum_loc) || (_current_arm[mab_sit]->_explore==0 && diff.msecval() > 50)){ // send a packet at least every 50ms when exploiting
VERB_DEBUG_CHATTER("[SrcMab %s] Erasing packet for seq %u", _now.unparse().c_str(), i);
packets_table->get(i)->kill();
packets_table->erase(i);
}
else
VERB_DEBUG_CHATTER("[SrcMab %s] No packet to erase for seq %u", _now.unparse().c_str(), i);
}
}
_now.assign_now();
DEBUG_NACK_CHATTER("[SrcMab %s] Received NACK message on route %s for flow to %s with %d nacks (seq %d, last seen %d). Have sent %d, size of packet table was %d, is %d",
// note: we assume here that when exploring, packets are sent on only one route.
if(_debug) {
_now.assign_now();
click_chatter("[SrcMab %s] Mark last packet for id %d (have killed: stop=%s, mark=%s, too much=%s (enq %s)), will be sent at %s", _now.unparse().c_str(),
VERB_DEBUG_CHATTER("[SrcMab] After rates for second half, exploit");
_last_explore.assign_now();
if(_debug) {
click_chatter("[SrcMab %s] Half of trial %d, id %s, route %s. Rate was %s, have sent at rates %s B/s, total %d, %s B sent dequeued; have killed stop=%s B, mark=%s B, too much=%s B (enq %s); have sent %d B dummy packets.",
VERB_DEBUG_CHATTER("[SrcMab] After rates for second half, explore");
StringAccum s;
s << "[SrcMab " << _now.unparse() << "] First half of exploration trial done for routes " << print_vector(current_arm->_froutes);
s << " (arm " << _ind_arm << "), id " << old_id << ". Rate was " << old_rate_str << "(have sent at rate " << print_vector(sent);
s << " B/s (total " << total_sent << "), have killed stop=" << String(_killed_stop) << "B, mark=" << String(_killed_mark);
s << "B, too much=" << String(_killed_too_much) << " B (enq " << _killed_too_much_enq << "); have sent " << String(_dummy_packet_sent) << " B dummy packets, " << String(_sent_dequeued) <<" B dequeued.";
s << " Is now " << print_vector(current_arm->_current_sending_rate) << reduced_rate << ", new id " << _currentId[_current_dst] << ".\n";
s << "Size is " << size() << ", TCP retransmissions ";
DEBUG_CHATTER("[SrcMab %s] End of trial %d, last seq id %d (rate was %s, have sent at rate %s B/s (total %d), have killed stop=%s B, mark=%s B, too much=%s B (enq %s); have sent %d B dummy packets, %s B dequeued, %d retransmissions)...",
click_chatter("[SrcMab %s] End of trial %d, last seq id %d. Rate was %s, have sent at rates %s B/s, total %d; have killed stop=%s B, mark=%s B, too much=%s B (enq %s); have sent %d B dummy packets, %s B sent dequeued, %d retransmissions.",
DEBUG_CHATTER("[SrcMab %s] Sending %d control packets on route %s of type %d for id %d (timestamp %s) for flow from %s to %s with %d missing acks... Timer scheduled at %s (queue %d, dummy %d)",
int sum_ok = _arms[mab_sit][i]->_missed_acks_explore.sum();
if( sum_ok < 3)
missed=" (missed "+String(_arms[mab_sit][i]->_missed_acks_explore.size() - sum_ok)+" out of "+String(_arms[mab_sit][i]->_missed_acks_explore.size())+")";
DEBUG_CHATTER("[SrcMab %s] UCB for arm %d is %d (scale %d, rate %d, nr_trials %d, total nr_explore %d, use %d). Missed %d%s.",
_now.unparse().c_str(), i, ucb, _arms[mab_sit][i]->_scaling_rate, _arms[mab_sit][i]->_current_best_rate_total,
if(rate < MAX_POSSIBLE_RATE && rate > max_rate && admissible) { // check that rate less than MAX_POSSIBLE_RATE (should not happen)
max_rate = rate;
best_rate.clear();
best_rate.push_back((uint32_t) rate_vec[0]);
best_rate.push_back((uint32_t) rate_vec[1]);
}
}
else if(it2.value().size() != 2)
DEBUG_CHATTER("[SrcMab] Error when computing rate: wrong size of second alpha %d (should be 2)", it.value().size());
else if (it2.value()[0] == 0 && it2.value()[1] == 0)
DEBUG_CHATTER("[SrcMab] Error when computing rate: second alpha is zero");
}
}
else if (it.value().size() != 2)
DEBUG_CHATTER("[SrcMab] Error when computing rate: wrong size of first alpha %d (should be 2)", it.value().size());
else
DEBUG_CHATTER("[SrcMab] Error when computing rate: first alpha is zero");
}
bool pass = false;
if(min_rate_route0 < 5*125*arm->_routes[0].max_capa_alone) { // if greater than three times capacity from routing, it is likely to be a mistake (note: B/s vs. kb/s)
DEBUG_CHATTER("[SrcMab %s] New best rate for arm %d, routes %s, explore %d (missed %d), is %s, total %u (was %s, total %u, estimation at this slot: %s, total %u)",
DEBUG_CHATTER("[SrcMab %s] New multipaths for ip %s, %d multipaths computed, had %d, now %d (%d to add, %d to remove), computed in %s sec", _last_computed_routes.unparse().c_str(),
//VERB_DEBUG_CHATTER("[SrcMab] Received packet, IP protocol %d (UDP is %d)", ip4_header->ip_p, IP_PROTO_UDP);
if(ip4_header->ip_p == IP_PROTO_ICMP)
return true;
if(ip4_header->ip_p == IP_PROTO_UDP) {
const click_udp *udp_hdr = p_in->udp_header();
//VERB_DEBUG_CHATTER("[SrcMab] It's an UDP packet, from port %d (ntoh %d) to port %d (ntoh %d)", udp_hdr->uh_sport, ntohs(udp_hdr->uh_sport), udp_hdr->uh_dport, ntohs(udp_hdr->uh_dport));