首页 > 代码库 > update_dctcp_alpha
update_dctcp_alpha
1 /* 2 + * Update dctcp alpha based on the ecn bit in the received packet. 3 + * This procedure is called only when dctcp_ is 1. 4 + */ 5 + void FullTcpAgent::update_dctcp_alpha(Packet *pkt) 6 + { 7 + int ecnbit = hdr_flags::access(pkt)->ecnecho(); 8 + int ackno = hdr_tcp::access(pkt)->ackno(); 9 + int acked_bytes = ackno - highest_ack_; 10 + 11 + if (acked_bytes <= 0) 12 + acked_bytes = size_; 13 + dctcp_total += acked_bytes;14 + if (ecnbit) {15 + dctcp_marked += acked_bytes;16 + }17 + 18 + /* Check for barrier indicating its time to recalculate alpha.19 + * This code basically updated alpha roughly once per RTT.20 + */21 + if (ackno > dctcp_alpha_update_seq) {22 + double temp_alpha;23 + dctcp_alpha_update_seq = dctcp_maxseq;24 + if (dctcp_total > 0) 25 + temp_alpha = ((double) dctcp_marked) / dctcp_total;26 + else 27 + temp_alpha = 0.0;28 + 29 + dctcp_alpha_ = (1 - dctcp_g_) * dctcp_alpha_ + dctcp_g_ * temp_alpha;30 + dctcp_marked = 0;31 + dctcp_total = 0;32 + }33 + }
update_dctcp_alpha
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。