I'm trying to simulate the situation where a connection is lost, to prepare for fault-tolerance of my application. my server listens on port 11111 instead of pulling out the physical cable, so far I do sudo /sbin/iptables -t filter -A INPUT -p tcp --dport 11111 -j REJECT this would reject new connections. but it seems that for already-established connections, the client side TCP won't trigger an exception if more bytes are pushed onto the connection is there a way to let TCP trigger an error ? Thanks
【在 c******n 的大作中提到】 : I'm trying to simulate the situation where a connection is lost, to prepare : for fault-tolerance of my application. : my server listens on port 11111 : instead of pulling out the physical cable, so far I do : sudo /sbin/iptables -t filter -A INPUT -p tcp --dport 11111 -j REJECT : this would reject new connections. but it seems that for already-established : connections, : the client side TCP won't trigger an exception if more bytes are pushed onto : the connection : is there a way to let TCP trigger an error ?
e*r
8 楼
just check USA-Beijing round trip: 2000!!! REALY EXPENSIVE!!
actually DROP will only cause a indefinite freeze on the client side, not causing it to drop, REJECT will actually send a RST what I am doing is similar to them with propability=1.0
If I were you, I might do this in a virtual machine and simulate real connection drop by disabling its virtual network interface. Can you try: sudo /sbin/iptables -t filter -A INPUT -p tcp --dport 11111 --state ESTABLISHED -j REJECT
j*y
14 楼
which website has over 100 cash back from shopper?
if you set p=1.0, there is no need for the random part. You just change the DROP to reject it should be fine.
【在 c******n 的大作中提到】 : actually DROP will only cause a indefinite freeze on the client side, : not causing it to drop, REJECT will actually send a RST : what I am doing is similar to them with propability=1.0
Just curious. What fault-tolerance you used on the server side? An idle client vs a dead client, will the server behave the same? Are you using tcp keepalive function or have your own logic?
prepare established onto
【在 c******n 的大作中提到】 : I'm trying to simulate the situation where a connection is lost, to prepare : for fault-tolerance of my application. : my server listens on port 11111 : instead of pulling out the physical cable, so far I do : sudo /sbin/iptables -t filter -A INPUT -p tcp --dport 11111 -j REJECT : this would reject new connections. but it seems that for already-established : connections, : the client side TCP won't trigger an exception if more bytes are pushed onto : the connection : is there a way to let TCP trigger an error ?
connection is always kept, server does not proactively bring down idle clients btw, I found the answer, it's simply adding "--reject-with tcp-reset " to my commands
【在 v*****r 的大作中提到】 : Just curious. What fault-tolerance you used on the server side? : An idle client vs a dead client, will the server behave the same? : Are you using tcp keepalive function or have your own logic? : : prepare : established : onto