简体   繁体   English

Netty和非标准TCP连接

[英]Netty and non standard TCP connections

I have 2 components, A and B, on different LANs with a Linux server between which acts as gateway for both LANs. 我在不同的LAN上有两个组件A和B,其中Linux服务器充当两个LAN的网关。

A sends TCP traffic to B using a gateway deployed on the public Internet. A使用部署在公共Internet上的网关向B发送TCP流量。 Therefore, no SYN is sent from A to B via the Linux server. 因此,没有SYN通过Linux服务器从A发送到B。 However, C sends TCP traffic back to A using a local TCP connection (the gateway is not involved). 但是,C使用本地TCP连接将TCP通信发送回A(不涉及网关)。 By sniffing the traffic, I can see that C is not establishing a regular TCP connection (SYN) but starts by sending (SYN+ACK). 通过嗅探流量,我可以看到C没有建立常规的TCP连接(SYN),而是通过发送(SYN + ACK)开始。

I'm using iptables on the Linux server to redirect locally the TCP traffic sent by C to A. Traffic is redirected to local port 9000. 我正在Linux服务器上使用iptables将C所发送的TCP流量本地重定向到A。流量被重定向到本地端口9000。

However, I would also like to intercept this traffic, therefore I've built a simple Netty proxy which listens on port 9000. For some reason, Netty doesn't receive or ignore this traffic. 但是,我也想拦截此流量,因此,我建立了一个简单的Netty代理,该代理侦听端口9000。出于某些原因,Netty不会接收或忽略此流量。

I wonder if Netty is able to manage the case of a SYN-ACK without SYN. 我想知道Netty是否能够在不使用SYN的情况下管理SYN-ACK的情况。

Any idea? 任何想法?

The question is whether the TCP protcool implementation stack in the kernel will manage it. 问题是内核中的TCP protcool实现堆栈是否将对其进行管理。

Netty won't even see it, whether managed by TCP/IP or not. Netty甚至看不到它,无论是否由TCP / IP管理。

Netty isn't an implementation of TCP/IP. Netty不是TCP / IP的实现。 It is an API layered over the Java API, which is layered over the BSD Sockets API, and none of those is an implementation of TCP/IP either. 它是一个位于Java API之上的API,该Java API则位于BSD Sockets API之上,并且都不是TCP / IP的实现。 It can't see any further into the network than calling listen() and accept() in this case. 在这种情况下,除了调用listen()accept() ,它再也看不到网络了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM