<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The F5 Guru &#187; SNAT</title>
	<atom:link href="http://www.thef5guru.com/tag/snat/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thef5guru.com</link>
	<description>Load balancing done right</description>
	<lastBuildDate>Thu, 13 Aug 2009 18:22:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SNAT Translation Overflow</title>
		<link>http://www.thef5guru.com/ltm/snat-translation-overflow/</link>
		<comments>http://www.thef5guru.com/ltm/snat-translation-overflow/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 20:17:21 +0000</pubDate>
		<dc:creator>brian</dc:creator>
				<category><![CDATA[LTM]]></category>
		<category><![CDATA[Resolved Issues]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Automap]]></category>
		<category><![CDATA[F5]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[SNAT]]></category>
		<category><![CDATA[SNAT Translation]]></category>

		<guid isPermaLink="false">http://www.thef5guru.com/?p=6</guid>
		<description><![CDATA[My first addition to the content on this site is going to cover a recent issue I encountered with the use of SNAT&#8217;s and the classic &#8220;on a stick&#8221; architecture that F5 recommends.
On the stick implementations are something I will cover in another post, but it seems many vendors support this method because it requires [...]]]></description>
			<content:encoded><![CDATA[<p>My first addition to the content on this site is going to cover a recent issue I encountered with the use of SNAT&#8217;s and the classic &#8220;on a stick&#8221; architecture that F5 recommends.</p>
<p>On the stick implementations are something I will cover in another post, but it seems many vendors support this method because it requires very little effort or engineering to implement and has great success in smaller organizations.</p>
<p>SNAT&#8217;s are used when traffic is sourced from nodes (pool members) and needs to be &#8220;translated&#8221; to an accessible VIP or core-facing network address that will allow bi-directional communication. For some reason the SNAT entries are divided into two tabs in the GUI and it is very easy to ignore the second tab.</p>
<p style="text-align: center;"><img class="aligncenter" title="SNAT Translation" src="http://www.thef5guru.com/wp-content/uploads/2009/07/SNAT-1.jpg" alt="SNAT Translation" width="324" height="134" /></p>
<p>If you notice this section is not populated until there are actual SNAT translations that occur. Each translation then inherits its own settings from the default F5 configuration which is &#8220;indefinite&#8221; (pictured below)</p>
<p style="text-align: center;"><img class="size-full wp-image-22 aligncenter" title="SNAT Indefinite" src="http://www.thef5guru.com/wp-content/uploads/2009/07/SNAT-2.jpg" alt="SNAT Indefinite" width="292" height="262" /></p>
<p style="text-align: left;">The challenge with this configuration is that most users implement a single default SNAT for these on-the-stick designs which restricts you to the maximum ephemeral port listing for one IP (max of 64511). If these translations never expire, with a high connection count you will see behavior similar to that pictured below (the behavior I encountered)</p>
<p style="text-align: center;"><img class="size-full wp-image-24 aligncenter" title="SNAT Translation" src="http://www.thef5guru.com/wp-content/uploads/2009/07/SNAT-3.jpg" alt="SNAT Translation" width="499" height="143" /></p>
<p style="text-align: left;">I knew this could not sustain, so I looked at the preprod environment for this application which was of the &#8220;inline&#8221; architecture, its connection count was pretty stable- typical of what you would expect to see:</p>
<p style="text-align: left;"><img class="aligncenter size-full wp-image-25" title="SNAT Translation" src="http://www.thef5guru.com/wp-content/uploads/2009/07/SNAT-4.jpg" alt="SNAT Translation" width="505" height="157" /></p>
<p style="text-align: left;">A quick glance at the SNAT translation table revealed that sure enough several SNAT&#8217;s were over-utilized and not expiring properly:</p>
<p style="text-align: left;">
<pre><em>[thef5guru@bigip01:Active]  home # b snat translation stats show</em></pre>
<pre><em>SNAT TRANSLATION 1.1.1.1  - stats:</em></pre>
<pre><em>|     (cur, max, limit,  tot) = (<strong>53754</strong>, 121, 0, <strong>55754</strong>)</em></pre>
<pre><em>|     (pkts,bits) in =  (18967, 101.0M), out = (16836, 102.1M)

</em></pre>
<p>So that appears to be the issue, a quick change of settings for the particular SNAT entry (1.1.1.1) to a reasonable timeout seems to be the fix. I decided to go with a 24hour timeout (specified in seconds-86,400)</p>
<p><img class="aligncenter size-full wp-image-31" title="SNAT-5" src="http://www.thef5guru.com/wp-content/uploads/2009/07/SNAT-5.jpg" alt="SNAT-5" width="310" height="223" /></p>
<p>Now, after making this change I noticed that the connections were still active in the translation table, so I pondered a reset of TMM, a failover, and other scenarios before I decided that there really is no clean way to change this without disrupting traffic. The short way to do it is via the command &#8220;b conn all delete&#8221;. The end result is shown below, notice that the connections are now holding steady and it could probably even be lowered to something more like an hour (3600 seconds)</p>
<p><img class="aligncenter size-full wp-image-32" title="SNAT-6" src="http://www.thef5guru.com/wp-content/uploads/2009/07/SNAT-6.jpg" alt="SNAT-6" width="461" height="133" /></p>
<p>My ultimate recommendation would be to implement a SNAT pool of several IP&#8217;s so that the port usage can increase substantially more than the anticipated traffic levels for your organization. In this example the option was not on the table and immediate action was needed, so be sure to analyze your particular problem and make sure the solution is appropriate.</p>
<p><em> </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thef5guru.com/ltm/snat-translation-overflow/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
