<?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>Advanced Software Engineering</title>
	<atom:link href="http://www.gabrielgonzalezgarcia.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gabrielgonzalezgarcia.com</link>
	<description>or something like that</description>
	<lastBuildDate>Sat, 28 Jan 2012 21:19:36 +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>SVN &amp; TRAC Backup</title>
		<link>http://www.gabrielgonzalezgarcia.com/2012/01/28/svn-trac-backu/</link>
		<comments>http://www.gabrielgonzalezgarcia.com/2012/01/28/svn-trac-backu/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 21:18:50 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[UNIX world]]></category>

		<guid isPermaLink="false">http://www.gabrielgonzalezgarcia.com/?p=555</guid>
		<description><![CDATA[After a few server crashes I had to write this very same script each time so I better keep it up here and maybe someone find it useful 1 2 3 4 5 6 7 8 9 10 11 12 13 #!/bin/sh &#160; PREFIX=/var/develbackup SVNFOO=/home/svnuser/repos/foo TRACFOO=/home/svnuser/trac-env/foo &#160; DATE=$&#40; date +%Y%m%d &#41; BACKUPDIR=backup-${DATE} &#160; mkdir ${PREFIX}/${BACKUPDIR} [...]]]></description>
			<content:encoded><![CDATA[<p>After a few server crashes I had to write this very same script each time so I better keep it up here and maybe someone find it useful</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #007800;">PREFIX</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>develbackup
<span style="color: #007800;">SVNFOO</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svnuser<span style="color: #000000; font-weight: bold;">/</span>repos<span style="color: #000000; font-weight: bold;">/</span>foo
<span style="color: #007800;">TRACFOO</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svnuser<span style="color: #000000; font-weight: bold;">/</span>trac-env<span style="color: #000000; font-weight: bold;">/</span>foo
&nbsp;
<span style="color: #007800;">DATE</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d <span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">BACKUPDIR</span>=backup-<span style="color: #800000;">${DATE}</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #800000;">${PREFIX}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${BACKUPDIR}</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> dump <span style="color: #800000;">${SVNFOO}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #800000;">${PREFIX}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${BACKUPDIR}</span><span style="color: #000000; font-weight: bold;">/</span>svn-foo.dump.gz
trac-admin <span style="color: #800000;">${TRACFOO}</span> hotcopy <span style="color: #800000;">${PREFIX}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${BACKUPDIR}</span><span style="color: #000000; font-weight: bold;">/</span>trac-foo</pre></td></tr></table></div>

<p>And the crontab line is as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">30</span> <span style="color: #000000;">22</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svnuser<span style="color: #000000; font-weight: bold;">/</span>develbackup.sh</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.gabrielgonzalezgarcia.com/2012/01/28/svn-trac-backu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Papers of the Month: Detecting RF Devices &amp; Embedded Multi-Core</title>
		<link>http://www.gabrielgonzalezgarcia.com/2011/10/03/papers-of-the-month-detecting-rf-devices-embedded-multi-core/</link>
		<comments>http://www.gabrielgonzalezgarcia.com/2011/10/03/papers-of-the-month-detecting-rf-devices-embedded-multi-core/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 06:00:06 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Embedded Systems]]></category>
		<category><![CDATA[General Computing]]></category>
		<category><![CDATA[Papers of the Month]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[embedded systems]]></category>

		<guid isPermaLink="false">http://www.gabrielgonzalezgarcia.com/?p=541</guid>
		<description><![CDATA[Airshark: Detecting Non-WiFi RF Devices using Commodity WiFi Hardware [PDF version] The paper presents a series of techniques which goal is to detect the presence of RF signal from different devices such as bluetooth, Zigbee, etc. They main contributions is the use of commodity WiFi adapters which allows anyone to use the solution proposed. The [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><strong>Airshark: Detecting Non-WiFi RF Devices using Commodity WiFi Hardware </strong><a title="Detecting Non-Wifi RF Signals" href="http://www.gabrielgonzalezgarcia.com/papers/Detecting_Non-WiFi_RF-rayanchu.pdf" target="_blank">[PDF version]</a><strong><br />
</strong></li>
</ul>
<p>The paper presents a series of techniques which goal is to detect the presence of RF signal from different devices such as bluetooth, Zigbee, etc. They main contributions is the use of commodity WiFi adapters which allows anyone to use the solution proposed.</p>
<p>The image below show an schematic view of the process of fingerprinting RF Signals and the pattern matching stage:</p>
<div id="attachment_542" class="wp-caption aligncenter" style="width: 741px"><a href="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/10/airshark-modules.png"><img class="size-large wp-image-542" title="airshark modules" src="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/10/airshark-modules-1024x328.png" alt="airshark modules" width="731" height="234" /></a><p class="wp-caption-text">airshark modules</p></div>
<p style="text-align: center;"><a href="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/10/airshark-modules.png"><br />
</a></p>
<p>The detection rate is pretty awesome as shown in the next table:</p>
<p><center><img class="aligncenter size-full wp-image-543" title="table-airshark" src="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/10/table-airshark.png" alt="" width="629" height="257" /></center></p>
<ul>
<li><strong>Embedded Multicore</strong> <a title="Embedded MultiCore" href="http://www.gabrielgonzalezgarcia.com/papers/EmbeddedMulticore-Freescale.pdf" target="_blank">[PDF Version]</a></li>
</ul>
<p>This paper is pretty long paper by Freescale describing several features of MultiCore Systems from a developer point of view both Operating Systems and application programmers. It covers basic techniques when dealing with MultiCore systems but provides some good aspects to state-of-the-art on this area and where the industry is heading.</p>
<div id="attachment_550" class="wp-caption aligncenter" style="width: 742px"><a href="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/10/qorIQ.png"><img class="size-full wp-image-550" title="Freescale's QorIQ(tm)" src="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/10/qorIQ.png" alt="Freescale's QorIQ(tm)" width="732" height="244" /></a><p class="wp-caption-text">Freescale&#39;s QorIQ(tm)</p></div>
<p style="text-align: center;">
<p> It also describes how virtual platforms allow developers to make better use of these kind of systems for example running a dedicated RTOS in a core a having a general purpose OS in another.</p>
<p>It is a good reading to brush up some concepts and get a better picture since MultiCore System will become the standard in the near future.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gabrielgonzalezgarcia.com/2011/10/03/papers-of-the-month-detecting-rf-devices-embedded-multi-core/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Papers of the Month: Packet Injection &amp; SSD Forensics</title>
		<link>http://www.gabrielgonzalezgarcia.com/2011/08/22/papers-of-the-month-packet-injection-ssd-forensics/</link>
		<comments>http://www.gabrielgonzalezgarcia.com/2011/08/22/papers-of-the-month-packet-injection-ssd-forensics/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 11:11:39 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Papers of the Month]]></category>
		<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[embedded systems]]></category>

		<guid isPermaLink="false">http://www.gabrielgonzalezgarcia.com/?p=512</guid>
		<description><![CDATA[Below you can find a summary of the two more relevant papers I have read in this month: Packets in Packets by Travis Goodspeed et al. [pdf version] This paper present a technique to inject raw frame at Layer 1 from the payload of upper-level Layers, for example HTTP. Tested for  IEEE 802.15.4 and 2-FSK [...]]]></description>
			<content:encoded><![CDATA[<p>Below you can find a summary of the two more relevant papers I have read in this month:</p>
<ul>
<li><strong>Packets in Packets by Travis Goodspeed et al. </strong>[<a href="http://www.gabrielgonzalezgarcia.com/papers/Goodspeed.pdf" target="_blank">pdf version</a>]</li>
</ul>
<p>This paper present a technique to inject raw frame at Layer 1 from the payload of upper-level Layers, for example HTTP. Tested for <a title="IEEE 802.15.4" href="http://en.wikipedia.org/wiki/IEEE_802.15.4" target="_blank"> IEEE 802.15.4</a> and <a title="2-FSK" href="http://en.wikipedia.org/wiki/Frequency-shift_keying" target="_blank">2-FSK</a> radio protocols.</p>
<p>This attack doesn&#8217;t work on encrypted channels since the raw frame inserted in the payload is encrypted too.</p>
<p>The image below shows a representation of the of the attack compared to a normal packet transmission:</p>
<p><center><img class="aligncenter size-full wp-image-514" title="PIP Example" src="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/08/pip-example.png" alt="" width="715" height="215" /></center>The paper present as a real-world example an attack against <a title="ZigBee" href="http://en.wikipedia.org/wiki/ZigBee" target="_blank">ZigBee</a>, which is based in<a title="IEEE 802.15.4" href="http://en.wikipedia.org/wiki/IEEE_802.15.4" target="_blank"> IEEE 802.15.4</a>, the next figure show a ZigBee packet with an embedded raw frame which starts right in the middle of the image, with the preamble 00 00 00 00 and the sync a7, which will cause the receiver to think a new packet is coming:</p>
<p><center><img class="aligncenter size-full wp-image-513" title="Injection in ZigBee" src="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/08/pip-zigbee.png" alt="" width="344" height="215" /></center></p>
<ul>
<li><strong>Empirical Analysis of Solid State Disk Data Retention when used with Contemporary Operating Systems by Christopher King et al.</strong> [<a href="http://www.gabrielgonzalezgarcia.com/papers/17-349.pdf" target="_blank">pdf version</a>]</li>
</ul>
<div>This paper present an analysis of 16 different disks and discusses the data recovery problems when TRIM command is used. The experiment shows that when TRIM is in place only 27% of blocks are recoverable, when without it nearly all can be recovered.</div>
<div>TRIM Command allows operating system changes garbage collection marking blocks as deleted telling the garbage collector to add those blocks to the free pool maintaining performance of SSDs.</div>
<div>They have only analyzed Windows 7 and Windows XP, I would like to see some future work showing results of other OSs including Unixes.</div>
<div>The following two figures show results for these two operating systems, show that when <strong>TRIM, Windows 7 and Intel&#8217;s SSDs are used together 0% of the data was recovered.</strong></div>
<div><center><img class="aligncenter size-full wp-image-529" title="ssd-win7" src="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/08/ssd-win7.png" alt="" width="699" height="388" /></center><center><img class="aligncenter size-full wp-image-528" title="ssd-winxp" src="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/08/ssd-winxp.png" alt="" width="699" height="349" /></center></div>
]]></content:encoded>
			<wfw:commentRss>http://www.gabrielgonzalezgarcia.com/2011/08/22/papers-of-the-month-packet-injection-ssd-forensics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Testing Strategies</title>
		<link>http://www.gabrielgonzalezgarcia.com/2011/07/24/software-testing-strategies/</link>
		<comments>http://www.gabrielgonzalezgarcia.com/2011/07/24/software-testing-strategies/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 19:23:23 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://www.gabrielgonzalezgarcia.com/?p=498</guid>
		<description><![CDATA[Software testing belongs to a wider topic, Verification and Validation, where testing procedures try to achieve these goals. Verification: Check whether we are building the product right Validation: Whether we are building the right product Some authors propose several strategies to improve software testing results: Quantify Requirements long before the testing begins: So testers can [...]]]></description>
			<content:encoded><![CDATA[<p>Software testing belongs to a wider topic, <em>Verification</em> and <em>Validation</em>, where testing procedures try to achieve these goals.</p>
<ul>
<li><strong>Verification</strong>: Check whether we are building the <em>product right</em></li>
<li><strong>Validation</strong>: Whether we are building the <em>right product</em></li>
</ul>
<p>Some authors propose several strategies to improve software testing results:</p>
<ul>
<li><em>Quantify Requirements long before the testing begins</em>: So testers can measure how close the product is to the client&#8217;s idea.</li>
<li><em>Specify testing goals</em>: Time between failures, cost of fixing a failure, etc</li>
<li><em>Understand the client&#8217;s behaviour and develop a profile</em>:  Focus software testing on its real usage</li>
<li><em>Testing plan featuring &#8216;Quick Testing Cycles&#8217;</em></li>
<li><em>Self-ControlProduct</em>: Failure detection</li>
<li><em>Formal Testing Techniques</em>: (Alright, they might be cool but too expensive)</li>
<li><em>Continuous Integration</em></li>
</ul>
<p><strong> Strategies for Testing Software</strong></p>
<p><center><img class="size-full wp-image-499 aligncenter" title="SoftwareTestingStrategies" src="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/07/SoftwareTestingStrategies.png" alt="" width="362" height="235" /></center></p>
<p><em>Unit Testing:</em></p>
<ul>
<li>Verification of each module to check whether it implements the contract it relays on.</li>
<li>Since some other components it depends on might not be yet available, some interface simulation must be developed.</li>
</ul>
<p><em>Integration Testing:</em></p>
<ul>
<li>The goal of this process is to test the interaction between modules and prevent any problema when interconecting interfaces</li>
<li>Top-Botton Aproach needs to generate simulators for no yet available modules</li>
<li>Bottom-Up Approach tests first low-level modules and keeps adding higher-level ones so no simulation is needed</li>
<li>Regression Tests are needed to be sure that when some modules has been modified all other keeps working ok</li>
<li>Smoke Testing is a lightweight tests which aims to detect problem in a early stage. It must be tested daily</li>
</ul>
<p><em>Validation</em></p>
<ul>
<li>Focuses to check whether the product stays close to the requirements</li>
<li>Uses Alpha (developer + user) and Beta (only user) tests</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gabrielgonzalezgarcia.com/2011/07/24/software-testing-strategies/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Understanding CAN Protocols I</title>
		<link>http://www.gabrielgonzalezgarcia.com/2011/06/21/understanding-can-protocols-i/</link>
		<comments>http://www.gabrielgonzalezgarcia.com/2011/06/21/understanding-can-protocols-i/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 17:17:31 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Embedded Systems]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[CAN]]></category>
		<category><![CDATA[CANBus]]></category>
		<category><![CDATA[CANOpen]]></category>
		<category><![CDATA[embedded systems]]></category>

		<guid isPermaLink="false">http://www.gabrielgonzalezgarcia.com/?p=450</guid>
		<description><![CDATA[&#160; This is the first article in a serie about CANBus and higher-level protocols, which are extensibily used in Industrial environtmens along with Embedded Systems. CANBus standard describes only the layer 1 and 2, from an OSI point of view, dealing with physical and datalink activities. On the other hand, CANOpen is a protocol which [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>This is the first article in a serie about <strong>CANBus </strong>and higher-level protocols, which are extensibily used in Industrial environtmens along with Embedded Systems.</p>
<p><strong>CANBus </strong>standard describes only the layer 1 and 2, from an OSI point of view, dealing with physical and datalink activities. On the other hand, <strong>CANOpen </strong>is a protocol which lies in the OSI layer 7.</p>
<p>There is no need for intermediate layers in these kind of busses since all of them belong to the same network segment; neither the notion of session is available in CAN networks.</p>
<p>&nbsp;</p>
<div id="attachment_452" class="wp-caption aligncenter" style="width: 550px"><img class="size-full wp-image-452" title="CANBus" src="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/06/CANBus.png" alt="CANBus" width="540" height="230" /><p class="wp-caption-text">CANBus</p></div>
<p>As can be seen in the image above, <strong>CANBus </strong>uses two wires for the communication bus and transceiver only need hook these two lines (and the ground). In some representations, as the above, you may see the bus both sides ended, this is usually done by a 120 Ohms resistor which is only mandatory when the bus exceeds a normal length.</p>
<p>For now, the fields, in a <strong>CANBus Frame</strong>, we are going to care about are identifier, which is 11 bit wide in the base version, and the data field holding as much as 8 bytes in each frame, the rest of the fields deal with synchronization of frames and error checking, you can find them in <a title="CAN Data Frame" href="http://en.wikipedia.org/wiki/Controller_Area_Network#Data_frame" target="_blank">Wikipedia CAN Entry.</a></p>
<p>&nbsp;</p>
<p><strong>CANOpen</strong></p>
<p><strong>CANOpen</strong> is a protocol built on top of <strong>CAN</strong>, but can run in different link layers, which implements an object centric message system. The main entity in <strong>CANOpen </strong>is the <strong><em>Object Dictionary</em></strong>, which is a description of all the objects supported by an specific device, it doesn&#8217;t matter the format it is delivered in as long as both side of the communication are aware of it. The protocol is profile based defining each of them different objects that must be implemented by the device</p>
<p>Each Object has its own 16bit wide index and another 8bit wide address for referecing subdata fields.  As can be seen in the next table there range of these address which are mapped to specific functions described in different profiles e.g. CiA 301 (communication profile area):</p>
<p>&nbsp;<br />
<center><br />
<table width="337" height="248">
<tbody>
<tr>
<th>Index</th>
<th>Object</th>
</tr>
<tr>
<td>0000</td>
<td>Not Used</td>
</tr>
<tr>
<td>0001 &#8211; 001F</td>
<td>Static Data Types (Boolean, Integer16, etc)</td>
</tr>
<tr>
<td>0020 &#8211; 003F</td>
<td>Complex Data Types</td>
</tr>
<tr>
<td>0040 &#8211; 005F</td>
<td>Manufacturer Specific Complex Data Types</td>
</tr>
<tr>
<td>0060 &#8211; 007F</td>
<td>Device Profile Specific Static Data Types</td>
</tr>
<tr>
<td>0080 &#8211; 009F</td>
<td>Device Profile Specific Complex Data Types</td>
</tr>
<tr>
<td>00A0 &#8211; 0FFF</td>
<td>reserved</td>
</tr>
<tr>
<td>1000- 1FFF</td>
<td>Communication Profile Area</td>
</tr>
<tr>
<td>2000 &#8211; 5FFF</td>
<td>Manufacturer Specific Profile Area</td>
</tr>
<tr>
<td>6000 &#8211; 9FFF</td>
<td>Standardised Device Profile Area</td>
</tr>
<tr>
<td>A000 &#8211; FFFF</td>
<td>reserved</td>
</tr>
</tbody>
</table>
<p></center><br />
In order to simplify communication in CANOpen redefines the CAN identification scheme as follow and renaming it as COB-ID:</p>
<p><center><img class="size-full wp-image-465 aligncenter" title="COB-ID" src="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/06/COB-ID.png" alt="COB-ID" width="415" height="106" /></center></p>
<p>So with this new specification we have 4 bits to specify the function the message is requesting to perform and 7 bits spare for device&#8217;s ID which span from 1 to 127, being 0 forbidden.</p>
<p>Function Codes can be either pre-defined by the standard or custom, modified after the devices powers-up.</p>
<p>The tables below shows the configuration for the pre-defined connection set; the first for broadcast messages and the second one for peer-to-peer object messages:<br />
<center><br />
<table>
<tbody>
<tr>
<th>Object</th>
<th>Function Code</th>
<th>COB-ID</th>
<th>Communication Parameters at OD idx</th>
</tr>
<tr>
<td>NMT Module Control</td>
<td>0000</td>
<td>000h</td>
<td>-</td>
</tr>
<tr>
<td>SYNC</td>
<td>0001</td>
<td>080h</td>
<td>1005h, 1006h, 1007h</td>
</tr>
<tr>
<td>TIME STAMP</td>
<td>0010</td>
<td>100h</td>
<td>1012h, 1013h</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<th>Object</th>
<th>Function Code</th>
<th>COB-ID</th>
<th>Communication Parameters at OD idx</th>
</tr>
<tr>
<td>EMERGENCY</td>
<td>0001</td>
<td>081h &#8211; 0FFh</td>
<td>1024h, 1015h</td>
</tr>
<tr>
<td>PD0 1 (transmit)</td>
<td>0011</td>
<td>181h &#8211; 1FFh</td>
<td>1800h</td>
</tr>
<tr>
<td>PD0 1 (receive)</td>
<td>0100</td>
<td>201h &#8211; 27Fh</td>
<td>1400h</td>
</tr>
<tr>
<td>PD0 2 (transmit)</td>
<td>0101</td>
<td>281h &#8211; 2FFh</td>
<td>1801h</td>
</tr>
<tr>
<td>PD0 2 (receive)</td>
<td>0110</td>
<td>301h &#8211; 37Fh</td>
<td>1401h</td>
</tr>
<tr>
<td>PD0 3 (transmit)</td>
<td>0111</td>
<td>381h &#8211; 3FFh</td>
<td>1802h</td>
</tr>
<tr>
<td>PD0 3 (receive)</td>
<td>1000</td>
<td>401h &#8211; 47Fh</td>
<td>1402h</td>
</tr>
<tr>
<td>PD0 4 (transmit)</td>
<td>1001</td>
<td>481h &#8211; 4FFh</td>
<td>1803h</td>
</tr>
<tr>
<td>PD0 4 (receive)</td>
<td>1010</td>
<td>501h &#8211; 57Fh</td>
<td>1403h</td>
</tr>
<tr>
<td>SDO (transmit/server)</td>
<td>1011</td>
<td>581h &#8211; 5FFh</td>
<td>1200h</td>
</tr>
<tr>
<td>PD0 4 (receive/client)</td>
<td>1100</td>
<td>601h &#8211; 67Fh</td>
<td>1200h</td>
</tr>
<tr>
<td>NMT Error Control</td>
<td>1110</td>
<td>701h &#8211; 77Fh</td>
<td>1016h, 1017h</td>
</tr>
</tbody>
</table>
<p></center><br />
<strong>Type of CANOpen Message</strong></p>
<p>&nbsp;</p>
<p><em>Administrative Messages:</em></p>
<ul>
<li>This messages fall in the category of Master &#8211; Slave communication such as those dealing with initialization or  network configuration. As an example <strong>NMT </strong>is used to initialize, start/stop nodes, etc</li>
</ul>
<p><em>Service Data messages (SDO):</em></p>
<ul>
<li>This messages provide access to device&#8217;s objects using the Object Dictionary index and subindex and allows data transfer of any length.</li>
<li>Each message needs to be confirmed and each request / reply transports 8 bytes rendering this kind of service not suitable for RT data transfer.</li>
</ul>
<p><em>Process Data Object (PDO):</em></p>
<ul>
<li>Used to transfer RT data from one producer to several consumers and each message is limited up to 8 Bytes.</li>
<li>Each PDO is described by two objects, one for setting the COB-ID, transmission type, inhibit time and timer period and the other to map list of objects from the Object Dictionary mapped into the PDO.</li>
<li>The objects mapped to a PDO are configured using SDO messages.</li>
<li>There are to modes: SYNC (triggered by a SYNC object, ASYNC (triggered by a device event)</li>
<li>Inhibite time: Minimun time betweet 2 PDOs</li>
<li>Event Timer: Transmission Trigger</li>
</ul>
<p><em>Predefined Messages:</em></p>
<ul>
<li>SYNC: Used to synchronized operations across the network, when device receive a SYNC message the perform the expected action.</li>
<li>Time &#8211; Stamp: Common time frame reference</li>
<li>Emergency: Triggered by an error in a device</li>
<li>Node/Life Guarding: Monitor state of Devices, detects network errors, etc</li>
<li>Boot-up: By sending an NMT message the slave change from state Initialising to Preoperational</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gabrielgonzalezgarcia.com/2011/06/21/understanding-can-protocols-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Man In Remote</title>
		<link>http://www.gabrielgonzalezgarcia.com/2011/04/18/man-in-remote/</link>
		<comments>http://www.gabrielgonzalezgarcia.com/2011/04/18/man-in-remote/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 09:53:19 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.gabrielgonzalezgarcia.com/?p=436</guid>
		<description><![CDATA[&#160; Man In Remote Setup After presenting this talk first at RootedCon and a month later at Hackito Ergo Sum the time for releasing the code behind it has arrived. To understand the source code, you only need to have a look at the deployment diagram where the attacker is drawn in red and the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">&nbsp;</p>
<div class="mceTemp mceIEcenter" style="text-align: left;">
<dl id="attachment_437" class="wp-caption   aligncenter" style="width: 530px;">
<dt class="wp-caption-dt"><a href="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/04/MiR-Setup.png"><img class="size-full wp-image-437 " title="Man In Remote Setup" src="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/04/MiR-Setup.png" alt="Man In Remote Setup" width="520" height="272" /></a></dt>
<dd class="wp-caption-dd">Man In Remote Setup</dd>
</dl>
</div>
<p style="text-align: left;">After presenting this talk first at <a title="RootedCON" href="http://www.rootedcon.es" target="_blank">RootedCon</a> and a month later at <a title="Hackito Ergo Sum" href="http://www.hackitoergosum.org" target="_blank">Hackito Ergo Sum</a> the time for releasing the code behind it has arrived.</p>
<p style="text-align: left;">To understand the source code, you only need to have a look at the deployment diagram where the attacker is drawn in red and the victim in green.<span id="more-436"></span>They have been designed as two independent components which exchange method invocations using a simple Marshalling/UnMarshalling scheme.</p>
<p style="text-align: left;">Although the proof is conceptually multiplatform I have only implemented the windows part so the source code is a Microsoft Visual Studio Solution with two projects, Attacker and Victim.</p>
<p style="text-align: left;"><strong>Attacker</strong></p>
<ul>
<li>It is a dll implementing the PKCS#11 API ready to be added as a Security Device in Firefox as follows: Tools-&gt;Options-&gt;Encryption Tab-&gt;Security Devices-&gt;Load</li>
<li>Instead of accessing any local device each method marshalls the parameters and sends them to the remote peer then  waiting for the response to arrive.</li>
<li>A file at C:\pkcs11-ip.cfg must contain the IP address where the library will be sending requests.</li>
</ul>
<p><strong>Victim</strong></p>
<ul>
<li>Binds a socket and waits for PKCS#11 requests to arrive</li>
<li>After a new request has been read, the official PKCS#11 library is used to perform the selected operation and retrieve its output sending it back to the Attacker.</li>
</ul>
<p style="text-align: left;">I have uploaded the <a title="Man In Remote" href="https://github.com/ggonzalez/Man-In-Remote" target="_blank">source code to github</a>, it is provided with known issues so do not blame for them, this is just a PoC.</p>
<p style="text-align: left;">Here you can find the presentation in <a title="Man In Remote" href="http://www.slideshare.net/rootedcon/gabriel-gonzalez-maninremote-pkcs11-for-fun-and-nonprofit-rootedcon-2011" target="_blank">Spanish</a> and here in <a title="Man In Remote" href="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/04/Man_In_Remote_-_HES2011.pdf" target="_blank">English</a>, they are pretty much the same.</p>
<p style="text-align: left;">Any question, bug, improvement, whatever please leave a comment below!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gabrielgonzalezgarcia.com/2011/04/18/man-in-remote/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Embedded System Development: QEMU + BuildRoot + Linux ARM</title>
		<link>http://www.gabrielgonzalezgarcia.com/2011/02/21/embedded-system-development-qemu-buildroot-linux-arm/</link>
		<comments>http://www.gabrielgonzalezgarcia.com/2011/02/21/embedded-system-development-qemu-buildroot-linux-arm/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 10:00:04 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Embedded Systems]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[UNIX world]]></category>
		<category><![CDATA[computer engineering]]></category>
		<category><![CDATA[embedded systems]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.gabrielgonzalezgarcia.com/?p=368</guid>
		<description><![CDATA[Here are some basic steps to get a virtual ARM Development board which will allows to practice our embedded systems skills or test code / firmware or whatever we want to do but without the need of having a physical device. The following takes place in a Linux machine running on Virtual Box (512MB RAM), [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_384" class="wp-caption alignleft" style="width: 395px"><a href="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/02/qemu-linux-arm.png"><img class="size-full wp-image-384 " title="QEMU + Linux + BuildRoot" src="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/02/qemu-linux-arm.png" alt="QEMU + Linux + BuildRoot" width="385" height="245" /></a><p class="wp-caption-text">QEMU + Linux + BuildRoot</p></div>
<p>Here are some basic steps to get a virtual ARM Development board which will allows to practice our embedded systems skills or test code / firmware or whatever we want to do but without the need of having a physical device.</p>
<p>The following takes place in a Linux machine running on Virtual Box (512MB RAM), which I first thought would&#8217;ve taken much more time to compile the whole stuff but it only took ~2h.</p>
<p>For the whole procedure you are gonna need some development packages such as gcc, g++, bison, flex, gettext, texinfo, zlib, ncurses, uml-utilities and maybe others, just install them when the process complains.</p>
<p><strong><div class="woo-sc-divider flat"></div>  First Step</strong>: Setting up the Environment</p>
<p>We need to make use of tun/tap device to create a local lan in order to let the embedded linux find the NFS mount point.</p>
<ul>
<li>Setting up tap0:</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ sudo tunctl -u youruser
&nbsp;
Set 'tap0' persistent owned by 10101
&nbsp;
$ sudo ifconfig tap0 192.168.10.1 up</pre></div></div>

<ul>
<li>Setting up NFS mount point:</li>
</ul>
<p>Since we want this set-up for development I assume we want to add new binaries or modify configuration on-the-fly so I have created ~/root-nfs where the file system for our embedded device will reside. Update /etc/exports appropriately:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ echo &quot;/home/someuser/root-nfs&quot; 192.168.10.0/192.168.10.255(rw, sync,no_root_squash)&quot; &amp;gt; /etc/exports</pre></div></div>

<p>Remember the no_root_squash method or files only accessible by root will no be exported through NFS.</p>
<p><strong>Second Step:</strong> Configuring <strong>QEMU</strong></p>
<p>Grab the source from <a href="http://www.qemu.org">www.qemu.org</a> and compile it, or if you prefer just used some prebuilt binaries. It shouldn&#8217;t make any difference.</p>
<p><strong>QEMU </strong>not only emulate CPUs but also a bunch of development boards with its attached hardware so you can run real software that interacts with the ethernet or whatever other peripheral available.</p>
<p>For our purpose we are going to use <strong><em>versatilepb</em> </strong>which is an <strong>ARM</strong> based development board which you can <a href="http://www.arm.com/products/tools/development-boards/versatile/index.php">physically have it</a> but thanks to <strong>QEMU</strong> we can use a virtual one.</p>
<p>The only thing you need be sure when configuring/compiling/installing <strong>QEMU </strong>is that it supports <strong>ARM</strong> as target and the <em><strong>versatilepb </strong></em>machine is available.</p>
<p><strong>Third Step</strong>: Getting <strong>BuildRoot</strong></p>
<p>Buildroot is a great framework for crosscompiling, targeting mainly embedded systems. It is a bunch of Makefiles and configuration files which automatizes the toolchain generation for the target platform, building bootloader, kernel, libraries, binaries and preparing the appropriate images for booting a device.</p>
<p>The configuration is pretty similar to the Linux Kernel so if you are used to deal with menuconfig this will not show any difficult to you.</p>
<p>After  decompressing buildroot we have to perform some minor configuration to produce the binaries we need for our target device.</p>
<p>Just type:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ make menuconfig</pre></div></div>

<p>And change the following entries:</p>
<ul>
<li>Target Architecture = arm</li>
<li>Target Architecture Variant = generic_arm</li>
<li>Target ABI = EABI</li>
<li>Target Options -&gt; Generic Serial Port Config -&gt; serial port to run getty on (ttyAMA0)</li>
<li>Package Selection, make sure Busybox is selected</li>
<li>Target FileSystem Options -&gt; check tar the root filesystem</li>
<li>Kernel -&gt; set deconfig name to &#8220;versatile&#8221;</li>
<li>Kernel -&gt; Kernel binary format to zImage</li>
</ul>
<p>Afterwards do:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ make linux26-menuconfig</pre></div></div>

<p>Accept the default configurations and change anything you feel like changing</p>
<p>Note: I had a problem with the provided fakeroot version so I downloaded the fakeroot_1.11 from the <a href="http://ftp.debian.org/debian/pool/main/f/fakeroot/">debian repository</a> and copied it to buildroot/dl/ (which is the place where downloaded packages are stored) and changed the verson to 1.11 in buildroot/packages/fakeroot/fakeroot.mk and then make again.</p>
<p>Just type:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ make</pre></div></div>

<p>And let the whole Makefiles produce the desired images!</p>
<p>They will be placed under buildroot/output/images, there you will find the zImage and the root.tar containing a whole filesystem with everything need to boot a Linux Operating System.</p>
<p><strong>Final Step</strong>: Booting QEMU</p>
<p>Just before booting we should uncompress the root fs to the exported NFS directory as root, otherwise the special files under /dev will not be properly created which will stop our system working properly.</p>
<p>Now we just need to tell qemu the following parameters to run our system:</p>
<ul>
<li>-M versatilepb # our target platform</li>
<li>-kernel buildroot/output/image/zImage # our generated kernel image targeting ARM</li>
<li>-net nic # so qemu emuletes a NIC interfaces as part of the versatilepb platform</li>
<li>-net tap,ifname=tap0,script=no # tell qemu to link the emulated NIC to the preconfigured tap device</li>
<li>-append &#8220;console=ttyAMA0 root=/dev/nfs rw nfsroot=192.168.10.1:/home/someuser/root-nfs ip=192.168.10.2&#8243; # to instruct the booted linux kernel to search for the root-fs in the specified NFS server using the provided ip as its own</li>
<li>-nographic # to output everything to stdout</li>
</ul>
<p>And all together:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">qemu-system-arm -M versatilepb -kernel buildroot/output/image/zImage -net nic -net tap,ifname=tap0,script=no append &quot;console=ttyAMA0 root=/dev/nfs rw nfsroot=192.168.10.1:/home/someuser/root-nfs ip=192.168.10.2&quot; -nographic</pre></div></div>

<p>Now you should see the booting process of Linux and then the busybox login, as seen in the image above; just use root and no password to log in.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gabrielgonzalezgarcia.com/2011/02/21/embedded-system-development-qemu-buildroot-linux-arm/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Introduction to the Personal Software Process</title>
		<link>http://www.gabrielgonzalezgarcia.com/2011/02/19/introduction-to-the-personal-software-process/</link>
		<comments>http://www.gabrielgonzalezgarcia.com/2011/02/19/introduction-to-the-personal-software-process/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 09:15:12 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://www.gabrielgonzalezgarcia.com/?p=353</guid>
		<description><![CDATA[The book is written in a pretty informal way, the author seems to talk to his son or someone really close, which I don&#8217;t really mind but, from my point of view, adds extra literature not necessary at all to explain the PSP. The author focuses in two aspects along the book, measuring / planning and defects. [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_354" class="wp-caption alignleft" style="width: 210px"><a href="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/02/introduction_to_psp.jpg"><img class="size-full wp-image-354 " title="Introduction to the PSP" src="http://www.gabrielgonzalezgarcia.com/wp-content/uploads/2011/02/introduction_to_psp.jpg" alt="Introduction to the PSP" width="200" height="332" /></a><p class="wp-caption-text">Introduction to the PSP</p></div>
<p>The book is written in a pretty informal way, the author seems to talk to his son or someone really close, which I don&#8217;t really mind but, from my point of view, adds extra literature not necessary at all to explain the PSP.</p>
<p>The author focuses in two aspects along the book, measuring / planning and defects. The most valuable part and which I found more interesting is the one dealing with personal planning since it can help you not only when dealing with software projects but in your real life.</p>
<p>I really think that applying techniques such as registering tasks durations, interruptions management and creating week summary can help you become more productive and eliminate those periods of the day you think you are working but your not.</p>
<p>I also agree with the author that using his techniques you can become more realistic when planning a new project I think it is not because of the whole planning stuff but you can know exactly how many time are you really working in your projects without all that bloat of interruptions.</p>
<p>The part I don&#8217;t really like is the second half of the book which focuses in dealing with defects. The author ideas are only applicable when dealing with beginners defects and I don&#8217;t find useful any of the metrics he proposes.</p>
<p>In few words, this books is worth reading if you feel you are wasting your time and want to become more productive and/or want to make sure you can make realistic project plans.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gabrielgonzalezgarcia.com/2011/02/19/introduction-to-the-personal-software-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design Quality Guidelines</title>
		<link>http://www.gabrielgonzalezgarcia.com/2011/02/09/design-quality-guidelines/</link>
		<comments>http://www.gabrielgonzalezgarcia.com/2011/02/09/design-quality-guidelines/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 12:36:10 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://www.advansen.com/?p=342</guid>
		<description><![CDATA[These guidelines are extracted and transformed from the Pressman&#8217;s &#8220;Software Engineering&#8221; book: A design must present an architecture built using known pattern designs, components with the right characteristics and that can be implemented in an incremental way. Must be modular, divided in subsystems Must lead to interfaces which reduce the complexity when connecting components Must be generated [...]]]></description>
			<content:encoded><![CDATA[<p>These guidelines are extracted and transformed from the Pressman&#8217;s <a href="http://www.amazon.com/Software-Engineering-Practitioners-Roger-Pressman/dp/0073375977/ref=ntt_at_ep_dpt_1">&#8220;Software Engineering&#8221; book</a>:</p>
<ul>
<li>A design must present an architecture built using known pattern designs, components with the right characteristics and that can be implemented in an incremental way.</li>
<li>Must be modular, divided in subsystems</li>
<li>Must lead to interfaces which reduce the complexity when connecting components</li>
<li>Must be generated from a reproducible method and the information produced during the analysis</li>
<li>Must use notation to express its meaning correctly</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gabrielgonzalezgarcia.com/2011/02/09/design-quality-guidelines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cost of Quality (COQ)</title>
		<link>http://www.gabrielgonzalezgarcia.com/2011/02/04/cost-of-quality-coq/</link>
		<comments>http://www.gabrielgonzalezgarcia.com/2011/02/04/cost-of-quality-coq/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 10:56:15 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://www.advansen.com/?p=337</guid>
		<description><![CDATA[To balance the quality of a product and the time spent looking for failures, we need some measurement to estimate how well we are doing. COQ takes into account the following costs: Failure costs: All costs of fixing a defect e.g. Patching a deployed product, using the debugger, reviewing code, etc Appraisal costs: Work done [...]]]></description>
			<content:encoded><![CDATA[<p>To balance the quality of a product and the time spent looking for failures, we need some measurement to estimate how well we are doing.</p>
<p>COQ takes into account the following costs:</p>
<ul>
<li><strong>Failure costs</strong>: All costs of fixing a defect e.g. Patching a deployed product, using the debugger, reviewing code, etc</li>
<li><strong>Appraisal costs</strong>: Work done evaluating whether a product has defects, excluding time spend on fixing them.</li>
<li><strong>Prevention costs</strong>: Resources used to improve the process to reduce the number of defects.</li>
</ul>
<p>Following I will describe the <a href="http://en.wikipedia.org/wiki/Personal_Software_Process">PSP </a>approximation to COQ a simplified way of calculating this measurement. The author states than this version of COQ shows the same effectiveness as the long COQ version.</p>
<ul>
<li>Failure costs: all compiling time, all testing time.</li>
<li>Appraisal cost: All review time</li>
</ul>
<p>Cost of Quality is calculated as a percentage of total development time:</p>
<ul>
<li><strong>Appraisal COQ</strong>: Sum of all review time as percentage of total development time.</li>
<li><strong>Failure COQ</strong>: Sum of all compile and test time as percentage of total development time.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gabrielgonzalezgarcia.com/2011/02/04/cost-of-quality-coq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

