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

<channel>
	<title>Windancer - Stairway to ...Heaven? &#187; RFC</title>
	<atom:link href="http://www.imacandi.net/windancer/tag/rfc/feed" rel="self" type="application/rss+xml" />
	<link>http://www.imacandi.net/windancer</link>
	<description>&#34;You know my methods, Watson...&#34;</description>
	<lastBuildDate>Sat, 04 Feb 2012 19:15:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>to IPComp or not to IPComp and…which Vendor</title>
		<link>http://www.imacandi.net/windancer/2010/02/05/to-ipcomp-or-not-to-ipcomp-and-which-vendor.html</link>
		<comments>http://www.imacandi.net/windancer/2010/02/05/to-ipcomp-or-not-to-ipcomp-and-which-vendor.html#comments</comments>
		<pubDate>Fri, 05 Feb 2010 17:49:21 +0000</pubDate>
		<dc:creator>cristina_crow</dc:creator>
				<category><![CDATA[technical]]></category>
		<category><![CDATA[checkpoint]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[IETF]]></category>
		<category><![CDATA[IKE]]></category>
		<category><![CDATA[IPComp]]></category>
		<category><![CDATA[ipsec]]></category>
		<category><![CDATA[netcocoon]]></category>
		<category><![CDATA[passion]]></category>
		<category><![CDATA[RFC]]></category>
		<category><![CDATA[Strongswan]]></category>
		<category><![CDATA[techie]]></category>
		<category><![CDATA[xfrm]]></category>

		<guid isPermaLink="false">http://www.imacandi.net/windancer/?p=1603</guid>
		<description><![CDATA[It occurred to me today&#8230;how &#8217;bout trying an IPcomp scenario? Of course, looking at RFC 3173, I was very excited about running a test and actually viewing Next Header / Protocol = 108, as the IETF guys say. Basically, the &#8220;Compression&#8221; part of this IPsec traffic is negotiated just as  any other protocol: AH, ESP, [...]]]></description>
			<content:encoded><![CDATA[<p>It occurred to me today&#8230;how &#8217;bout trying an <strong><a href="http://www.faqs.org/rfcs/rfc3173.html">IPcomp</a></strong> scenario? Of course, looking at <strong><a href="http://www.faqs.org/rfcs/rfc3173.html">RFC 3173</a></strong>, I was very excited about running a test and actually viewing <strong>Next Header / Protocol = 108</strong>, as the IETF guys say.</p>
<p>Basically, the &#8220;Compression&#8221; part of this IPsec traffic is negotiated just as  any other protocol: AH, ESP, EAP&#8230;via IKE, or manually configured on a device. Now&#8230;as I&#8217;ve got to devices&#8230;.good question: _what_ device could I use if I want IPsec IPCompression?</p>
<p>Look at this:<strong><a href="http://www.vpnc.org/vpnc-ipsec-features-chart.html"> http://www.vpnc.org/vpnc-ipsec-features-chart.html</a><span style="font-weight: normal;">. Scroll down to &#8220;Features (HTML table). The vendors that actually implement this, as per VPN Consortium (and for some of them I could tell you from direct experience), are </span>CheckPoint, Cisco, McAfee, SafeNet, StoneSF and TeamF1</strong>. A bit disappointed that I didn&#8217;t have the opportunity of working on all of these devices, I am redirecting my attention to what I do have: a big, shiny and fluffy Debian, with Strongswan installed and xfrm module also on.</p>
<p>So, lets get down to business. I have taken the simplest scenario I could think of at the moment, a <strong>transport mode</strong> scenario, having as Initiator 192.168.0.10 and as Responder 192.168.0.1. These two hosts negotiate 3des-md5-dh2 algorithms, doing PSK authentication. No PFS, no other kinky stuff. Just basic IKEv2 negotiation. The Strongswan config is as simple as possible.</p>
<p>*Note 1 : on strongswan.org people say that IKEv2 does not support compression &#8211; I have run a test with IKEv2 and compression and it works very well <img src='http://www.imacandi.net/windancer/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  But, in order to humor the strongswan guys, I have used IKEv1 in the following scenario</p>
<p>*Note 2 : in order to actually _see_ the encapsulated packets, I have used ESP-NULL Encryption for data encapsulation. Yes, I could have used a <strong>NetCocoon </strong>analyzer, but that &#8211; in the next episode <img src='http://www.imacandi.net/windancer/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>So: IKEv1, Transport mode, Main Mode, Null Encryption, ESP only, IP Comp:</p>
<div id="_mcePaste"><strong><em>config setup</em></strong></div>
<div id="_mcePaste"><strong><em>plutostart=yes</em></strong></div>
<div id="_mcePaste"><strong><em>charonstart=no</em></strong></div>
<div id="_mcePaste"><strong><em>plutodebug=all</em></strong></div>
<div id="_mcePaste"><strong><em>crlcheckinterval=180</em></strong></div>
<div id="_mcePaste"><strong><em>strictcrlpolicy=no</em></strong></div>
<div id="_mcePaste"><strong><em># Add connections here.</em></strong></div>
<div id="_mcePaste"><strong><em>conn %default</em></strong></div>
<div id="_mcePaste"><strong><em>keyingtries=1</em></strong></div>
<div id="_mcePaste"><strong><em>keyexchange=ikev1</em></strong></div>
<div id="_mcePaste"><strong><em>authby=secret</em></strong></div>
<div id="_mcePaste"><strong><em>mobike=no</em></strong></div>
<div id="_mcePaste"><strong><em>pfs=no</em></strong></div>
<div id="_mcePaste"><strong><em>type=transport</em></strong></div>
<div id="_mcePaste"><strong><em>compress=yes</em></strong></div>
<div id="_mcePaste"><strong><em>auto=start</em></strong></div>
<div id="_mcePaste"><strong><em>ike=3des-md5-modp1024</em></strong></div>
<div id="_mcePaste"><strong><em>esp=null-md5</em></strong></div>
<div id="_mcePaste"><strong><em>leftfirewall=yes</em></strong></div>
<div id="_mcePaste"><strong><em>rekey=yes</em></strong></div>
<div id="_mcePaste"><strong><em>conn network1</em></strong></div>
<div id="_mcePaste"><strong><em>left=192.168.0.1</em></strong></div>
<div id="_mcePaste"><strong><em>right=192.168.0.10</em></strong></div>
<div><strong><em></p>
<div># ipsec status</div>
<div><span style="font-weight: normal;">000 &#8220;network1&#8243;: 192.168.0.1[192.168.0.1]&#8230;192.168.0.10[192.168.0.10]; erouted; eroute owner: #3</span></div>
<div><span style="font-weight: normal;">000 &#8220;network1&#8243;:   newest ISAKMP SA: #2; newest IPsec SA: #3;</span></div>
<div><span style="font-weight: normal;">000</span></div>
<div><span style="font-weight: normal;">000 #3: &#8220;network1&#8243; STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 2488s; newest IPSEC; eroute owner</span></div>
<div><span style="font-weight: normal;">000 #3: &#8220;network1&#8243; esp.525b0b48@192.168.0.10 (0 bytes) esp.5511d8c2@192.168.0.1 (0 bytes) comp.1169@192.168.0.10 comp.527e@192.168.0.1; transport</span></div>
<div><span style="font-weight: normal;">000 #2: &#8220;network1&#8243; STATE_MAIN_R3 (sent MR3, ISAKMP SA established); EVENT_SA_REPLACE in 2488s; newest ISAKMP</span></div>
<div><span style="font-weight: normal;">000</span></div>
<div><span style="font-weight: normal;"><br />
</span></div>
<div><span style="font-style: normal; font-weight: normal;"><strong><em></p>
<div><span style="font-weight: normal;"><span style="font-style: normal;">Yes, it worked.</span></span></div>
<div><span style="font-weight: normal;"><span style="font-style: normal;"><br />
</span></span></div>
<div><span style="font-weight: normal;"><span style="font-style: normal;">Now&#8230;I am not sure what exact compression algorithms this Strongswan daemon has, but I can tell you for sure it uses at least <strong><a href="http://en.wikipedia.org/wiki/DEFLATE">DEFLATE</a></strong><a href="http://en.wikipedia.org/wiki/DEFLATE"> </a>(  <strong><a href="http://www.faqs.org/rfcs/rfc2394.html">RFC 2394</a></strong> ). <strong><a href="http://www.cisco.com/en/US/docs/ios/12_2t/12_2t13/feature/guide/ft_lzsft.html">Cisco</a></strong><a href="http://www.cisco.com/en/US/docs/ios/12_2t/12_2t13/feature/guide/ft_lzsft.html"> </a>on the other hand, uses only <strong>LZS </strong>(<strong><a href="http://www.faqs.org/rfcs/rfc2395.html">RFC 2395</a></strong> ) &#8211; as far as I have seen &#8211; to be updated if anybody else tested it versus DEFLATE.</span></span></div>
<div><span style="font-weight: normal;"><span style="font-style: normal;">The process of actually obtaining this cute ESP packets is the following:</span></span></div>
<div><span style="font-weight: normal;"><span style="font-style: normal;">a. get the Data from the upper layers of the TCP stack &#8211; doh, we need data</span></span></div>
<div><span style="font-weight: normal;"><span style="font-style: normal;">b. compress the Data above using the chosen algorithm &#8211; you will notice the <strong>CPI</strong> &#8211; Compression Parameter Index &#8211; which has well know identifiers for the well known compression algorithms</span></span></div>
<div><span style="font-weight: normal;"><span style="font-style: normal;">c. set the Next Header value of the IPComp header to the layer 4 protocol (in this case, TCP)</span></span></div>
<div><span style="font-weight: normal;"><span style="font-style: normal;">d. encapsulate everything in ESP, put on the corresponding SPI, set the Next Header value of the ESP header to 108 (0x6c)</span></span></div>
<div><span style="font-style: normal; font-weight: normal;">e. wrap it up in IP and&#8230; we are all set</span></div>
<div><span style="font-style: normal; font-weight: normal;"><br />
</span></div>
<div><span style="font-weight: normal;"><span style="font-style: normal;">&#8212; You can admire the ESP of IKEv1 in the screenshot attached</span></span></div>
<div><span style="font-weight: normal;"><span style="font-style: normal;"><a href="http://www.imacandi.net/windancer/wp-content/uploads/2010/02/ipcomp.jpg" class="lightview" data-lightview-group="group-1603" data-lightview-options="background: { color: '#ffffff', opacity: 1.00 }, skin: 'mac', border: { color: '#ffffff', opacity: 1.00, size: 8 }, controls: 'relative', overlay: { background: '#000000', opacity: 0.70, close: true }, radius: { size: 8, position: 'border' }, shadow: false" data-lightview-title="ipcomp"><img class="alignright size-full wp-image-1608" title="ipcomp" src="http://www.imacandi.net/windancer/wp-content/uploads/2010/02/ipcomp.jpg" alt="" width="744" height="268" /></a><br />
</span></span></div>
<div><span style="font-weight: normal;"><span style="font-style: normal;"><br />
</span></span></div>
<div><span style="font-style: normal; font-weight: normal;">Now, what happens differently with IKEv2? I was telling you before the on Strongswan, IKEv2 and AH is a no-no for the moment, ESP with null encryption does a weird thinggie that vmp was so kind to point it out for me (while I was feeling actually quite happy about myself being able to do an IPComp test via IKEv1).</span></div>
<div><span style="font-style: normal; font-weight: normal;">The thing is that, unlike the (correct) way of doing IPComp in IKEv1 (see the aboe a. to e. steps), IKEv2 implementation of Strongswan does a weird thing: </span></div>
<div><span style="font-style: normal; font-weight: normal;">a. get the Data ..blah-blah</span></div>
<div><span style="font-style: normal; font-weight: normal;">b. compress the Data with whatever compression algorithm and put on the IPComp header with CPI value and all</span></div>
<div><span style="font-style: normal; font-weight: normal;">* c. put on another IP header (the internal one, in case of a tunnel mode scenario)</span></div>
<div><span style="font-style: normal; font-weight: normal;">d. put on the ESP header</span></div>
<div><span style="font-style: normal; font-weight: normal;">e. wrap everything up</span></div>
<div><span style="font-style: normal; font-weight: normal;"><br />
</span></div>
<div><span style="font-style: normal; font-weight: normal;">&#8212; Unfortunately, you CANNOT admire the ESP of IKEV2 in a screenshot, because my current wireshark has no idea on how to do decompression of this type of packet. Once it does, I will update <img src='http://www.imacandi.net/windancer/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </span></div>
<p></em></strong></p>
<p></span></div>
<p></em></strong></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.imacandi.net/windancer/2010/02/05/to-ipcomp-or-not-to-ipcomp-and-which-vendor.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

