Chapter 2 - 18. Understanding Congestion in Fibre Channel Fabrics

Effect of Primitive Signals on Data Rate

Primitive signals, such as R_RDY, do not contribute to the data rate of an FC link, and hence, they do not increase link utilization. Primitive Signals, however, are accounted in the bit rate. As explained earlier, the difference between the bit rate and data rate leaves enough space for Primitive Signals to be transmitted without contributing to the link utilization. Let’s understand it in detail. R_RDY 等原始信号不影响 FC 链路的数据传输速率,因此不会提高链路利用率。然而,原始信号会计入比特率。如前所述,比特率和数据率之间的差额为原始信号的传输留出了足够的空间,而不会增加链路利用率。让我们来详细了解一下。

An FC port is ready to send frames when it reaches an active state. But it sends frames only when an upper-layer protocol hands off data to the Fibre Channel levels. If there is no data from the upper layers, the FC port continuously transmits fill words (4 bytes), for example, Idle, at a bit rate (Figure 2-29) defined by the port speed. These fill words maintain synchronization between the sender and the receiver and keep the link ready for frame transmission. FC 端口在达到激活状态时就可以发送帧。但只有当上层协议向光纤通道层发送数据时,FC 端口才会发送帧。如果上层没有数据,FC 端口会以端口速度定义的比特率(图 2-29)持续传输填充字(4 字节),例如空闲。这些填充字可保持发送方和接收方之间的同步,并使链路为帧传输做好准备。

Figure 2-29 Fill words on a Fibre Channel link with no traffic

When an upper layer hands off data to Fibre Channel levels and as a result the FC port has frames for transmission, it replaces multiple fill words with the frame. But fill words are never completely eliminated because they make the inter-frame fill (Figure 2-30). Only a frame, which carries the Data Field, adds to the data rate on a link. 当上层将数据移交给光纤通道层时,FC 端口因此有了要传输的帧,它会将多个填充字替换为帧。但填充字永远不会被完全消除,因为它们会造成帧间填充(图 2-30)。只有携带数据字段的帧才会增加链路上的数据传输速率。

Figure 2-30 Fill word primitive signals and frame

### 关于 `gnuplot-example.cc` 的介绍 在探讨 `gnuplot-example.cc` 程序时,可以理解这是一个用于展示如何通过 C++ 代码调用 Gnuplot 来创建图形的例子。这类程序通常旨在说明编程接口与数据可视化工具之间的交互方法。 #### 使用 Gnuplot 绘制拥塞窗口变化趋势图 对于具体实现方面,假设有一个名为 `cwnd.dat` 的文件存储了时间序列数据以及对应的拥塞窗口大小值,则可以通过如下方式来绘制这些数据: ```cpp #include <iostream> #include <fstream> #include <string> int main() { std::ofstream scriptFile; scriptFile.open ("plot_cwnd.gnu"); // 向脚本文件写入Gnuplot指令 scriptFile << "set xlabel 'Time'\n"; scriptFile << "set ylabel 'Congestion Window Size'\n"; scriptFile << "set grid\n"; scriptFile << "set title 'TCP Congestion Window Variation'\n"; scriptFile << "plot 'cwnd.dat' using 1:2 title 'Congestion Window' with linespoints\n"; scriptFile.close(); system("gnuplot -persist plot_cwnd.gnu"); // 执行Gnuplot命令并保持窗口打开状态 return 0; } ``` 此段代码展示了如何编写一个简单的C++应用程序,该应用能够读取外部的数据集,并利用Gnuplot生成相应的图表[^1]。 #### 导出图像至 PNG 文件 为了使生成的图表更易于分享和集成到其他文档中,还可以修改上述例子中的部分逻辑,使得最终结果被保存成图片形式而非仅限于临时显示。这可通过调整终端设置完成: ```cpp // 修改后的部分内容 scriptFile << "set terminal png size 800,600\n"; // 设置输出格式为PNG及其尺寸 scriptFile << "set output 'output.png'\n"; // 指定输出路径及名称 ``` 这样做的好处在于可以直接获得高质量的静态图像文件,方便后续处理或嵌入报告之中[^4]。 #### 创建三维表面图或其他复杂图形 如果涉及到更加复杂的多维数据分析场景下,比如需要呈现三个维度上的关系时,同样可以在类似的框架内扩展功能。例如,当拥有适合构建3D模型的数据源之后,就可以尝试制作不同类型的高级视图,像曲面图、等高线图或是热力图等形式[^3]: ```cpp // 假设存在xyz_data.txt作为输入源 scriptFile << "splot 'xyz_data.txt' u 1:2:3 w l notitle\n"; // 构建简单线条连接的3D散点图 ``` 以上就是有关 `gnuplot-example.cc` 可能涉及的一些基本概念和技术细节描述。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mounter625

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值