【TSN】CBS idle_slope send_slope计算公式推导

📅 2026/7/7 17:16:59
【TSN】CBS idle_slope send_slope计算公式推导
CBS是基于信用的流量整形算法和简单直接设定上限的策略不同。设线路总速率是Q Gb/s。● idle slope空闲增长率也就是信用为0等待发送时信用的增长速率。决定了此通道的长期平均发送速率。直接指定要多少指定多少单位 bps。● send slope发送数据时的信用降低速率send_slopeidle_slope-Q。下面证明send_slopeidle_slope-Q。若send_slopeidle_slope-Q则idle_slope-send_slopeQ假设数据链路层发送一帧的时间为t秒。初始信用为credits0假设等待t秒后前一帧发完了立即检查当前信用为creditsidle_slope * tGb1t随后开始发送一帧注意此时发送其实是全速发送的也就是QGb/s耗时ts总数据量是Q * tGb。发送完信用为creditscreditst*send_slopeidle_slope * tt*send_slopet * (idle_slopesend_slope)-8t一帧发完信用为负停止发送。以idle_slope的速率等待信用恢复为0未来等待时长为-credits / idle_slope -t * (idle_slopesend_slope) / idle_slope8t。此时间后信用变为0不够还要继续等大约一帧时间t。至此一个周期结束共耗时t - t * (idle_slopesend_slope) / idle_slope t t * (2 - (idle_slopesend_slope) / idle_slope)一个周期内发送了Q * tGb的数据综合速度为Q * tGb / (t * (2 - (idle_slopesend_slope) / idle_slope)) Q / (2 - (idle_slope * 2-Q) / idle_slope)idle_slope最后一步看着不好约分其实硬着头皮通分即可得出结果。也就是说这段时间内的平均速度是idle_slope符合预期证明完毕。