Java RMI and netstat output

帅比萌擦擦* 提交于 2019-12-08 04:54:29
tcp6       0      0 10.1.1.1:1099         10.1.1.2:33400        ESTABLISHED

A connection between a client on port 33400 and a server on port 1099. You can't tell that from this line alone but you mentioned RMI which uses 1099, and there would have been a prior line with 1099 LISTENING.

tcp6       0      0 10.1.1.1:1099         10.1.1.1:33378        ESTABLISHED

A connection between a client on port 33378 and a server on port 1099. Same remark as above.

tcp6       0      0 10.1.1.1:33408        10.1.1.1:1099         ESTABLISHED

A connection between a client on port 33408 and a server on port 1099. Same remark as above. If the client was on a different host, this line would only show at the client host.

tcp6       0      0 10.1.1.1:1099         10.1.1.1:33408        ESTABLISHED

The other side of that connection. This line only shows at the server host.

tcp6       0      0 10.1.1.1:46866        10.1.1.2:1099         ESTABLISHED
tcp6       0      0 10.1.1.1:1099         10.1.1.2:33404        ESTABLISHED
tcp6       0      0 10.1.1.1:33378        10.1.1.1:1099         ESTABLISHED
tcp6       0      0 10.1.1.1:46862        10.1.1.2:1099         ESTABLISHED
tcp6       0      0 10.1.1.1:46864        10.1.1.2:1099         ESTABLISHED
tcp6       0      0 10.1.1.1:1099         10.1.1.2:33402        ESTABLISHED
tcp6       0      0 10.1.1.1:46860        10.1.1.2:1099         ESTABLISHED

Et cetera.

Is this expected?

Yes.

Why am I seeing port #'s like 33400, 33378 etc?

Because connections have two ends: a server end and a client end, and the client port is normally chosen fairly randomly.

Or is my understanding of how source and destination ports work wrong? I was hoping to see all connections (registry lookup and remote service calls) going to port 1099 only.

They are. But there are client ends to those connections.

This is really a question about TCP and netstat, not RMI or Java.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!