<?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>108.bz &#187; Networking</title>
	<atom:link href="http://www.108.bz/posts/tag/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.108.bz</link>
	<description>Wandering futilities...</description>
	<lastBuildDate>Fri, 27 May 2011 09:08:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Cloning DHCP reservations between Windows servers</title>
		<link>http://www.108.bz/posts/it/cloning-dhcp-reservations-between-windows-servers/</link>
		<comments>http://www.108.bz/posts/it/cloning-dhcp-reservations-between-windows-servers/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 16:01:30 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=688</guid>
		<description><![CDATA[Quick post to show you how DHCP reservations can be replicated between Windows servers. Why whould you want to do that? Because often, to achieve DHCP service high availability, DHCP scopes are equally divided between servers. When a client PC is connected to the network, it sends out a broadcast to discover which DHCP servers [...]]]></description>
			<content:encoded><![CDATA[<p>Quick post to show you how DHCP reservations can be replicated between Windows servers. Why whould you want to do that? Because often, to achieve DHCP service high availability, DHCP scopes are equally divided between servers. When a client PC is connected to the network, it sends out a broadcast to discover which DHCP servers are active on that particular ethernet segment. Depending on their number, the PC will receive one or more answer, each offering an IP address. If a client is to be assigned a fixed IP, all of those offers should bear the same IP address. Hence, DHCP reservations need to be configured the same for every DHCP server in the given scope. As far as I know, this needs to be done by hand. To speed up the process, I use <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">netsh</span> (see <a href="http://technet.microsoft.com/en-us/library/cc787375(WS.10).aspx">Netsh commands for DHCP</a>).</p>
<p>The command below will dump all of the reservations to a file named &#8220;reservations.txt&#8221;. <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">findstr</span> filters <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">netsh</span> output keeping just the info we need.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\Documents and Settings\Administrator&gt; netsh dhcp server \\dhcpsrv1 scope 10.4.0.0 dump | findstr Add.reservedip &gt; reservations.txt</div></div>
<p>Each line in &#8220;reservations.txt&#8221; should look like this:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Dhcp Server 10.4.1.1 Scope 10.4.0.0 Add reservedip 10.4.5.3 58b04576339a &quot;pcname.domain.lan&quot; &quot;Reservation Comment&quot; &quot;BOTH&quot;</div></div>
<p><span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">10.4.1.1</span> is the IP address for <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">dhcpsrv1</span>, the &#8220;source&#8221; DHCP server.</p>
<p>Open &#8220;reservations.txt&#8221; in a text editor, check that everything is fine and substitute the source DHCP server IP with the target&#8217;s one (i.e.: 10.4.1.1 becomes 10.4.1.2), save the file and run:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\Documents and Settings\Administrator&gt; netsh &lt; reservations.txt<br />
netsh&gt;<br />
Changed the current scope context to 10.4.0.0 scope.<br />
<br />
Command completed successfully.<br />
netsh&gt;<br />
Command completed successfully.<br />
netsh&gt;<br />
[..]</div></div>
<p>That&#8217;s it; not a fancy trick, but it may be useful nonetheless. Just beware that, when there are thousands of clients, <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">netsh</span> could take a while to complete its job (especially the &#8220;dump&#8221; step)&#8230;</p>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=688" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/it/cloning-dhcp-reservations-between-windows-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FortiGate firewall clusters group-id</title>
		<link>http://www.108.bz/posts/it/fortigate-firewall-clusters-group-id/</link>
		<comments>http://www.108.bz/posts/it/fortigate-firewall-clusters-group-id/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 15:53:31 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[FortiGate]]></category>
		<category><![CDATA[HA]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=527</guid>
		<description><![CDATA[A newly installed FortiGate cluster (a simple two node HA active-passive setup) and some packet loss issues&#8230; Ping from the LAN side to the Internet (or from the firewall itself) resulted in about 20% packet loss, while the other way around (WAN to firewall&#8217;s main public IP) didn&#8217;t work at all. I used the following [...]]]></description>
			<content:encoded><![CDATA[<p>A newly installed FortiGate cluster (a simple two node HA active-passive setup) and some packet loss issues&#8230;<br />
Ping from the LAN side to the Internet (or from the firewall itself) resulted in about 20% packet loss, while the other way around (WAN to firewall&#8217;s main public IP) didn&#8217;t work at all.</p>
<p>I used the following command to check my MAC addresses:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">FORTIGATE-PRI # diagnose hardware deviceinfo nic wan1<br />
[..]<br />
Current_HWaddr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;00:09:0f:09:00:08<br />
Permanent_HWaddr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;00:09:0f:d1:be:ef<br />
[..]</div></div>
<p>Then resorted to the &#8220;show mac&#8221; switches facilites (some Cisco, some ProCurve) to know on which network ports that particular MAC lied&#8230; Only to discover that the cluster&#8217;s &#8220;logical&#8221; MAC address (00:09:0f:09:00:08) wasn&#8217;t really located where I expected it to be.<br />
Well, FortiGate&#8217;s MAC addresses <i>aren&#8217;t randomly generated</i>. They have predictable values that depend on the firewall&#8217;s port number. The eight port (or wan1, in my case) will always have a virtual MAC as the one above. What will happen if you have two clusters (as we had) sitting on the same L2 network segment (on the same broadcast domain, that is)? You said MAC address conflict? You&#8217;re right.<br />
The solution is simple, use the <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">group-id</span> directive to tweak the logical MAC address, i.e.:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">config system ha<br />
&nbsp; &nbsp; set group-id 10<br />
end</div></div>
<p>Changes the second right-most bytes of the MAC, from 00 to 0a:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">before &nbsp;00:09:0f:09:00:08<br />
after &nbsp; 00:09:0f:09:0a:08</div></div>
<p>Point is that the &#8220;FortiOS High Availablity <a href="http://docs.fortinet.com/fgt/handbook/fortigate-ha-40-mr2.pdf">Handbook</a>&#8221; explains the case very thoroughly! See page 192, paragraph &#8220;Diagnosing packet loss with two FortiGate HA clusters in the same broadcast domain&#8221;. We&#8217;re so used to discardable product documentation that sometimes we don&#8217;t even try to look for clues where they should normally reside.<br />
Instead of troubleshooting, this time, I should really have Read The (unexpectedly) Fine Manual&#8230; </p>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=527" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/it/fortigate-firewall-clusters-group-id/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the CLI to manage Windows DNS servers</title>
		<link>http://www.108.bz/posts/uncategorized/using-the-cli-to-manage-windows-dns-servers/</link>
		<comments>http://www.108.bz/posts/uncategorized/using-the-cli-to-manage-windows-dns-servers/#comments</comments>
		<pubDate>Mon, 24 May 2010 14:16:46 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=486</guid>
		<description><![CDATA[(This, for once, is going to be quick.) Did you know about the Dnscmd.exe command? Read about it here and here. It&#8217;s the command-line/DOS prompt way to configure Microsoft&#8217;s DNS servers&#8230; If you need to create many zones/records at once, it saves you lots of clicks. Here&#8217;s how to add six DNS zones (same domain [...]]]></description>
			<content:encoded><![CDATA[<p>(This, for once, is going to be quick.)<br />
Did you know about the <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">Dnscmd.exe</span> command? Read about it <a href="http://technet.microsoft.com/en-us/library/cc778513(WS.10).aspx">here</a> and <a href="http://www.petri.co.il/dnscmd_command_in_windows_2000_2003.htm">here</a>. It&#8217;s the command-line/DOS prompt way to configure Microsoft&#8217;s DNS servers&#8230; If you need to create many zones/records at once, it saves you lots of clicks.<br />
Here&#8217;s how to add six DNS zones (same domain name, different TLD). With the <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">/DSPrimary</span> option, the zone will be stored into Active Directory (rather than a file).</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dnscmd /ZoneAdd domainname.bz &nbsp;/DSPrimary<br />
dnscmd /ZoneAdd domainname.biz /DSPrimary<br />
dnscmd /ZoneAdd domainname.com /DSPrimary<br />
dnscmd /ZoneAdd domainname.eu &nbsp;/DSPrimary<br />
dnscmd /ZoneAdd domainname.net /DSPrimary<br />
dnscmd /ZoneAdd domainname.org /DSPrimary</div></div>
<p>And here&#8217;s how to add the same &#8220;A&#8221; record (named &#8220;www&#8221;) to each of the zones created above.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dnscmd dns-dc-hostname /RecordAdd domainname.bz &nbsp;www A 10.0.0.123<br />
dnscmd dns-dc-hostname /RecordAdd domainname.biz www A 10.0.0.123<br />
dnscmd dns-dc-hostname /RecordAdd domainname.com www A 10.0.0.123<br />
dnscmd dns-dc-hostname /RecordAdd domainname.eu &nbsp;www A 10.0.0.123<br />
dnscmd dns-dc-hostname /RecordAdd domainname.net www A 10.0.0.123<br />
dnscmd dns-dc-hostname /RecordAdd domainname.org www A 10.0.0.123</div></div>
<p>As you may have guessed this is the typical scenario where you&#8217;ve got to re-create some external zones, on the internal DNS servers. That&#8217;s needed in order for the internal hosts to reach some server with the &#8220;public&#8221; DNS name, but the private IP.<br />
For the sake of completeness, let me also mention that you could achieve the same effect by leaving DNS as it is, and configuring  &#8220;loopback NAT&#8221;/&#8221;double NAT&#8221; on the router/firewall. E.g.: an internal Host wants to reach an internal Server, given it&#8217;s public hostname, mapped to a public IP address. It asks the (possibly internal) DNS to translate the name. DNS doesn&#8217;t know the zone, it forwards the query to an external DNS Server, obtaining a public IP address that it hands back to the Client. Since its address is non-local, while trying to talk with the Server, the Client sends packets to its default gateway (possibly the router/firewall). The firewall matches the server&#8217;s public IP addresses, substituting it with the right private one. It also changes the source IP, swapping the Client&#8217;s with the firewall&#8217;s LAN address. This way Client and Server are actually communicating <i>through</i> the firewall, even if they&#8217;re both internal hosts. And the Server can&#8217;t tell Client A from Client B since every connection to it comes from the firewall&#8217;s IP address. That&#8217;s the main reason why I prefer duplicating the public DNS zones on internal DNS servers, with private IP addresses: you avoid routing internal traffic through the firewall, and avoid NAT where there shouldn&#8217;t be any.</p>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=486" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/uncategorized/using-the-cli-to-manage-windows-dns-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Allot NetEnforcer bandwidth reports</title>
		<link>http://www.108.bz/posts/it/allot-netenforcer-bandwidth-reports/</link>
		<comments>http://www.108.bz/posts/it/allot-netenforcer-bandwidth-reports/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 14:01:20 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Allot]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Performance Monitoring]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=429</guid>
		<description><![CDATA[A while ago I was trying to get my head around some nasty network performance issues. A couple of firewalls were in the play, along with a Bandwidth Manager device (an Allot NetEnforcer AC-402). I wasn&#8217;t completely satisfied with NetEnforcer reporting functions and wanted something more dependable and realtime. Well, if you turn to the [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I was trying to get my head around some nasty network performance issues. A couple of firewalls were in the play, along with a Bandwidth Manager device (an <a href="http://www.allot.com/NetEnforcer_AC-400.html">Allot NetEnforcer AC-402</a>).</p>
<p>I wasn&#8217;t completely satisfied with NetEnforcer reporting functions and wanted something more dependable and realtime. Well, if you turn to the device&#8217;s CLI access (SSH), you&#8217;ll notice an interesting <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">acthruput</span> command.<br />
It shows the <i>current</i> throughput per Interface, Line, Pipe and Virtual Channel. What more could you ask for?</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">AC:~# acthruput<br />
---------------------------------------------------------<br />
Entity &nbsp; &nbsp; &nbsp; &nbsp; Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Bits/sec<br />
---------------------------------------------------------<br />
INTERFACE &nbsp; &nbsp; &nbsp;Internal &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1918600<br />
&nbsp; LINE &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1770720<br />
&nbsp; &nbsp; &nbsp; PIPE &nbsp; &nbsp; 8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2144<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VC &nbsp; 32 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2144<br />
&nbsp; &nbsp; &nbsp; PIPE &nbsp; &nbsp; 5 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7136<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VC &nbsp; 8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7136<br />
[..]<br />
---------------------------------------------------------<br />
INTERFACE &nbsp; &nbsp; &nbsp;External &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 9509880<br />
&nbsp; LINE &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9421000<br />
&nbsp; &nbsp; &nbsp; PIPE &nbsp; &nbsp; 8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;96960<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VC &nbsp; 32 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 96960<br />
&nbsp; &nbsp; &nbsp; PIPE &nbsp; &nbsp; 13 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 752<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VC &nbsp; 22 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 752<br />
[..]</div></div>
<p>As you can see, <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">acthruput</span> identifies Pipes by number. How do you relate this number to the actual mnemonic pipe name? Use &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">acstat -l pipe</span>&#8220;, which also displays the total number of live connections per pipe .</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">AC:~# acstat -l pipe<br />
---------------------------------------------------------------------------------<br />
Rule QID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Rule name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Live connections<br />
---------------------------------------------------------------------------------<br />
1.8.0.0.0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Customer1 ; Fallback &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10<br />
1.13.0.0.0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Customer2 ; Fallback &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7<br />
1.5.0.0.0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Customer3 ; Fallback &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 23<br />
[..]</div></div>
<p>Wrap <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">acthruput</span> in a <i>while</i> loop that adds a timestamp and a delay (&rarr; sampling frequency). Start your terminal emulator logging facilities, hit enter, wait, ctrl-c, stop logging.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">AC:~# while [ 1 ] ; do date; acthruput; sleep 10; done</div></div>
<p>Eventually, clean the log a bit and feed it to the Perl script you&#8217;ll find at the end of this post.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ DATE='Thu Dec 10'; grep &quot;$DATE\|INTERFACE\|LINE\|PIPE&quot; &quot;log.txt&quot; &nbsp;| ./allot_fmt.pl &quot;$DATE&quot; &gt; log.csv</div></div>
<p>The script outputs CSV formatted data:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">timestamp;ifc;L1;P1;P10;P12;P2;P3;P4;P5;P8;P9;<br />
Thu Dec 10 14:48:00 CET 2009;Int;2779648;2599928;4608;;111760;1024;;9792;;52536;<br />
Thu Dec 10 14:48:00 CET 2009;Ext;8372424;5372392;206448;;2407264;60720;;258816;;66784;<br />
Thu Dec 10 14:48:12 CET 2009;Int;1909272;1699872;3776;;170624;512;;1216;;33272;<br />
Thu Dec 10 14:48:12 CET 2009;Ext;7932680;7370584;97152;;350920;36432;;12144;;65448;<br />
[..]</div></div>
<p>And here&#8217;s what it looks like when opened up in OpenOffice Calc (sorry, no fancy formatting).<br />
<a href="http://www.108.bz/wp-content/uploads/2010/04/Allot_NetEnforcer_bandwidth_reports.gif"><img src="http://www.108.bz/wp-content/uploads/2010/04/Allot_NetEnforcer_bandwidth_reports-300x181.gif" alt="NetEnforcer bandwidth report" title="NetEnforcer_bandwidth_report" width="300" height="181" class="alignnone size-medium wp-image-435" /></a><br />
The graph above shows that the 8Mbps link (the &#8220;Line&#8221;, in Allot&#8217;s parlance) is not saturated. Problem was that, during that timeframe, we were also trying to make <a href="http://en.wikipedia.org/wiki/Iperf">Iperf</a> &#8220;consume&#8221; all of the available bandwidth. We couldn&#8217;t make it because one of the firewalls was acting as a bottleneck if presented with certain workloads (many connections, see <a href="http://www.108.bz/posts/it/who-ate-all-the-bandwidth/">this</a>) . Being able to generate these kinds of report proved very useful in troubleshooting&#8230;</p>
<div class="codecolorer-container perl blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;height:300px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl </span><br />
<span style="color: #666666; font-style: italic;"># Giuliano - http://www.108.bz</span><br />
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@samples</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$lastsample</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$lastint</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009999;">&lt;STDIN&gt;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #009966; font-style: italic;">s/[\r\n]*//g</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">next</span> <span style="color: #b1b100;">unless</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/$ARGV[0]/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$lastsample</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$lastsample</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$lastsample</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/push.html"><span style="color: #000066;">push</span></a> <span style="color: #0000ff;">@samples</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$lastsample</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">#print &quot;$_\n&quot;;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elsif</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/INTERFACE/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009966; font-style: italic;">s/^.*INTERFACE.*(Int|Ext)ernal.*$/$1/</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$lastint</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">#print &quot;$lastint\n&quot;;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elsif</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/LINE/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009966; font-style: italic;">s/^.*LINE\s*([0-9]+)\s*(\d+).*$/L$1;$2/</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$tput</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/split.html"><span style="color: #000066;">split</span></a> <span style="color: #ff0000;">';'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">#print &quot;$line,$tput\n&quot;;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$lastsample</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$lastint</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$line</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$tput</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elsif</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/PIPE/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009966; font-style: italic;">s/^.*PIPE\s*([0-9]+)\s*(\d+).*$/P$1;$2/</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$pipe</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$tput</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/split.html"><span style="color: #000066;">split</span></a> <span style="color: #ff0000;">';'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">#print &quot;$pipe,$tput\n&quot;;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$lastsample</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$lastint</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$pipe</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$tput</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #000000; font-weight: bold;">STDERR</span> <span style="color: #ff0000;">&quot;wtf<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/exit.html"><span style="color: #000066;">exit</span></a><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$keys</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$sample</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@samples</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$int</span> <span style="color: #009900;">&#40;</span><a href="http://perldoc.perl.org/functions/keys.html"><span style="color: #000066;">keys</span></a> <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$sample</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$key</span> <span style="color: #009900;">&#40;</span><a href="http://perldoc.perl.org/functions/keys.html"><span style="color: #000066;">keys</span></a> <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$sample</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$int</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$keys</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$key</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #339933;">@</span><a href="http://perldoc.perl.org/functions/keys.html"><span style="color: #000066;">keys</span></a> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/sort.html"><span style="color: #000066;">sort</span></a> <a href="http://perldoc.perl.org/functions/keys.html"><span style="color: #000066;">keys</span></a> <span style="color: #0000ff;">%$keys</span><span style="color: #339933;">;</span><br />
<br />
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;timestamp;ifc;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$key</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><a href="http://perldoc.perl.org/functions/keys.html"><span style="color: #000066;">keys</span></a><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;$key;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$sample</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@samples</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$int</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Int'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'Ext'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;$sample-&gt;[0];&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;$int;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$key</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><a href="http://perldoc.perl.org/functions/keys.html"><span style="color: #000066;">keys</span></a><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;$sample-&gt;[1]-&gt;{$int}-&gt;{$key};&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<a href="http://perldoc.perl.org/functions/exit.html"><span style="color: #000066;">exit</span></a><span style="color: #339933;">;</span></div></div>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=429" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/it/allot-netenforcer-bandwidth-reports/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Who ate all the bandwidth?</title>
		<link>http://www.108.bz/posts/it/who-ate-all-the-bandwidth/</link>
		<comments>http://www.108.bz/posts/it/who-ate-all-the-bandwidth/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 17:36:40 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Performance Monitoring]]></category>
		<category><![CDATA[Switching]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=370</guid>
		<description><![CDATA[Today Internet browsing is particularly slow. At seemingly random intervals, available bandwith drops down and people get more and more irritable. How do you find out why this is happening? The possible causes boil down to: Router/Firewall1 is not pleased by &#8220;something&#8221;. Could be an attack or a bug in the device firmware. Too many [...]]]></description>
			<content:encoded><![CDATA[<p>Today Internet browsing is particularly slow.<br />
At seemingly random intervals, available bandwith drops down and people get more and more irritable. <img src='http://www.108.bz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>How do you find out why this is happening?</p>
<p>The possible causes boil down to:</p>
<ol style="list-style-type: upper-alpha;">
<li style="list-style-type: upper-alpha;">Router/Firewall<sup class='footnote'><a href='#fn-370-1' id='fnref-370-1'>1</a></sup> is not pleased by &#8220;something&#8221;. Could be an attack or a bug in the device firmware.</li>
<li style="list-style-type: upper-alpha;">Too many connections. Maybe they&#8217;re not passing much traffic, but the internet gateway can&#8217;t keep up with their number. I&#8217;ve seen firewalls perform very badly in this respect. E.g.: 3 connections trying to download/upload as fast as they can, and a total, aggregate, b/w of 10Mbps. Those 3 plus 3000 &#8220;normal&#8221; connections and a total b/w of 6Mbps.</li>
<li style="list-style-type: upper-alpha;">A reasonable amount of connections, effectively eating all of the available bandwidth.</li>
</ol>
<p>I&#8217;ll skip case <b>A</b>, for now. <img src='http://www.108.bz/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
In case <b>B</b> you&#8217;ll likely want to know the firewall&#8217;s idea of &#8220;netstat&#8221;, meaning the complete listing of TCP/UDP/other connections. No big deal if the device has got some sort of CLI access: capture its output, import it into a spreadsheet, or use awk/sort/grep<sup class='footnote'><a href='#fn-370-2' id='fnref-370-2'>2</a></sup> to build your stats. Usually, computing total number of connections by source IP address and sorting accordingly, is enough to gain some insight about what&#8217;s going on.<br />
Case <b>C</b>&#8230; For long-running (days) data analysis, you could use a tool like <a href="http://www.ntop.org/">NTOP</a>. But if, like me today, you need to act quickly (perhaps because you know that the issue will disappear soon), <a href="http://www.ex-parrot.com/pdw/iftop/">iftop</a> can hardly be beaten.<br />
Both tools require the machine they run on to be able to &#8220;sniff&#8221; all the traffic passing through the firewall. This can be accomplished by configuring <i>monitoring</i>/<i>monitored</i> port(s) on a switch.  <i>Monitored</i> ports get their inbound/outbound traffic copied to the monitoring one. Different vendors call the thing a different way, <i>port mirroring</i> is also a good keyphrase. Here are a couple of resources:</p>
<ul>
<li>(Old) 3Com Superstack: <a href="http://blog.icewolf.ch/archive/2008/07/08/monitor-port-on-3com-4400.aspx">Monitor Port on 3Com 4400</a></li>
<li>HP ProCurve, pretty straightforward to set up using the &#8220;menu&#8221; interface:  <a href="http://www.hp.com/rnd/support/faqs/sw_208_224.htm#question25">How do I attach a LAN Analyzer to a Switch 208t/224t port to monitor LAN traffic for diagnostic purposes?</a></li>
<li>ProCurve switches are not limited to mirroring ports that belong to the same device/chassis: <a href="http://pro-h40060-hpwpux-pro.atlanta.hp.com/procurve/uk/en/pdfs/application-notes/AN-S14_ProCurve-intelligent-mirroring-final.pdf">How to configure remote and intelligent mirroring on ProCurve switches</a></li>
<li>
Low-end HP switches (like the ProCurve 1800 one I encountered here), though, are only manageable via a web gui:<br />
<div id="attachment_389" class="wp-caption alignnone" style="width: 310px"><a href="http://www.108.bz/wp-content/uploads/2010/03/procurve1800mirroring.png"><img src="http://www.108.bz/wp-content/uploads/2010/03/procurve1800mirroring-300x120.png" alt="Port Mirroring on a ProCurve 1800" title="procurve1800mirroring" width="300" height="120" class="size-medium wp-image-389" /></a><p class="wp-caption-text">Port Mirroring on a ProCurve 1800</p></div>
</li>
<li>Cisco: <a href="http://en.wikipedia.org/wiki/Port_mirroring">Port Mirroring</a>, <a href="http://itprofesionals.blogspot.com/2009/12/configuring-cisco-catalyst-switch-span.html">Configuring a Cisco Catalyst Switch SPAN mirroring port</a>
</li>
</ul>
<p>(You could as well use a hub instead of a switch and get implicit mirroring of any port, to any port of the hub. Just unplug the firewall, link the hub to the switch, plug firewall and monitoring host in the hub. Kludgy but quick and easy, if you can afford the temporary cabling changes, and the bottleneck introduced by the hub&#8230;)</p>
<p>So:
<ul>
<li>Find the switch where the firewall is connected to. Which side of the firewall? It depends on where you believe the issues originates from. Let&#8217;s say the culprit is most likely to lie on the LAN &rarr; switch port A.</li>
<li>Connect your laptop/monitoring machine to the same switch &rarr; port B.</li>
<li>Set up monitoring: port A is <i>monitored</i>, port B is <i>monitoring</i>.</li>
<li>Run iftop, maybe telling it to also show port numbers (&#8220;-P&#8221;, without this switch, you&#8217;ll only see totals by source/destination IP addresses couple), don&#8217;t display hostnames &#8220;-n&#8221;, the interface &#8220;-i eth0&#8243; and provide a meaningful filter (here I&#8217;m selecting packets whose source is not on the LAN<sup class='footnote'><a href='#fn-370-3' id='fnref-370-3'>3</a></sup>. The &#8220;-p&#8221; option instructs iftop to capture packets in <a href="http://en.wikipedia.org/wiki/Promiscuous_mode">promiscuous</a> mode. Without it, iftop won&#8217;t lift off the wire packets that aren&#8217;t addressed to the machine on which it is running.
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">iftop -p -P -n -i eth0 -f 'not src net 192.168.200.0/23'</div></div>
<p>Iftop will produce a realtime table of running connections, sorted by how demanding they are in terms of bandwidth (10s average, by default). See the screenshot below; the top connections are due to two running video conference streams stealing 1Mbit/second worth of bandwidth, each.<br />
<div id="attachment_394" class="wp-caption alignnone" style="width: 310px"><a href="http://www.108.bz/wp-content/uploads/2010/03/iftop.png"><img src="http://www.108.bz/wp-content/uploads/2010/03/iftop-300x193.png" alt="iftop output" title="iftop" width="300" height="193" class="size-medium wp-image-394" /></a><p class="wp-caption-text">iftop's output</p></div><br />
Once everything is set up and you&#8217;re able to read iftop&#8217;s output, spotting the &#8220;top talkers&#8221; of your net becomes kids play, enjoy!</p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-370-1'>for brevity, I&#8217;ll just say &#8220;firewall&#8221; from now on. <span class='footnotereverse'><a href='#fnref-370-1'>&#8617;</a></span></li>
<li id='fn-370-2'>Yuri is king at doing that. See his <a href="http://yurisk.info/2010/03/08/awk-weekly-checkpoint-anti-spam-statistics-or-viva-la-open-relays/">AWK weekly</a> series. <span class='footnotereverse'><a href='#fnref-370-2'>&#8617;</a></span></li>
<li id='fn-370-3'>iftop will still show these source addresses, since its output is always made of bidirectional &#8220;connections&#8221;. Only, counters pertaining to the LAN &rarr; outside direction, won&#8217;t increase. <span class='footnotereverse'><a href='#fnref-370-3'>&#8617;</a></span></li>
</ol>
</div>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=370" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/it/who-ate-all-the-bandwidth/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

