From my understanding, A TCP session is identified as <ServerIP, ServerPort, ClientIP, ClientPort>
.
根据我的理解,TCP会话被识别为
For instance, the session <192.168.0.1, 80, 192.168.0.2, 1000>
is separated from <192.168.0.1, 80, 192.168.0.2, 1001>
, and these two sessions can co-exist on the hosts simultaneously.
例如,会话<192.168.0.1,80,192.168.0.2,1000>与<192.168.0.1,80,192.168.0.2,1001>分开,并且这两个会话可以同时在主机上共存。
However, in OPNET, if <192.168.0.1, 80, 192.168.0.2, 1000>
is already established, then <192.168.0.1, 80, 192.168.0.2, 1001>
cannot be established because port 80 of 192.168.0.1 is already in use.
但是,在OPNET中,如果已经建立了<192.168.0.1,80,192.168.0.2,1000>,则无法建立<192.168.0.1,80,192.168.0.2,1001>,因为192.168.0.1的端口80已经在使用。
Given this model, if I try to host a HTTP service on 192.168.0.1:80, there can only be 1 connection to my server at a time, which severely limits the simulation capability.
鉴于此模型,如果我尝试在192.168.0.1:80上托管HTTP服务,则一次只能有1个连接到我的服务器,这严重限制了模拟功能。
Please confirm whether the model is indeed problematic, or is there anything I have overlooked. Also a workaround solution would be very appreciated.
请确认模型是否确实存在问题,或者是否有任何我忽略的问题。此外,我们非常感谢解决方案。
1 个解决方案
#1
I dug into the source code of OPNET TCP model, and found the bug.
我挖掘了OPNET TCP模型的源代码,发现了这个bug。
First of all, OPNET does consider <192.168.0.1, 80, 192.168.0.2, 1000>
and <192.168.0.1, 80, 192.168.0.2, 1001>
as two separate and independent sessions, and it can distinguish them using a session_key
.
首先,OPNET确实将<192.168.0.1,80,192.168.0.2,1000>和<192.168.0.1,80,192.168.0.2,1001>视为两个独立且独立的会话,并且它可以使用session_key来区分它们。
However, there is a minor bug in the model. When an open request is issued to the TCP model layer (either PASSIVE
(listen) or ACTIVE
(connect)), the model will check if the local port is being used. If the local port is being used, a error signal will be returned regardless of the type of open request, whereas the correct action is to only check for ACTIVE
open.
但是,模型中存在一个小错误。当向TCP模型层发出打开请求(PASSIVE(listen)或ACTIVE(connect))时,模型将检查是否正在使用本地端口。如果正在使用本地端口,则无论打开请求的类型如何都将返回错误信号,而正确的操作是仅检查ACTIVE打开。
A solution is to modify the check procedure to only work for ACTIVE
open case. Preliminary test shows that multiple connection can be established on the same listening port now.
解决方案是将检查过程修改为仅适用于ACTIVE open case。初步测试表明,现在可以在同一个监听端口上建立多个连接。
#1
I dug into the source code of OPNET TCP model, and found the bug.
我挖掘了OPNET TCP模型的源代码,发现了这个bug。
First of all, OPNET does consider <192.168.0.1, 80, 192.168.0.2, 1000>
and <192.168.0.1, 80, 192.168.0.2, 1001>
as two separate and independent sessions, and it can distinguish them using a session_key
.
首先,OPNET确实将<192.168.0.1,80,192.168.0.2,1000>和<192.168.0.1,80,192.168.0.2,1001>视为两个独立且独立的会话,并且它可以使用session_key来区分它们。
However, there is a minor bug in the model. When an open request is issued to the TCP model layer (either PASSIVE
(listen) or ACTIVE
(connect)), the model will check if the local port is being used. If the local port is being used, a error signal will be returned regardless of the type of open request, whereas the correct action is to only check for ACTIVE
open.
但是,模型中存在一个小错误。当向TCP模型层发出打开请求(PASSIVE(listen)或ACTIVE(connect))时,模型将检查是否正在使用本地端口。如果正在使用本地端口,则无论打开请求的类型如何都将返回错误信号,而正确的操作是仅检查ACTIVE打开。
A solution is to modify the check procedure to only work for ACTIVE
open case. Preliminary test shows that multiple connection can be established on the same listening port now.
解决方案是将检查过程修改为仅适用于ACTIVE open case。初步测试表明,现在可以在同一个监听端口上建立多个连接。