当前位置:网站首页>Calculate BDP value and wnd value
Calculate BDP value and wnd value
2022-07-25 05:41:00 【Know the old code】
Calculation BDP Values and wnd value
background
Optimize the network , Need to adjust wnd The best value of window value . But there is no algorithm that is particularly easy to understand . The example given is completely out of line with the result of your own calculation . Burst the liver for several nights , Finally put BDP and Window value I understand the calculation method of , The network efficiency has indeed been improved .
I hope this blog can help Xiaobai understand the calculation process , Help people in need .
BDP Value algorithm
Reference resources : https://docs.oracle.com/cd/E56344_01/html/E53803/gnkor.html
BDP brief introduction :
Bandwidth delay product (bandwidth delay product, BDP)
computing method :Bandwidth-Delay Product = delay * bandwidth
Bandwidth delay product = Time delay * bandwidth
BDP = Broadband _ byte _B * Time delay _s
sndwnd and rcvwnd Algorithm
sndwnd Is the send window , Corresponding upload ;rcvwnd Is the receiving window , Corresponding download .
computing method : Window value _ byte _B = BDP / MTU
Use python Calculate window value
Even if the calculation method is given , I'll feel dizzy for the first time , Simply write it directly python Script , If you need it, take it and calculate it directly . Personally, I think the notes are fairly clear , I hope those who need it can understand it .
""" Refer to the formula : BDP = Broadband _ byte _B * Time delay _s Window value _ byte _B = BDP / MTU """
def wnd( bandwidth _ Megabits _Mbit, Time delay _s, MTU):
""" # Calculate window value _ byte _B :param bandwidth _ Megabits _Mbit: Incoming bandwidth value ( Small b) :param Time delay _s: Incoming delay (s) :param MTU: Incorporation mtu value ( It's usually 1400) :return: Return the calculated window value _ byte _B """
# 128 = 1024 / 8 # kBtye conversion Mbit The value of is 128
# Broadband _ kilobytes _kBtye = bandwidth _ Megabits _Mbit * 128
Broadband _ kilobytes _kBtye = bandwidth _ Megabits _Mbit * 1024 / 8
# Broadband _ byte _B and Broadband _ kilobytes _kBtye The conversion unit of is 1024
Broadband _ byte _B = Broadband _ kilobytes _kBtye * 1024
BDP = Broadband _ byte _B * Time delay _s
# Window value _ byte _B In bytes _B
Window value _ byte _B = BDP / MTU
print(f"BDP The value is :{
int(BDP)}")
print(f" The window value is :{
int( Window value _ byte _B)}")
if __name__ == '__main__':
bandwidth _ Megabits _Mbit = 500
Time delay _s = 0.125
MTU = 1500
# Print window values _ byte _B
wnd( bandwidth _ Megabits _Mbit, Time delay _s, MTU)
边栏推荐
- How to start if you want to be a product manager?
- 微服务 - Hystrix 熔断器
- Three billion dollars! Horizon becomes the world's highest valued AI chip Unicorn
- Tips for downloading videos in batches
- msys2常用配置
- 2020ICPC 江西省赛热身赛 E.Robot Sends Red Packets(dfs)
- Typera+picgo+ Alibaba cloud OSS setup and error reporting solution [reprint]
- HTB-Granpa
- Exchange 2010 SSL certificate installation document
- The selection reference of Junzheng T41, T40 and T31 versions are all here
猜你喜欢

LeetCode第302场周赛

Realsense d435i depth map optimization_ High precision mode

The computer accesses the Internet normally with the same network cable, and the mobile phone connects to WiFi successfully, but it cannot access the Internet

Easyrecovery free data recovery tool is easy to operate and restore data with one click

Why is it that all the games are pseudorandom and can't make true random?

sqlilabs less-28~less-8a

线性代数(三)

Adaptation dynamics | in June, sequoiadb completed mutual certification with five products

Application of hard coding and streaming integration scheme based on spice protocol in cloud games

Microservice gateway component
随机推荐
Basset: learning the regulatory code of the accessible genome with deep convolutional neural network
HTB-Arctic
G1 garbage collector
JWT(json web token)
Terminate 5g chip cooperation! The official response of Intel and zhanrui came
npx和npm区别
The difference between $write and $display in SystemVerilog
2020ICPC 江西省赛热身赛 E.Robot Sends Red Packets(dfs)
[cloud co creation] design Huawei cloud storage architecture with the youngest cloud service hcie (Part 1)
Summary of common attributes of flex layout
typora+PicGo+阿里云OSS 搭建以及报错解决【转载】
HTB-Granpa
Leetcode 0121. the best time to buy and sell stocks - simulation from back to front
Obj file format and.Mtl file format
2021 ICPC Shaanxi warm up match b.code (bit operation)
微服务 - 配置中心 - Nacos
Adaptation dynamics | in June, sequoiadb completed mutual certification with five products
Samsung folding screen has sent samples to apple and Google, and the annual production capacity will be expanded from 2.4 million to 10million!
Unity中使用UniRx入门总结
C Programming -- the solution of dynamic programming of "the sum of the largest subarray"