RTX 下使用普通網卡即可實現實時以太網的性能。作者對 RTX 與 Windows 下以太網性能進行了對比測試來驗證該觀點。
1. 測試環境
Windows XP 操作系統, RTX 使用Dedicated 模式, 單獨占用一顆 CPU 核, 硬件使用 Core i7, 4 核8 線程, 2.8GHz 主頻, 4GB 內存, 兩塊 Intel 82545GM 千兆網卡點對點互聯。
2. 測試方法
RTX 環境下, 測試方法為兩臺機器分別運行RT Client 和 RT Server 兩個 RTSS 應用程序, RT Client 發送數據包到 RT Server, RT Server 收到數據包之后發送回 RT Client。使用 TCP/IP & UDP 協議, 選擇不同的包長度, 每次發送500 個數據包, 重復 20 次Windows 環境下, 兩臺機器分別運行 Client 和 Server 兩個應用程序, Client 發送數據包到 Server, Server 收到數據包之后發送回 Client。使用 TCP/IP & UDP 協議, 選擇不同的包長度, 每次發送500 個數據包, 重復 20 次。
3. 測試結果
RTX 環境, TCP/IP 協議測試結果 | Windows 環境, TCP/IP 協議測試結果 | Packet Size = 1 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 35 us
Maximum Time = 54 us
Errors = 0
Lost Packets = 0 | -- | Packet Size = 16 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 36 us
Maximum Time = 55 us
Errors = 0
Lost Packets = 0 | Packet Size = 16 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 55 us
Maximum Time = 199 us
Errors = 0
Lost Packets = 0 | Packet Size = 32 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 37 us
Maximum Time = 54 us
Errors = 0
Lost Packets = 0 | Packet Size = 32 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 58 us
Maximum Time = 196 us
Errors = 0
Lost Packets = 0 | Packet Size = 64 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 39 us
Maximum Time = 51 us
Errors = 0
Lost Packets = 0
| Packet Size = 64 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 58 us
Maximum Time = 3400 us
Errors = 0
Lost Packets = 0
| Packet Size = 128 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 42 us
Maximum Time = 59 us
Errors = 0
Lost Packets = 0 | Packet Size = 128 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 55 us
Maximum Time = 166 us
Errors = 0
Lost Packets = 0 | Packet Size = 256 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 50 us
Maximum Time = 71 us
Errors = 0
Lost Packets = 0 | Packet Size = 256 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 79 us
Maximum Time = 653 us
Errors = 0
Lost Packets = 0 | Packet Size = 512 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 64 us
Maximum Time = 92 us
Errors = 0
Lost Packets = 0 | Packet Size = 512 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 122 us
Maximum Time = 495 us
Errors = 0
Lost Packets = 0 | Packet Size = 1024 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 92 us
Maximum Time = 111 us
Errors = 0
Lost Packets = 0 | Packet Size = 1024 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 212 us
Maximum Time = 716 us
Errors = 0
Lost Packets = 0 | Packet Size = 1462 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 117 us
Maximum Time = 633 us
Errors = 0
Lost Packets = 0 | -- | Packet Size = 2048 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 124 us
Maximum Time = 632 us
Errors = 0
Lost Packets = 0
| Packet Size = 2048 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 165 us
Maximum Time = 709 us
Errors = 0
Lost Packets = 0
| Packet Size = 4096 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 188 us
Maximum Time = 695 us
Errors = 0
Lost Packets = 0 | Packet Size = 4096 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 232 us
Maximum Time = 565 us
Errors = 0
Lost Packets = 0 | Packet Size = 8192 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 289 us
Maximum Time = 1083 us
Errors = 0
Lost Packets = 0 | Packet Size = 8192 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 348 us
Maximum Time = 946 us
Errors = 0
Lost Packets = 0 | Packet Size = 65535 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 1643 us
Maximum Time = 2707 us
Errors = 0
Lost Packets = 0 | Packet Size = 65535 bytes
Connections = 1
Messages / Connection = 10000
Minimum Time = 2244 us
Maximum Time = 2591 us
Errors = 0
Lost Packets = 0 |
4 測試數據分析
使用 TCP/IP 協議, 當傳輸的數據包長度低于1460 上限時, RTX 下數據包傳輸的實時性明顯優于 Windows 。當傳輸數據包長度超過 1460 上限的大包時, RTX 在應用層分包, Windows 下在 IP 層自動分包。由于 TCP 協議數據傳輸的可靠性要求, RTX 下大數據包需要接收多次數據包 ACK 報文, RTX 下數據包傳輸的實時性與 Windows 相當。使用 UDP 協議傳輸時, 由于 UDP 協議不需要數據包ACK 報文, RTX 實時性得以體現, RTX 下數據包傳輸的實時性明顯優于 Windows 。
5 結論
1)使用 TCP/IP 協議, 相比于 Windows, RTX 在傳輸小包(數據包長度低于 1460) 時有明顯的實時性。
2)使用 UDP 協議, 相比于 Windows, RTX 在數據包傳輸時有明顯的實時性。
|