当前位置:网站首页>implement tcp bbr on ns3 (在ns3上实现TCP BBR)
implement tcp bbr on ns3 (在ns3上实现TCP BBR)
2022-08-02 14:12:00 【Soonyang Zhang】
After several days of work and debug, I implement TCP BBR algorithms on ns3.33.
One thing is to get instant rtt instead of smothed rtt.
The second is I notice some difference in tcp-rate-ops.cc (ns3) by comparison with tcp_rate.c (linux tcp stack).
const TcpRateOps::TcpRateSample &
TcpRateLinux::GenerateSample (uint32_t delivered, uint32_t lost, bool is_sack_reneg,
uint32_t priorInFlight, const Time &minRtt){
if (m_rateSample.m_priorTime == Seconds (0) || is_sack_reneg)
{
NS_LOG_INFO ("PriorTime is zero, invalidating sample");
m_rateSample.m_delivered = -1;
m_rateSample.m_interval = Seconds (0);
m_rateSampleTrace (m_rateSample);
return m_rateSample;
}
if (m_rateSample.m_interval < minRtt)
{
NS_LOG_INFO ("Sampling interval is invalid");
m_rateSample.m_interval = Seconds (0);
m_rateSample.m_priorTime = Seconds (0); // To make rate sample invalid
m_rateSampleTrace (m_rateSample);
return m_rateSample;
}
}
When m_priorTime is reset as zero in TcpRateSample, m_rateSample.m_ackElapsed will sample a time intervel equal to Simulator::Now (). And m_rateSample.m_priorTime will be update and the acked packet is valid (m_rateSample.m_priorTime!=Seconds(0)) in GenerateSample. A quite low bandwidth value will be sampled. Such low bandwidth will be used by long term bandwidth sampling in BBR algorithm. The flow will gain lower bandwidth here after and weird behavior will be observed.
void
TcpRateLinux::SkbDelivered (TcpTxItem * skb){
if (m_rateSample.m_priorDelivered == 0
|| skbInfo.m_delivered > m_rateSample.m_priorDelivered)
{
m_rateSample.m_ackElapsed = Simulator::Now () - m_rateSample.m_priorTime;
m_rateSample.m_priorDelivered = skbInfo.m_delivered;
m_rateSample.m_priorTime = skbInfo.m_deliveredTime;
m_rateSample.m_isAppLimited = skbInfo.m_isAppLimited;
m_rateSample.m_sendElapsed = skb->GetLastSent () - skbInfo.m_firstSent;
m_rateSampleTrace (m_rateSample);
m_rate.m_firstSentTime = skb->GetLastSent ();
}
}
So change is made on SkbDelivered function:
if (m_rateSample.m_priorDelivered == 0
|| skbInfo.m_delivered > m_rateSample.m_priorDelivered)
{
m_rateSample.m_priorDelivered = skbInfo.m_delivered;
m_rateSample.m_priorTime = skbInfo.m_deliveredTime;
m_rateSample.m_isAppLimited = skbInfo.m_isAppLimited;
m_rateSample.m_sendElapsed = skb->GetLastSent () - skbInfo.m_firstSent;
m_rate.m_firstSentTime = skb->GetLastSent ();
}
m_rateSample.m_ackElapsed = Simulator::Now () - m_rateSample.m_priorTime;
m_rateSampleTrace (m_rateSample);
The third change is in tcp_socket_base.cc
uint32_t
TcpSocketBase::SendDataPacket (SequenceNumber32 seq, uint32_t maxSize, bool withAck){
m_rateOps->SkbSent(outItem, isStartOfTransmission&&(m_tcb->m_highTxMark==m_tcb->m_nextTxSequence));
}
I test three TCP BBR flows on a 6Mbps, 50 one way propagation delay p2p link.
Result:
Estimated bandwidth at sender:
Taces rtt of each flow:
The code is uploaded to github [6].
Reference:
[1] Reproduce-TCP-BBR-in-ns-3
[2] linux bbr
[3] ns-3-dev-git
[4] test quic bbr on ns3
[5] evaluation BBRv2 on ns3
[6] tcp-bbr-ns3 code
边栏推荐
- Introduction to MATLAB drawing functions ezplot explanation
- 面试汇总
- [System Design and Implementation] Flink-based distracted driving prediction and data analysis system
- KiCad Common Shortcuts
- 1. Development community homepage, register
- Network Security Packet Capture
- 背包问题-动态规划-理论篇
- cmake configure libtorch error Failed to compute shorthash for libnvrtc.so
- 极简式 Unity 获取 bilibili 直播弹幕、SC、上舰、礼物等 插件
- 锥形相位掩模的Talbot图像
猜你喜欢
Doubled and sparse tables
使用1D-1D EPE的光波导布局设计工具
Detailed explanation of MATLAB drawing function plot
Based on the matrix calculation in the linear regression equation of the coefficient estimates
Installation and configuration of Spark and related ecological components - quick recall
第三十三章:图的基本概念与性质
第二十五章:一文掌握while循环
二叉树的遍历:递归法/ 迭代法/ 统一迭代法(强QAQ)
第二十九章:树的基本概念和性质
5. Transaction management
随机推荐
系统性能和TCP/UDP网络优化-学习大杂烩
项目:数据库表的梳理
软件测试基础知识(背)
MATLAB drawing command fimplicit detailed introduction to drawing implicit function graphics
光波导的入射耦合和出射耦合区域
锥形相位掩模的Talbot图像
shader入门精要2
Open the door to electricity "Circuit" (3): Talk about different resistance and conductance
线性结构,顺序结构
剑指offer:合并两个排序的链表
质数相关问题-小记
二叉树创建之层次法入门详解
Problems related to prime numbers - small notes
STM32LL library - USART interrupt to receive variable length information
求解斐波那契数列的若干方法
计算机导论——数据库
golang的内存相关内容
关于推荐系统的随想
Qt | 读取文件内容并删除文件 QFile
第二十五章:一文掌握while循环