当前位置:网站首页>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
边栏推荐
猜你喜欢

cmake configure libtorch error Failed to compute shorthash for libnvrtc.so

剑指offer:合并两个排序的链表

饥荒联机版Mod开发——配置代码环境(二)

第二十六章:二维数组

1.开发社区首页,注册

mysql学习总结 & 索引

光导布局设计工具

【离散化+前缀和】Acwing802. 区间和

MATLAB drawing command fimplicit detailed introduction to drawing implicit function graphics

Installation and configuration of Spark and related ecological components - quick recall
随机推荐
LeetCode 2344. 使数组可以被整除的最少删除次数 最大公约数
unity 和C# 一些官方优化资料
剑指offer:反转链表
Qt | 读取文件内容并删除文件 QFile
px和em和rem的区别
Compilation error D8021: Invalid numeric argument '/Wextra' cl command line error d8021 invalid numeric argument '/Wextra'
Cmd Markdown 公式指导手册
STM32LL library use - SPI communication
lua编程
仿真结果的格式&定制
golang-reflect-method-callback
How to simulate 1/3 probability with coins, and arbitrary probability?
Detailed explanation of MATLAB drawing function plot
shader 和 ray marching
What are IPV4 and IPV6?
TypeScript
cmake configure libtorch error Failed to compute shorthash for libnvrtc.so
企业的电子签名、私钥签名
shader入门精要2
Codeforces Round #624 (Div. 3)