Reputation: 201
I have a TCP server that only allows a few clients to connect to it. However the data transfer is purely unidirectional -- the server sends all the data to the client and the clients little to no data back to the server. Is there a way to use iptables or firewalls to redirect the TCP stream leaving the server to the client to another TCP client?
Upvotes: 2
Views: 938
Reputation: 108641
You may be able to cook up a sketchy packet sniffing scheme to do this, but the second client cannot be a standard tcp client.
There is no such thing as a unidirectional TCP connection. The PAYLOAD -- the application data transfer -- may be unidirectional, but TCP itself is a bidirectional, acknowledged, protocol, with state maintained at both ends and updated by control messages or control information piggybacked on data messages. The state is also updated by timeouts -- failures to receive control packets within a specified time.
TCP will turn 30 in September. Here is the RFC, written by Jon Postel of blessed memory. See http://www.ietf.org/rfc/rfc793.txt
The state diagram for the protocol entity at each end is shown in Figure 6.
Upvotes: 2