I am a bit lost how Idle Timeout (IT) is managed when there are different object involved for given connection.
VS has Idle Timeout set via TCP profile (let’s say it’s Standard VS), SNAT object has separate Idle Timeout set via SNAT Translation objects (I wonder why for SNAT IT is by default set to Indefinite when in all SOLs it’s advised to be set to shortest possible time?)
When given connection is processes only by SNAT object things seems to be simple, IT set in SNAT Translation for given Translation Address is used.
What in case we have such situation:
There is SNAT object for given Origin Address (10.128.20.11)
There is VS processing traffic from 10.128.20.0/24 network, SNAT pool set to None
Connection coming from 10.128.20.11 is processed by VS
According to my tests in this case SNAT object will translate src IP of packet to it’s Translation Address. VS will handle translation of dst IP
TCP IT is set to 300 s, SNAT Translation has TCP Idle Timeout set to 900 s
Which timeout will be used for connection that is both processed by VS and SNAT object? One set by TCP profile assigned to VS or the one set on SNAT Translation object?
What in case when VS is using SNAT Pool set to some configured SNAT pool (again we have IT in TCP profile and TCP IT in SNAT Translation object)?
My thinking is like this: When the virtual reaches it’s idle timeout, and it is configured to RST on timeout, it will send a RST to both client side and server side. At this point, it doesn’t matter what state the timeout counter for the SNAT is in. If RST on Timeout is not enabled on the virtual, then it will simply delete the connection from memory, at which point it again doesn’t matter what the SNAT thinks. Needs testing to be 100% certain though.
Thanks, well testing is the king of course but it takes time Your way things are working seems to be OK and simple so I hope it’s working like that. Because of some references to multiple timeouts in docs I lost my confidence how it’s handled. Thanks for help, Piotr
In a given scenario, the connection’s TCP idle timeout is 5 minutes (300 sec). The difference is that once the connection’s record is removed from the Connections Table (due to timeout exceeded), the SNAT translation record will be retained for another 10 minutes (600 sec). In this state, the SNAT record will only consume memory and do nothing useful. For this reason, the SNAT record’s Idle Timeout should be equal to the Idle Timeout value set in TCP profile, or less than that.
In a given scenario, the connection’s TCP idle timeout is 5 minutes (300 sec). The difference is that once the connection’s record is removed from the Connections Table (due to timeout exceeded), the SNAT translation record will be retained for another 10 minutes (600 sec). In this state, the SNAT record will only consume memory and do nothing useful. For this reason, the SNAT record’s Idle Timeout should be equal to the Idle Timeout value set in TCP profile, or less than that.
Are you sure about that? That can cause quite a mess (if I am not wrong) when setting is other way around: TCP IT - 300 s SNAT IT - 100s Will in this case SNAT record be removed before connection is removed for Connection Table? If so what will happen with connection - it will be broken because there will be no SNAT record used for src IP translation presesnt any more? Piotr
Are you sure about that? That can cause quite a mess (if I am not wrong) when setting is other way around: TCP IT - 300 s SNAT IT - 100s Will in this case SNAT record be removed before connection is removed for Connection Table? If so what will happen with connection - it will be broken because there will be no SNAT record used for src IP translation presesnt any more? Piotr
In an idle scenario, yes, the SNAT record will be removed before the TCP record. If the SNAT record is not in place while a packet for an existing TCP connection is received, a new SNAT record will be created and the session will not be interrupted. The impact to consider is very similar to TCP Idle Timeout vs. ARP record Idle Timeout - ARP records time out a lot sooner, but the TCP sessions are not interrupted because of that. Only thing you may want to consider is that setting a SNAT Idle Timeout value too low will start to consume CPU (due to the necessity of re-adding those SNAT records).
In an idle scenario, yes, the SNAT record will be removed before the TCP record. If the SNAT record is not in place while a packet for an existing TCP connection is received, a new SNAT record will be created and the session will not be interrupted. The impact to consider is very similar to TCP Idle Timeout vs. ARP record Idle Timeout - ARP records time out a lot sooner, but the TCP sessions are not interrupted because of that. Only thing you may want to consider is that setting a SNAT Idle Timeout value too low will start to consume CPU (due to the necessity of re-adding those SNAT records).
I was thinking about idle situation and I am a bit afraid that it is not so simple. If SNAT record will be removed and then new record created then new record can use different source port or even different src.IP (when SNAT pool used) - at least that is my view - there is no info about previous ip and port used for given connection because SNAT record was deleted. In this case connection should broke as at least different src port can be used for packets, and if I am not wrong receiving side will not recognize it as any existing connection and reject such packet. Am I wrong here? Piotr
I was thinking about idle situation and I am a bit afraid that it is not so simple. If SNAT record will be removed and then new record created then new record can use different source port or even different src.IP (when SNAT pool used) - at least that is my view - there is no info about previous ip and port used for given connection because SNAT record was deleted. In this case connection should broke as at least different src port can be used for packets, and if I am not wrong receiving side will not recognize it as any existing connection and reject such packet. Am I wrong here? Piotr
Thanks a lot for your time. I would not bother others but I am still not so good with packet tracing and tmsh. I am working on that skills and hopefully soon will manage to do such tests by myself. Only thing that above is still not resolving is what will happen when we will not use indefinite for on of settings but instead configure explicitly some timeouts on both objects. Common sense dictates that still VS profile setting should win but… Piotr
Thanks a lot for your time. I would not bother others but I am still not so good with packet tracing and tmsh. I am working on that skills and hopefully soon will manage to do such tests by myself. Only thing that above is still not resolving is what will happen when we will not use indefinite for on of settings but instead configure explicitly some timeouts on both objects. Common sense dictates that still VS profile setting should win but… Piotr
Sorry for nit picking :-), promise to avoid. To summarize: 1. Setting of VS always wins 2. It’s best to use SNAT pool (even with one translation IP) - then you have full control when SNAT is used, SNAT object has to be created explicitly or SNAT pool used with VS. No way to create some hole in LTM like with SNAT object not using SNAT pool 3. When using SNAT object it’s advised to adjust IT - I guess leaving it at Indefinite is not best practice Thanks a lot for all help, I really appreciate your time and effort. Piotr