The simple fix is to add more addresses to the SNAT pool and/or create a unique SNAT pool per LB pool. If you need to ensure the same client is SNAT’d to the same SNAT address over connections you can use an iRule:
FYI this is not for a SNAT, just a VIP with a pool of servers that were being load tested.
Here’s the response to a my inquiry to F5 Support about being concerned that this exhaustion might impact our production VIPs:
“If you are not seeing this error in conjunction with a SNAT, you won’t see an impact on the production traffic. You are correct, the number of ports per node is exhausted and shouldn’t affect the other nodes, given that your test and production nodes are not the same.”
Funkdaddy: In the event it helps (I know I’m coming in late here…), here’s some extra information on the setup here. Connections are defined by the source IP:port and destination IP:port combination. The most common situation is that port exhaustion happens on the source side, when they’re headed for a common port. So it doesn’t surprise me at all that you saw this during your load tests - you probably had a single or small number of devices hammering as many connections as possible. Once you go above 65k connections you’ll run out of ports…
One way to help offset this and get better test data fidelity is to reduce TIME_WAIT or enable time wait recycle on the source side of the conversation. This will recycle sockets in TIME_WAIT, which is fine to do if you’re doing load testing in a controlled environment. The basic idea here is to free up those source ports asap so testing can continue.
Tech note: from a TCP perspective, whoever sends the first FIN of a teardown will go into TIME_WAIT. Less frequently you’ll see a ‘simulataneous close’ where both sides send a FIN at the same time, and both go into TIME_WAIT. It’s common that this interval is too long and it can be lower than the defaults (2*max. segment lifetime). So what happens here is that the source port will be sitting there doing nothing for the TIME_WAIT interval, even though it really could be re-used for your load testing.
Hi Experts Apart from any SNAT configuration for DNS, will the F5 throw any such errors? For example, if F5 acts in line and forwards DNS traffic in L3 forwarding mode? Sample logs given below, it does not have the SNAT IP pool. Feb 16 11:09:47 slot1/lb1 crit tmm3[11818]: 01010201:2: Inet port exhaustion on 50.185.12.146 to 171.61.183.190:53 (proto 17) Feb 16 11:09:48 slot1/lb1 crit tmm6[11818]: 01010201:2: Inet port exhaustion on 50.185.12.146 to 171.61.159.8:53 (proto 17) Feb 16 11:09:48 slot1/lb1 crit tmm8[11818]: 01010201:2: Inet port exhaustion on 50.185.12.146 to 171.61.183.190:53 (proto 17) Feb 16 11:09:48 slot1/lb1 crit tmm9[11818]: 01010201:2: Inet port exhaustion on 50.185.12.146 to 171.61.159.8:53 (proto 17) Feb 16 11:09:48 slot1/lb1 crit tmm9[11818]: 01010201:2: Inet port exhaustion on 50.185.12.146 to 171.61.159.8:53 (proto 17)
Hi Experts Apart from any SNAT configuration for DNS, will the F5 throw any such errors? For example, if F5 acts in line and forwards DNS traffic in L3 forwarding mode? Sample logs given below, it does not have the SNAT IP pool. Feb 16 11:09:47 slot1/lb1 crit tmm3[11818]: 01010201:2: Inet port exhaustion on 50.185.12.146 to 171.61.183.190:53 (proto 17) Feb 16 11:09:48 slot1/lb1 crit tmm6[11818]: 01010201:2: Inet port exhaustion on 50.185.12.146 to 171.61.159.8:53 (proto 17) Feb 16 11:09:48 slot1/lb1 crit tmm8[11818]: 01010201:2: Inet port exhaustion on 50.185.12.146 to 171.61.183.190:53 (proto 17) Feb 16 11:09:48 slot1/lb1 crit tmm9[11818]: 01010201:2: Inet port exhaustion on 50.185.12.146 to 171.61.159.8:53 (proto 17) Feb 16 11:09:48 slot1/lb1 crit tmm9[11818]: 01010201:2: Inet port exhaustion on 50.185.12.146 to 171.61.159.8:53 (proto 17)