<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>CharlieBlog</title>
	
	<link>http://www.longitudetech.com</link>
	<description>Thinking, doing, and learning about sysadmin/devops issues.</description>
	<lastBuildDate>Tue, 24 Jan 2012 05:20:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<copyright>Copyright © LongitudeTech Blog 2010 </copyright>
	<managingEditor>info@longitudetech.com (CharlieBlog)</managingEditor>
	<webMaster>info@longitudetech.com (CharlieBlog)</webMaster>
	<image>
		<url>http://www.longitudetech.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>CharlieBlog</title>
		<link>http://www.longitudetech.com</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle />
	<itunes:summary>Linux, Networking, Stories, and Rants</itunes:summary>
	<itunes:keywords />
	<itunes:category text="Society &amp; Culture" />
	<itunes:author>CharlieBlog</itunes:author>
	<itunes:owner>
		<itunes:name>CharlieBlog</itunes:name>
		<itunes:email>info@longitudetech.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.longitudetech.com/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/LongitudetechBlog" /><feedburner:info uri="longitudetechblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Connecting to existing buckets in S3 with boto, the right way</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/6sbpfAgaisE/</link>
		<comments>http://www.longitudetech.com/devops/connecting-to-existing-buckets-in-s3-with-boto-the-right-way/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 05:20:18 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[DevOps]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/?p=72</guid>
		<description><![CDATA[Here&#8217;s another interesting tidbit. If you have scripts that connect to S3, and you run out of buckets (Amazon only allows 100 buckets per account), you might get a nasty surprise. See, you may have been using create_bucket(name-of-bucket) to get your bucket object. It&#8217;s undocumented as far as I can see, but apparently if you [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/devops/finding-instances-by-name-with-boto-in-python/' rel='bookmark' title='Finding instances by name with boto in python'>Finding instances by name with boto in python</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/ldap-understand-the-protocol-and-work-with-entries/' rel='bookmark' title='LDAP: Understand the Protocol and Work With Entries'>LDAP: Understand the Protocol and Work With Entries</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another interesting tidbit.</p>
<p>If you have scripts that connect to S3, and you run out of buckets (Amazon only allows 100 buckets per account), you might get a nasty surprise.</p>
<p>See, you may have been using create_bucket(name-of-bucket) to get your bucket object. It&#8217;s undocumented as far as I can see, but apparently if you use create_bucket() on an bucket that actually exists, it&#8217;ll return the Bucket object. That&#8217;s handy! Except it breaks if you&#8217;re unable to create more buckets (even though you aren&#8217;t really trying to create more). Sigh, so I refactored as such:</p>
<pre># old and busted: bucket = s3_conn.create_bucket(bucket_name)</pre>
<pre># new hotness:
# iterate over Bucket objects and return the one matching string:
def find_s3_bucket(s3_conn, string):
    for i in s3_conn.get_all_buckets():
        if string in i.name:
            return i</pre>
<pre>Used as: bucket = find_s3_bucket(s3_conn, bucket_name)</pre>
<p>There is likely a more elegant way, but hey this works.</p>
<p>&nbsp;</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d72').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d72" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fdevops%2Fconnecting-to-existing-buckets-in-s3-with-boto-the-right-way%2F&amp;title=Connecting+to+existing+buckets+in+S3+with+boto%2C+the+right+way" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fdevops%2Fconnecting-to-existing-buckets-in-s3-with-boto-the-right-way%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fdevops%2Fconnecting-to-existing-buckets-in-s3-with-boto-the-right-way%2F&amp;title=Connecting+to+existing+buckets+in+S3+with+boto%2C+the+right+way" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fdevops%2Fconnecting-to-existing-buckets-in-s3-with-boto-the-right-way%2F&amp;title=Connecting+to+existing+buckets+in+S3+with+boto%2C+the+right+way" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Connecting+to+existing+buckets+in+S3+with+boto%2C+the+right+way+@+http%3A%2F%2Fwww.longitudetech.com%2Fdevops%2Fconnecting-to-existing-buckets-in-s3-with-boto-the-right-way%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fdevops%2Fconnecting-to-existing-buckets-in-s3-with-boto-the-right-way%2F&amp;t=Connecting+to+existing+buckets+in+S3+with+boto%2C+the+right+way" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d72').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/devops/finding-instances-by-name-with-boto-in-python/' rel='bookmark' title='Finding instances by name with boto in python'>Finding instances by name with boto in python</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/ldap-understand-the-protocol-and-work-with-entries/' rel='bookmark' title='LDAP: Understand the Protocol and Work With Entries'>LDAP: Understand the Protocol and Work With Entries</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/BViKGrrc7YvjB4QvPgt8c8sR8IQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/BViKGrrc7YvjB4QvPgt8c8sR8IQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/BViKGrrc7YvjB4QvPgt8c8sR8IQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/BViKGrrc7YvjB4QvPgt8c8sR8IQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/6sbpfAgaisE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/devops/connecting-to-existing-buckets-in-s3-with-boto-the-right-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/devops/connecting-to-existing-buckets-in-s3-with-boto-the-right-way/</feedburner:origLink></item>
		<item>
		<title>Finding instances by name with boto in python</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/erDEFqGxoiY/</link>
		<comments>http://www.longitudetech.com/devops/finding-instances-by-name-with-boto-in-python/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 05:57:11 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[DevOps]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/?p=69</guid>
		<description><![CDATA[OK, I know I need to blog more. Rather than think I don&#8217;t have anything useful to say, I&#8217;ll start adding quick entries of what-I-learned. Random tidbits from today: I got annoyed with EC2 failures, and having to manually terminate and redeploy instances today, so I finally worked on a script I&#8217;ve been meaning to [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/devops/connecting-to-existing-buckets-in-s3-with-boto-the-right-way/' rel='bookmark' title='Connecting to existing buckets in S3 with boto, the right way'>Connecting to existing buckets in S3 with boto, the right way</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>OK, I know I need to blog more. Rather than think I don&#8217;t have anything useful to say, I&#8217;ll start adding quick entries of what-I-learned.</p>
<p>Random tidbits from today:<br />
I got annoyed with EC2 failures, and having to manually terminate and redeploy instances today, so I finally worked on a script I&#8217;ve been meaning to write. One thing I had to figure out (which isn&#8217;t all that complex), is how to discover an instance by name.</p>
<p>If you tag an instance with the hostname you&#8217;re using in your deployment script, you don&#8217;t need to fumble in the AWS console to find an instance ID. Ever. I don&#8217;t find it acceptable to manually click around or run scripts to discover information that&#8217;s available from an API <img src='http://www.longitudetech.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So, to &#8220;find&#8221; the instance using python and boto (assume AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are defined in your shell environment):</p>
<pre>import boto
ec2conn = boto.connect_ec2(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
reservations = ec2conn.get_all_instances()
instances = [i for r in reservations for i in r.instances]
my_fqdn = "example.com" # trailing part of my domain</pre>
<p>Now, &#8216;instances&#8217; can be iterated over to find instances with the name you desire. I wrote a little wrapper function to do this, and it returns an instance object (which I call instance.terminate() on, for this purpose). Code:</p>
<pre>def find_instance_by_nametag(instances, name):
    # support short or full hostname usage
    if not my_fqdn in name:
        name = name + my_fqdn
    for i in instances:
        if "Name" in i.tags and name in i.tags['Name']:
            return i
    sys.exit("sorry, I couldn't find an instance with that name!")</pre>
<p><code>Easy as that!</code></p>
<p>&nbsp;</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d69').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d69" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fdevops%2Ffinding-instances-by-name-with-boto-in-python%2F&amp;title=Finding+instances+by+name+with+boto+in+python" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fdevops%2Ffinding-instances-by-name-with-boto-in-python%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fdevops%2Ffinding-instances-by-name-with-boto-in-python%2F&amp;title=Finding+instances+by+name+with+boto+in+python" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fdevops%2Ffinding-instances-by-name-with-boto-in-python%2F&amp;title=Finding+instances+by+name+with+boto+in+python" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Finding+instances+by+name+with+boto+in+python+@+http%3A%2F%2Fwww.longitudetech.com%2Fdevops%2Ffinding-instances-by-name-with-boto-in-python%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fdevops%2Ffinding-instances-by-name-with-boto-in-python%2F&amp;t=Finding+instances+by+name+with+boto+in+python" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d69').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/devops/connecting-to-existing-buckets-in-s3-with-boto-the-right-way/' rel='bookmark' title='Connecting to existing buckets in S3 with boto, the right way'>Connecting to existing buckets in S3 with boto, the right way</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/xiLXgnu5hRnpJr86om-3kF0EFpo/0/da"><img src="http://feedads.g.doubleclick.net/~a/xiLXgnu5hRnpJr86om-3kF0EFpo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xiLXgnu5hRnpJr86om-3kF0EFpo/1/da"><img src="http://feedads.g.doubleclick.net/~a/xiLXgnu5hRnpJr86om-3kF0EFpo/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/erDEFqGxoiY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/devops/finding-instances-by-name-with-boto-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/devops/finding-instances-by-name-with-boto-in-python/</feedburner:origLink></item>
		<item>
		<title>Display current location on your web page using the SPOT GPS tracker</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/ps3VpxbS50w/</link>
		<comments>http://www.longitudetech.com/tricks-tips/display-current-location-on-your-web-page-using-the-spot-gps-tracker/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 02:34:25 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Tricks & Tips]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/?p=66</guid>
		<description><![CDATA[The SPOT GPS tracker is not only a lifesaver, but also a handy tool for motorcycle (ok, and other types) travelers. If you subscribe to the Track Progress service, you can tell the GPS device to send your location to SPOT via satellite every 10 minutes, and then export those tracks at a later time. [...]
No related posts found.]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://findmespot.com" target=blank>SPOT</a> GPS tracker is not only a lifesaver, but also a handy tool for motorcycle (ok, and other types) travelers. If you subscribe to the Track Progress service, you can tell the GPS device to send your location to SPOT via satellite every 10 minutes, and then export those tracks at a later time.</p>
<p>They even have an API from which you can fetch an XML document with all your current tracks! The unfortunate part, and the reason for this post, is that they only keep 30 days of GPS coordinates. It&#8217;s not a problem if you export your data to <a href="http://www.spotadventures.com" target=blank>Spot Adventures</a> and create an &#8220;adventure&#8221; &#8212; that will live forever. But if you wish to present &#8220;my current location&#8221; on your personal web page, for example, you&#8217;re out of luck. It will only work as long as you&#8217;ve used the track progress functionality within the last 30 days.</p>
<p>I guess you need to cache the last used location yourself. OK, this shouldn&#8217;t be hard. This is how to do it with a little perl script (download <a href="http://charlierides.com/files/spotparse.pl.txt" target=blank>here</a>, see in action in CharlieTracker <a href="http://charlierides.com" target=blank>here</a>):</p>
<blockquote><p>
<code>#!/usr/bin/perl<br />
# Author: Charlie Schluting &lt;charlie@schluting.com&gt; (c) 2011<br />
#<br />
use XML::Simple;<br />
#use strict.. heh, no, this barely works.</code><br />
<code>$CACHEFILE = "/home/charlie/lastspotlocation.txt";<br />
$XML = "/home/charlie/spot.xml";<br />
$JS = "/stash/www/charlierides.com/files/map.js";</code>
</p></blockquote>
<p>The CACHEFILE is where I store the last known latitude and longitude. It&#8217;s mostly for reference, so that other things (aside from this script) can use it.</p>
<p>XML is the location I store the fetched XML from SPOT&#8217;s API.</p>
<p>JS is the file I write the javascript out to. OK, you probably don&#8217;t need to care about this part of the script.. but here&#8217;s the details: if you use joomla or wordpress, you might not want to enable PHP code execution or other evil things like that. So, in order to include a snippet of generated HTML, the only choice (as far as I know, aside from editing the DB where a &#8220;display html&#8221; module stores its data), is to write javascript to include another javascript file. So that&#8217;s what I do.. the script actually generates javascript that when run, will spit out html. If you don&#8217;t care about that and just want the map part, read on.</p>
<blockquote><p>
<code># hahaha, oh man..<br />
`wget -q -O $XML http://share.findmespot.com/messageService/guestlinkservlet?glId=0Vn4kA4MiPgNSYD52NgPjuVJDpUCSUlGW`;</code>
</p></blockquote>
<p>This part fetches the XML file from spot, using my shared page identifier.</p>
<blockquote><p>
<code># create object<br />
$xml = new XML::Simple;<br />
# read XML file<br />
$data = $xml-&gt;XMLin("$XML");</p>
<p># this is how we overcome spot's API not keeping &gt;30 days. If they've aged out, do nothing (i.e. keep using the old data).<br />
die("No messages found, totalCount is 0, ABORTING LIKE AN UGLY KID") unless $data-&gt;{totalCount} &gt; 0;</p>
<p># the first object is always the most recent:<br />
$lat = $data-&gt;{message}-&gt;[0]-&gt;{latitude};<br />
$long = $data-&gt;{message}-&gt;[0]-&gt;{longitude};</p>
<p># just because (hey, what if something else wants to use this?)<br />
open(FILE, "&gt;$CACHEFILE");<br />
print FILE $lat . "," . $long . "\n";<br />
close(FILE);</code>
</p></blockquote>
<p>And the rest (above) is pretty self explanatory. Using just this part of the script, you&#8217;ve overcome the annoying limitation that is SPOT Track Progress (losing your last known location). Your last known coordinates will be in CACHEFILE. For completeness, I will include the rest of this horrible hack I used:</p>
<blockquote><p>
<code># ugly shit that writes out javascript to write out html, to include a linked static google maps image<br />
$googleoptions = "&amp;zoom=8&amp;size=140x152&amp;sensor=false&amp;maptype=hybrid";<br />
$googlelink = "&lt;a target=\"blank\" href=\"http://maps.google.com/maps?q=" . $lat . "," . $long . "+(charlie)&amp;z=8&amp;t=h\"\&gt;";<br />
$header = "&lt;p&gt;Current location (since the last GPS update):&lt;/p&gt;";<br />
$js = 'document.write(\''. $header .'\');' . '<br />
document.write(\''. $googlelink .'\');' . '<br />
document.write(\'&lt;img src="http://maps.googleapis.com/maps/api/staticmap?center=' . $lat .<br />
        ',' . $long . $googleoptions . '" /&gt;\');<br />
document.write(\'&lt;/a&gt;\');<br />
document.write(\'&lt;p&gt;Or &lt;a href="http://share.findmespot.com/shared/faces/viewspots.jsp?glId=0Vn4kA4MiPgNSYD52NgPjuVJDpUCSUlGW" <br />
 target=blank&gt;view all recent tracks.&lt;/a&gt;&lt;/p&gt; \');<br />
';</code><br />
<code>open(FILE, "&gt;$JS");<br />
print FILE $js;<br />
close(FILE);</code>
</p></blockquote>
<p>So, what this writes out (in HTML, finally), is an IMG tag embedding a static google map (because I&#8217;m using a small thumbnail), which links to the google maps page when clicked:</p>
<p>Map: http://maps.googleapis.com/maps/api/staticmap?center=45.42553,-122.52251&amp;zoom=8&amp;size=140&#215;152&amp;sensor=false&amp;maptype=hybrid <br />
Link target: http://maps.google.com/maps?q=45.42553,-122.52251+(charlie)&amp;z=8&amp;t=h</p>
<p>The parameters you can pass google maps are well documented, so I don&#8217;t need to rehash them here. You may even prefer to use the real maps API, rather than the static image one. That too, is well documented.</p>
<p>Run this from cron every 15 minutes, and you&#8217;ll always have your last checked-in GPS coordinates!</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d66').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d66" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Ftricks-tips%2Fdisplay-current-location-on-your-web-page-using-the-spot-gps-tracker%2F&amp;title=Display+current+location+on+your+web+page+using+the+SPOT+GPS+tracker" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Ftricks-tips%2Fdisplay-current-location-on-your-web-page-using-the-spot-gps-tracker%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Ftricks-tips%2Fdisplay-current-location-on-your-web-page-using-the-spot-gps-tracker%2F&amp;title=Display+current+location+on+your+web+page+using+the+SPOT+GPS+tracker" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Ftricks-tips%2Fdisplay-current-location-on-your-web-page-using-the-spot-gps-tracker%2F&amp;title=Display+current+location+on+your+web+page+using+the+SPOT+GPS+tracker" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Display+current+location+on+your+web+page+using+the+SPOT+GPS+tracker+@+http%3A%2F%2Fwww.longitudetech.com%2Ftricks-tips%2Fdisplay-current-location-on-your-web-page-using-the-spot-gps-tracker%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Ftricks-tips%2Fdisplay-current-location-on-your-web-page-using-the-spot-gps-tracker%2F&amp;t=Display+current+location+on+your+web+page+using+the+SPOT+GPS+tracker" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d66').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>No related posts found.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/3jObFQJc7SoQeJrQs_9Spid9Md0/0/da"><img src="http://feedads.g.doubleclick.net/~a/3jObFQJc7SoQeJrQs_9Spid9Md0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/3jObFQJc7SoQeJrQs_9Spid9Md0/1/da"><img src="http://feedads.g.doubleclick.net/~a/3jObFQJc7SoQeJrQs_9Spid9Md0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/ps3VpxbS50w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/tricks-tips/display-current-location-on-your-web-page-using-the-spot-gps-tracker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/tricks-tips/display-current-location-on-your-web-page-using-the-spot-gps-tracker/</feedburner:origLink></item>
		<item>
		<title>Are Cisco Flex Links the End of STP?</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/VHYXwIw_1lk/</link>
		<comments>http://www.longitudetech.com/networking/are-cisco-flex-links-the-end-of-stp/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 21:12:55 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[ccie]]></category>
		<category><![CDATA[ccna]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[networks]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=33</guid>
		<description><![CDATA[Cisco Flex Links gives network operators a simple, reliable, and more scalable method of layer 2 redundancy. The Spanning Tree Protocol (STP) is not destined for the scrap bin, but it will certainly fall out of favor with many enterprise networks. Flex Links are a pair of layer 2 interfaces configured to act as a [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking/built-in-security-with-cisco-ips/' rel='bookmark' title='Built-in Security with Cisco IPS'>Built-in Security with Cisco IPS</a></li>
<li><a href='http://www.longitudetech.com/networking/cisco-autoqos-voip-qos-for-mere-mortals/' rel='bookmark' title='Cisco AutoQoS: VoIP QoS for Mere Mortals'>Cisco AutoQoS: VoIP QoS for Mere Mortals</a></li>
<li><a href='http://www.longitudetech.com/networking/manage-devices-and-configurations-with-cisco-sdm/' rel='bookmark' title='Manage Devices and Configurations with Cisco SDM'>Manage Devices and Configurations with Cisco SDM</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Cisco Flex Links gives network operators a simple, reliable, and more scalable method of layer 2 redundancy. The Spanning Tree Protocol (STP) is not destined for the scrap bin, but it will certainly fall out of favor with many enterprise networks.</p>
<p>Flex Links are a pair of layer 2 interfaces configured to act as a backup of each other. Configuring Flex Links is very simple, but it&#8217;s a manual process. Spanning tree can configure itself if you just enable it, albeit likely a sub-optimal configuration, but a working one nonetheless. Flex Links, on the other hand, require manual setup and layout of your layer 2 network. If you don&#8217;t want to leave anything to chance, then Flex Links are preferred over STP.</p>
<p>The benefits of FlexLinks include:</p>
<ul>
<li>simplicity, which equals stability.</li>
<li>instant failover.</li>
<li>rudimentary load balancing capabilities, so one link isn&#8217;t wastefully idle.</li>
<li>load balancing works across switches in a stack, including port channels.</li>
</ul>
<p>Flex Links&#8217; primary operating mode is just like spanning tree: one on, one off. With per-VLAN spanning tree, a trunk port can have some VLANs enabled and some blocked at the same time, so on the surface it seems that STP is superior. In reality, you can configure Flex Links to load balance VLANs, and we&#8217;ll show you how shortly.</p>
<p><strong>Configuration</strong></p>
<p>Conceptually, you configure Flex Links by telling one link it&#8217;s the active link, and another that it&#8217;s the backup of that</p>
<div id="attachment_34" class="wp-caption alignleft" style="width: 279px"><a href="http://www.ciscosystems.com/en/US/docs/switches/lan/catalyst3750/software/release/12.2_25_sed/configuration/guide/swflink.html"><img class="size-full wp-image-34" title="cisco_flex" src="http://www.longitudetech.com/blog/wp-content/uploads/2010/02/cisco_flex.jpg" alt="" width="269" height="471" /></a><p class="wp-caption-text">Flex Links Design Map</p></div>
<p>primary (active) one. Without configuring VLAN load balancing, it will completely disable the backup, and if the active link goes down the backup will take over.</p>
<p>For example, to configure port gi1/0/1 as a active link, and gi1/0/2 as the backup, you&#8217;d run:</p>
<p><code>Switch# configure terminal<br />
Switch(conf)# interface gigabitethernet1/0/1<br />
Switch(conf-if)# switchport backup interface gigabitethernet1/0/2<br />
</code><br />
That&#8217;s all there is to configuring the basic mode, which gets you failover but no load balancing. Before talking about load balancing, let&#8217;s take a look at preemption and &#8220;mac address-table move update.&#8221;</p>
<p><strong>Preemption</strong></p>
<p>Preemption, that is, the preferred port for forwarding traffic, is also configurable. This is most often used in combination with multiple links that have differing bandwidth capacities. If you wish to ensure that port 1, a primary port that has more bandwidth, will return to the active link when it comes back up, you would set:  interface preemption mode bandwidth andswitchport backup interface preemption delay. The delay is used to set the amount of time (in seconds) to wait before allowing port 1 to preempt port 2 and begin taking over traffic again.</p>
<p><strong>MAC Address-Table Move Update</strong></p>
<p>Enabling the MAC address-table move update feature allows for rapid convergence when a primary link goes down and the backup takes over traffic forwarding duties. Without this feature enabled, neighboring switches may continue to forward traffic for a short time to a dead port, since they have learned MAC addresses associated with that link.</p>
<p>When move update is enabled, the switch containing Flex Links will broadcast an update packet to let other switches know what happened, and they will in turn un-learn that false MAC address mapping.</p>
<p>On the switch with Flex Links, simply configure:</p>
<p><code>Switch(conf)# mac address-table move update transmit<br />
</code><br />
All switches, including ones with Flex Links, need to receive these updates. This is not enabled by default, so you&#8217;ll need to run the following command on all of your devices:</p>
<p><code>Switch(conf)# mac address-table move update receive<br />
</code><br />
To see the status and verify that &#8220;move update&#8221; is enabled, run: show mac address-table move update. Checking the status of your Flex Links is much the same: show interfaces [interface-id] switchport backup.</p>
<p><strong>Load Balancing</strong></p>
<p>Flex Links should be configured such that both ports are forwarding traffic at the same time. This way, you get load balancing in addition to redundancy. The limitation is that only one port can be forwarding a single VLAN at a time. If we have VLANs 1-200, we need to choose which VLANs are forwarded primarily through which port. The most simple configuration, ignoring traffic requirements, would be that VLANs 1-100 use port 1, and VLANs 101-200 use port 2.</p>
<p>Before we get into configuring preferred VLANs, let&#8217;s talk about multicast. Multicast, of course, becomes an issue with this type of setup. If a port passed an IGMP join, and the switch is part of a multicast group, when the port goes down the switch will no longer be able to receive multicast traffic for that group. The quick fix is to make both Flex Links always be part of learned groups, with the command: switchport backup interface gigabitEthernet 1/0/12 multicast fast-convergence.</p>
<p>Now, on to VLAN load balancing. It is quite easy; just specify which VLANs you prefer on which links:</p>
<p><code>Switch(config-if)#switchport backup interface gigabitEthernet1/0/2 prefer vlan 101-200.<br />
</code><br />
If you have VLANs 1-200 on the switch, show interfaces switchport backup will show you:</p>
<p><code>Vlans Preferred on Active Interface: 1-100<br />
Vlans Preferred on Backup Interface: 101-200<br />
</code><br />
If a link goes down, VLANs that are preferred on that interface will be moved to the other link in the pair. Likewise, when a link returns to service, its preferred VLANs are blocked on the backup and returned to the preferred link.</p>
<p>Be sure to run show interfaces switchport backup detail to see the full status, including link speeds, preemption modes, the MAC address-table move update status.</p>
<p>In summary, the simplicity of Flex Links make it a better choice for carrier and core enterprise networks over the ubiquitous spanning tree protocol. Link-level redundancy is had via STP, but with Flex Links you have more control and better load balancing capabilities. This certainly means that it takes longer to configure since you are planning the layer 2 network manually, but when you need a stable no-surprises link-layer network, Flex Links are definitely the way to go.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d33').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d33" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fare-cisco-flex-links-the-end-of-stp%2F&amp;title=Are+Cisco+Flex+Links+the+End+of+STP%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fare-cisco-flex-links-the-end-of-stp%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fare-cisco-flex-links-the-end-of-stp%2F&amp;title=Are+Cisco+Flex+Links+the+End+of+STP%3F" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fare-cisco-flex-links-the-end-of-stp%2F&amp;title=Are+Cisco+Flex+Links+the+End+of+STP%3F" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Are+Cisco+Flex+Links+the+End+of+STP%3F+@+http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fare-cisco-flex-links-the-end-of-stp%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fare-cisco-flex-links-the-end-of-stp%2F&amp;t=Are+Cisco+Flex+Links+the+End+of+STP%3F" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d33').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking/built-in-security-with-cisco-ips/' rel='bookmark' title='Built-in Security with Cisco IPS'>Built-in Security with Cisco IPS</a></li>
<li><a href='http://www.longitudetech.com/networking/cisco-autoqos-voip-qos-for-mere-mortals/' rel='bookmark' title='Cisco AutoQoS: VoIP QoS for Mere Mortals'>Cisco AutoQoS: VoIP QoS for Mere Mortals</a></li>
<li><a href='http://www.longitudetech.com/networking/manage-devices-and-configurations-with-cisco-sdm/' rel='bookmark' title='Manage Devices and Configurations with Cisco SDM'>Manage Devices and Configurations with Cisco SDM</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/sfjH4bajXVzVZYl5p7KZFG-yMjM/0/da"><img src="http://feedads.g.doubleclick.net/~a/sfjH4bajXVzVZYl5p7KZFG-yMjM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/sfjH4bajXVzVZYl5p7KZFG-yMjM/1/da"><img src="http://feedads.g.doubleclick.net/~a/sfjH4bajXVzVZYl5p7KZFG-yMjM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/VHYXwIw_1lk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/networking/are-cisco-flex-links-the-end-of-stp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/networking/are-cisco-flex-links-the-end-of-stp/</feedburner:origLink></item>
		<item>
		<title>Cisco AutoQoS: VoIP QoS for Mere Mortals</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/JGtdgJoBlAI/</link>
		<comments>http://www.longitudetech.com/networking/cisco-autoqos-voip-qos-for-mere-mortals/#comments</comments>
		<pubDate>Sun, 09 May 2010 02:46:56 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[networks]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=54</guid>
		<description><![CDATA[WANs often need Quality of Service (QoS) configured to ensure that certain traffic is classified as “more important” than other traffic. Until now, it took a serious Cisco guru to configure a network properly for VoIP if the network was at all bandwidth constrained. AutoQoS, a new IOS feature for Cisco routers, makes deploying VoIP [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking/built-in-security-with-cisco-ips/' rel='bookmark' title='Built-in Security with Cisco IPS'>Built-in Security with Cisco IPS</a></li>
<li><a href='http://www.longitudetech.com/networking/are-cisco-flex-links-the-end-of-stp/' rel='bookmark' title='Are Cisco Flex Links the End of STP?'>Are Cisco Flex Links the End of STP?</a></li>
<li><a href='http://www.longitudetech.com/networking/manage-devices-and-configurations-with-cisco-sdm/' rel='bookmark' title='Manage Devices and Configurations with Cisco SDM'>Manage Devices and Configurations with Cisco SDM</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>WANs often need Quality of Service (QoS) configured to ensure that certain traffic is classified as “more important” than other traffic. Until now, it took a serious Cisco guru to configure a network properly for VoIP if the network was at all bandwidth constrained. AutoQoS, a new IOS feature for Cisco routers, makes deploying VoIP easy, even on busy WAN links. In this article we’ll cover the basics, what AutoQoS does, and some of its limitations.</p>
<p>The first whack at AutoQoS was Cisco recognizing the need to simplify VoIP traffic prioritization. VoIP is especially sensitive to any latency, jitter, or loss, and users will notice problems. To ensure the best possible VoIP call, the network must ensure that lower priority <img class="alignleft size-full wp-image-55" title="traffic_jam" src="http://www.longitudetech.com/blog/wp-content/uploads/2010/03/traffic_jam.jpg" alt="" width="326" height="400" />traffic does not interfere with time-sensitive VoIP. AutoQoS can be enabled on both WAN links and Ethernet switches to automatically provide a nice best-practices based template for VoIP prioritization. If you&#8217;re lucky enough to have metro Ethernet service, like ﻿﻿﻿<a href="http://business.att.com/enterprise/Family/network-services/ethernet">AT&amp;T ethernet service</a> for example, you should contact your provider to find out if QoS settings on your switches can be duplicated through theirs.</p>
<p><strong>How it Works</strong></p>
<p>QoS allows a router to classify which types of traffic are most important, and ensure that that traffic passed as quickly as possible. If necessary, other traffic will be queued until the higher priority traffic has had a chance to pass. Before a router can know when to queue versus when to attempt to pass all traffic, it must be configured with bandwidth settings for each link.</p>
<p>Configuring QoS on a Cisco router normally involves a complex series of interactions, which require understanding not only the protocols, but a router’s strange way of associating policies. The basic steps are:</p>
<ul>
<li>Use an ACL to define which traffic gets matched</li>
<li>A class-map classifies matched traffic into classes</li>
<li>A policy-map assigns priorities to the classes</li>
<li>The policy-map is applied to the interface, which enables the processing of all packets through the ACL, class-map, and policy-map</li>
</ul>
<p>Each of these “maps” are quite complicated and prone to error. Most sites are going to be duplicating effort because of common problems, like VoIP, needing QoS help.</p>
<p><strong>Why AutoQoS</strong></p>
<p>QoS configuration is not simple. It requires understanding the protocols your network interfaces are using, as well as the type of data you’re passing. To configure QoS for VoIP, for example, you must understand how VoIP works. In short, it requires a guru. If you’re like me, you literally giggled out loud the first time you encountered the word, “AutoQoS.”</p>
<p>AutoQoS enables any network administrator to just “turn on” a solid solution for ensuring VoIP is happy. VoIP is the pain point for most organizations, so that’s what Cisco focused on first, and that’s what we’re focusing on here. Given the limited scope of AutoQoS, it’s believable that it works well enough. In reality, QoS configurations generally classify many types of traffic, and then place a priority on each one.</p>
<p>The main benefit of AutoQoS is that administrator training is much quicker. It also means that VoIP deployments often go much smoother, and upgrading WAN links isn’t usually required. Finally, AutoQoS creates templates that can be modified as needed and copied elsewhere for deployment.</p>
<p><strong>Limitations</strong></p>
<p>Before talking about how to enable AutoQoS, which is literally three commands, let’s talk about where this works best, and what’s required to use AutoQoS.</p>
<p>First and foremost, you can only configure AutoQoS on a few types of router interfaces. These interfaces include:</p>
<ul>
<li>PPP or HDLC serial interfaces</li>
<li>ATM PVCs</li>
<li>Frame Relay (point-to-point links only)</li>
</ul>
<p>Cisco catalyst switches also support an AutoQoS command to prioritize Cisco VoIP phones, but you cannot prioritize (using AutoQoS) generic VoIP protocols.</p>
<p>Next, there are some limitations with ATM sub-interfaces. If you have a low-speed ATM link (less than 768Kbps), then AutoQoS will only work on point-to-point sub-interfaces. Higher speed ATM PVCs are fully supported though. For standard serial links, AutoQoS is not supported at all on sub-interfaces. A quick litmus test to see if AutoQoS will work on your desired interfaces or not is to verify that the <strong>service-policy</strong> configuration is supported. If not, you’ll probably have to reconfigure some links.</p>
<p>AutoQoS will not work if an existing QoS configuration exists on an interface. Likewise, when you disable the AutoQoS configuration, any changes you may have made to the template after the initial configuration will be lost.</p>
<p>Bandwidth statements are used by AutoQoS to determine what settings it should use, so remember that after updating bandwidth statements in the future, you have to re-run the AutoQoS commands.</p>
<p><strong>Making it Work</strong></p>
<p>In the most standard situation, where VoIP isn’t performing as it was promised, the network admin can quickly save the day by running the following on the WAN interface:</p>
<pre>interface Serial0
bandwidth 256
autoqos voip</pre>
<p>If it’s the local network that needs tuning, the following can be run on Catalyst switches (if running Enhanced Images):</p>
<pre>auto qos voip cisco-phone
auto qos voip trust</pre>
<p>It really couldn’t be easier than that.  For the WAN example, we told the router that interface Serial0 has 256 Kbps, and to enable VoIP QoS. The switch example is similar, for Cisco phones.</p>
<p>The neat part about this is that AutoQoS is actually doing more than just generating a configuration for you and forgetting about it. If you run the command <strong>show autoqos interface s0</strong>, you will see much more than just your standard old interface configuration. It will show that a Virtual Template “interface” has been created, and that a class is applied to the interface. The same output will also show you the configuration of the template and class-map, with an asterisk next to each entry that was generated by AutoQoS. It’s actually keeping track of what was done automatically so that you can learn what AutoQoS is doing. As mentioned previously, however, don’t forget that removing the AutoQoS configuration will destroy all QoS settings on an interface, not just the ones that AutoQoS configured.</p>
<p>Finally, remember to enable QoS on both sides of a WAN link to truly prioritize VoIP packets. Don’t forget to read through the Cisco documentation before deploying it, even though AutoQoS is simple, in comparison. It is simple, but the more prepared you are the easier it is to deploy.</p>
<p>Cisco will hopefully continue this trend of providing Auto features for complicated, but common tasks. AutoQoS for VoIP sure does enable a much larger audience to correctly deploy VoIP over a wide variety of networks.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d54').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d54" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fcisco-autoqos-voip-qos-for-mere-mortals%2F&amp;title=Cisco+AutoQoS%3A+VoIP+QoS+for+Mere+Mortals" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fcisco-autoqos-voip-qos-for-mere-mortals%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fcisco-autoqos-voip-qos-for-mere-mortals%2F&amp;title=Cisco+AutoQoS%3A+VoIP+QoS+for+Mere+Mortals" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fcisco-autoqos-voip-qos-for-mere-mortals%2F&amp;title=Cisco+AutoQoS%3A+VoIP+QoS+for+Mere+Mortals" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Cisco+AutoQoS%3A+VoIP+QoS+for+Mere+Mortals+@+http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fcisco-autoqos-voip-qos-for-mere-mortals%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fcisco-autoqos-voip-qos-for-mere-mortals%2F&amp;t=Cisco+AutoQoS%3A+VoIP+QoS+for+Mere+Mortals" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d54').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking/built-in-security-with-cisco-ips/' rel='bookmark' title='Built-in Security with Cisco IPS'>Built-in Security with Cisco IPS</a></li>
<li><a href='http://www.longitudetech.com/networking/are-cisco-flex-links-the-end-of-stp/' rel='bookmark' title='Are Cisco Flex Links the End of STP?'>Are Cisco Flex Links the End of STP?</a></li>
<li><a href='http://www.longitudetech.com/networking/manage-devices-and-configurations-with-cisco-sdm/' rel='bookmark' title='Manage Devices and Configurations with Cisco SDM'>Manage Devices and Configurations with Cisco SDM</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/lQa0CUx_NhP_zwhq3LJHg_gPhwE/0/da"><img src="http://feedads.g.doubleclick.net/~a/lQa0CUx_NhP_zwhq3LJHg_gPhwE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/lQa0CUx_NhP_zwhq3LJHg_gPhwE/1/da"><img src="http://feedads.g.doubleclick.net/~a/lQa0CUx_NhP_zwhq3LJHg_gPhwE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/JGtdgJoBlAI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/networking/cisco-autoqos-voip-qos-for-mere-mortals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/networking/cisco-autoqos-voip-qos-for-mere-mortals/</feedburner:origLink></item>
		<item>
		<title>Networking 101: Layer 2, Link and Spanning Tree</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/U5dWLbJd1zs/</link>
		<comments>http://www.longitudetech.com/networking-101/networking-101-layer-2-link-and-spanning-tree/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 16:17:08 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Networking 101]]></category>
		<category><![CDATA[ccna]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[networks]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=58</guid>
		<description><![CDATA[What&#8217;s more important than IP and routing? Well, Layer 2 is much more important when it&#8217;s broken. Many people don&#8217;t have the Spanning Tree Protocol (STP) knowledge necessary to implement a Layer 2 network that&#8217;s resilient. A switch going down shouldn&#8217;t prevent anyone from having connectivity, excluding the hosts that are directly attached to it. [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-understanding-layers/' rel='bookmark' title='Networking 101: Understanding Layers'>Networking 101: Understanding Layers</a></li>
<li><a href='http://www.longitudetech.com/networking/networking-101-more-subnets-and-ipv6/' rel='bookmark' title='Networking 101: More Subnets, and IPv6'>Networking 101: More Subnets, and IPv6</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-ip-addresses/' rel='bookmark' title='Networking 101: IP addresses'>Networking 101: IP addresses</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>What&#8217;s more important than IP and routing? Well, Layer 2 is much more important when it&#8217;s broken. Many people don&#8217;t have the Spanning Tree Protocol (STP) knowledge necessary to implement a Layer 2 network that&#8217;s resilient. A switch going down shouldn&#8217;t prevent anyone from having connectivity, excluding the hosts that are directly attached to it. Before we can dive into Spanning Tree, you must understand the innerworkings of layer 2.</p>
<p>Layer 2, the Data Link layer, is where Ethernet lives. We&#8217;ll be talking about bridges, switching, and VLANs with the goal of discovering how they interact in this part of Networking 101. You don&#8217;t really need to study the internals of Ethernet to make a production network operate, so if you&#8217;re inclined, do that on your own time.</p>
<p>Ethernet switches, as they&#8217;re called now, began life as a &#8220;bridge.&#8221; Traditional bridges would read all Ethernet frames, and then forward them out every port, except the one it came in on. They had the ability to allow redundancy via STP, and they also began learning which MAC addresses were on which port. At this point, a bridge then became a learning device, which means they would store a table of all MAC addresses seen on a port. When a frame needed to be sent, the bridge could look up the destination MAC address in the bridge table, and know which port is should be sent out. The ability to send data to only the correct host was a huge advancement in switching; collisions were much less likely. If the destination MAC address wasn&#8217;t found in the bridge table, the switch would simply flood it out all ports. That&#8217;s the only way to find where a host actually lives for the first time, so as you can see, flooding is an important concept in switching. It turns out to be quite necessary in routing too.</p>
<p>Important terminology in this layer includes:</p>
<p><strong>Unicast segmentation </strong>: Bridges can limit which hosts hear unicast frames (frames sent to only one MAC address). Hubs would simply forward everything to everyone, so this alone is a huge bandwidth-saver.</p>
<p><strong>Collision Domain </strong>: The segment over which collisions can occur. Collisions don&#8217;t happen any more, since switches use cut-through forwarding and NICs are full-duplex. If you see collisions on a port, that means someone negotiated half-duplex accidentally, or something else is very wrong.</p>
<p><strong>Broadcast Domain </strong>: The segment over which broadcast frames are sent and can be heard.</p>
<p>A few years later, the old store-and-forward method of bridge operation was modified. New switches started only looking at the destination MAC address of the frame, and then sending it instantly. Dubbed cut-through forwarding, presumably because frames cut through the switch much quicker and with less processing. This implies a few important things: a switch can&#8217;t check the CRC to see if the packet was damaged, and that implies collisions needed to be made impossible.</p>
<p>Now, to address broadcast segmentation, VLANs were introduced. If you can&#8217;t send a broadcast frame to another machine, they&#8217;re not on your local network, and you will instead send the entire packet to a router for forwarding. That&#8217;s what a Virtual LAN (VLAN) does, in essence&#8211;it makes more networks. On a switch, you can configure VLANs, and then assign a port to a VLAN. If host A is in VLAN 1, it can&#8217;t talk to anyone in VLAN 2, just as if they lived on totally disconnected devices. Well, almost; if the bridge table is flooded and the switch is having trouble keeping up, all data will be flooded out every port. This has to happen in order for communication to continue in these situations. This needs to be pointed out because many people believe VLANs are a security mechanism. They are not even close. Anyone with half a clue about networks (or with the right cracking tool in their arsenal) can quickly overcome the VLAN broadcast segmentation. In fact, a switch will basically turn into a hub when it floods frames, spewing everyone&#8217;s data to everyone else.</p>
<p>If you can&#8217;t ARP for a machine, you have to use a router, as we already know. But does that mean you have to physically connect wires from a router into each VLAN? Not anymore, we have layer 3 switches now! Imagine for an instance, if you will, a switch that contains 48 ports. It also has VLAN 1 and VLAN 2, and ports 1-24 are in VLAN 1, while ports 25-48 are part of VLAN 2. To route between the two VLANs, you have basically three options. First, you can connect a port in each VLAN to a router, and assign the hosts the correct default route. In the new-fangled world of today, you can also simply bring up two virtual interfaces in each VLAN. In Cisco land, the router interfaces would be called vlan1 and vlan2. They get IP addresses, and the hosts use the router interface as their router.</p>
<p>The third way brings us to the final topic of the layer 2 overview. If you have multiple switches that need to contain the same VLANs, you can connect them together so that VLAN 1 on switch A is the same as VLAN 1 on switch B. This is accomplished with 802.1q, which will tag the packets as they leave the first switch with a VLAN identifier. Cisco calls these links &#8220;trunk ports,&#8221; and you can have as many VLANs on them as the switch allows (currently 4096 on most hardware). So, the third and final way to route between VLANs is to connect a trunk to a router, and bring up the appropriate interfaces for each VLAN. The hosts on VLAN 1, on both switch A and B will have access to the router interface (which happens to be on another device) since they are all &#8220;trunked&#8221; together and share a broadcast domain.</p>
<p>We&#8217;ve saved you from the standard &#8220;this is layer 2, memorize the Ethernet header&#8221; teaching method. To become truly guru you must know it, but to be a useful operator, (something the cert classes don&#8217;t teach you) simply understand how it all works. Join us next time for an exploration of most interesting protocol in the world, Spanning Tree.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d58').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d58" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-layer-2-link-and-spanning-tree%2F&amp;title=Networking+101%3A+Layer+2%2C+Link+and+Spanning+Tree" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-layer-2-link-and-spanning-tree%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-layer-2-link-and-spanning-tree%2F&amp;title=Networking+101%3A+Layer+2%2C+Link+and+Spanning+Tree" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-layer-2-link-and-spanning-tree%2F&amp;title=Networking+101%3A+Layer+2%2C+Link+and+Spanning+Tree" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Networking+101%3A+Layer+2%2C+Link+and+Spanning+Tree+@+http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-layer-2-link-and-spanning-tree%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-layer-2-link-and-spanning-tree%2F&amp;t=Networking+101%3A+Layer+2%2C+Link+and+Spanning+Tree" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d58').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-understanding-layers/' rel='bookmark' title='Networking 101: Understanding Layers'>Networking 101: Understanding Layers</a></li>
<li><a href='http://www.longitudetech.com/networking/networking-101-more-subnets-and-ipv6/' rel='bookmark' title='Networking 101: More Subnets, and IPv6'>Networking 101: More Subnets, and IPv6</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-ip-addresses/' rel='bookmark' title='Networking 101: IP addresses'>Networking 101: IP addresses</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/fHbzlJv8mPXKPA_MjqBN7vv_ljk/0/da"><img src="http://feedads.g.doubleclick.net/~a/fHbzlJv8mPXKPA_MjqBN7vv_ljk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/fHbzlJv8mPXKPA_MjqBN7vv_ljk/1/da"><img src="http://feedads.g.doubleclick.net/~a/fHbzlJv8mPXKPA_MjqBN7vv_ljk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/U5dWLbJd1zs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/networking-101/networking-101-layer-2-link-and-spanning-tree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/networking-101/networking-101-layer-2-link-and-spanning-tree/</feedburner:origLink></item>
		<item>
		<title>Understanding Fibre Channel</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/oQoaRFrQ9SU/</link>
		<comments>http://www.longitudetech.com/san-101/understanding-fibre-channel/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 00:41:07 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[SAN 101]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[SAN]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[storage networking]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=57</guid>
		<description><![CDATA[As we dive deeper into SAN technology, it&#8217;s Fibre Channel&#8217;s turn to be examined. FC is the underpinning of all SAN technologies these days, as it won the protocol war roughly 25 years ago. FC wouldn&#8217;t be much use without something on top of it, namely SCSI. FC is the low-level transport that ships data, [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-understanding-layers/' rel='bookmark' title='Networking 101: Understanding Layers'>Networking 101: Understanding Layers</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/understanding-linux-virtual-memory/' rel='bookmark' title='Understanding Linux Virtual Memory'>Understanding Linux Virtual Memory</a></li>
<li><a href='http://www.longitudetech.com/san-101/san-101-intro-to-sans-and-storage/' rel='bookmark' title='SAN 101: Intro to SANs and Storage'>SAN 101: Intro to SANs and Storage</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As we dive deeper into SAN technology, it&#8217;s Fibre Channel&#8217;s turn to be examined. FC is the underpinning of all SAN technologies these days, as it won the protocol war roughly 25 years ago.</p>
<p>FC wouldn&#8217;t be much use without something on top of it, namely SCSI. FC is the low-level transport that ships data, but hosts are normally talking SCSI as far as they&#8217;re concerned. The hubs, switches, and HBAs in a SAN all speak FC, while the applications that use SAN storage continue to use familiar protocols, like SCSI.</p>
<p>The idea behind FC was to create a high throughput, low latency, reliable and scalable protocol. Ethernet wouldn&#8217;t quite cut it for highly-available storage needs. FC can currently operate of speeds up to 10Gb/s (10GFC) for uplinks, and 4Gb for standard host connections. FC also provides small connectors. As silly as it sounds, SCSI cables become unruly after time, and small strands of fibre are certainly easier to manage. The equipment required to connect to a FC SAN (multiple HBAs for each host, fibre, and switches) is extremely expensive, and was the main reason SAN technologies took so long to become widely adopted.</p>
<p><strong>Topologies</strong><br />
In reality, two different protocols, or topologies, make up the FC protocol. FC supports all topologies, but the behavior of the protocol changes depending on the topology. The following three types of topologies are supported:</p>
<ul>
<li>PTP (point to point): normally used for DAS configurations.</li>
<li>FC-AL (FC Arbitrated Loop): Fabric Loop ports, or FL ports on a switch, and NL_Ports (node loop) on an HBA, support loop operations.</li>
<li>FC-SW (FC Switched): the mode when operating on a switched SAN.</li>
</ul>
<p>FC-AL operation is quite scary, but sometimes a device doesn&#8217;t support FC-SW operations, and there&#8217;s no choice. A hub has no choice but to operate in FC-AL mode, and therefore attached hosts must as well. When a device joins an FC-AL, or when there&#8217;s any type of error or reset, the loop must reinitialize. All communication is temporarily halted during this process, so it can cause problems for some applications. FC-AL is limited to 127 nodes due to the addressing mechanism, in theory, but in reality closer to 20. FC-AL is mostly relegated to niche uses now, including but not limited to internal disk array communications and internal storage for high-end servers.</p>
<p>FC switches can be connected any way you please, since the FC protocol avoids the possibility of a loop by nature. Ethernet isn&#8217;t so lucky. The addressing scheme used does impose a limit of 239 switches though. FC switches use FSPF, a link-state protocol like OSPF in the IP world, to ensure loop-free and efficient connectivity.</p>
<p>FC networks are generally designed in one of two ways: either one big star, or one big star with edge switches hanging off it. These are commonly known as &#8220;core-only&#8221; and &#8220;core-edge&#8221; configurations. Normally a SAN will contain two of these networks, and each host&#8217;s HBA or storage device&#8217;s controller will attach to each. Keeping these networks separate isn&#8217;t as necessary as it is with FC-AL topologies, but even with FC-SW setups it still provides complete isolation and assurance that a problem in one fabric won&#8217;t impact the other. An FSPF recalculation, for example, could cause a brief interruption in service.</p>
<p><strong>Ports</strong><br />
As previously mentioned, there are different port types in a SAN, and it can get confusing. Let&#8217;s try to clear up some of that terminology:</p>
<ul>
<li>N_Port: Node Port; the node connection point; end points for FC traffic</li>
<li>F_Port: Fabric Port; a switch-connected port, that is a &#8220;middle point&#8221; connection for two N_Ports</li>
<li>NL_Port: Node Loop Port; connects to others via their NL_Ports, or to a switched fabric via a single FL_Port; or NL_port to F_Port to F_Port to N_Port (through a switch)</li>
<li>FL_Port: Fabric Loop Port; a shared point of entry into a fabric for AL devices; example  NL_Port to FL_Port to F_Port to N_Port</li>
<li>E_Port: Expansion Port; used to connect multiple switches together via ISL (inter-switch links)</li>
<li>G_Port: Generic Port; can switch between F_Port and E_Port operation depending on how it&#8217;s connected</li>
<li>TE_Port: Trunked Expansion Port; link aggregation of multiple E_Ports for higher throughput</li>
</ul>
<p>You&#8217;ll generally only see F_Ports and FL_Ports when looking at a single SAN switch, and knowing the difference helps. FL means that you&#8217;re talking FC-AL, and there&#8217;s a device attached that is either a hub, something that can&#8217;t do anything but FC-AL, or something strange. Ports will automatically configure themselves as an FL_Port if the attached device is Loop-only, otherwise it will be an F_Port. It&#8217;s also worth noting that some brands of FC switches don&#8217;t allow you to have an E_Port unless you pay a higher licensing fee. It&#8217;s something to think about if you ever plan to connect multiple switches together.</p>
<p><strong>FC Layers</strong><br />
FC has its own layers, so in fact, calling it &#8220;like Ethernet&#8221; isn&#8217;t quite accurate, even if it helps for understanding. They are:</p>
<ul>
<li>FC-0: The interface to the physical media; cables, etc</li>
<li>FC-1: Transmission protocol or data-link layer, encodes and decodes signals</li>
<li>FC-2: Network Layer; the core of FC</li>
<li>FC-3: Common services, like hunt groups</li>
<li>FC-4: Everything! Protocol mapping for SCSI, iSCSI, FCP, IP, and others</li>
</ul>
<p>The bulk of FC is really in FC-2. FC-PH refers to FC-0 through FC-2, which are strangely dubbed the physical layers.</p>
<p>FC also supports its own naming and addressing mechanism, which sheds light on the previously mentioned limitations in FC-AL and FC-SW topologies. Next time, we&#8217;ll discuss the header format for FC-2 as well as FC address assignment and name resolution.</p>
<p>In a Nutshell:</p>
<ul>
<li>FC is the transport mechanism, and SCSI or even IP rid atop FC</li>
<li>FC-AL is a loop, where all connected devices see each other, and a re-initialization takes out the entire SAN</li>
<li>Port types reveal what is actually happening, and knowing what they stand for can aid in topology visualization when looking at a switch&#8217;s configuration</li>
</ul>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d57').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d57" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fsan-101%2Funderstanding-fibre-channel%2F&amp;title=Understanding+Fibre+Channel" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fsan-101%2Funderstanding-fibre-channel%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fsan-101%2Funderstanding-fibre-channel%2F&amp;title=Understanding+Fibre+Channel" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fsan-101%2Funderstanding-fibre-channel%2F&amp;title=Understanding+Fibre+Channel" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Understanding+Fibre+Channel+@+http%3A%2F%2Fwww.longitudetech.com%2Fsan-101%2Funderstanding-fibre-channel%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fsan-101%2Funderstanding-fibre-channel%2F&amp;t=Understanding+Fibre+Channel" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d57').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-understanding-layers/' rel='bookmark' title='Networking 101: Understanding Layers'>Networking 101: Understanding Layers</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/understanding-linux-virtual-memory/' rel='bookmark' title='Understanding Linux Virtual Memory'>Understanding Linux Virtual Memory</a></li>
<li><a href='http://www.longitudetech.com/san-101/san-101-intro-to-sans-and-storage/' rel='bookmark' title='SAN 101: Intro to SANs and Storage'>SAN 101: Intro to SANs and Storage</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/LBwpQXBMQVom9q8WewNgfrp9_3s/0/da"><img src="http://feedads.g.doubleclick.net/~a/LBwpQXBMQVom9q8WewNgfrp9_3s/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/LBwpQXBMQVom9q8WewNgfrp9_3s/1/da"><img src="http://feedads.g.doubleclick.net/~a/LBwpQXBMQVom9q8WewNgfrp9_3s/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/oQoaRFrQ9SU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/san-101/understanding-fibre-channel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/san-101/understanding-fibre-channel/</feedburner:origLink></item>
		<item>
		<title>Multi-user Security in Linux</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/7Q_85fSOwgo/</link>
		<comments>http://www.longitudetech.com/linux-unix/multi-user-security-in-linux/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 17:16:05 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=56</guid>
		<description><![CDATA[A wise man once said, “everyone is root if you allow them to login as a user,” in retort to a question about the security of a multi-user Linux system. There is plenty of truth in that, but just accepting eminent compromise isn’t always acceptable. Let’s take a look at how you can limit your [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/the-perils-of-sudo-with-user-passwords/' rel='bookmark' title='The Perils of Sudo With User Passwords'>The Perils of Sudo With User Passwords</a></li>
<li><a href='http://www.longitudetech.com/networking/built-in-security-with-cisco-ips/' rel='bookmark' title='Built-in Security with Cisco IPS'>Built-in Security with Cisco IPS</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/understanding-linux-virtual-memory/' rel='bookmark' title='Understanding Linux Virtual Memory'>Understanding Linux Virtual Memory</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A wise man once said, “everyone is root if you allow them to login as a user,” in retort to a question about the security of a multi-user Linux system. There is plenty of truth in that, but just accepting eminent compromise isn’t always acceptable. Let’s take a look at how you can limit your exposure while letting unknown and untrusted users login with a shell.</p>
<p>There are basically two groups of people who’d want to restrict login users heavily. First, the collaborators, possibly two separate organizations that have been forced to work together. Second, people who wish to allow some shady characters access to a shell, but believe they may attempt to compromise security. If at all possible, the best policy is to simply not give access out, and if you do, make sure patches are applied daily.</p>
<p><img class="alignleft" src="http://www.princeton.edu/plug/linux-penguin.png" alt="" width="227" height="260" />To say that you simply shouldn’t give out shells to untrustworthy users may work in a few instances. Say, for example, there is a need for remote users at another site to login and run the same series of commands every day. Say, for the sake of argument, their task can be easily scripted. If this is their only purpose on the server, a shell certainly isn’t necessary. OpenSSH allows a set of restrictions to be applied to an SSH key.</p>
<p>At the end of an SSH key entry, you can tack on these options:<br />
no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command=&#8221;~/bin/script.sh”<br />
This effectively restricts any SSH connections using this key to only being allowed to run the mentioned script. This can even be a setuid script that restarts a web server, for example. It’s quite safe, because OpenSSH will reject any variation of the <em>command= </em>text. Users possessing this key will <em>only</em> be able to execute the command that is explicitly allowed.</p>
<p>Aside from that, and possibly some fancy web-based tools or cron jobs, there aren’t may options left. At times users just need to be able to login and work.</p>
<p>It should go without saying that you need to stay up-to-date on patches. We won’t focus too much on that, aside from saying: automate! Securing a machine is an entirely different topic all together, but here are a few points to consider.</p>
<p>Enabling SELinux (Security-Enhanced Linux) is your first line of defense against unknown attacks. SELinux can prevent buffer overflows, as opposed to simply taking the “updates” path, which requires that a publicly known hole be fixed before some tries to exploit it. SELinux provides a significantly improved access system to limit programs from accessing things they don’t require to be operational. That, combined with overflow prevention makes it quite difficult to compromise a Linux system.</p>
<p>Further, on the issue of securing a multi-user machine, there is a much-debated precept: that users shouldn’t be able to see what processes are running, unless they own them. This restriction is simple to enable in Linux and the BSD’s, but does it really buy you anything? The answer is “maybe,” and at the same time, “not really.” To satisfy the maybe camp, consider a process’s arguments. When you run a command with a given set of arguments, the command as well as the arguments will show up in a ‘ps’ listing. If you have provided a password on the command-line for some reason, it will be visible to anyone running a ‘ps’ while your process is still running. Many people think that allowing users to see running daemon processes on a server will allow them to know what to try attacking. This information is trivial to obtain via other means anyway, so “not really.”</p>
<p>Every time this discussion starts, someone quickly suggests a chroot jail. The chroot command stands for “change root,” which does just that. If you run the command: ‘chroot /home/charlie /bin/bash’ then chroot will look for the shell in /home/charlie/bin/bash, and then proceed to lock you into that directory. The new root of the file system, for the lifetime of the bash shell, is /home/charlie. You now have zero access to any other part of the actual file system. Any available command, and its required libraries, needs to be copied into the chroot jail. Providing a usable environment is a ton of work. It’s actually easier to give each user their own Linux Xen or Solaris Zone instance. Really.</p>
<p>Finally we come to the restricted shells. The most popular, rbash, is a restricted bash shell. Setting a user’s shell to rbash will provide absolutely zero security. In theory, rbash will prevent users from running anything by specifying a full path, including ‘./’ (the current directory). This implies that it’s difficult for users to run commands, including scripts they write or downloaded exploits. Since $PATH is controlled globally, users can only run things in those locations. Unfortunately, /bin/ is going to need to be in their path, so all a user needs to do is run a new shell, and rbash is no longer in the picture: ‘exec bash’</p>
<p>One method of alleviating this is to give users only one item in their path, a directory the administrator created. Within the directory, simply place symlinks to all the authorized commands. This is nearly as cumbersome as setting up chroot, but much more tolerable.</p>
<p>Security isn’t convenient, and if it is, you’re doing something wrong.</p>
<p>There are certainly ways to prevent users from running downloaded programs, but in the end, the multi-user security of a system will depend on security of every piece of software installed. Preventing the exploits from being successful, a la SELinux, adds the most viable method of protection. Coupled with a frequently updated system, additional restrictions such as rbash aren’t generally necessary.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d56').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d56" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fmulti-user-security-in-linux%2F&amp;title=Multi-user+Security+in+Linux" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fmulti-user-security-in-linux%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fmulti-user-security-in-linux%2F&amp;title=Multi-user+Security+in+Linux" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fmulti-user-security-in-linux%2F&amp;title=Multi-user+Security+in+Linux" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Multi-user+Security+in+Linux+@+http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fmulti-user-security-in-linux%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fmulti-user-security-in-linux%2F&amp;t=Multi-user+Security+in+Linux" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d56').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/the-perils-of-sudo-with-user-passwords/' rel='bookmark' title='The Perils of Sudo With User Passwords'>The Perils of Sudo With User Passwords</a></li>
<li><a href='http://www.longitudetech.com/networking/built-in-security-with-cisco-ips/' rel='bookmark' title='Built-in Security with Cisco IPS'>Built-in Security with Cisco IPS</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/understanding-linux-virtual-memory/' rel='bookmark' title='Understanding Linux Virtual Memory'>Understanding Linux Virtual Memory</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/cfNzqJRsI7DM_HFOtX3MklEGK9k/0/da"><img src="http://feedads.g.doubleclick.net/~a/cfNzqJRsI7DM_HFOtX3MklEGK9k/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/cfNzqJRsI7DM_HFOtX3MklEGK9k/1/da"><img src="http://feedads.g.doubleclick.net/~a/cfNzqJRsI7DM_HFOtX3MklEGK9k/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/7Q_85fSOwgo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/linux-unix/multi-user-security-in-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/linux-unix/multi-user-security-in-linux/</feedburner:origLink></item>
		<item>
		<title>Networking 101: Understanding Layers</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/vg2V8uexmtQ/</link>
		<comments>http://www.longitudetech.com/networking-101/networking-101-understanding-layers/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 17:56:04 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Networking 101]]></category>
		<category><![CDATA[ccie]]></category>
		<category><![CDATA[ccna]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[networks]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=52</guid>
		<description><![CDATA[Continuing our journey, it&#8217;s time to take a trip up the OSI Reference Model, and learn what this mysterious thing is all about. The network stack is of great significance, but not so much that it&#8217;s the first thing you should learn. The networking 101 series has waited to ensue the &#8220;layers&#8221; discussion for good [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking/networking-101-more-subnets-and-ipv6/' rel='bookmark' title='Networking 101: More Subnets, and IPv6'>Networking 101: More Subnets, and IPv6</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-subnetting-slice-up-32-bits/' rel='bookmark' title='Networking 101: Subnetting &#8211; Slice Up 32-bits'>Networking 101: Subnetting &#8211; Slice Up 32-bits</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-layer-2-link-and-spanning-tree/' rel='bookmark' title='Networking 101: Layer 2, Link and Spanning Tree'>Networking 101: Layer 2, Link and Spanning Tree</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Continuing our journey, it&#8217;s time to take a trip up the OSI Reference Model, and learn what this mysterious thing is all about. The network stack is of great significance, but not so much that it&#8217;s the first thing you should learn. The networking 101 series has waited to ensue the &#8220;layers&#8221; discussion for good reason. Many so-called networking classes will start by teaching you to memorize the name of every layer and every protocol contained within this model. Don&#8217;t do that. Do realize that layers 5 and 6 can be completely ignored, though.</p>
<p>The International Standards Organization (ISO) developed the OSI (Open Systems Interconnection) model. It divides network communication into seven layers. Layers 1-4 are considered the lower layers, and mostly concern themselves with moving data around. Layers 5-7, the upper layers, contain application-level data. Networks operate on one basic principle: &#8220;pass it on.&#8221; Each layer takes care of a very specific job, and then passes the data onto the next layer.</p>
<p>The physical layer, layer 1, is too often ignored in a classroom setting. It may seem simple, but there are aspects of the first layer that oftentimes demand significant attention. Layer one is simply wiring, fiber, network cards, and anything else that is used to make two network devices communicate. Even a carrier pigeon would be considered layer one gear (see RFC 1149). Network troubleshooting will often lead to a layer one issue. We can&#8217;t forget the legendary story of CAT5 strung across the floor, and an office chair periodically rolling <a href="http://www.longitudetech.com/blog/wp-content/uploads/2010/03/osi-model-7-layers.png"><img class="alignleft size-full wp-image-53" title="osi-model-7-layers" src="http://www.longitudetech.com/blog/wp-content/uploads/2010/03/osi-model-7-layers.png" alt="" width="404" height="467" /></a>over it leading to spotty network connectivity. Sadly, this type of problem exists quite frequently, and takes the longest to troubleshoot.</p>
<p>Layer two is Ethernet, among other protocols; we&#8217;re keeping this simple, remember. The most important take-away from layer 2 land is that you should understand what a bridge is. Switches, as they&#8217;re called nowadays, are bridges. They all operate at layer 2, paying attention only to MAC addresses on Ethernet networks. The common fledgling network admin always seem to mix up layers two and three. If you&#8217;re talking about MAC address, switches, or network cards and drivers, you&#8217;re in the land of layer 2. Hubs live in layer 1 land, since they are simply electronic devices with zero layer 2 knowledge. Layer two will have it&#8217;s own section in Networking 101, so don&#8217;t worry about the details for now, just know that layer 2 translates data frames into bits for layer 1 processing.</p>
<p>On the other hand, if you&#8217;re talking about an IP address, you&#8217;re dealing with layer 3 and &#8220;packets&#8221; instead of layer 2&#8242;s &#8220;frames.&#8221; IP is part of layer 3, along with some routing protocols, and ARP (Address Resolution Protocol). Everything about routing is handled in layer 3. Addressing and routing is the main goal of this layer.</p>
<p>Layer four, the transport layer, handles messaging. Layer 4 data units are also called packets, but when you&#8217;re talking about specific protocols, like TCP, they&#8217;re &#8220;segments&#8221; or &#8220;datagrams&#8221; in UDP. This layer is responsible for getting the entire message, so it must keep track of fragmentation, out-of-order packets, and other perils. Another way to think of layer 4 is that it provides end-to-end management of communication. Some protocols, like TCP, do a very good job of making sure the communication is reliable. Some don&#8217;t really care if a few packets are lost&#8211;UDP is the prime example.</p>
<p>And arriving at layer seven, we wonder what happened to layer 5 and 6. They&#8217;re useless. A few applications and protocols live there, but for the understanding of networking issues, talking about these provides zero benefit. Layer 7, our friend, is &#8220;everything.&#8221; Dubbed the &#8220;Application Layer,&#8221; layer 7 is simply application-specific. If your program needs a specific format for data, you will invent some format that you expect the data to arrive in, and you&#8217;ve just created a layer 7 protocol. SMTP, DNS, FTP, etc, etc are all layer 7 protocols.</p>
<p>The most important thing to learn about the OSI model is what it really represents. Pretend you&#8217;re an operating system on a network. Your network card, operating at layers 1 and 2, will notify you when there&#8217;s data available. The driver handles the shedding of the layer 2 frame, which reveals a bright, shiny layer 3 packet inside (hopefully). You, as the operating system, will then call your routines for handling layer 3 data. If the data has been passed to you from below, you know that it&#8217;s a packet destined for yourself, or it&#8217;s a broadcast packet (unless you&#8217;re also a router, but never mind that for now). If you decide to keep the packet, you will unwrap it, and reveal a layer 4 packet. If it&#8217;s TCP, the TCP subsystem will be called to unwrap and pass the layer 7 data onto the application that&#8217;s listening on the port it&#8217;s destined for. That&#8217;s all!</p>
<p>When it&#8217;s time to respond to the other computer on the network, everything happens in reverse. The layer 7 application will ship its data onto the TCP people, who will stick additional headers onto the chunk of data. In this direction, the data gets larger with each progressive step. TCP hands a valid TCP segment onto IP, who give its packet to the Ethernet people, who will hand it off to the driver as a valid Ethernet frame. And then off it goes, across the network. Routers along the way will partially disassemble the packet to get at the layer 3 headers in order to determine where the packet should be shipped. If the destination is on the local Ethernet subnet, the OS will simply ARP for the computer instead of the router, and send it directly to the host.</p>
<p>Grossly simplified, sure; but if you can follow this progression and understand what&#8217;s happening to every packet at each stage, you&#8217;re just conquered a huge part of understanding networking. Everything gets horribly complex when you start talking about what each protocol actually does. If you are just beginning, please ignore all that stuff until you understand what the complex stuff is trying to accomplish. It makes for a much better learning endeavor! In future Networking 101 articles we will begin the journey up the stack, examining each layer in detail by discussing the common protocols and how they work.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d52').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d52" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-understanding-layers%2F&amp;title=Networking+101%3A+Understanding+Layers" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-understanding-layers%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-understanding-layers%2F&amp;title=Networking+101%3A+Understanding+Layers" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-understanding-layers%2F&amp;title=Networking+101%3A+Understanding+Layers" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Networking+101%3A+Understanding+Layers+@+http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-understanding-layers%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-understanding-layers%2F&amp;t=Networking+101%3A+Understanding+Layers" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d52').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking/networking-101-more-subnets-and-ipv6/' rel='bookmark' title='Networking 101: More Subnets, and IPv6'>Networking 101: More Subnets, and IPv6</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-subnetting-slice-up-32-bits/' rel='bookmark' title='Networking 101: Subnetting &#8211; Slice Up 32-bits'>Networking 101: Subnetting &#8211; Slice Up 32-bits</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-layer-2-link-and-spanning-tree/' rel='bookmark' title='Networking 101: Layer 2, Link and Spanning Tree'>Networking 101: Layer 2, Link and Spanning Tree</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/um5R9I76iyryoQEAGyzqFadzPrE/0/da"><img src="http://feedads.g.doubleclick.net/~a/um5R9I76iyryoQEAGyzqFadzPrE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/um5R9I76iyryoQEAGyzqFadzPrE/1/da"><img src="http://feedads.g.doubleclick.net/~a/um5R9I76iyryoQEAGyzqFadzPrE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/vg2V8uexmtQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/networking-101/networking-101-understanding-layers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/networking-101/networking-101-understanding-layers/</feedburner:origLink></item>
		<item>
		<title>SAN 101: Intro to SANs and Storage</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/9KqI5wGYTqo/</link>
		<comments>http://www.longitudetech.com/san-101/san-101-intro-to-sans-and-storage/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 21:31:14 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[SAN 101]]></category>
		<category><![CDATA[iSCSI]]></category>
		<category><![CDATA[SAN]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[storage networking]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=51</guid>
		<description><![CDATA[Welcome! We begin outr Storage Networking 101 series with an introduction to Storage Area Networks and storage technologies. In case you missed it, be sure to read the entire Networking 101 series (link coming soon) before embarking on the Storage journey—a solid understanding of various network protocols is required. What is a storage network? A [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/san-101/understanding-fibre-channel/' rel='bookmark' title='Understanding Fibre Channel'>Understanding Fibre Channel</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-understanding-layers/' rel='bookmark' title='Networking 101: Understanding Layers'>Networking 101: Understanding Layers</a></li>
<li><a href='http://www.longitudetech.com/it-management/how-much-server-do-you-need/' rel='bookmark' title='How Much Server do you Need?'>How Much Server do you Need?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Welcome! We begin outr Storage Networking 101 series with an introduction to Storage Area Networks and storage technologies. In case you missed it, be sure to read the entire Networking 101 series (link coming soon) before embarking on the Storage journey—a solid understanding of various network protocols is required.</p>
<p><strong>What is a storage network?</strong><br />
A storage network is any network that&#8217;s designed to transport block-level storage protocols. Hosts (servers), disk arrays, tape libraries, and just about anything else can connect to a SAN. Generally, one would use a SAN switch to connect all devices, and then configure the switch to allow friendly devices to pair up. The entire concept is about flexibility: in a SAN environment you can move storage between hosts, virtualize your storage at the SAN level, and obtain a new level of redundancy than was ever possible with direct-attached storage.</p>
<p>A FC-SAN, or Fiber Channel SAN, is a SAN comprised of the Fiber Channel protocol. Think of Fiber Channel (FC) as an Ethernet <img class="alignleft" src="http://www.vibrant.com/images/img_san-switch.jpg" alt="" width="190" height="131" />replacement. In fact, Fiber Channel can transport other protocols, like IP, but it&#8217;s mostly used for transporting SCSI traffic. Don&#8217;t worry about the FC protocol itself for now; we&#8217;ll cover that in another article later on.</p>
<p>A fairly new type of SAN is the IP-SAN: an IP network that&#8217;s been designated as a storage network. Instead of using FC, an IP-SAN uses Ethernet with IP and TCP to transport iSCSI data. There&#8217;s nothing to stop you from shipping iSCSI data over your existing network, but an IP-SAN typically means that you&#8217;re using plumbing dedicated for the storage packets. Operating system support for the iSCSI protocol has been less than stellar, but the state of iSCSI is slowly improving.</p>
<p>Another term you&#8217;ll frequently see thrown around is NAS. Network Attached Storage doesn&#8217;t really have anything to do with SANs—they&#8217;re just file servers. A NAS device runs something like Linux, and serves files using NFS or CIFS over your existing IP network. Nothing fancy to see here; move along.</p>
<p>There is one important take-away from the NAS world, however. That is the difference between block-level storage protocols and file-level protocols. A block-level protocol is SCSI or ATA, where as file protocols can be anything from NFS or CIFS to HTTP. Block protocols ship an entire disk block at once, and it gets written to disk as a whole block. File-level protocols could ship one byte at a time, and depend on the lower-level block protocol to assemble the bytes into disk blocks.</p>
<p><strong>Block-level protocols</strong><br />
A protocol always defines a method by which two devices communicate. Block storage protocols are no different: they define how storage interacts with storage controllers. There are two main block protocols used today: SCSI and ATA.</p>
<p>ATA operates in a bus topology, and allows for two devices on each bus. Your IDE disk drive and CD ROM are, you guessed it, using the ATA protocol. There are many different ATA standards, but we&#8217;ll cover just the important ones here. ATA-2 was also known as EIDE, or enhanced IDE. It was the first of the ATA protocol we know today. ATA-4 introduced ATAPI, or the ATA Packet Interface, which allows for CD ROM devices to speak SCSI-like on the same bus as a regular ATA device.</p>
<p>The neat thing about ATA is that the controllers are integrated. The only &#8220;traffic&#8221; sent over the ATA bus is plain electrical signals. The host operating system is actually responsible for implementing the ATA protocol, in software. This means that ATA devices will never, ever be as fast as SCSI, because the CPU has to do so much work to just talk to these devices. As far as SANs are concerned, ATA isn&#8217;t that important. There are some ATA-based devices that allow you to connect cheap disks, but they translate operations into SCSI before sending them out to the SAN.</p>
<p>SCSI, on the other hand, is very confusing. SCSI-1 and SCSI-2 devices were connected via a parallel interface to a bus that could support 8 or 16 devices, depending on the bus width. Don&#8217;t worry about the details unless you&#8217;re unfortunate enough to have some older SCSI gear lying around.</p>
<p>SCSI-3 separated the device-specific commands into a different category. The primary SCSI-3 command set includes the standard commands that every SCSI-3 device speaks, but the device-specific commands can be anything. This opened up a whole new world for SCSI, and it has been used to support many strange and wonderful new devices.</p>
<p>SCSI controllers normally contain a storage processor, and the commands are processed on-board so that the host operating system doesn&#8217;t become burdened to do so, as with ATA. Such a SCSI controller is called a Host Bus Adapter. In the SAN world, the FC card is always called an HBA.</p>
<p>The main thing to know about SCSI is that it operates in a producer/consumer manner. One SCSI device (the initiator) will initiate the communication with another device, which is known as the target. The roles can be reversed! Most people call this a command/response protocol, because the initiator sends a command to a target, and awaits a response, but not always. In asynchronous mode, the host (initiator) can simply blast the target with data until it&#8217;s done. The SCSI bus, parallel in nature, can only support a single communication at a time, so subsequent sessions must wait their turn. SAS, or Serial Attached SCSI, does away with this limitation by automatically switching back and forth.</p>
<p>SCSI is tremendously more complex, but that&#8217;s the gist of it.</p>
<p>We need to understand SCSI to know how our storage network is going to ship data. The SCSI protocol plays an enormous role in storage networking, so you may even want to look at it more in-depth.</p>
<p>Next up, we&#8217;ll begin talking about Fiber Channel itself, which, as chance would have it, is much more complex than Ethernet. This is certainly going to be a fun journey.</p>
<p>In A Nutshell:</p>
<p>- A FC-SAN is a network that uses Fiber Channel at Layer 2, instead of Ethernet, and is dedicated to moving around SCSI commands.<br />
- SCSI initiator, generally a host&#8217;s storage controller, is called an HBA; the SCSI target is most often the storage device you&#8217;re talking to.<br />
- iSCSI can transport SCSI over your existing network, but a network dedicated to iSCSI is called an IP-SAN.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d51').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d51" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fsan-101%2Fsan-101-intro-to-sans-and-storage%2F&amp;title=SAN+101%3A+Intro+to+SANs+and+Storage" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fsan-101%2Fsan-101-intro-to-sans-and-storage%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fsan-101%2Fsan-101-intro-to-sans-and-storage%2F&amp;title=SAN+101%3A+Intro+to+SANs+and+Storage" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fsan-101%2Fsan-101-intro-to-sans-and-storage%2F&amp;title=SAN+101%3A+Intro+to+SANs+and+Storage" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+SAN+101%3A+Intro+to+SANs+and+Storage+@+http%3A%2F%2Fwww.longitudetech.com%2Fsan-101%2Fsan-101-intro-to-sans-and-storage%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fsan-101%2Fsan-101-intro-to-sans-and-storage%2F&amp;t=SAN+101%3A+Intro+to+SANs+and+Storage" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d51').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/san-101/understanding-fibre-channel/' rel='bookmark' title='Understanding Fibre Channel'>Understanding Fibre Channel</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-understanding-layers/' rel='bookmark' title='Networking 101: Understanding Layers'>Networking 101: Understanding Layers</a></li>
<li><a href='http://www.longitudetech.com/it-management/how-much-server-do-you-need/' rel='bookmark' title='How Much Server do you Need?'>How Much Server do you Need?</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/ZX9iny2QfWhxFcweofDNAjRf96Q/0/da"><img src="http://feedads.g.doubleclick.net/~a/ZX9iny2QfWhxFcweofDNAjRf96Q/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ZX9iny2QfWhxFcweofDNAjRf96Q/1/da"><img src="http://feedads.g.doubleclick.net/~a/ZX9iny2QfWhxFcweofDNAjRf96Q/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/9KqI5wGYTqo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/san-101/san-101-intro-to-sans-and-storage/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/san-101/san-101-intro-to-sans-and-storage/</feedburner:origLink></item>
		<item>
		<title>How Much Server do you Need?</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/zOneGAcFSrU/</link>
		<comments>http://www.longitudetech.com/it-management/how-much-server-do-you-need/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 04:47:56 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[IT Management]]></category>
		<category><![CDATA[capacity]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[tuning]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=50</guid>
		<description><![CDATA[When purchasing server hardware, do you tend to purchase more power than you need, or not enough? Specifying the correct server for your current need is a fine art, and it’s easy to get wrong. Here are some helpful hints and considerations to remember that will ensure you make the right server purchasing decision. We&#8217;re [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/managing-virtual-machine-and-cloud-sprawl/' rel='bookmark' title='Managing Virtual Machine and Cloud Sprawl'>Managing Virtual Machine and Cloud Sprawl</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/understanding-linux-virtual-memory/' rel='bookmark' title='Understanding Linux Virtual Memory'>Understanding Linux Virtual Memory</a></li>
<li><a href='http://www.longitudetech.com/networking/squeeze-your-gigabit-nic-for-top-performance-2/' rel='bookmark' title='Squeeze Your Gigabit NIC for Top Performance'>Squeeze Your Gigabit NIC for Top Performance</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When purchasing server hardware, do you tend to purchase more power than you need, or not enough? Specifying the correct server for your current need is a fine art, and it’s easy to get wrong. Here are some helpful hints and considerations to remember that will ensure you make the right server purchasing decision.</p>
<p>We&#8217;re going to focus on standalone (non-blade) servers for the moment, but many aspects are also applicable to blade servers. Blade servers are wonderful for centralized management of the hardware, but the specs of the individual server blades can vary tremendously.</p>
<p><strong>Hardware Management</strong></p>
<p>Want to avoid trudging down to the datacenter late at night, or even worse, across the world if something breaks? Then don&#8217;t skimp on the management controller, lights out manager, or whatever the vendor is calling it. Many vendors ship a simple version by default: it may allow serial console access only, for example. Make sure to get the full-featured controller, because even if the hardware is only a few doors down, getting up from your desk should never be necessary.</p>
<p><img class="alignleft" src="http://i.dell.com/images/global/products/pedge/pedge_solutions/server-poweredge-rack-tower.jpg" alt="" width="289" height="183" />If you aren&#8217;t thinking of switching vendors any time soon, you might think that the management interface will always work the same as it has on all your other servers. Unfortunately, that&#8217;s not the case. Sun x86 hardware, for example, has many different hardware management controllers to choose from. The more expensive and feature-rich servers have the better controllers, but don&#8217;t make the mistake of thinking the interface never changes. The unfortunate part is that you never know how well it works until you get a server on-site.</p>
<p>Hardware management comes in two forms: IPMI (most support), and the user interface. The user interface is more often than not, a Web-based java application that provides remote console access. Some are extremely buggy, and others work quite well from all Web browsers. We can&#8217;t make a recommendation, though, because these things change often.</p>
<p><strong>Memory</strong></p>
<p>Shucks, this one is a no-brainer: as much as you can afford. Within reason, that is. If you aren&#8217;t going to run virtual machines, and this server&#8217;s only job is to serve up some simple Web pages, then 16GB of RAM is likely overkill. Likewise, make sure you know what your application can support. Many java applications are limited to a heap size of 2 or 4GB.</p>
<p>It&#8217;s also overkill to purchase more than 4GB of RAM if you need to run a 32-bit operating system. Yes, Windows Server does some tricks and it can use more than 4GB, but it&#8217;s a huge performance it.</p>
<p>If virtualization is in your future, load up as much as possible. You also want to pay attention to how many DIMM slots the server has. The 8GB DIMMs are horribly expensive now, so you&#8217;ll probably want to stick with 4GB sticks. Just remember, if you fill all the slots in the server, the only memory upgrade path is to buy higher capacity DIMMs.</p>
<p><strong>CPU</strong></p>
<p>Do you want to run many threads at an even pace or just a few threads as fast as possible? Sun&#8217;s T2 processors aren&#8217;t fast by any measure, but they can run many threads at the same speeds consistently. These are ideal for database servers, but not for Web servers.</p>
<p>Will this server be executing a wide variety of processes over and over again, as opposed to just running the same big application server constantly? If so, make sure you pay attention to the amount of cache each core of the CPU has.</p>
<p>For virtualization, you want the fastest multi-core processors available, with the largest amount of L2 cache. Cache is very important as it minimizes the number of times the CPU needs to fetch data from slower RAM. It makes a very noticeable difference on heavily used servers.</p>
<p><strong>Disks, Controllers, and RAID</strong></p>
<p>If you need local storage, do pay attention to the type of disks you&#8217;re ordering. A SATA disk is likely to disappoint if you have an IO-heavy workload. SAS, and FC disks should perform equally well, since they are both SCSI disks underneath.</p>
<p>Even if you don&#8217;t need much local storage, you should always buy a server with a RAID controller that can mirror the operating system disks, unless you&#8217;re SAN booting of course. You don&#8217;t want the OS to crash just because of a failed disk. Likewise, if you&#8217;re keeping tons of local storage for some reason, make sure to get a RAID card that does RAID-5, so that you can at least lose one disk at a time without losing data. If performance is a concern you should really be using iSCSI or SAN storage, but you may also think about a RAID 0+1 configuration to avoid the slower RAID-5 parity calculations.</p>
<p>If you&#8217;re attaching to a SAN, make sure to include the correct HBA as well.</p>
<p><strong>Networking</strong></p>
<p>When servers started showing up with two or four gigabit NICs I must admit, I was confused. Why would someone need that many? Aside from large servers that do a lot of network IO, you might also want to separate out your iSCSI traffic from normal Ethernet. It&#8217;s also important these days to make sure that the network cards support TOE, or a TCP Offload Engine. This will task the network card with computing TCP checksums, freeing your CPUs for more important things.</p>
<p>In summary, most of these things may seem common sense, but you need to remember to ask all the right questions every time you spec a server. Here&#8217;s a good checklist:</p>
<ul>
<li>Adequate hardware management controller</li>
<li>Enough (but not too much) RAM, that&#8217;s fast enough, but not faster than the CPU&#8217;s front-side bus</li>
<li>Enough memory slots for expansion, if that seems likely</li>
<li>Correct CPU for this server&#8217;s needs</li>
<li>RAID-1 for the OS, and (optionally) other RAID levels for other local storage</li>
<li>FC HBAs?</li>
<li>Multiple gigabit NICs with TOE capabilities</li>
</ul>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d50').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d50" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fit-management%2Fhow-much-server-do-you-need%2F&amp;title=How+Much+Server+do+you+Need%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fit-management%2Fhow-much-server-do-you-need%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fit-management%2Fhow-much-server-do-you-need%2F&amp;title=How+Much+Server+do+you+Need%3F" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fit-management%2Fhow-much-server-do-you-need%2F&amp;title=How+Much+Server+do+you+Need%3F" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+How+Much+Server+do+you+Need%3F+@+http%3A%2F%2Fwww.longitudetech.com%2Fit-management%2Fhow-much-server-do-you-need%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fit-management%2Fhow-much-server-do-you-need%2F&amp;t=How+Much+Server+do+you+Need%3F" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d50').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/managing-virtual-machine-and-cloud-sprawl/' rel='bookmark' title='Managing Virtual Machine and Cloud Sprawl'>Managing Virtual Machine and Cloud Sprawl</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/understanding-linux-virtual-memory/' rel='bookmark' title='Understanding Linux Virtual Memory'>Understanding Linux Virtual Memory</a></li>
<li><a href='http://www.longitudetech.com/networking/squeeze-your-gigabit-nic-for-top-performance-2/' rel='bookmark' title='Squeeze Your Gigabit NIC for Top Performance'>Squeeze Your Gigabit NIC for Top Performance</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/SDJf1yl_IUk0OrXWEjWYwATIRT0/0/da"><img src="http://feedads.g.doubleclick.net/~a/SDJf1yl_IUk0OrXWEjWYwATIRT0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/SDJf1yl_IUk0OrXWEjWYwATIRT0/1/da"><img src="http://feedads.g.doubleclick.net/~a/SDJf1yl_IUk0OrXWEjWYwATIRT0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/zOneGAcFSrU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/it-management/how-much-server-do-you-need/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/it-management/how-much-server-do-you-need/</feedburner:origLink></item>
		<item>
		<title>Networking 101: More Subnets, and IPv6</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/i8WeD-VwEjU/</link>
		<comments>http://www.longitudetech.com/networking/networking-101-more-subnets-and-ipv6/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 04:07:32 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Networking 101]]></category>
		<category><![CDATA[ccna]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[networks]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=49</guid>
		<description><![CDATA[What&#8217;s the point of creating subnets anyways? How do I remember those strange looking subnet masks? How the heck does this work with those crazy looking IPv6 addresses? This edition of Networking 101 will expand on the previous Subnets and CIDR article, in the interest of promoting a thorough understanding of subnetting. An oft-asked question in [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-subnetting-slice-up-32-bits/' rel='bookmark' title='Networking 101: Subnetting &#8211; Slice Up 32-bits'>Networking 101: Subnetting &#8211; Slice Up 32-bits</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-ip-addresses/' rel='bookmark' title='Networking 101: IP addresses'>Networking 101: IP addresses</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-understanding-layers/' rel='bookmark' title='Networking 101: Understanding Layers'>Networking 101: Understanding Layers</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>What&#8217;s the point of creating subnets anyways? How do I remember those strange looking subnet masks? How the heck does this work with those crazy looking IPv6 addresses? This edition of Networking 101 will expand on the previous <a href="http://www.longitudetech.com/blog/networking-101/networking-101-subnetting-slice-up-32-bits/">Subnets and CIDR</a> article, in the interest of promoting a thorough understanding of subnetting.</p>
<p>An oft-asked question in networking classes is &#8220;why can&#8217;t we just put everyone on the same subnet and stop worrying about routing?&#8221; The reason is very simple. Every time someone needs to talk, be it to a router or another host, they have to send an ARP request. Also, there&#8217;s broadcast packets that aren&#8217;t necessarily limited to ARP, which everyone hears. When there are only 255 devices on a /24 subnet, the amount of broadcast packets are fairly limited. It is important to keep this number low, because every time a packet destined for a specific host or a broadcast address is seen, the host must handle the packet. A hardware interrupt is created, and the kernel of the operating system must read enough of the packet to determine whether or not it cares about it.</p>
<p><img class="alignleft" src="http://wiki.bc.net/atl-conf/download/attachments/20548220/world.jpg" alt="" width="400" height="200" /></p>
<p>Broadcast storms happen at times, mainly because of layer 2 topology loops. We&#8217;ll explain layer 2 topology issues in excruciating (actually, enlightening) detail in a future issue. When thousands of packets hit a computer at a time, slow and fast computers alike can become very slow. The kernel spends so much time handling interrupts that it doesn&#8217;t have much left for dealing with &#8220;trivial&#8221; things like making sure your web browser process gets a chance to run. So that, my friends, is why subnets are very important. This is also known as a broadcast domain, because it limits the amount of broadcasts that you will hear.</p>
<p>The natural follow-up question normally involves a host&#8217;s notion of a broadcast address and netmask. We hopefully understand that a host needs to understand what computers are on the same subnet. Those IP addresses can be spoken to directly, making a router unnecessary. When the netmask or broadcast address is incorrectly configured, you&#8217;ll quickly find that some hosts are unreachable.</p>
<p>The most common erroneous configuration happens when someone configure an IP address without specifying the netmask and broadcast address. For some reason, most operating systems don&#8217;t take the liberty of updating these things, even though one can be determined from the other. If you run &#8216;ifconfig eth0 130.211.0.1 netmask 255.255.255.0&#8242; you might expect that everything is ready to go. Unfortunately, it&#8217;s very likely that your broadcast address was set to 255.255.0.0. It largely depends on the router&#8217;s configuration, but normally this results in all broadcast packets being dropped. Conversely, if the netmask is configured incorrectly, the computer wouldn&#8217;t know where the subnet starts and begins. If a computer thinks a host is on the same subnet when it actually isn&#8217;t, it will attempt to ARP for it instead of the router. Routers can be configured to handle this and pretend they are the host (called Proxy Arp), but normally the result is unreachable hosts.</p>
<p>Understand how the netmask is configured, to avoid this problem. Figuring out the network and broadcast address isn&#8217;t very difficult when you remember that the netmask simply means &#8220;cover some bits,&#8221; but deciphering netmask representation can induce a double-take. The netmask for a /24 network is 255.255.255.0, that&#8217;s easy. But what does 255.255.240.0 mean? The best way to decipher it is to begin with the masked off part. Comparing it to the /24, which had three octets masked, we see that 255.255.240.0 has two octets masked, and part of another. We know it&#8217;s between a /16 and a /24. We have to understand binary, and realize how many bits are masked. The last 16 bits are clearly part of the network portion. The third octet, 240, allows 16 IP addresses beyond the mask, so it must mean that four bits are left (2^4=16). The four remaining bits, plus the 16 bits used for the first two octets means that we&#8217;re dealing with a /20!</p>
<p>What about 1.0.0.0/255.255.255.248? We&#8217;re definitely in a land smaller than the /24 subnet. If we look at the remaining bits in the last octet, we can see that there are eight IP addresses available. Remember that only 2^3 can make eight, so we&#8217;re using all but three bits in the network portion. This is a /29 network. Of course, the easy ones are pretty clear: 255.255.255.128 allows half as many host addresses in the last octet compared to the /24 network, so it&#8217;s a /25.</p>
<p>On the topic of confusing netmasks, IPv6 addresses certainly have a place. The netmask isn&#8217;t really an issue&#8211;the same concept applies, just with larger numbers to remember. The real problem lies within the address representation itself; the IETF seemed to take pride in creating confusion. Typically an IPv6 address is represented in hex, or base-16. Our old friend IPv4 could represent an IP address in hex too, which would look like B.B.B.B for the address 11.11.11.11. Unfortunately, IPv6 isn&#8217;t quite that nice looking. To represent 128 bits, IPv6 normally breaks up the address into eight 16-bit segments.</p>
<p>An IPv6 address looks like: 2013:4567:0000:CDEF:0000:0000:00AD:0000. It does get a bit easier. For example, leading zeros are not written, and contiguous quads of zeros get collapsed to ::. Trailing zeros ,however, must be shown. This is a bit confusing, but the rules always allow for a non-ambiguous IP address. Leading zeros in each quad can always be removed, but the collapsing of contiguous blocks of zeros can only happen once per address. The above address with collapsed zeros will look like: 2013:4567:0000:CDEF::AD:0000. IPv6 provides 2^128 addresses, more than enough to allocate roughly 1000+ IP addresses per square meter of the earth.</p>
<p>If you remember the rules of binary, the address representation rules with IPv6, and a few simple subnets for reference, you&#8217;ll be Master of Subnets &#8211; the one who everyone asks for help.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d49').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d49" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fnetworking-101-more-subnets-and-ipv6%2F&amp;title=Networking+101%3A+More+Subnets%2C+and+IPv6" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fnetworking-101-more-subnets-and-ipv6%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fnetworking-101-more-subnets-and-ipv6%2F&amp;title=Networking+101%3A+More+Subnets%2C+and+IPv6" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fnetworking-101-more-subnets-and-ipv6%2F&amp;title=Networking+101%3A+More+Subnets%2C+and+IPv6" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Networking+101%3A+More+Subnets%2C+and+IPv6+@+http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fnetworking-101-more-subnets-and-ipv6%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fnetworking-101-more-subnets-and-ipv6%2F&amp;t=Networking+101%3A+More+Subnets%2C+and+IPv6" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d49').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-subnetting-slice-up-32-bits/' rel='bookmark' title='Networking 101: Subnetting &#8211; Slice Up 32-bits'>Networking 101: Subnetting &#8211; Slice Up 32-bits</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-ip-addresses/' rel='bookmark' title='Networking 101: IP addresses'>Networking 101: IP addresses</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-understanding-layers/' rel='bookmark' title='Networking 101: Understanding Layers'>Networking 101: Understanding Layers</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/ZDq7Mfiyfnxu8oSGBBkIKA_ylFA/0/da"><img src="http://feedads.g.doubleclick.net/~a/ZDq7Mfiyfnxu8oSGBBkIKA_ylFA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ZDq7Mfiyfnxu8oSGBBkIKA_ylFA/1/da"><img src="http://feedads.g.doubleclick.net/~a/ZDq7Mfiyfnxu8oSGBBkIKA_ylFA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/i8WeD-VwEjU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/networking/networking-101-more-subnets-and-ipv6/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/networking/networking-101-more-subnets-and-ipv6/</feedburner:origLink></item>
		<item>
		<title>The Perils of Sudo With User Passwords</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/69dRix82d4U/</link>
		<comments>http://www.longitudetech.com/linux-unix/the-perils-of-sudo-with-user-passwords/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 17:11:37 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[IT Management]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=47</guid>
		<description><![CDATA[The consensus among new Unix and Linux users seems to be that sudo is more secure than using the root account, because it requires you type your password to perform potentially harmful actions. In reality, a compromised user account, which is no big deal normally, is instantly root in most setups. This sudo thinking is [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/multi-user-security-in-linux/' rel='bookmark' title='Multi-user Security in Linux'>Multi-user Security in Linux</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-file-permissions/' rel='bookmark' title='Back to Basics: Unix File Permissions'>Back to Basics: Unix File Permissions</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/zenoss-we-can-ditch-nagios-now/' rel='bookmark' title='Zenoss: We Can Ditch Nagios Now'>Zenoss: We Can Ditch Nagios Now</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The consensus among new Unix and Linux users seems to be that sudo is more secure than using the root account, because it requires you type your password to perform potentially harmful actions. In reality, a compromised user account, which is no big deal normally, is instantly root in most setups. This sudo thinking is flawed, but sudo is actually useful for what’s it was designed for.</p>
<p>The (wrong) idea is that you shouldn’t use the root account, because apparently it’s too “dangerous.” This argument usually comes from new Linux users and people that call themselves “network administrators,” but has no basis in reality. We’ll come back to that in a moment.</p>
<p>The concept behind sudo is to give non-root users access to perform specific tasks without giving away the root password. It can also be used to log activity, if desired. Role-based access control isn’t available in Linux, so sudo is a great alternative, if used properly. Solaris 10 has greatly improved RBAC capabilities; so you can easily allow a junior admin access to web server restart scripts with the appropriate access levels, for example. Sudo is supposed to be configured to allow a certain set of people to run a very limited set of commands, as a different user.</p>
<p>Unfortunately, sysadmins and home users alike have begun using sudo for everything. Instead of running ‘su’ and becoming root, they believe that ‘sudo’ plus ‘command’ is a better alternative. Most of the time, sysadmins with full sudo access just end up running ‘sudo bash’ and doing all their work from that root shell. This is a problem.</p>
<p><strong>Using a user account password to get a root shell is a </strong><em><strong>bad</strong></em><strong> idea.</strong></p>
<p>Why is there a separate root account anyway? It isn’t to simply protect you from your own mistakes. If all sysadmins just become root using their user password (running: sudo bash), then why not just give them uid 0 (aka root) and be done with it? For a group of sysadmins, the only reason they should want to use sudo is for logging of commands. Unfortunately, this provides zero additional security or auditing, because an attacker would just run a shell. If sysadmins are un-trusted such that they need to be audited, they shouldn’t have root access in the first place.</p>
<p>Surprisingly, the home-user rational makes its way into the workplace as well. The recurring argument is that running a root shell is dangerous. Partially to blame for this grave misunderstanding is X login managers, for allowing the root user to login. New users are always scolded and explained to that running X as root is wrong. The same goes for many other applications, too. As time progressed, people started remembering that “running as root” is wrong, passing this idology down to their children, but without any details. A genetic mutation may have occurred, but insufficient research has been done on that topic thus far. Now that Ubuntu Linux doesn’t enable a root account by default, but instead allows full root access to the user via sudo, the world will never be the same.</p>
<p>People praise sudo, while demeaning Windows at the same time for not having any separation of privileges by default. The answer to security clearly is a multi-user system with privilege separation, but sudo blurs these lines in its most common usage. The Ubuntu usage of sudo simply provides a hoop to jump through, requiring users to type their password more often than they’d like. Of course this will prevent a user’s web browser from running something as root, but it isn’t security.</p>
<p><strong>We’d really like to focus on the Enterprise, where sudo has very little place.</strong></p>
<p>The sudo purists, or sudoists, we’ll call them, would have you run sudo before every command that requires root. Apparently running ‘sudo vi /etc/resolv.conf’ is supposed to make you remember that you’re root, and prevent mistakes. Sudoists will also say that it protects against “accidentally left open root shells” as well. If there are accidental shells left on computers with public access, well that’s an HR action item.</p>
<p>Sudo atheists will quickly point out that using sudo without specifically defined commands in the configuration file is a security risk. Sudoists user account passwords have root access, so in essence, sudo has un-done all security mechanisms in place. SSH doesn’t allow root to login, but with sudo, a compromised user password removes that restriction.</p>
<p>In a true multi-user environment, every so often a root compromise will happen. If users can login, they can eventually become root, and that’s just a fact of life. The first thing any old-school cracker installs is a hacked SSH program, to log user passwords. Ideally, this single hacked machine doesn’t have any sort of trust relationship with other computers, because users are allowed access. The next time an administrator logs into the hacked machine, his user account is compromised. Generally this isn’t a big deal, but with sudo, this means a complete root compromise, probably for all machines. Of course SSH keys can help, as will requiring separate passwords for administrators on the more important (non user accessible) servers; but if they’re willing to allow their user account access to unrestricted root-level commands, then it’s unlikely that there’s any other security in place elsewhere.</p>
<p>As we mentioned, sudo has its place. Allowing a single command to be run with elevated privileges in an operating system that doesn’t support such things is quite useful. Still, be very careful about who gets this access, even for one item. As with all software, sudo isn’t without <a href="http://www.courtesan.com/sudo/security.html">bugs</a>.</p>
<p>For the love of security, please, we beg of you, do not use sudo for full root access. Administrators keep separate, non-UID 0 accounts for a reason, and it’s not for “limiting the mistakes.” Everything should be done from a root shell, and you should have to know an uber-secret root password to access anything as root.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d47').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d47" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fthe-perils-of-sudo-with-user-passwords%2F&amp;title=The+Perils+of+Sudo+With+User+Passwords" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fthe-perils-of-sudo-with-user-passwords%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fthe-perils-of-sudo-with-user-passwords%2F&amp;title=The+Perils+of+Sudo+With+User+Passwords" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fthe-perils-of-sudo-with-user-passwords%2F&amp;title=The+Perils+of+Sudo+With+User+Passwords" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+The+Perils+of+Sudo+With+User+Passwords+@+http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fthe-perils-of-sudo-with-user-passwords%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fthe-perils-of-sudo-with-user-passwords%2F&amp;t=The+Perils+of+Sudo+With+User+Passwords" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d47').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/multi-user-security-in-linux/' rel='bookmark' title='Multi-user Security in Linux'>Multi-user Security in Linux</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-file-permissions/' rel='bookmark' title='Back to Basics: Unix File Permissions'>Back to Basics: Unix File Permissions</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/zenoss-we-can-ditch-nagios-now/' rel='bookmark' title='Zenoss: We Can Ditch Nagios Now'>Zenoss: We Can Ditch Nagios Now</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/Cbi4JqNIZOqq9oKtBdajTg2m8tM/0/da"><img src="http://feedads.g.doubleclick.net/~a/Cbi4JqNIZOqq9oKtBdajTg2m8tM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Cbi4JqNIZOqq9oKtBdajTg2m8tM/1/da"><img src="http://feedads.g.doubleclick.net/~a/Cbi4JqNIZOqq9oKtBdajTg2m8tM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/69dRix82d4U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/linux-unix/the-perils-of-sudo-with-user-passwords/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/linux-unix/the-perils-of-sudo-with-user-passwords/</feedburner:origLink></item>
		<item>
		<title>Back to Basics: Unix System Stats Utilities</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/XbBNZklVC84/</link>
		<comments>http://www.longitudetech.com/linux-unix/back-to-basics-unix-system-stats-utilities/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 17:24:29 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=46</guid>
		<description><![CDATA[Unix and Linux systems have forever been obtuse and mysterious for many people. They generally don’t have nice graphical utilities for displaying system performance information; you need to know how to coax the information you need. Furthermore, you need to know how to interpret the information you’re given. Let’s take a look at some common [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-differences-in-performing-tasks/' rel='bookmark' title='Back To Basics: Unix Differences in Performing Tasks'>Back To Basics: Unix Differences in Performing Tasks</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-file-permissions/' rel='bookmark' title='Back to Basics: Unix File Permissions'>Back to Basics: Unix File Permissions</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/working-with-unix-variant-differences/' rel='bookmark' title='Working With Unix Variant Differences'>Working With Unix Variant Differences</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Unix and Linux systems have forever been obtuse and mysterious for many people. They generally don’t have nice graphical utilities for displaying system performance information; you need to know how to coax the information you need. Furthermore, you need to know how to interpret the information you’re given. Let’s take a look at some common system tools that can provide tons of visibility into what the opaque OS is really doing.</p>
<p>Unfortunately, the same tools don’t exist universally across all Unix variants. A few commonly underused ones do, however, and that is what we’ll focus on first.</p>
<p><strong>Disk Activity</strong><br />
A common source of “slowness” is disk I/O, or rather the lack of available I/O. On Linux especially, it may be a difficult diagnosis. Often the load average will climb quickly, but without any corresponding processes in top eating much CPU. Linux counts “iowait” as CPU time when calculating load average. I’ve seen load numbers in the tens of thousands, on more than one occasion.</p>
<p>The easiest way to see what’s happening to your disks is to run the ‘iostat’ program. Via iostat, you can see how many read and write operations are happening per device, how much CPU is being utilized, and how long each transaction takes. Many arguments are available for iostat, so do spend some time with the man page on your specific system. By default, running &#8216;iostat&#8217; with no arguments produces a report about disk IO since boot. To get a snapshot of &#8220;now&#8221; add a numerical argument last, which will prompt iostat to gather statistics for that number of seconds.</p>
<p>Linux will show number of blocks read or written per second, along with some useful CPU statistics. This is one particularly busy server:</p>
<pre> avg-cpu:  %user   %nice %system %iowait  %steal   %idle
 1.36    0.07    5.21   23.80    0.00   69.57</pre>
<pre>Device:   tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sda       18.22     15723.35       643.25 65474958946 2678596632</pre>
<p>Notice that iowait is at 23%. This means that 23% of the time this server is waiting on disk I/O. Some Solaris iostat output shows a similar thing, just represented differently(iostat -xnz):</p>
<pre>    r/s    w/s   kr/s   kw/s wait actv wsvc_t asvc_t  %w  %b device
295.3   79.7 5657.8  211.0  0.0 10.3    0.0   27.4   0 100 d101
134.8   16.4 4069.8  116.0  0.0  3.5    0.0   23.3   0  90 d105</pre>
<p>The %b (block) column shows that I/O to device d101 is 100% blocked waiting for the device to complete transaction. The average service time isn&#8217;t good either: disk reads shouldn&#8217;t take 27.4ms. Arguably, Solaris&#8217;s output is more friendly to parse, since it gives the reads per second in kilobytes rather than blocks. We can quickly calculate that this server is reading about 19KB per read by dividing the number of KB read per second by the number of reads that happened. In short: this disk array is being taxed by large amounts of read requests.</p>
<p><strong>Vmstat</strong><br />
The &#8216;vmstat&#8217; program is also universally available, and extremely useful. It, too, provides vastly different information among operating systems. The vmstat utility will show you statistics about the virtual memory subsystem, or to put it simply: swap space. It is much more complex than just swap, as nearly every IO operation involves the VM system when pages of memory are allocated.A disk write, network packet send, and the obvious &#8220;program allocates RAM&#8221; all impact what you see in vmstat.</p>
<p>Running vmstat with the -p argument will print out statistics about disk IO. In Solaris you get some disk information anyway, as seen below:</p>
<pre> kthr      memory            page            disk
 faults      cpu  r b w   swap
free  re  mf pi po fr de sr m0 m1 m2 m7
in   sy   cs us sy id  0 0 0 7856104 526824 386 2401 0 0 0  0  0  3  0  0  0
16586 22969 12576 8 9 83  1 0 0 7851344 522016 18 678 32 0  0  0  0  2
0  0  0 13048 11737 10197 7 6 86  0 0 0 7843584 514128 76 3330 197 0
0 0  0  2  0  0  0 4762 131492 4441 16 8 76</pre>
<p>A subtle, but important differences between Solaris and Linux is that Solaris will start scanning for pages of memory that can be freed before it will actually start swapping RAM to disk. The &#8216;sr&#8217; column, scan rate, will start increasing right before swapping takes place, and continue until some RAM is available. The normal things are available in all operating systems; these include: swap space, free memory, pages in and out (careful, this doesn&#8217;t mean swapping is happening), page faults, context switches, and some CPU idle/system/user statistics. Once you know how to interpret these items you quickly learn to infer what they indicate about the usage of your system.</p>
<p>The two main programs for finding &#8220;slowness&#8221; are therefore iostat and vmstat. Before the obligatory tangent into &#8220;what Dtrace can do for you,&#8221; here&#8217;s a few other tools that no Unix junkie should leave home without:</p>
<dl>
<dt>lsof</dt>
<dd>Lists open files (including network ports) for all processes</dd>
<dt>netstat</dt>
<dd>Lists all sockets in use by the system</dd>
<dt>mpstat</dt>
<dd>Shows CPU statistics (including IO), per-processor</dd>
</dl>
<p>Dtrace<br />
We cannot talk about system visibility without mentioning Dtrace. Invented by Sun, Dtrace provides dynamic tracing of everything about a system. Dtrace gives you the ability to ask any arbitrary question about the state of a system, which works by calling &#8220;probes&#8221; within the kernel. That sounds intimidating, doesn&#8217;t it?</p>
<p>Let&#8217;s say that we wanted to know what files were being read or written on our Linux server that has a high iowait percentage. There&#8217;s simply no way to know. Let&#8217;s ask the same question of Solaris, and instead of learning Dtrace, we&#8217;ll find something useful in the <a href="http://opensolaris.org/os/community/dtrace/dtracetoolkit/">Dtrace ToolKit</a>. In the kit, you&#8217;ll find a few neat programs like iosnoop and iotop, which will tell you which processes are doing all the disk IO operations. Neat, but we really want to know what files are being accessed so much. In the FS directory, the rfileio.d script will provide this information. Run it, and you&#8217;ll see every file that&#8217;s read or written, and cache hit statistics. There&#8217;s no way to get this information in other Unixes, and this is just one simple example of how Dtrace is invaluable.</p>
<p>The script itself is about 90 lines, inclusive of comments, but the bulk of it is dealing with cache statistics. An excellent way to start learning Dtrace is to simply read the Dtrace ToolKit scripts.</p>
<p>Don&#8217;t worry if you&#8217;re not a Solaris admin: Dtrace is coming soon to a FreeBSD near you. SystemTap, a replica of Dtrace, will be available for Linux soon as well. Until then, and even afterward, the above mentioned tools will still be invaluable. If you can quickly get disk IO statistics and see if you&#8217;re swapping the majority of system performance problems are solved. Dtrace also provides amazing application tracing functionality, and if you&#8217;re looking at the application itself, you already know the slowness isn&#8217;t likely being caused by a system problem.</p>
<p>Soon, I&#8217;ll publish a few Dtrace tutorials.</p>
<p>Some things have surely been left out &#8211; discuss below!</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d46').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d46" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-system-stats-utilities%2F&amp;title=Back+to+Basics%3A+Unix+System+Stats+Utilities" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-system-stats-utilities%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-system-stats-utilities%2F&amp;title=Back+to+Basics%3A+Unix+System+Stats+Utilities" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-system-stats-utilities%2F&amp;title=Back+to+Basics%3A+Unix+System+Stats+Utilities" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Back+to+Basics%3A+Unix+System+Stats+Utilities+@+http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-system-stats-utilities%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-system-stats-utilities%2F&amp;t=Back+to+Basics%3A+Unix+System+Stats+Utilities" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d46').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-differences-in-performing-tasks/' rel='bookmark' title='Back To Basics: Unix Differences in Performing Tasks'>Back To Basics: Unix Differences in Performing Tasks</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-file-permissions/' rel='bookmark' title='Back to Basics: Unix File Permissions'>Back to Basics: Unix File Permissions</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/working-with-unix-variant-differences/' rel='bookmark' title='Working With Unix Variant Differences'>Working With Unix Variant Differences</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/yniKdbXmnwuryv7lVjjaHV1QuHM/0/da"><img src="http://feedads.g.doubleclick.net/~a/yniKdbXmnwuryv7lVjjaHV1QuHM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/yniKdbXmnwuryv7lVjjaHV1QuHM/1/da"><img src="http://feedads.g.doubleclick.net/~a/yniKdbXmnwuryv7lVjjaHV1QuHM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/XbBNZklVC84" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/linux-unix/back-to-basics-unix-system-stats-utilities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/linux-unix/back-to-basics-unix-system-stats-utilities/</feedburner:origLink></item>
		<item>
		<title>Back To Basics: Unix Differences in Performing Tasks</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/Wd6WKh86B5g/</link>
		<comments>http://www.longitudetech.com/linux-unix/back-to-basics-unix-differences-in-performing-tasks/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 17:44:31 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[hpux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=44</guid>
		<description><![CDATA[It has often been said that a skilled sysadmin can quickly come up to speed with any Unix system in a matter of hours. After all, the underlying principals are all the same. Fortunately, this is somewhat correct. Unfortunately, this also leads to people making changes on systems they do not understand, often times in [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-system-stats-utilities/' rel='bookmark' title='Back to Basics: Unix System Stats Utilities'>Back to Basics: Unix System Stats Utilities</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-file-permissions/' rel='bookmark' title='Back to Basics: Unix File Permissions'>Back to Basics: Unix File Permissions</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/working-with-unix-variant-differences/' rel='bookmark' title='Working With Unix Variant Differences'>Working With Unix Variant Differences</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It has often been said that a skilled sysadmin can quickly come up to speed with any Unix system in a matter of hours. After all, the underlying principals are all the same. Fortunately, this is somewhat correct. Unfortunately, this also leads to people making changes on systems they do not understand, often times in suboptimal ways.</p>
<p>In this final Back to Basics With Unix piece, we’d like to spend some time talking about some common, routine sysadmin tasks and how they differ between Unix variants.</p>
<p>Sure, you can clunk around and change configuration files to mostly make something work on a foreign system. But will those changes <img class="alignleft size-medium wp-image-45" title="unix_plate-med" src="http://www.longitudetech.com/blog/wp-content/uploads/2010/02/unix_plate-med-300x152.jpg" alt="" width="300" height="152" />remain after security patches get applied and stomp all over your work? Did you just change a file that was meant to never change, because there’s a separate file for local modifications? If you’re not familiar with “how it’s done” in that particular OS, it’s as likely as not.</p>
<p><strong>GUIs</strong><br />
Yes, I make fun of GUI configuration utilities. People that don’t understand systems often use them and “get by,” but they cannot fix things when they break, unless the GUI tool can do it for them. That said, they do have their place. When learning a new system, it often makes sense to use the provided configuration utilities, as you know without a doubt they will adjust the necessary setting they way the OS wants it done. Here’s a list of some handy general administration GUIs:</p>
<p>-	AIX: smitty (does pretty much everything)<br />
-	FreeBSD: sysinstall (not recommended for use after the initial install, but it works)<br />
-	HP-UX: sam (like AIX’s smitty)<br />
-	Linux: system-config, webmin and many others (distro-dependant)<br />
-	Solaris: admintool, wbem (use with caution)</p>
<p>Often, these tools still don’t do what you need. They certainly don’t help you learn a system unless you take the time to examine what the tool actually changed. Let’s start off with the basics: gathering system information and managing hardware. It can be a nightmare to add a disk to a foreign system, so hopefully this list will get you steered in the proper direction.</p>
<p><strong>Show hardware configuration</strong>:<br />
-	AIX: lsdev, lscfg, prtconf<br />
-	FreeBSD: /var/run/dmesg.boot, pciconf<br />
-	HP-UX: ioscan, model, getconf, print_manifest<br />
-	Linux: dmesg, lspci, lshw, dmidecode<br />
-	Solaris: prtconf, prtdiag, psrinfo, cfgadm</p>
<p>Note that ‘dmesg’ is a circular kernel buffer on most systems, and after the machine has been up for a while the boot information listing devices gets overwritten. FreeBSD thoughtfully saves it in dmesg.boot for you, but in other systems you’re left relying on the above-mentioned exploratory tools.</p>
<p><strong>Add a new device</strong> (have the OS discover it without a reboot):<br />
-	AIX: cfgmgr<br />
-	FreeBSD: atacontrol, camcontrol<br />
-	HP-UX: ioscan, insf<br />
-	Linux: udev, hotplug (automatic)<br />
-	Solaris: devfsadm, disks, devlinks (all a hardlink to the same binary now)</p>
<p>If you connect a new internal disk and need it recognized, you should not need to reboot in the Unix world. The above commands will discover new devices and make them available. If you’re talking about SAN disks, the utilities are mostly the same, but there are other programs that make the process much easier and also allow for multipathing configurations.</p>
<p><strong>Label and partition a disk</strong>:<br />
-	AIX: mkvg then mklv<br />
-	FreeBSD: fdisk or sysinstall<br />
-	HP-UX: pvcreate then lvcreate, or sam<br />
-	Linux: fdisk or others<br />
-	Solaris: format or fmthard</p>
<p>Of course, you’ll also want to create a file system on your new disk. This is newfs or mkfs everywhere, with the exception of AIX which forces you to use crfs. The filesystem tab file, which describes file systems and mount options, vary a bit as well. In Linux, FreeBSD, and HP-UX it is /etc/fstab, Solaris uses /etc/vfstab, and AIX references /etc/filesystems. We spent so much time on filesystems and hardware because that’s the generally the biggest hurdle when learning a new system, and when you’re needing to do it, often you’re in a hurry.</p>
<p>Other tasks may or may not be covered by GUI utilities in the various flavors of Unix, so here’s a few more that we deem crucial to understand.</p>
<p><strong>Display IP information and change IP address permanently</strong>:<br />
-	AIX: ifconfig/lsattr; smitty or chdev<br />
-	FreeBSD: ifconfig; /etc/rc.conf<br />
-	HP-UX: ifconfig/lanadmin; set_params<br />
-	Linux: &#8216;ip addr&#8217;; /etc/sysconfig/network or /etc/network/interfaces<br />
-	Solaris: ifconfig; edit /etc/hosts, /etc/hostname.*</p>
<p>Linux will of course vary, but those two files cover the most popular distros.</p>
<p>When taking over a foreign system, we frequently want to two two things: install missing software (like GNU utilities), and verify that the system is up-to-date on security patches. Where to get packages and where to gete latest security patches varies too much to cover here—you’ll likely need to search to the OS in question—but the way you install packages and show installed patches is extremely useful to know.</p>
<p><strong>List installed patches</strong>:<br />
-	AIX: instfix, oslevel<br />
-	FreeBSD: uname<br />
-	HP-UX: swlist<br />
-	Linux: rpm, dpkg<br />
-	Solaris: showrev</p>
<p><strong>Install packages</strong>:<br />
-	AIX: smitty, rpm, installp<br />
-	FreeBSD: pkg_add, portinstall, sysinstall<br />
-	HP-UX: swinstall<br />
-	Linux: rpm, yum, apt, yast, etc.<br />
-	Solaris: pkgadd</p>
<p>As you can see, things vary immensely between the Unix variants. Even within all of Linux you can easily find yourself lost. Google is a friend to all sysadmins, but too often the conceptual questions go unanswered. Here’s a general rule of thumb, and something I’ve seen done incorrectly too many times: if you see a configuration file in /etc/, say syslog.conf, and there is an accompanying syslog.d directory, you are not supposed to edit the syslog.conf file directly. The same goes for pam.conf and pam.d. Each service will have their own file within the .d directory, and that is where they are configured.</p>
<p>The .d directory example is mostly applicable to Linux, but be sure to pay attention when you see similar multi-config layouts anywhere else. Future sysadmins using the system will thank you if the OS’s conventions are followed and it’s easy to identify customizations. It also means that your changes aren’t likely to be stomped over by updates.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d44').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d44" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-differences-in-performing-tasks%2F&amp;title=Back+To+Basics%3A+Unix+Differences+in+Performing+Tasks" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-differences-in-performing-tasks%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-differences-in-performing-tasks%2F&amp;title=Back+To+Basics%3A+Unix+Differences+in+Performing+Tasks" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-differences-in-performing-tasks%2F&amp;title=Back+To+Basics%3A+Unix+Differences+in+Performing+Tasks" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Back+To+Basics%3A+Unix+Differences+in+Performing+Tasks+@+http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-differences-in-performing-tasks%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-differences-in-performing-tasks%2F&amp;t=Back+To+Basics%3A+Unix+Differences+in+Performing+Tasks" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d44').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-system-stats-utilities/' rel='bookmark' title='Back to Basics: Unix System Stats Utilities'>Back to Basics: Unix System Stats Utilities</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-file-permissions/' rel='bookmark' title='Back to Basics: Unix File Permissions'>Back to Basics: Unix File Permissions</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/working-with-unix-variant-differences/' rel='bookmark' title='Working With Unix Variant Differences'>Working With Unix Variant Differences</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/-N9Gr3V5gyp3lbUrSS-O7mytu4I/0/da"><img src="http://feedads.g.doubleclick.net/~a/-N9Gr3V5gyp3lbUrSS-O7mytu4I/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/-N9Gr3V5gyp3lbUrSS-O7mytu4I/1/da"><img src="http://feedads.g.doubleclick.net/~a/-N9Gr3V5gyp3lbUrSS-O7mytu4I/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/Wd6WKh86B5g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/linux-unix/back-to-basics-unix-differences-in-performing-tasks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/linux-unix/back-to-basics-unix-differences-in-performing-tasks/</feedburner:origLink></item>
		<item>
		<title>LDAP: Understand the Protocol and Work With Entries</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/ejoLPF7vTtE/</link>
		<comments>http://www.longitudetech.com/linux-unix/ldap-understand-the-protocol-and-work-with-entries/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 18:57:55 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=42</guid>
		<description><![CDATA[Last week we explained how LDAP directories work, without really explaining how to use them. This week we’ll show how LDAP queries work, after explaining how the protocol works. The LDAP protocol supports just a few fairly easy to understand operations. Knowing what’s available provides administrators with the ability to surmise how various applications are [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/an-introduction-to-ldap/' rel='bookmark' title='An Introduction to LDAP'>An Introduction to LDAP</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/managing-virtual-machine-and-cloud-sprawl/' rel='bookmark' title='Managing Virtual Machine and Cloud Sprawl'>Managing Virtual Machine and Cloud Sprawl</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/zenoss-we-can-ditch-nagios-now/' rel='bookmark' title='Zenoss: We Can Ditch Nagios Now'>Zenoss: We Can Ditch Nagios Now</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Last week we explained <a href="http://www.longitudetech.com/blog/linux-unix/an-introduction-to-ldap/">how LDAP directories work</a>, without really explaining how to use them. This week we’ll show how LDAP queries work, after explaining how the protocol works.</p>
<p>The LDAP protocol supports just a few fairly easy to understand operations. Knowing what’s available provides administrators with the ability to surmise how various applications are using LDAP, troubleshoot issues, and construct their own search queries and filters more effectively.</p>
<p><img class="alignleft size-full wp-image-43" title="ldap icon" src="http://www.longitudetech.com/blog/wp-content/uploads/2010/02/ldap-icon.jpg" alt="" width="175" height="96" />A client, be it a PHP script, command-line program like ldapsearch, or LDAP libraries for user authentication in Unix, will connect to a server on port 389 (or 636 with SSL), and send one of roughly a dozen operation requests. The following operations define how the LDAP protocol works:</p>
<p><strong>Bind</strong><br />
Binding is the pivotal concept to understand. It is optional, depending on access control restrictions defined in the server. The act of binding is authentication: it sends a user’s DN and password. Binding anonymously may not allow access to all directory entries, or it may not be allowed at all, again depending on how the server is configured.</p>
<p><strong>Search or Compare</strong><br />
Search is used to both list entries and search for them. Searching supports a number of parameters, which define how the search is carried out.</p>
<ul>
<li> Base: object to start at</li>
<li> Scope: how much to search; one entry only, a single level below, or the entire subtree below</li>
<li> Filter: limit (optimize) search based on attribute/value or object filters</li>
<li> derefAliases: whether or not to follow alias entries</li>
<li> attributes: which attributes to return (none specified means return all)</li>
<li> sizeLimit, timeLimit: number of entries to return, and a time limit</li>
<li> typesOnly: just return the attribute types, not the actual values</li>
</ul>
<p><strong>Add, Delete, Modify (Update types)</strong><br />
Updating an LDAP entry can take the form of three operations: add, delete, or modify. Actually four, because modify can modify either an entry or a DN. As was explained last week, modifying the DN simply means moving an entry. Add and Delete do the obvious.</p>
<p><strong>Extended Operations</strong><br />
Extended operations can be added at will. For example, many servers support the STARTTLS command, tells the server to start a secure connection.</p>
<p><strong>Abandon</strong><br />
An Abandon operation will abandon any operation, hopefully. There is no guarantee the server will honor an abandon request.</p>
<p><strong>Unbind</strong><br />
Unbind abandons any outstanding operations and disconnects a client.</p>
<p>As mentioned before, LDAP is pretty simple. You can connect, search or update entries, and then disconnect. Nearly every LDAP communication follows those three steps.</p>
<p>So how does one connect? The majority of connections to an LDAP server are made by LDAP client programs on a Unix machine, in environments that use LDAP for server directory services. Web applications often gather and display directory information, or use LDAP to authenticate people. Aside from those, LDAP connections can also be made by Perl or even shell scripts to manage the information within. When you want to manually search or update information, you will generally use some common tools such as ldapsearch, ldapvi, or ldapmodify.</p>
<p>Searching an LDAP directory can be challenging if you’ve never done it before. The command-line utilities have a few arguments that aren’t optional. Let’s take a look at an ldapsearch example:<br />
<code>ldapsearch –h ldapserver.example.com –b ou=People,dc=example,dc=com uid=charlie</code></p>
<p>The ldapsearch program, in most Unix/Linux environments, take the same arguments. You must specify a server (-h) and a base (-b) to begin searching at. The base can be as broad or as specific as you’d like. We’ve chose to start searching at the ou (organizational unit) called people, withing the domain components used to designate our portion of the tree. I could have left out the ou=People portion, but if there is anything else at the level below dc=example, then it would search through those too. It faster to specify the subtree as close to the entry as possible, if you know it. Finally, the last argument was a search filter. I stated that I was interested in all entries where the value of the attribute uid was “charlie.”</p>
<p>The previous example used an anonymous bind, since a DN wasn’t specified. If you need to search information that is restricted to certain people, then specifying –D followed by a user DN will cause ldapsearch to bind as that user, and prompt for a password.</p>
<p>Search filters can be quite complex. When you’re searching manually with ldapsearch, you probably won’t get very complex. When writing a script that could potentially be run very often, you want as optimal a search as possible. Search filters can specify many thing, including what object classes to look for. It’s all about providing as many hints to the server as possible, so that it may make best use of its search indexes.</p>
<p>A search filter has a few basic operators, including “and” and “or” operators. The general syntax is similar to RPN (for math geeks) or functional languages (for programmers). If we want to search for a person whose given name is Bob, and mail attribute is also bob, we could use a search filter of:<br />
<code>(&amp;(givenName=bob)(mail=bob))<br />
</code><br />
If we wanted to return all entries where either bob is the givenName or the mail attribute, we could simply specify: <code>(|(givenName=bob)(mail=bob))</code><br />
Notice the | symbol, followed by two or more attribute/value pairs. In reality, we would really want to specify what object class we’re looking for, if this was used in a script: (&amp;(objectClass=person)(|(givenName=bob)(mail=bob)))<br />
The filter ensures that the objectClass is person, and the other nested statement is true. Again, we’re just trying to give as many hints to the server as possible.</p>
<p>An LDAP URL is similar, but it contains all the information necessary to both identify a server and perform a search. URLs similar to this one, or portions of it, may be required to configure some LDAP clients: <code>ldap://ldap.example.com/ou=People,dc=example,dc=com?one?(pod=evil)</code></p>
<p>The general format is: <code>ldap://host:port/BaseDN?attributes?scope?filter</code></p>
<p>LDAP is extremely powerful, and is certainly the best place for server-based directory information and people information. If you already live in an LDAP environment, hopefully you have a better understanding now. If you’re pondering an LDAP deployment, go and unleash the power now.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d42').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d42" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fldap-understand-the-protocol-and-work-with-entries%2F&amp;title=LDAP%3A+Understand+the+Protocol+and+Work+With+Entries" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fldap-understand-the-protocol-and-work-with-entries%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fldap-understand-the-protocol-and-work-with-entries%2F&amp;title=LDAP%3A+Understand+the+Protocol+and+Work+With+Entries" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fldap-understand-the-protocol-and-work-with-entries%2F&amp;title=LDAP%3A+Understand+the+Protocol+and+Work+With+Entries" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+LDAP%3A+Understand+the+Protocol+and+Work+With+Entries+@+http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fldap-understand-the-protocol-and-work-with-entries%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fldap-understand-the-protocol-and-work-with-entries%2F&amp;t=LDAP%3A+Understand+the+Protocol+and+Work+With+Entries" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d42').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/an-introduction-to-ldap/' rel='bookmark' title='An Introduction to LDAP'>An Introduction to LDAP</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/managing-virtual-machine-and-cloud-sprawl/' rel='bookmark' title='Managing Virtual Machine and Cloud Sprawl'>Managing Virtual Machine and Cloud Sprawl</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/zenoss-we-can-ditch-nagios-now/' rel='bookmark' title='Zenoss: We Can Ditch Nagios Now'>Zenoss: We Can Ditch Nagios Now</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/HVp9WAbBC8EVDrs0lvvz42sr52g/0/da"><img src="http://feedads.g.doubleclick.net/~a/HVp9WAbBC8EVDrs0lvvz42sr52g/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HVp9WAbBC8EVDrs0lvvz42sr52g/1/da"><img src="http://feedads.g.doubleclick.net/~a/HVp9WAbBC8EVDrs0lvvz42sr52g/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/ejoLPF7vTtE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/linux-unix/ldap-understand-the-protocol-and-work-with-entries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/linux-unix/ldap-understand-the-protocol-and-work-with-entries/</feedburner:origLink></item>
		<item>
		<title>Working With Unix Variant Differences</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/_H4cl5ta_vY/</link>
		<comments>http://www.longitudetech.com/linux-unix/working-with-unix-variant-differences/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 01:55:28 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[hpux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=38</guid>
		<description><![CDATA[One thing is for certain: Unix is complicated. Linux does it one way, Solaris another, and all the BSDs, yet another. Fortunately there is some logic behind the differences. Some differences have to do with where the OS came from, and some were deign choices, intended to improve usability. In this article we’ll talk about [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-differences-in-performing-tasks/' rel='bookmark' title='Back To Basics: Unix Differences in Performing Tasks'>Back To Basics: Unix Differences in Performing Tasks</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-system-stats-utilities/' rel='bookmark' title='Back to Basics: Unix System Stats Utilities'>Back to Basics: Unix System Stats Utilities</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-file-permissions/' rel='bookmark' title='Back to Basics: Unix File Permissions'>Back to Basics: Unix File Permissions</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>One thing is for certain: Unix is complicated. Linux does it one way, Solaris another, and all the BSDs, yet another. Fortunately there is some logic behind the differences. Some differences have to do with where the OS came from, and some were deign choices, intended to improve usability. In this article we’ll talk about a few major differences between the Unix variants, and tell you what you need to know about various differences in command-line utilities.</p>
<p><strong>Systems</strong></p>
<p><img class="alignleft size-full wp-image-40" title="freebsd_logo" src="http://www.longitudetech.com/blog/wp-content/uploads/2010/02/freebsd_logo.gif" alt="" width="145" height="158" />First, recall that Unix started off in research labs, and two main flavors came about: System V (SysV), and BSD. SysV (five, not “vee”) spawned from AT&amp;T Unix, in their fourth version, SVR4. BSD, from Berkeley, is the competing Unix variant. They both derived from the same Unix from Bell labs, but quickly diverged. Despite POSIX efforts, there are still BSD and SysV systems today, and their functionality still diverges.</p>
<p>Most operating systems are pretty clearly associated with one or the other, and generalizations about BSD vs. SysV prove correct. FreeBSD is the main branch from the traditional BSD, soon followed by NetBSD and OpenBSD. Then OS X came about, which was loosely based on FreeBSD (but is very BSD-like). On the SysV side of the house, AIX, IRIX, and HP-UX were the main variants. In short: commercial entities focused on SysV, academics focused on BSD.</p>
<p>Linux, however, is an oddball. Linux certainly adopted many SysV methodologies, but these days it is also very BSD-like. Sun Solaris, too, is confusing. SunOS started off as BSD, but SunOS 4 was the last BSD version; SunOS 5.x (aka Solaris) is now SysV. The details are much crazier than I’ve alluded to here, and we probably don’t want yet another Unix history lesson. A fun place to start for further reading is the Wikipedia page on Unix_wars.</p>
<p><strong>Fundamental Differences</strong><br />
It has been said that one can tell which system they are using based on two indicators: whether or not the system boots with inittab, and the format of their accounting file. Process accounting isn’t really used any longer, and most people don’t even know what it’s for, so that’s mostly moot. The boot system, however, is still critical to understand.</p>
<p>SysV booting means you use inittab. The init program, when run by the kernel, will check /etc/inittab for the initdefault entry, and then boots<img class="alignright size-medium wp-image-39" title="debian_splash" src="http://www.longitudetech.com/blog/wp-content/uploads/2010/02/debian_splash-283x300.png" alt="" width="198" height="210" /> to the runlevel defined there. Entering a runlevel means that each startup script in the directory will be run in order. Sequentially, and slowly. Sun was so annoyed with this they implemented a mechanism to fire up services in parallel, among other things, with the Service Management Facility (SMF). Ubuntu Linux implemented Upstart, which basically works around the sequential nature of init scripts too.</p>
<p>BSD booting means that init simply runs /etc/rc, and that’s all. Well, it used to. Soon BSD systems implemented rc.local, so that software and sysadmins alike could implement changes without fear of harming the critical system startup routines. Then /etc/rc.d/ was implemented, so that each script could live separately, just like SysV init scripts. Traditionally, BSD-style scripts didn’t take arguments, because there are no runlevels, and they only run once: on startup. There are still no runlevels in BSD, but the startup scripts generally take “start” and “stop” arguments, to allow sysadmins and package management tools to restart services easily.</p>
<p><strong>Command Arguments</strong><br />
The most frustrating, and quickest to surface differences between SysV and BSD, are in the traditional utilities. Some common commands take very different arguments, and even have some very different functionality. This isn’t so important if you’re in Linux now, as it generally supports both, but once you find yourself in BSD-land, you’re up for some confusion.</p>
<p>The first command people usually run into is ‘ps.’ The arguments differ:</p>
<ul>
<li> SysV: ps –elf</li>
<li> BSD: ps aux</li>
</ul>
<p>Linux supports both, BSD does not. Often we may want to list all processes owned by a particular user. In BSD, you must run, “ps aux |grep username” but in SysV you can run, “ps –u username.” Just plain ‘ps’ will list your own processes in both flavors.</p>
<p>Another commonly noticed difference is with the ‘du’ command. Not because some older systems don’t support the –h argument to provide human-readable output, but because they display different things.</p>
<ul>
<li> SysV: shows the amount available in 512-byte blocks</li>
<li> BSD: nice output showing size in bytes and percentage used</li>
</ul>
<p>Printing in BSD is always confusing for SysV users, and vice-versa. Again this isn’t as common, since newer OSes support both, but it’s noteworthy nonetheless. BSD systems traditionally used lpr, lpq, and lprm to administer print jobs, whereas SysV had lp, lpstat, and cancel. Most systems adopted the BSD style, since lpr-ng (next generation) provided these commands, and CUPS subsequently adopted the BSD variants.</p>
<p>Other programs, such as du, who, ln, tr and more will have slight differences between SysV and BSD. Heck, the differences between the various Unix standards are confusing enough that a single Unix variant may have multiple directories of utilities. Take a look at Solaris’s /usr/ucb, /usr/xpg4, and /usr/xpg6 directories. Each standard they support, which has differences from POSIX, is documented and implemented in a separate location. Too bad Linux doesn’t comply with any standards.</p>
<p>In the end, the differences outlined here are probably the only ones anyone would ever notice. The nuances between du, for example, may be applicable for people writing shell scripts for systems administration procedures. The differences do turn up often enough to be mentionable, <img class="alignleft size-full wp-image-41" title="solaris_logo" src="http://www.longitudetech.com/blog/wp-content/uploads/2010/02/solaris_logo.jpg" alt="" width="140" height="120" />but in reality this level of work requires reading manual pages so often that they’d figure it out quickly. User-level utilities are “similar enough” with the exception of ps.</p>
<p>There are so many other differences in system maintenance procedures that those are more frequently focused on. Once the ‘ps’ hurdle is out of the way, and you understand how the system boots, the main problems are more conceptual, as in “how do I add a user.” These vary by OS, and also by distribution of Linux.</p>
<p>Come back next week to learn about the different ways Unix-like operating systems facilitate systems administration tasks.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d38').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d38" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fworking-with-unix-variant-differences%2F&amp;title=Working+With+Unix+Variant+Differences" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fworking-with-unix-variant-differences%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fworking-with-unix-variant-differences%2F&amp;title=Working+With+Unix+Variant+Differences" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fworking-with-unix-variant-differences%2F&amp;title=Working+With+Unix+Variant+Differences" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Working+With+Unix+Variant+Differences+@+http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fworking-with-unix-variant-differences%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fworking-with-unix-variant-differences%2F&amp;t=Working+With+Unix+Variant+Differences" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d38').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-differences-in-performing-tasks/' rel='bookmark' title='Back To Basics: Unix Differences in Performing Tasks'>Back To Basics: Unix Differences in Performing Tasks</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-system-stats-utilities/' rel='bookmark' title='Back to Basics: Unix System Stats Utilities'>Back to Basics: Unix System Stats Utilities</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-file-permissions/' rel='bookmark' title='Back to Basics: Unix File Permissions'>Back to Basics: Unix File Permissions</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/eokv0P8NMmTdm34B19WDqQAxdV8/0/da"><img src="http://feedads.g.doubleclick.net/~a/eokv0P8NMmTdm34B19WDqQAxdV8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/eokv0P8NMmTdm34B19WDqQAxdV8/1/da"><img src="http://feedads.g.doubleclick.net/~a/eokv0P8NMmTdm34B19WDqQAxdV8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/_H4cl5ta_vY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/linux-unix/working-with-unix-variant-differences/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/linux-unix/working-with-unix-variant-differences/</feedburner:origLink></item>
		<item>
		<title>Networking 101: Subnetting – Slice Up 32-bits</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/wEaJjjBdO2A/</link>
		<comments>http://www.longitudetech.com/networking-101/networking-101-subnetting-slice-up-32-bits/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 17:33:08 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Networking 101]]></category>
		<category><![CDATA[ccie]]></category>
		<category><![CDATA[ccna]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[networks]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=37</guid>
		<description><![CDATA[Welcome to networking 101, edition two. This time around we&#8217;ll learn about subnets and CIDR, hopefully in a more manageable manner than some books present it. But first, let&#8217;s get one thing straight: there is no Class in subnetting. In the olden days, there was Class A, B, and C networks. These could only be [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-ip-addresses/' rel='bookmark' title='Networking 101: IP addresses'>Networking 101: IP addresses</a></li>
<li><a href='http://www.longitudetech.com/networking/networking-101-more-subnets-and-ipv6/' rel='bookmark' title='Networking 101: More Subnets, and IPv6'>Networking 101: More Subnets, and IPv6</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-understanding-layers/' rel='bookmark' title='Networking 101: Understanding Layers'>Networking 101: Understanding Layers</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Welcome to networking 101, edition two. This time around we&#8217;ll learn about subnets and CIDR, hopefully in a more manageable manner than some books present it.</p>
<p>But first, let&#8217;s get one thing straight: there is no Class in subnetting. In the olden days, there was Class A, B, and C networks. These could only be divided up into equal parts so VLSM, or Variable Length Subnet Masks, were introduced. The old Class C was a /24, B was a /16, and A was a /8. That&#8217;s all you need to know about Classes. They don&#8217;t exist anymore.</p>
<p>An IP address consists of a host and a network portion. Coupled with a subnet mask, you can determine which part is the subnet, how large the network is, and where the network begins. Operating systems need to know this information in order to determine what IP addresses are on the local subnet and which addresses belong to the outside world and require a router to reach. Neighboring routers also need to know how large the subnet is, so they can send only applicable traffic that direction. Divisions between host and network portions of an address are completely determined by the subnet mask.</p>
<p>Classless Internet Domain Routing (CIDR), pronounced &#8220;cider,&#8221; represents addresses using the network/mask style. What this really means is that an IP address/mask combo tells you a lot of information:</p>
<p>network part / host part<br />
<code>0000000000000000/0000000000000000<br />
</code><br />
The above string of 32-bits represents a /16 network, since 16 bits are masked.</p>
<p>Throughout these examples (and in the real world), certain subnet masks are referred to repeatedly. They are not special in any way; subnetting is a simple string of 32 bits, masked by any number of bits. It is, however, helpful for memorizing and visualizing things to start with a commonly used netmask, like the /24, and work from there.</p>
<p>Let&#8217;s take a look at a standard subnetting table, with a little bit different information:</p>

<table id="wp-table-reloaded-id-5-no-1" class="wp-table-reloaded wp-table-reloaded-id-5">
<thead>
	<tr class="row-1 odd">
		<th class="column-1"><p><strong>Subnet mask bits </strong></p></th><th class="column-2"><p><strong>Number of /24 subnets </strong></p></th><th class="column-3"><p><strong>Number of addresses </strong></p></th><th class="column-4"><p><strong>Bits stolen </strong></p></th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1"><p>/24 </p></td><td class="column-2"><p>1 </p></td><td class="column-3"><p>256 </p></td><td class="column-4"><p>0 </p></td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1"><p>/25 </p></td><td class="column-2"><p>2 </p></td><td class="column-3"><p>128 </p></td><td class="column-4"><p>1 </p></td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1"><p>/26 </p></td><td class="column-2"><p>4 </p></td><td class="column-3"><p>64 </p></td><td class="column-4"><p>2 </p></td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1"><p>/27 </p></td><td class="column-2"><p>8 </p></td><td class="column-3"><p>32 </p></td><td class="column-4"><p>3 </p></td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1"><p>/28 </p></td><td class="column-2"><p>16 </p></td><td class="column-3"><p>16 </p></td><td class="column-4"><p>4 </p></td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1"><p>/29 </p></td><td class="column-2"><p>32 </p></td><td class="column-3"><p>8 </p></td><td class="column-4"><p>5 </p></td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1"><p>/30 </p></td><td class="column-2"><p>64 </p></td><td class="column-3"><p>4 </p></td><td class="column-4"><p>6 </p></td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1"><p>/31 </p></td><td class="column-2"><p>128 </p></td><td class="column-3"><p>2 </p></td><td class="column-4"><p>7 </p></td>
	</tr>
</tbody>
</table>

<p>Because of the wonders of binary, it works out that a /31 has two IP addresses available. Imagine the subnet: 2.2.2.0/31. If we picture that in binary, it looks like:</p>
<p><code>00000010.00000010.00000010.00000000 (2.2.2.0)<br />
11111111.11111111.11111111.11111110 (31)<br />
</code><br />
The mask is &#8220;masking&#8221; the used bits, meaning that the bits are used up for network identification. The number of host bits available for tweaking is equal to one. It can be a 0 or a 1. This results in two available IP addresses, just like the table shows. Also, for each additional bit used in the netmask (stolen from the network portion), you can see that the number of available addresses gets cut in half.</p>
<p>Let&#8217;s figure out the broadcast address, network address, and netmask for 192.168.0.200/26. The netmask is simple: that&#8217;s 255.255.255.192 (26 bits of mask means 6 bits for hosts, 2^6 is 64, and 255-64 is 192). You can find subnetting tables online that will list all of this information for you, but we&#8217;re more interested in teaching people how to understand what&#8217;s happening. The netmask tells you immediately that the only part of the address we need to worry about is the last byte: the broadcast address and network address will both start with 192.168.0.</p>
<p>Figuring out the last byte is a lot like subnetting a /24 network, but you don&#8217;t even need to think about that, if it doesn&#8217;t help you. Each /26 network has 64 hosts. The networks run from .0 to .64, .65 to .128, .128 to .192, and from .192 to .256. Our address, 192.168.0.200/26, falls into the .192 to .256 netblock. So the network address is 192.168.0.192/26. And the broadcast address is even simpler: 192 is 11000000 in binary. Take the last six bits (the bits turned &#8220;off&#8221; by the netmask), turn them &#8220;on&#8221;, and what do you get? 192.168.0.255. To see if you got this right, now compute the network address and broadcast address for 192.168.0.44/26. (Network address: 192.168.0.0/26; broadcast 192.168.0.63).</p>
<p>It can be hard to visualize these things at first, and it helps to start with making a table. If you calculated that you wanted subnets with six hosts in each of them, (eight, including the network and broadcast address that can&#8217;t be used) then you can start making the table. The following is 2.2.2.0/29, 2.2.2.8/29, 2.2.2.16/29 and the final subnet of 2.2.2.249/29.</p>

<table id="wp-table-reloaded-id-6-no-1" class="wp-table-reloaded wp-table-reloaded-id-6">
<thead>
	<tr class="row-1 odd">
		<th class="column-1"><p><strong>Subnet Number </strong></p></th><th class="column-2"><p><strong>Network Address </strong></p></th><th class="column-3"><p><strong>First IP </strong></p></th><th class="column-4"><p><strong>Last IP </strong></p></th><th class="column-5"><p><strong>Broadcast Address </strong></p></th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1"><p>1 </p></td><td class="column-2"><p>2.2.2.0 </p></td><td class="column-3"><p>2.2.2.1 </p></td><td class="column-4"><p>2.2.2.6 </p></td><td class="column-5"><p>2.2.2.7 </p></td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1"><p>2 </p></td><td class="column-2"><p>2.2.2.8 </p></td><td class="column-3"><p>2.2.2.9 </p></td><td class="column-4"><p>2.2.2.14 </p></td><td class="column-5"><p>2.2.2.15 </p></td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1"><p>3 </p></td><td class="column-2"><p>2.2.2.16 </p></td><td class="column-3"><p>2.2.2.17 </p></td><td class="column-4"><p>2.2.2.22 </p></td><td class="column-5"><p>2.2.2.23 </p></td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1"><p>32 </p></td><td class="column-2"><p>2.2.2.249 </p></td><td class="column-3"><p>2.2.2.250 </p></td><td class="column-4"><p>2.2.2.254 </p></td><td class="column-5"><p>2.2.2.255 </p></td>
	</tr>
</tbody>
</table>

<p>In reality, you&#8217;re much more likely to stumble upon a network where there&#8217;s three /26&#8242;s and the final /26 is divided up into two /27&#8242;s. Being able to create the above table mentally will make things much easier.</p>
<p>That&#8217;s really all you need to know. It gets a little trickier with larger subnets in the /16 to /24 range, but the principal is the same. It&#8217;s 32 bits and a mask. Do, however, realize that there are certain restrictions governing the use of subnets. We cannot allocate a /26 starting with 10.1.0.32. If we utter the IP/mask of 10.1.0.32/26 to most operating systems, they will just assume we meant 10.1.0.0/26. This is because the /26 space requires 64 addresses, and they must start at a natural bit boundary for the given mask. In the above table, what would 2.2.2.3/29 mean? It means you meant to say 2.2.2.0/29.</p>
<p>Those tricky ones do demand a quick example. Remember how the number of IP addresses in a subnet gets halved when you take another bit from the network side to create a larger mask? The same concept works in reverse. If we have a /25 that holds 128 hosts, and steal a bit from the host (netmask) portion, we now have a /24 that holds 256. Google for a &#8220;subnet table&#8221; to see the relationship between netmasks and network sizes all at once. If a /16 holds 65536 addresses, a /17 holds half as many, and a /15 holds twice as many. It&#8217;s tremendously exciting! Practice, practice, practice. That&#8217;s what it takes to understand how this works. Don&#8217;t forget, you can always fall back to counting bits.</p>
<p>The next step, should you want to understand more about subnets, is to read up on some routing protocols. We&#8217;ll cover some of them soon, but in the next installment of Networking 101, we&#8217;re starting our trip up the OSI model.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d37').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d37" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-subnetting-slice-up-32-bits%2F&amp;title=Networking+101%3A+Subnetting+%26%238211%3B+Slice+Up+32-bits" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-subnetting-slice-up-32-bits%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-subnetting-slice-up-32-bits%2F&amp;title=Networking+101%3A+Subnetting+%26%238211%3B+Slice+Up+32-bits" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-subnetting-slice-up-32-bits%2F&amp;title=Networking+101%3A+Subnetting+%26%238211%3B+Slice+Up+32-bits" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Networking+101%3A+Subnetting+%26%238211%3B+Slice+Up+32-bits+@+http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-subnetting-slice-up-32-bits%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking-101%2Fnetworking-101-subnetting-slice-up-32-bits%2F&amp;t=Networking+101%3A+Subnetting+%26%238211%3B+Slice+Up+32-bits" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d37').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-ip-addresses/' rel='bookmark' title='Networking 101: IP addresses'>Networking 101: IP addresses</a></li>
<li><a href='http://www.longitudetech.com/networking/networking-101-more-subnets-and-ipv6/' rel='bookmark' title='Networking 101: More Subnets, and IPv6'>Networking 101: More Subnets, and IPv6</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-understanding-layers/' rel='bookmark' title='Networking 101: Understanding Layers'>Networking 101: Understanding Layers</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/oHz3FkvT0TiGxkrZPvoIPlRQRJc/0/da"><img src="http://feedads.g.doubleclick.net/~a/oHz3FkvT0TiGxkrZPvoIPlRQRJc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/oHz3FkvT0TiGxkrZPvoIPlRQRJc/1/da"><img src="http://feedads.g.doubleclick.net/~a/oHz3FkvT0TiGxkrZPvoIPlRQRJc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/wEaJjjBdO2A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/networking-101/networking-101-subnetting-slice-up-32-bits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/networking-101/networking-101-subnetting-slice-up-32-bits/</feedburner:origLink></item>
		<item>
		<title>An Introduction to LDAP</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/6tGw5sUc1l0/</link>
		<comments>http://www.longitudetech.com/linux-unix/an-introduction-to-ldap/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 21:10:20 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=36</guid>
		<description><![CDATA[LDAP directory services are nearly ubiquitous these days. Every sysadmin should know how to work with directories, understand how they are constructed, and have a certain level of familiarity with the LDAP protocol itself. In this, part one of two, we will introduce LDAP and explain how entries and schemas work. Next week, the second [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/ldap-understand-the-protocol-and-work-with-entries/' rel='bookmark' title='LDAP: Understand the Protocol and Work With Entries'>LDAP: Understand the Protocol and Work With Entries</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-file-permissions/' rel='bookmark' title='Back to Basics: Unix File Permissions'>Back to Basics: Unix File Permissions</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/multi-user-security-in-linux/' rel='bookmark' title='Multi-user Security in Linux'>Multi-user Security in Linux</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>LDAP directory services are nearly ubiquitous these days. Every sysadmin should know how to work with directories, understand how they are constructed, and have a certain level of familiarity with the LDAP protocol itself. In this, part one of two, we will introduce LDAP and explain how entries and schemas work. Next week, the second part will cover the LDAP protocol, working with LDAP entries, and searching and storing data.</p>
<p><img alt="" src="http://www.helpdeskpilot.com/images/ldap%20icon.jpg" title="LDAP Directory" class="alignleft" width="175" height="96" />LDAP is actually quite simple, even though it does make use of the ITU X.500 standard—a notoriously complex specification. X.500 directories were accessed via DAP, or Directory Access Protocol. It was large, complex, and unruly, so Lightweight DAP was created. That’s almost accurate; in fact, LDBP (Lightweight Directory Browsing Protocol) came first, because all you could do was search. When the functionality to modify entries was implemented, LDAP was born.</p>
<p><strong>LDAP Structure</strong><br />
A directory can be defined as a set of objects with similar attributes, organized in a hierarchical manner. Sorry, but I must use the old phone book analogy now. In a phone book, an object is a person, and each person has a set of similar attributes: a phone number and perhaps an address. LDAP is the same, but you may make use of many other types of attributes.</p>
<p>LDAP directories are organized in a tree manner, and the design often will reflect organizational or geographic boundries. X.500 tells us:</p>
<ul>
<li>A directory is a tree of directory entries</li>
<li>An entry contains a set of attributes</li>
<li>An attribute has a name, and one or more values.</li>
</ul>
<p>Attributes are defined in a schema, which specifies what types of things can be attributes and whether or not you can multiple values per attribute.</p>
<p>Every entry in a directory has a unique identifier, called the Distinguished Name (DN). The Relative DN (RDN) is part that specifies the current attribute you’re dealing with, sort of like a relative path in Unix (./file). The DN, then, would be a full path (/var/lib/file). A sample directory entry’s DN, therefore, would look like: cn=”john doe”,dc=mytree. The RDN is cn=”john doe”, and the DN is the full path, starting at the top of the tree. A “cn” simply means the “common name” that the entry is referred to as, and “dc” is the “domain component.”</p>
<p>You will often see examples of LDAP structures that use DNS names for the domain component, such as: dc=example,dc=com. This is not necessary, but since DNS itself often implies organizational boundaries, it usually makes sense to just use your existing naming structure. One final note about a DN; it changes over time. If you change a DN, you’re effectively moving an entry in the tree. Some LDAP servers support unique identifiers that will track the movement of entries, but you often don’t need to care. Just know that even though a DN is unique, it changes over time.</p>
<p><strong>LDIF Example</strong><br />
A sample directory entry (of a person) looks like this:<br />
<code>dn: cn=John Doe,dc=myplace<br />
cn: John Doe<br />
givenName: John<br />
sn: Doe<br />
telephoneNumber: +1 555 555 1234<br />
telephoneNumber: +1 555 555 5555<br />
mail: john@example.com<br />
manager: cn=Bob Smith,dc=example,dc=com<br />
objectClass: inetOrgPerson<br />
objectClass: organizationalPerson<br />
objectClass: person<br />
objectClass: top</code></p>
<p>All of the attributes (objects) listed above are associated with the DN; it is a single directory entry. Objects (givenName, sn, etc) are defined by schemas. Every entry must list the objectClass that every attribute is using. For example, organizationalPerson defines what values can live in the attribute called “manager.” If the objectClass wasn’t listed, the LDAP server wouldn’t know what values were allowed, so it wouldn’t allow you to define an attribute called manager.</p>
<p>The example above is an LDIF, LDAP Data Interchange Format, entry. That is the entire LDAP entry in text form. You could insert the data into a directory, and in fact, this is exactly what a backup of your directory looks like. It’s just text, and that’s all there is to an LDAP entry. Well almost: most servers also support aliases and references. An LDAP alias can point to another local entry in the same directory, to avoid duplicating information. A reference will provide a new DN to an LDAP client and tell it to go ask another server. Some LDAP servers even support chained references, where the server will go get the answer and return it to the client; the client never knows a referral has taken place. Regardless, LDAP entries are quite simple.</p>
<p><strong>LDAP Schemas</strong><br />
A schema defines the attribute types that entries can contain, as well as the format of their values. It will specify that: Mail contains a well-formed e-mail address, Photo contains a JPEG image, and uidNumber contains an integer, for example.</p>
<p>Here is an example schema we recently created:<br />
<code>attributeTypes: ( 1.1.1.2.1<br />
NAME 'pod'<br />
DESC 'A pod for people to belong in'<br />
EQUALITY caseIgnoreMatch<br />
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15<br />
)<br />
objectClasses: ( 1.1.1.1.1<br />
NAME 'podPerson'<br />
DESC 'A person who belongs in some pods'<br />
SUP top<br />
MUST cn<br />
MAY pod<br />
)<br />
</code><br />
The objectClass is defined, as well as the allowed attributeTypes. Each schema must have a unique OID (object identifier), which is part of the way X.500 works (SNMP is the same way). We created an objectClass called podPerson, gave it a description, an said the entry must contain a ‘cn,’ and may contain a ‘pod.’ The pod attribute can contain any value, because the only restriction specified is that case doesn’t matter. After loading that scheme into our LDAP server, we could then add a ‘pod’ attribute to each person entry.</p>
<p>Since LDAP is so lightweight and simple, it is not suitable for a few things. It’s very tempting to store tons of data in LDAP, since so many applications can reference LDAP. Unix machines can use LDAP for passwd, shadow, group, netgroup, protocols, and just about everything in nsswitch.conf. LDAP is a database, so print accounting programs, configuration management systems, and just about everything that stores data in a DB will support LDAP. It’s fine for most of these things, but LDAP is not ideal for replicating a relational database. The data in LDAP is not ordered, which means you could get results in any order. If your application is querying for only one result at a time, this is fine, but if multiple results are common and order is important, LDAP just won’t work.</p>
<p>Check back next week (i.e. follow me on Twitter and subscribe via RSS, links at top-right of this page) for a look at the protocol, and some practical examples of querying and using LDAP data.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d36').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d36" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fan-introduction-to-ldap%2F&amp;title=An+Introduction+to+LDAP" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fan-introduction-to-ldap%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fan-introduction-to-ldap%2F&amp;title=An+Introduction+to+LDAP" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fan-introduction-to-ldap%2F&amp;title=An+Introduction+to+LDAP" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+An+Introduction+to+LDAP+@+http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fan-introduction-to-ldap%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fan-introduction-to-ldap%2F&amp;t=An+Introduction+to+LDAP" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d36').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/ldap-understand-the-protocol-and-work-with-entries/' rel='bookmark' title='LDAP: Understand the Protocol and Work With Entries'>LDAP: Understand the Protocol and Work With Entries</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-file-permissions/' rel='bookmark' title='Back to Basics: Unix File Permissions'>Back to Basics: Unix File Permissions</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/multi-user-security-in-linux/' rel='bookmark' title='Multi-user Security in Linux'>Multi-user Security in Linux</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/nzoIwtQH5p17UVGUIj5ey0kfrfA/0/da"><img src="http://feedads.g.doubleclick.net/~a/nzoIwtQH5p17UVGUIj5ey0kfrfA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/nzoIwtQH5p17UVGUIj5ey0kfrfA/1/da"><img src="http://feedads.g.doubleclick.net/~a/nzoIwtQH5p17UVGUIj5ey0kfrfA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/6tGw5sUc1l0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/linux-unix/an-introduction-to-ldap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/linux-unix/an-introduction-to-ldap/</feedburner:origLink></item>
		<item>
		<title>Back to Basics: Unix File Permissions</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/VnL_AuRGlVM/</link>
		<comments>http://www.longitudetech.com/linux-unix/back-to-basics-unix-file-permissions/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 00:21:40 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=32</guid>
		<description><![CDATA[The most basic, yet important part of mastering Unix is to fully understand the nuances of file permissions. Tools exist to manage permissions easily, but true enlightenment and quick troubleshooting skills come to those who wholly master the concept. Remember, 80% of Unix problems are permissions issues. The Concept At the most basic level, there [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-system-stats-utilities/' rel='bookmark' title='Back to Basics: Unix System Stats Utilities'>Back to Basics: Unix System Stats Utilities</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-differences-in-performing-tasks/' rel='bookmark' title='Back To Basics: Unix Differences in Performing Tasks'>Back To Basics: Unix Differences in Performing Tasks</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/working-with-unix-variant-differences/' rel='bookmark' title='Working With Unix Variant Differences'>Working With Unix Variant Differences</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The most basic, yet important part of mastering Unix is to fully understand the nuances of file permissions. Tools exist to manage permissions easily, but true enlightenment and quick troubleshooting skills come to those who wholly master the concept. Remember, 80% of Unix problems are permissions issues.</p>
<p>The Concept<br />
At the most basic level, there are three types of access:</p>
<ul>
<li> Read – the ability to open a file and read it</li>
<li> Write – the ability to write the file</li>
<li> Execute – the ability to execute (run) the file</li>
</ul>
<p>Directories, though similar, are subject to special rules. Write permissions on a directory imply that you can create new files and directories within. Execute permissions are required to ‘cd’ into the directory, and read permissions are required to list the contents (‘ls’).</p>
<p>You will generally see permissions represented as r, w, or x; for read, write, and execute. Running ‘ls –al’ on the command line will show three sets of these strung together.</p>
<p>For example: -rwxr-xr-x</p>
<p>The dash means that the permission is not set. The first place is always reserved for special identifiers, like ‘d’ for directories or ‘c’ for character devices. The next place begins the actual permissions, for the user, group, and other categories.</p>
<p>Every access control in Unix is based on “who you are.” The user is identified by the uid (user ID), as defined by a person’s user account. The third field in the /etc/password file, for example, specifies what a user’s uid is. Similarly, every user belongs to a default group, as identified by the fourth field in the passwd file. Users can belong to many groups, but they’re always a member of their default group.</p>
<p>The above example of -rwxr-xr-x means that the owner of the file may read, write and execute it, the group members may read or execute it, and everyone else on the system may also read or execute the file.</p>
<p>A full example, from the output of ‘ls -l’ is:<br />
-rw-r&#8211;r&#8211;  1 charlie root        164 2006-12-10 23:51 test.js</p>
<p>The file named test.js is owned by me with read and write permissions, is set to the root group who can only read it, and also allows everyone else to read it.</p>
<p><strong>How it Really Works</strong><br />
That’s basically enough to get by, but being able to understand the more advanced modes of file permissions, your umask, and the numeric representation demands a full understanding. In reality, there are 8-bits available for each type of attribute. Take a look at Figure 1 and note that wherever you see a 1 in the binary column, a corresponding permission will exist.</p>

<table id="wp-table-reloaded-id-3-no-1" class="wp-table-reloaded wp-table-reloaded-id-3">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Number  </th><th class="column-2">Permissions</th><th class="column-3">Binary</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">0</td><td class="column-2">---</td><td class="column-3">000</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">1  </td><td class="column-2">--x</td><td class="column-3">001</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">2  </td><td class="column-2">-w-</td><td class="column-3">010</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">3 	</td><td class="column-2">-wx</td><td class="column-3">011</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">4 	</td><td class="column-2">r--</td><td class="column-3">100</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">5  </td><td class="column-2">r-x</td><td class="column-3">101</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">6  </td><td class="column-2">rw-</td><td class="column-3">110</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">7 	</td><td class="column-2">rwx</td><td class="column-3">111</td>
	</tr>
</tbody>
</table>

<p>As you can see, if a “bit” in a certain position of the binary representation is set, the permissions in that space are activated. The number column is the octal representation, and the “Binary” column is how it really works, from the operation system’s perspective.</p>
<p>Example time. Let’s say we wish to give ourselves read/write/execute permissions, the group read/execute, and everyone else read/execute permissions. The following commands both do the same thing:</p>
<ul>
<li> chmod u+rwx .; chmod go+rx .</li>
<li> chmod 755 .</li>
</ul>
<p>Since we know that setting ‘5’ means rx, we can simply say ‘5’ instead of ‘rx.’ The real advntage to knowing the octal representation is that we can set any arbitrary permissions with a single command. Running the chmod command using the mnemonic requires that we run it each time for each set of permissions.</p>
<p>Likewise, to set our umask, we must know how the permissions are numerically represented. The umask is the default mode with which files and directories will get created. It’s a mask, so if we want to create all files with permissions like 755, we must take the mask. Simply subtract 7 from each item, and 022 reveals itself as the magic setting. See the umask man page for further details.</p>
<p><strong>Advanced Modes<br />
</strong>There are, in fact, three other modes you can set on a file or directory. All Unixes support the following:</p>
<ul>
<li> 4000 set user id (suid) on execution</li>
<li> 2000 set group id on execution</li>
<li> 1000 the sticky bit</li>
</ul>
<p>If suid is enabled, the permissions look like: -rws&#8212;&#8212;<br />
This means that when the file is executed, it will run with the permissions of the owner of the file. It’s dangerous, but some times necessary and quite useful. For example, a file suid and owned by root will always run as root.</p>
<p>When sgid is enabled, the permissions look like: -rwxrws&#8212;<br />
When set on a directory, sgid means that all files created within the directory will have the gid set to the current directory’d gid. This is handy when sharing files with other people, who will often forget to give other members read or write permissions.</p>
<p>The sticky bit looks like: -rwx&#8212;&#8212;T<br />
When the sticky bit is enabled, only the owner of the file can change its permissions or delete it. Without the sticky bit, anyone with write permissions can change the modes (including ownership) or delete a file. This one is also handy when sharing files with a group of people.</p>
<p>There are other tidbits of information, once you get into the nuts and bolts of Unix file permissions too. For example, you can also set ACL attributes, which get horribly complex. Yes, you can give individual users access to your files, but it’s better not to. Creating a new group and sticking to general permissions can accomplish most things. Often the extended attributes aren’t necessary, and ACLs likely won’t work over NFS if you’re using Linux.</p>
<p>Spend some time with the chmod manual page to master tricky parts, if they still aren’t clear. It will also mention some implementation-specific limitations you may need to be aware of.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d32').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d32" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-file-permissions%2F&amp;title=Back+to+Basics%3A+Unix+File+Permissions" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-file-permissions%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-file-permissions%2F&amp;title=Back+to+Basics%3A+Unix+File+Permissions" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-file-permissions%2F&amp;title=Back+to+Basics%3A+Unix+File+Permissions" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Back+to+Basics%3A+Unix+File+Permissions+@+http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-file-permissions%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fback-to-basics-unix-file-permissions%2F&amp;t=Back+to+Basics%3A+Unix+File+Permissions" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d32').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-system-stats-utilities/' rel='bookmark' title='Back to Basics: Unix System Stats Utilities'>Back to Basics: Unix System Stats Utilities</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/back-to-basics-unix-differences-in-performing-tasks/' rel='bookmark' title='Back To Basics: Unix Differences in Performing Tasks'>Back To Basics: Unix Differences in Performing Tasks</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/working-with-unix-variant-differences/' rel='bookmark' title='Working With Unix Variant Differences'>Working With Unix Variant Differences</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/CE7oBsG5m7yheEQQfODWrpWeAEc/0/da"><img src="http://feedads.g.doubleclick.net/~a/CE7oBsG5m7yheEQQfODWrpWeAEc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/CE7oBsG5m7yheEQQfODWrpWeAEc/1/da"><img src="http://feedads.g.doubleclick.net/~a/CE7oBsG5m7yheEQQfODWrpWeAEc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/VnL_AuRGlVM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/linux-unix/back-to-basics-unix-file-permissions/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/linux-unix/back-to-basics-unix-file-permissions/</feedburner:origLink></item>
		<item>
		<title>What the Heck is a TCAM?</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/e4RSjyqCs88/</link>
		<comments>http://www.longitudetech.com/networking/what-the-heck-is-a-tcam/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 18:37:02 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[ccie]]></category>
		<category><![CDATA[ccna]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[networks]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=30</guid>
		<description><![CDATA[Let’s talk about TCAM hardware, Cisco SDM templates, and try to answer that elusive question: “why do I have to reboot my router to enable certain features, which in turn disables others?” First, CAM stands for Content Addressable Memory. A CAM is a special type of memory; some would say the opposite of RAM. With [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-subnetting-slice-up-32-bits/' rel='bookmark' title='Networking 101: Subnetting &#8211; Slice Up 32-bits'>Networking 101: Subnetting &#8211; Slice Up 32-bits</a></li>
<li><a href='http://www.longitudetech.com/networking/are-cisco-flex-links-the-end-of-stp/' rel='bookmark' title='Are Cisco Flex Links the End of STP?'>Are Cisco Flex Links the End of STP?</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-layer-2-link-and-spanning-tree/' rel='bookmark' title='Networking 101: Layer 2, Link and Spanning Tree'>Networking 101: Layer 2, Link and Spanning Tree</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Let’s talk about TCAM hardware, <a href="https://www.cisco.com/en/US/products/hw/switches/ps5023/products_tech_note09186a00801e7bb9.shtml" target="_blank">Cisco SDM templates</a>, and try to answer that elusive question: “why do I have to reboot my router to enable certain features, which in turn disables others?”<strong> </strong></p>
<p>First, CAM stands for Content Addressable Memory. A CAM is a special type of memory; some would say the opposite of RAM. With normal computer memory (RAM) the operating system provides an address, and receives the data stored at the supplied address. With a CAM, the operating system supplies the data, and the CAM returns a list of addresses where the data is stored, if it finds any. Furthermore, a CAM searches the entire memory in one operation, so it is considerably faster than RAM.</p>
<p>CAMs are very expensive, so they aren’t normally found in PCs. Even router vendors will sometimes skimp, opting to instead implement advanced software-based searching algorithms to plod through RAM. Most commonly, CAMs and TCAMs are found in network processing devices, including Intel IXP cards and various routers or switches. The most commonly implemented CAMs are called binary CAMs. They search only for ones and zeros; a simple operation. MAC address tables in switches commonly get stored inside binary CAMs. You can bet that any</p>
<div id="attachment_29" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-29" title="TCAM" src="http://www.longitudetech.com/blog/wp-content/uploads/2010/02/screenshot3-300x186.png" alt="" width="300" height="186" /><p class="wp-caption-text">A Renesas TCAM</p></div>
<p>switch capable of forwarding Ethernet frames at line-speed gigabit is using CAMs for lookups. If they were using RAM, the operating system would have to remember the address where everything is stored. With CAMs, the operating system can find what it needs in a single operation. In this case desired data is the switchport that data should be sent out, based on the given MAC address, i.e. the essence of a MAC table. Some older Cisco switches running CatOS even opted to call this table the cam table, thereby causing great confusion across the land. Bridge table, forwarding table, mac-address table, cam table; it’s all the same.</p>
<p>Finally, a TCAM is a Ternary CAM. This allows the operating system to match a third state, “X.” The X state is a mask, which means you don’t care what it is. This naturally lends itself to networking, since netmasks operate this way. To calculate a subnet address we mask the bits we don’t care about, and then apply the logical AND operation to the rest. Being able to do this in hardware is a great benefit for routers. Additionally, routers can store their entire routing table in these TCAMs, allowing for very quick lookups. A router with routing tables in TCAMs can find the next-hop destination in a single operation every time instead of trying to search through a tree (or other data structure) in RAM.</p>
<p>Hardware can sometimes seem magic, but it isn’t always transparent. When configuring routers most people will run into a situation where enabling a new feature will require that the Cisco SDM (Switching Database Manager) template be changed. This template is actually a method Cisco uses to assign specific applications to specific TCAM resources.</p>
<p>Some routers will allow you to manually specify how much TCAM space you want to allocate to a specific feature. Others aren’t so nice. They make you choose from a few restrictive templates, which allocate the resources automatically based on a few predetermined settings. For example, on the Cisco 3750, we recently wanted to enable policy-based routing (PBR) to implement a layer 3 jail. The basic idea with template-only routers is that you have to choose where you want most of the optimizations, and compromise on the rest.</p>
<p>For this platform, there are four templates: default, routing, PBR, and VLAN. Each of these tries to allow for a bit more resources allocated to the specified task. For policy routing, we’d have to choose “routing” or “PBR,” which in turn limits the amount of unicast MAC addresses that can be held in TCAMs. Likewise, selecting a VLAN template will make PBR impossible, but allow for more VLAN database information to be held in TCAMs. There are always compromises when we need to use more advanced features. Keeping true with the spirit of router operating systems, there’s also some mysterious side-effects when a new template is chosen. On our specific router, if the PBR template is chosen, the router will become unable to support VPN routing/forwarding tables (VRF). The next unsightly gotcha is that with the IOS version that supports IPv6, you cannot even enable PBR. There is no template to allow both policy routing and IPv6.</p>
<p>Perhaps the main idea of TCAM allocation still isn’t clear. Just because, for example, 8K is allocated to routing tables, this doesn’t mean that you can only have a routing table of that size. There’s always the fallback of process switching. Process switching means that everything will be done by the processor instead of in hardware (TCAMs). Processor intervention is not desirable, mostly because it is much slower than hardware lookups. Also, the processor is supposed to be used for things like sending logs to a syslog server and controlling SSH sessions. If a router doing process switching gets really busy, it may be unable to service your console access attempts. Generally speaking, the more expensive the router, the less it will use the processor.</p>
<p>Hardware is finite, and we always need more. More expensive routers don’t always suffer from the constant struggle for TCAMs because they have enough to support most features that currently exist. Unfortunately, most companies won’t want to purchase the latest and greatest router with seemingly endless hardware resources unless they can justify the added cost by showing a current need for them. So, most of us are stuck having to adjust TCAM allocations.</p>
<p>Further reading: an <a href="http://www.lovemytool.com/blog/2009/12/netflow-overflow-with-tcam-tables-by-michael-patterson.html" target="_blank">interesting blog from Plixer</a>.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d30').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d30" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fwhat-the-heck-is-a-tcam%2F&amp;title=What+the+Heck+is+a+TCAM%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fwhat-the-heck-is-a-tcam%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fwhat-the-heck-is-a-tcam%2F&amp;title=What+the+Heck+is+a+TCAM%3F" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fwhat-the-heck-is-a-tcam%2F&amp;title=What+the+Heck+is+a+TCAM%3F" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+What+the+Heck+is+a+TCAM%3F+@+http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fwhat-the-heck-is-a-tcam%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fwhat-the-heck-is-a-tcam%2F&amp;t=What+the+Heck+is+a+TCAM%3F" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d30').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-subnetting-slice-up-32-bits/' rel='bookmark' title='Networking 101: Subnetting &#8211; Slice Up 32-bits'>Networking 101: Subnetting &#8211; Slice Up 32-bits</a></li>
<li><a href='http://www.longitudetech.com/networking/are-cisco-flex-links-the-end-of-stp/' rel='bookmark' title='Are Cisco Flex Links the End of STP?'>Are Cisco Flex Links the End of STP?</a></li>
<li><a href='http://www.longitudetech.com/networking-101/networking-101-layer-2-link-and-spanning-tree/' rel='bookmark' title='Networking 101: Layer 2, Link and Spanning Tree'>Networking 101: Layer 2, Link and Spanning Tree</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/Me-lkxegfe9xVVLzeskw6A2YBDc/0/da"><img src="http://feedads.g.doubleclick.net/~a/Me-lkxegfe9xVVLzeskw6A2YBDc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Me-lkxegfe9xVVLzeskw6A2YBDc/1/da"><img src="http://feedads.g.doubleclick.net/~a/Me-lkxegfe9xVVLzeskw6A2YBDc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/e4RSjyqCs88" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/networking/what-the-heck-is-a-tcam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/networking/what-the-heck-is-a-tcam/</feedburner:origLink></item>
		<item>
		<title>Managing Virtual Machine and Cloud Sprawl</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/6T8VmCXPPTQ/</link>
		<comments>http://www.longitudetech.com/linux-unix/managing-virtual-machine-and-cloud-sprawl/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 06:38:02 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[IT Management]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[configuration management]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=26</guid>
		<description><![CDATA[Virtualization (in the cloud or locally) is great; that much we can all agree on. Virtual machines (VMs) can tend to grow out of control, however, now that it’s so easy to create them. This should not be all that surprising, but many small to medium businesses are also dabbling in VMs, and they are [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/understanding-linux-virtual-memory/' rel='bookmark' title='Understanding Linux Virtual Memory'>Understanding Linux Virtual Memory</a></li>
<li><a href='http://www.longitudetech.com/it-management/how-much-server-do-you-need/' rel='bookmark' title='How Much Server do you Need?'>How Much Server do you Need?</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/zenoss-we-can-ditch-nagios-now/' rel='bookmark' title='Zenoss: We Can Ditch Nagios Now'>Zenoss: We Can Ditch Nagios Now</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Virtualization (in the cloud or locally) is great; that much we can all agree on. Virtual machines (VMs) can tend to grow out of control, however, now that it’s <a href="http://socializedsoftware.com/2010/02/15/cloud-computing-and-virtualization-resources/" target="_blank">so easy to create them</a>. This should not be all that surprising, but many small to medium businesses are also dabbling in VMs, and they are suddenly overwhelmed by the VM growth.</p>
<p>Each VM is another server that an administrator must manage. Security updates must be applied and global configuration changes now need to be propagated to all these new machines. While it’s easy to create 3-4 (or more) servers on one physical piece of hardware, you’ll certainly struggle if you aren’t already set up to scale.</p>
<p><strong>Unfettered Growth</strong><br />
The number of physical machines in a small company may drop dramatically; maybe 40%, when virtualization is implemented. Unfortunately, the number of OS instances will generally increase by two-fold or more at the same time. The power and cooling savings are realized, as was promised by virtualization, but taking 20 servers to 12 servers, for example, will means you may soon have 40 OS instances to manage.</p>
<div id="attachment_27" class="wp-caption alignleft" style="width: 229px"><a href="http://reductivelabs.com" target="_blank"><img class="size-full wp-image-27" title="reductivelabs" src="http://www.longitudetech.com/blog/wp-content/uploads/2010/02/reductivelabs.png" alt="You Need It" width="219" height="103" /></a><p class="wp-caption-text">Puppet, from Reductive Labs</p></div>
<p>The reasons for VM proliferation depend on your culture, but the most common reason is that delegating control of an entire OS is easier than managing an application for customers. IT customer, be they engineers, application developers, or smaller IT units within an organization, frequently need more access then cenral IT is willing to give. The easy solution: give them a server of their own. Test environments, too, are best served by virtual machines.</p>
<p>To keep hardware (and power and cooling) costs down, many companies implement policies about the implementation of new services. New applications and servers need to be run on VMs first, unless it’s really requires its own server. Policies such as these are good, in that they limit wastefulness, but they do tend to exacerbate VM sprawl.</p>
<p>Sprawl aside; it’s worth noting that higher utilization levels on your servers does not mean that they’ll use an appreciably larger amount of power. In fact, the power savings claims are really true, and can be even greater if your utilization is low and you use VirtualCenter’s power management features. VMWare can migrate VMs to fewer servers if utilization isn’t high enough, and actually power off unnecessary servers. This works best with Dell hardware, but other large vendors are supported as well. Imagine: all your VMs migrating to a few blades in a blade server during the nighttime, and then as utilization increases during the day, blades quickly boot up and take the load as needed. Granted, I don’t personally know any enterprise environments that are brave enough to try it yet, but in theory the concept is wonderful.</p>
<p><strong>Dealing</strong><br />
Something magical happens when a company grows to around 50 operating systems. It’s too many to manage by simply logging in and running commands, so people start to write scripts. In Windows land, if it hasn’t already happened, you must implement Active Directory. For the Unix/Linux servers, configuration management becomes even more important. Writing a script that SSH’s to each server and runs a command doesn’t scale, no matter how hard people want it to. You need a real configuration management system (such as <a href="reductivelabs.com/">puppet</a> or <a href="http://www.opscode.com/">cfengine</a>) to ensure that servers are configured exactly how you want, and that they will remain that way.</p>
<p>If you already operate in a large environment with good automated installations and configuration management systems, chances are scaling 100-fold won’t be a problem. Barring scaling issues with the management software itseld, that is. A good network-booting deployment system is only half the battle, because every server isn’t going to be configured identically. If you’re “doing it right,” you should be able to arbitrarily reinstall any server, walk away, and know that it’ll come back up patched and running all the services it’s supposed to. Servers, or rather the OS that runs on them, should be truly disposable.</p>
<p>Management of a “golden image” is promised by VMWare, probably because ITIL mentions it, but it doesn’t really help in practice. You have to create your images (somehow). There’s no mechanism to update a golden image with security patches and apply them to existing systems; you’ll generally have to reinstall the OS instances. And that’s what you should do periodically, but without some kind of configuration management system, you’ll also be manually installing and configuring the services that the VMs used to provide in order to restore service functionality.</p>
<p>VM growth, therefore, is no different from server growth. It may be easier and cheaper, but from the OS management viewpoint, you’re doing the same thing. Likewise, the availability of your services is also in danger. Running five VMs on a single piece of hardware means that a hardware failure takes out five servers instead of one. VMWare and Xen can both be clustered and run from shared storage, such that a hardware failure will result in the VMs immediately (instantly, even) being migrated to other servers. The problem is that VMotion requires the most expensive VMWare license, and a VirtualCenter server. Shared storage isn’t as big of an issues these days with iSCSI, but its still another aspect that must be configured. We’ll cover this issue in-depth in a future article, focusing on Xen and RHEL Clustering Services.</p>
<p>The point is: dealing with VM sprawl is no different than dealing with scaling up to support more physical servers. Use whatever mechanisms are available on your given platforms, and “do it right.” A VM is, and always will be, just another server.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d26').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d26" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fmanaging-virtual-machine-and-cloud-sprawl%2F&amp;title=Managing+Virtual+Machine+and+Cloud+Sprawl" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fmanaging-virtual-machine-and-cloud-sprawl%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fmanaging-virtual-machine-and-cloud-sprawl%2F&amp;title=Managing+Virtual+Machine+and+Cloud+Sprawl" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fmanaging-virtual-machine-and-cloud-sprawl%2F&amp;title=Managing+Virtual+Machine+and+Cloud+Sprawl" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Managing+Virtual+Machine+and+Cloud+Sprawl+@+http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fmanaging-virtual-machine-and-cloud-sprawl%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Fmanaging-virtual-machine-and-cloud-sprawl%2F&amp;t=Managing+Virtual+Machine+and+Cloud+Sprawl" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d26').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/understanding-linux-virtual-memory/' rel='bookmark' title='Understanding Linux Virtual Memory'>Understanding Linux Virtual Memory</a></li>
<li><a href='http://www.longitudetech.com/it-management/how-much-server-do-you-need/' rel='bookmark' title='How Much Server do you Need?'>How Much Server do you Need?</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/zenoss-we-can-ditch-nagios-now/' rel='bookmark' title='Zenoss: We Can Ditch Nagios Now'>Zenoss: We Can Ditch Nagios Now</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/MYMuooe1EdY2k-gtAF40plkyjBI/0/da"><img src="http://feedads.g.doubleclick.net/~a/MYMuooe1EdY2k-gtAF40plkyjBI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/MYMuooe1EdY2k-gtAF40plkyjBI/1/da"><img src="http://feedads.g.doubleclick.net/~a/MYMuooe1EdY2k-gtAF40plkyjBI/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/6T8VmCXPPTQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/linux-unix/managing-virtual-machine-and-cloud-sprawl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/linux-unix/managing-virtual-machine-and-cloud-sprawl/</feedburner:origLink></item>
		<item>
		<title>Manage Devices and Configurations with Cisco SDM</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/1WHBRT8MLGM/</link>
		<comments>http://www.longitudetech.com/networking/manage-devices-and-configurations-with-cisco-sdm/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 00:44:11 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[configuration management]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=24</guid>
		<description><![CDATA[Ever wanted to make something “just work” in a secure and reliable way? We, too, have often thought that common configurations should just be selectable. The Cisco Security Device Manager(SDM) is a Java-based Web application for managing Cisco devices. It implements many management features aside from just security-related tasks, and it’s quite interesting. In this article [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking/built-in-security-with-cisco-ips/' rel='bookmark' title='Built-in Security with Cisco IPS'>Built-in Security with Cisco IPS</a></li>
<li><a href='http://www.longitudetech.com/networking/cisco-autoqos-voip-qos-for-mere-mortals/' rel='bookmark' title='Cisco AutoQoS: VoIP QoS for Mere Mortals'>Cisco AutoQoS: VoIP QoS for Mere Mortals</a></li>
<li><a href='http://www.longitudetech.com/networking/are-cisco-flex-links-the-end-of-stp/' rel='bookmark' title='Are Cisco Flex Links the End of STP?'>Are Cisco Flex Links the End of STP?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to make something “just work” in a secure and reliable way? We, too, have often thought that common configurations should just be selectable. The Cisco <a href="http://www.cisco.com/en/US/products/sw/secursw/ps5318/index.html">Security Device Manager</a>(SDM) is a Java-based Web application for managing Cisco devices. It implements many management features aside from just security-related tasks, and it’s quite interesting. In this article we’ll explain what it can do, and why you might want to take it for a test drive.</p>
<p>Network admins can use SDM to generate Cisco TAC approved configurations with the click of a few buttons. It’s not just limited to simple configurations either. Some tricky configuration tasks such as QoS and VPNs also become easier with the SDM because it ensure that configuration errors don’t exist. In short, you can deploy new devices and services much quicker by using the SDM.</p>
<p>As the name implies, SDM also intently focuses on security. A feature called “one-click lockdown” will set your router up as Cisco recommends—a good starting point for new routers. Also, the security audit function of the SDM will check your configuration and offer up a surprisingly large set of recommendations for hardening security. Many are things that most administrators don’t worry about, but with the SDM you can easily click “fix it” for each item after reading a description. There’s no reason to leave any possible vulnerability open when you have a quick, easy GUI manager pointing out what should change.</p>
<div id="attachment_25" class="wp-caption alignleft" style="width: 310px"><a href="http://newsroom.cisco.com/dlls/SDM.jpg"><img class="size-medium wp-image-25 " title="SDM" src="http://www.longitudetech.com/blog/wp-content/uploads/2010/02/SDM-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Cisco SDM user interface</p></div>
<p>The SDM is also a management console that gives you a real-time look at your device. It provides a nice interface for viewing system logs, firewall logs, and even real-time performance statistics. You probably already gather performance data via SNMP for historical charting, but being able to see the real-time information while you’re logged into the device manager, where you can also make changes to the configuration, is quite convenient.</p>
<p>SDM is available for most IOS-based routers running 12.2 and above. It is install by downloading a zip file from Cisco and copying it to the router’s flash memory. It’s then accessed from your Web browser (Firefox or IE required, as well as certain Java versions).</p>
<p><strong>Making it Work</strong></p>
<p>First, we must point out that using the SDM requires that you enable the HTTP server on your device. Yes, most Cisco security holes involve the Web server, and yes, a Web spider can easily DoS your router if it starts crawling Web pages and runs it out of RAM. Fortunately, both of these are negligible if you don’t allow access to the Web server from external networks. So first things first, enable: <strong>ip http secure-server</strong>, then configure ACLs to limit access properly.</p>
<p>After unzipping the file downloaded from Cisco, you can browse to: https://$server/flash/sdm.shtml</p>
<p>Then, login with a highly privileged account (level 15 is required). Up comes the Java applet, and you’re in! It couldn’t be easier than that.</p>
<p><strong>Features</strong></p>
<p>At the top, you’ll see things like Wizard, Advanced, and Monitor. The left had side lists things you can do in Wizard mode, and includes things such as VPN, Firewall, and LAN configuration options.</p>
<p>At the top you’ll also see a “deliver” button, which is another way of saying “commit.” All changes made within the SDM are committed to flash and merged into the running configuration when deliver is clicked.</p>
<p>Various configuration menus exist, most of which make the task at hand slightly easier. For the advanced administrator, it means you can just select options quickly without remembering the specific syntax. More junior admins can make previously confusing concepts work with little effort as well, and then look at the configuration that was generated.</p>
<p>The neatest feature is the security audit. When run, it will gather information about your device and then provide a list of problems. A nice “fix it” check box next to each item can be clicked, or you can elect to choose “fix all.” Beware that Cisco’s idea of security is basically very locked down. Selecting “fix all,” for example, will disable SNMP. It’s true that exposing SNMP to the external world is unwise, but you really do need it enabled for internal access.</p>
<p>You can also configure ACLs and interface parameters from within the GUI. Interfaces can be configured completely via the SDM, and the really nice part is that it lists all available setting for the particular interface. You’ll see check boxes for every option, along with a nice description of each option. ACLs can also be configured, and the GUI presents a nice view of which services will be allowed, and in which direction, on each interface.</p>
<p>In advanced mode, you can easily change many things, including OSPF and BGP settings. It’s just a matter of a few clicks to add another OSPF process ID or add another network to an existing one. Being able to see networks each OSPF process advertises and configure passive interfaces in a single well laid out window is very exciting.</p>
<p>In Monitor mode, you can see which interfaces are down, how much CPU is being utilized, and how much RAM is being taken up by which processes. Very useful information, sure to put a smile on your face the first time you see it.</p>
<p>The SDM does not support everything you’d want to do on a router, but the majority of common tasks are covered. It’s definitely a time-saver, learning tool, and convenience crutch all in one. Don’t feel bad using the SDM; convenience always outweighs prestige, assuming you can do it via the command line too. Enable the “show changes before delivering config” option to see what commands the SDM is about to run, and you’ll avoid surprises and possibly learn something at the same time.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d24').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d24" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fmanage-devices-and-configurations-with-cisco-sdm%2F&amp;title=Manage+Devices+and+Configurations+with+Cisco+SDM" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fmanage-devices-and-configurations-with-cisco-sdm%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fmanage-devices-and-configurations-with-cisco-sdm%2F&amp;title=Manage+Devices+and+Configurations+with+Cisco+SDM" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fmanage-devices-and-configurations-with-cisco-sdm%2F&amp;title=Manage+Devices+and+Configurations+with+Cisco+SDM" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Manage+Devices+and+Configurations+with+Cisco+SDM+@+http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fmanage-devices-and-configurations-with-cisco-sdm%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fmanage-devices-and-configurations-with-cisco-sdm%2F&amp;t=Manage+Devices+and+Configurations+with+Cisco+SDM" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d24').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking/built-in-security-with-cisco-ips/' rel='bookmark' title='Built-in Security with Cisco IPS'>Built-in Security with Cisco IPS</a></li>
<li><a href='http://www.longitudetech.com/networking/cisco-autoqos-voip-qos-for-mere-mortals/' rel='bookmark' title='Cisco AutoQoS: VoIP QoS for Mere Mortals'>Cisco AutoQoS: VoIP QoS for Mere Mortals</a></li>
<li><a href='http://www.longitudetech.com/networking/are-cisco-flex-links-the-end-of-stp/' rel='bookmark' title='Are Cisco Flex Links the End of STP?'>Are Cisco Flex Links the End of STP?</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/QLnROcK9XBBxkWW3UN6HJvS28do/0/da"><img src="http://feedads.g.doubleclick.net/~a/QLnROcK9XBBxkWW3UN6HJvS28do/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/QLnROcK9XBBxkWW3UN6HJvS28do/1/da"><img src="http://feedads.g.doubleclick.net/~a/QLnROcK9XBBxkWW3UN6HJvS28do/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/1WHBRT8MLGM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/networking/manage-devices-and-configurations-with-cisco-sdm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/networking/manage-devices-and-configurations-with-cisco-sdm/</feedburner:origLink></item>
		<item>
		<title>Understanding Linux Virtual Memory</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/XLk4LYg1fVs/</link>
		<comments>http://www.longitudetech.com/linux-unix/understanding-linux-virtual-memory/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 19:11:56 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[tuning]]></category>
		<category><![CDATA[vmm]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=22</guid>
		<description><![CDATA[Virtual memory is one of the most important, and accordingly confusing, piece of an operating system. Understanding the basics of virtual memory is a requisite to understanding operating system performance. Beyond the basics, a deeper understanding allows a systems administrator to interpret system profiling tools better, leading to quicker troubleshooting and better decisions. The concept [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/multi-user-security-in-linux/' rel='bookmark' title='Multi-user Security in Linux'>Multi-user Security in Linux</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/managing-virtual-machine-and-cloud-sprawl/' rel='bookmark' title='Managing Virtual Machine and Cloud Sprawl'>Managing Virtual Machine and Cloud Sprawl</a></li>
<li><a href='http://www.longitudetech.com/san-101/understanding-fibre-channel/' rel='bookmark' title='Understanding Fibre Channel'>Understanding Fibre Channel</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Virtual memory is one of the most important, and accordingly confusing, piece of an operating system. Understanding the basics of virtual memory is a requisite to understanding operating system performance. Beyond the basics, a deeper understanding allows a systems administrator to interpret system profiling tools better, leading to quicker troubleshooting and better decisions.</p>
<p>The concept of virtual memory is generally taught as though it’s only used for extending the amount of physical RAM in a system. Indeed, paging to disk is important, but virtual memory is used by nearly  every aspect of an operating system.</p>
<p>In addition swapping, virtual memory is used to manage all pages of memory, which incidentally are required for file caching, process isolation, and even network communication. Anything that queues data, you can be assured, traverses the virtual memory system. Depending on a server’s role, virtual memory functionality may not be optimal. An administrator can dramatically improve overall system performance by adjusting certain virtual memory manager settings.</p>
<p>To optimally configure your Virtual Memory Manager (VMM), it’s necessary to understand how it does its job. We’re using Linux for example’s sake, but the concepts apply across the board, though some slight architectural differences will exist between the Unixes.</p>
<p>Nearly every VMM interaction involves the MMU, or Memory Management Unit, excluding the disk subsystem. The MMU allows the operating system to access memory through virtual addresses by using data structures to track these translations. Its main job is to translate these virtual addresses into physical addresses, so that the right section of RAM is accessed.</p>
<p>The Zoned Buddy Allocator interacts directly with the MMU, providing valid pages when the kernel asks for them. It also manages lists of pages and keeps track of different categories of memory addresses.</p>
<p>The Slab Allocator is another layer in front of the Buddy Allocator, and provides the ability to create cache of memory objects in memory. On x86 hardware, pages of memory must be allocated in 4KB blocks, but the Slab Allocator allows the kernel to store objects that are differently sized, and will manage and allocate real pages appropriately.</p>
<p>Finally, a few kernel tasks run to manage specific aspects of the VMM. The bdflush manages block device pages (disk IO), and kswapd handles swapping pages to disk. Pages of memory are either Free (available to allocate), Active (in use), or Inactive. Inactive pages of memory are either dirty or clean, depending on if it has been selected for removal yet or not. An inactive dirty page is no longer in use, but is not yet available for re-use. The operating system must scan for dirty pages, and decide to deallocate them. After they have been guaranteed sync’d to disk, an inactive page my be “clean,” or ready for re-use.</p>
<p>Tuning<br />
Tunable parameters may be adjusted in real-time via the proc fils system, but to persist across a reboot, /etc/sysctl.conf is the preferred method. Parameters can be entered in real-time via the sysctl command, and then recorded  in the configuration file for reboot persistence.</p>
<p>You can adjust everything from the interval pages are scanned to the amount of memory to reserve for pagecache use. Let’s see a few examples.</p>
<p>Often we’ll want to optimize a system for IO performance. A busy database server, for example, is generally only going to run the database, and it doesn’t matter if the user experience is good or not. If the system doesn’t require much memory for user applications decreasing the available bdflush tunables is beneficial. The specific parameters being adjusted are just too lengthy to explain here, but definitely look into them if you wish to adjust the values further. They are fully explained in vm.txt, usually located at: /usr/src/linux/Documenation/sysctl/vm.txt.</p>
<p>In general, a IO-heavy server will benefit from the following setting these values in sysctl.conf:<br />
<code>vm.bdflush=”100 5000 640 2560 150 30000 5000 1884 2”<br />
</code></p>
<p>The pagecache values control how much memory is used for pagecache. The amount of pagecache allowed translates directly to how many programs and open files can be held in memory.</p>
<p>The three tunable parameters with pagecache are:</p>
<ul>
<li> Min: the minimum amount of memory reserved for pagecache</li>
<li> Borrow: the percentage of pages used in the process of reclaiming pages</li>
<li> Max: percentage at which kswapd will only page pagecache pages; once it falls below, it can swap out process pages again</li>
</ul>
<p>On a file server, we’d want to increase the amount of pagecache available, so that data isn’t moved to disk as often. Using vm.pagecache=&#8221;10 50 100&#8243; provides more caching, allowing larger and less frequent disk writes for file IO intensive work loads.</p>
<p>On a single-user machine, say your workstation, large number will keep pages in memory, allowing programs to execute faster. Once the upper limit is reached, however, you will start swapping constantly.</p>
<p>Conversely, a server with many users that frequently executes many different programs will not want high amounts of pagecache. The pagecache can easily eat up available memory if it’s too large, so something like vm.pagecache=”10 20 30” is a good compromise.</p>
<p>Finally, the swappiness and vm.overcommit parameters are also very powerful. The overcommit number can be used to allow more memory allocation than RAM exists, which allows you to overcommit the amount of pages. Programs that have a habit of trying to allocate many gigabytes of memory are a hassle, and frequently they don’t use nearly that much memory. Upping the overcommit factor will allow these allocations to happen, but if the application really does use all the RAM, you’ll be swapping like crazy in no time (or worse: running out of swap).</p>
<p>The swappiness concept is heavily debated. If you want to decrease the amount of swapping done by the system, just echo a small number of the range 0-100 into: /proc/sys/vm/swappiness. You don’t generally want to play with this, as it its more mysterious and non-deterministic than the advanced parameters described above. In general, you want applications to swap to avoid them using memory for no reason. Task-specific servers, where you know the amount of RAM and the application requirements, are best suited for swappiness tuning (using a low number to decrease swapping).</p>
<p>These parameters all require a bit of testing, but in the end, you can dramatically increase the performance of many types of servers. The common case of disappointing disk performance stands to gain the most: give the settings a try before going out and buying a faster disk array.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d22').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d22" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Funderstanding-linux-virtual-memory%2F&amp;title=Understanding+Linux+Virtual+Memory" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Funderstanding-linux-virtual-memory%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Funderstanding-linux-virtual-memory%2F&amp;title=Understanding+Linux+Virtual+Memory" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Funderstanding-linux-virtual-memory%2F&amp;title=Understanding+Linux+Virtual+Memory" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Understanding+Linux+Virtual+Memory+@+http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Funderstanding-linux-virtual-memory%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Flinux-unix%2Funderstanding-linux-virtual-memory%2F&amp;t=Understanding+Linux+Virtual+Memory" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d22').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/linux-unix/multi-user-security-in-linux/' rel='bookmark' title='Multi-user Security in Linux'>Multi-user Security in Linux</a></li>
<li><a href='http://www.longitudetech.com/linux-unix/managing-virtual-machine-and-cloud-sprawl/' rel='bookmark' title='Managing Virtual Machine and Cloud Sprawl'>Managing Virtual Machine and Cloud Sprawl</a></li>
<li><a href='http://www.longitudetech.com/san-101/understanding-fibre-channel/' rel='bookmark' title='Understanding Fibre Channel'>Understanding Fibre Channel</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/YoJJMkOMP5gIFUYJMAUJBB0uuH0/0/da"><img src="http://feedads.g.doubleclick.net/~a/YoJJMkOMP5gIFUYJMAUJBB0uuH0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/YoJJMkOMP5gIFUYJMAUJBB0uuH0/1/da"><img src="http://feedads.g.doubleclick.net/~a/YoJJMkOMP5gIFUYJMAUJBB0uuH0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/XLk4LYg1fVs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/linux-unix/understanding-linux-virtual-memory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/linux-unix/understanding-linux-virtual-memory/</feedburner:origLink></item>
		<item>
		<title>Built-in Security with Cisco IPS</title>
		<link>http://feedproxy.google.com/~r/LongitudetechBlog/~3/u-hDVBVZ4ZI/</link>
		<comments>http://www.longitudetech.com/networking/built-in-security-with-cisco-ips/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 01:46:58 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[ccna]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[networks]]></category>

		<guid isPermaLink="false">http://www.longitudetech.com/blog/?p=21</guid>
		<description><![CDATA[Another new feature available in IOS (12.3) is Cisco’s Intrusion Prevention System. An IDS has been part of IOS for a long time, but they recently took it a step further. As part of its Self-Defending Network campaign, Cisco realized that an IPS should be integrated into the network fabric. We’ll explain what this means, [...]
Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking/manage-devices-and-configurations-with-cisco-sdm/' rel='bookmark' title='Manage Devices and Configurations with Cisco SDM'>Manage Devices and Configurations with Cisco SDM</a></li>
<li><a href='http://www.longitudetech.com/networking/are-cisco-flex-links-the-end-of-stp/' rel='bookmark' title='Are Cisco Flex Links the End of STP?'>Are Cisco Flex Links the End of STP?</a></li>
<li><a href='http://www.longitudetech.com/networking/cisco-autoqos-voip-qos-for-mere-mortals/' rel='bookmark' title='Cisco AutoQoS: VoIP QoS for Mere Mortals'>Cisco AutoQoS: VoIP QoS for Mere Mortals</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Another new feature available in IOS (12.3) is Cisco’s Intrusion Prevention System. An IDS has been part of IOS for a long time, but they recently took it a step further. As part of its Self-Defending Network campaign, Cisco realized that an IPS should be integrated into the network fabric. We’ll explain what this means, and show you how to implement it.</p>
<p>Actively <em>preventing</em> the attack makes it an IPS. The standard old IDS solution means that it can detect and alert, but blocking attacks is not normally part of an IDS’s feature set. Thus, if you want to prevent attacks rather than just receive alerts, you need an IPS. Cisco’s IPS works like any other: you get a signature file, called the Signature Definition File (SDF) by Cisco, and if the IPS finds that a packet matches a signature, it’s blocked.</p>
<p>There are appliances, Catalyst switch modules, and router modules, but IPS is also built-in to certain IOS images now. Since Cisco claims IPS features won’t impact router performance (since the latest release), it may be possible to skip the purchase of a dedicated module for IPS.</p>
<p>The catch, of course, is that an IPS is not robust without constant signature updates. Attacks are constantly evolving, and without an update you aren’t protected against the latest and greatest attacks. Something completely new could sneak in, but the idea is that after the first few attacks Cisco will update the SDF and you’ll be notified that it’s time to download a new version. That’s right, you have to manually download and install a new signature file. This requires a subscription service above and beyond what you pay for SMARTnet. Services for IPS, as it’s called, provides SDF updates and the other features (support, warranty) that SMARTnet does as well. Accordingly, your SMARTnet contract is discounted when you purchase a Cisco Services for IPS contract, according to Cisco’s Q&amp;A documentation.</p>
<p><strong>Configuring IPS for Sensor Modules</strong></p>
<p>There are many different cases for configuring IPS depending on your device. First, we’ll show you how to enable it on any IPS sensor module that uses the IPS 5.1 or later, then we’ll show you how to take advantage of the IOS built-in default IPS features.</p>
<p>The IDS Device Manager (IDM) is a graphical interface for configuring all IDS (and IPS) functionality. If you prefer that, then refer to the Cisco documentation after reading about how it’s done via the CLI here.</p>
<p>The general idea we’re working with here is called the VLAN pair method. This means that we’ll configure two VLANs in a pair group, and all traffic received by a sensor will be inspected and either forwarded on to the other VLAN, or dropped. Up to 255 VLAN pairs can be configured on most sensors.</p>
<p>First we enter configuration mode, then the service interface, and finally select the physical interface that we wish to configure:</p>
<p><code>sensor#configure terminal</code></p>
<p><code>sensor(config)#service interface</code></p>
<p><code> </code></p>
<p><code>sensor(config-int)#physical-interfaces GigabitEthernet0/1<br />
</code><br />
Next, we must configure the VLAN pair (and give it a meaningful description):</p>
<p><code>sensor(config-int-phy)#subinterface-type inline-vlan-pair</code></p>
<p><code>sensor(config-int-phy-inl)#subinterface 1</code></p>
<p><code>sensor(config-int-phy-inl-sub)#vlan1 10</p>
<p>sensor(config-int-phy-inl-sub)#vlan2 11</p>
<p></code></p>
<p><code>sensor(config-int-phy-inl-sub)#description vlans 10 and 11<br />
</code><br />
Conceptually, the interface will now be added to a virtual sensor, and once it’s enabled it will monitor traffic. We now need to enable a virtual sensor:</p>
<p><code>sensor(config)#service analysis-engine</code></p>
<p><code> </code></p>
<p><code>sensor(config-ana)#virtual-sensor vs0<br />
</code><br />
Once that’s completed, we simply add the previously-defined subinterface to the sensor, and we’re done:</p>
<p><code>sensor(config-ana-vir)#physical-interface GigabitEthernet0/2 subinterface-number 1<br />
</code><br />
<strong>Configuring IPS for IOS</strong></p>
<p>You can enable IPS features in IOS using the default SDF. Signatures may be added manually to the SDF, or you can pay Cisco for the latest signatures.</p>
<p>First we need to enable what’s called Security Device Event Exchange notifications:</p>
<p><code>router(config)#ip ips notify sdee<br />
</code><br />
Then we must configure an IPS rule name that will be used for associating with interfaces.</p>
<p><code>router(config)# ip ips name MYIPSRULES<br />
</code><br />
The next step is to specify where the SDF file will come from. The following command specifies that the file 256MB.sdf can be found in flash memory. You can also specify tftp or any other protocol your Cisco knows how to handle, but it’s best to use flash memory to ensure no dependencies on other servers.</p>
<p><code>router(config)# ip ips sdf location flash:256MB.sdf<br />
</code><br />
Finally, we simply enable IPS on the interface (in both directions). It is also a good idea to enable IP reassembly on the interface, so that the IPS rule can evaluate entire IP packets at once.</p>
<p><code>router(config)#interface fastEthernet 0</code></p>
<p><code>router(config-if)#ip ips MYIPSRULES in</code></p>
<p><code>router(config-if)#ip ips MYIPSRULES out</p>
<p></code></p>
<p><code>router(config-if)#ip virtual-reassembly<br />
</code><br />
Now you have a working IPS, based on the file in your flash called 256MB.sdf. That file must be downloaded from Cisco using your CCO login linked to a valid support contract.</p>
<p><strong>The Power of Community</strong></p>
<p>If you don’t feel like paying Cisco for signature updates, you can update the SDF yourself. When a new attack surfaces, you’ll often find Cisco IPS XML signatures posted to various online forums. You can and should use them.</p>
<p>To view your current SDF version, you can run: <strong>sh ip ips signatures</strong></p>
<p>To merge the IPS SDF configuration with new information, you can copy in an XML file. Just like copying in any configuration snippet, the updates will be merged, not replaced. Say we got sigs.xml from a helpful network operator. To enable these signatures, we simply run:</p>
<p><code>router#copy tftp://serer.fqdn/sigs.xml ips-sdf<br />
</code><br />
That’s it! You’ll see that 256MB.sdf on the flash memory is now a bit larger. It’s a good idea (and is recommended by Cisco) to rename 256MB.sdf to avoid confusion, now that you are no longer running a Cisco-sanctioned version.</p>
<p>Enabling IPS on supported routers is quite easy, but can lead to some interesting troubleshooting sessions. Be sure you have a syslog server that your routers all log to: it will save hours of work. Also, search around; you may find a source for XML updates that you wish to trust, and then it’s pretty easy to automate daily merges into your local SDF.</p>
<p></p> <!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d21').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Feel free to share!</em></strong></a>
<br />
<div class="d21" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fbuilt-in-security-with-cisco-ips%2F&amp;title=Built-in+Security+with+Cisco+IPS" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fbuilt-in-security-with-cisco-ips%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fbuilt-in-security-with-cisco-ips%2F&amp;title=Built-in+Security+with+Cisco+IPS" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fbuilt-in-security-with-cisco-ips%2F&amp;title=Built-in+Security+with+Cisco+IPS" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Built-in+Security+with+Cisco+IPS+@+http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fbuilt-in-security-with-cisco-ips%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.longitudetech.com%2Fnetworking%2Fbuilt-in-security-with-cisco-ips%2F&amp;t=Built-in+Security+with+Cisco+IPS" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.longitudetech.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d21').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<p>Related posts:<ol>
<li><a href='http://www.longitudetech.com/networking/manage-devices-and-configurations-with-cisco-sdm/' rel='bookmark' title='Manage Devices and Configurations with Cisco SDM'>Manage Devices and Configurations with Cisco SDM</a></li>
<li><a href='http://www.longitudetech.com/networking/are-cisco-flex-links-the-end-of-stp/' rel='bookmark' title='Are Cisco Flex Links the End of STP?'>Are Cisco Flex Links the End of STP?</a></li>
<li><a href='http://www.longitudetech.com/networking/cisco-autoqos-voip-qos-for-mere-mortals/' rel='bookmark' title='Cisco AutoQoS: VoIP QoS for Mere Mortals'>Cisco AutoQoS: VoIP QoS for Mere Mortals</a></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/HVzH5Nurw1MbhMWvtFB6AcitFMA/0/da"><img src="http://feedads.g.doubleclick.net/~a/HVzH5Nurw1MbhMWvtFB6AcitFMA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HVzH5Nurw1MbhMWvtFB6AcitFMA/1/da"><img src="http://feedads.g.doubleclick.net/~a/HVzH5Nurw1MbhMWvtFB6AcitFMA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/LongitudetechBlog/~4/u-hDVBVZ4ZI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.longitudetech.com/networking/built-in-security-with-cisco-ips/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.longitudetech.com/networking/built-in-security-with-cisco-ips/</feedburner:origLink></item>
	</channel>
</rss><!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->

