<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Nat on yomimono - something to read</title>
    <link>http://localhost:1313/tags/nat/</link>
    <description>Recent content in Nat on yomimono - something to read</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 09 Oct 2017 00:03:00 +0000</lastBuildDate>
    <atom:link href="http://localhost:1313/tags/nat/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>NAT your own packets</title>
      <link>http://localhost:1313/post/2017-10-09-nat-your-own-packets/</link>
      <pubDate>Mon, 09 Oct 2017 00:03:00 +0000</pubDate>
      <guid>http://localhost:1313/post/2017-10-09-nat-your-own-packets/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve been talking about &lt;a href=&#34;http://localhost:1313/blog/2015/04/01/things-routers-do-network-address-translation/&#34;&gt;network address translation&lt;/a&gt; here for a while, including &lt;a href=&#34;http://localhost:1313/blog/2015/04/02/lets-play-network-address-translation/&#34;&gt;instructions on building your own NAT device&lt;/a&gt; with MirageOS. The library behind those posts, &lt;a href=&#34;https://github.com/mirage/mirage-nat&#34;&gt;mirage-nat&lt;/a&gt;, went on to back &lt;a href=&#34;https://github.com/talex5/qubes-mirage-firewall&#34;&gt;talex5&amp;rsquo;s unikernel firewall for QubesOS&lt;/a&gt;, but was unreleased and essentially unmaintained between late 2015 and early 2017.&lt;/p&gt;&#xA;&lt;p&gt;At the &lt;a href=&#34;https://mirage.io/blog/2017-march-hackathon-roundup&#34;&gt;March 2017 MirageOS hack retreat&lt;/a&gt; in Marrakesh, talex5 convinced me to do some much-needed maintenance on this library. After having let it age between March and October, I was persuaded to release &lt;a href=&#34;https://github.com/mirage/mirage-nat/releases/tag/v1.0.0&#34;&gt;a version with the hippest latest build system&lt;/a&gt; last week. It comes with &lt;a href=&#34;https://github.com/mirage/mirage-nat/tree/master/example&#34;&gt;an example of how you might use it&lt;/a&gt; in a MirageOS unikernel that does no additional firewalling. A more compelling example of how you might use mirage-nat (and MirageOS) is still available in &lt;a href=&#34;https://github.com/talex5/qubes-mirage-firewall&#34;&gt;qubes-mirage-firewall&lt;/a&gt;, which I recommend highly if you’re using QubesOS.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Let&#39;s Play Network Address Translation: The Home Game</title>
      <link>http://localhost:1313/blog/2015/04/02/lets-play-network-address-translation/</link>
      <pubDate>Thu, 02 Apr 2015 14:53:00 +0000</pubDate>
      <guid>http://localhost:1313/blog/2015/04/02/lets-play-network-address-translation/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://localhost:1313/blog/2015/04/05/things-routers-do-network-address-translation/&#34;&gt;When last we spoke&lt;/a&gt;, I left you with a teaser about writing your own NAT implementation.  &lt;code&gt;iptables&lt;/code&gt; (and friends &lt;code&gt;nftables&lt;/code&gt; and &lt;code&gt;pf&lt;/code&gt;, to be a little less partisan and outdated) provide the interfaces to the kernel modules that implement NAT in many widely-used routers.  If we wanted to implement our own in a traditional OS, we&amp;rsquo;d have to either &lt;a href=&#34;http://kernelnewbies.org/FAQ&#34;&gt;take a big dive into kernel programming&lt;/a&gt; or &lt;a href=&#34;https://github.com/pkelsey/libuinet&#34;&gt;find a way to manipulate packets at the Ethernet layer in userspace&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;But if all we need to do is NAT traffic, why not just build something that only knows how to NAT traffic?  I&amp;rsquo;ve looked at building networked applications on top of (and with) the full network stack provided by the &lt;a href=&#34;http://openmirage.org&#34;&gt;MirageOS&lt;/a&gt; library OS a lot, but we can also build lower-level applications with fundamentally the same programming tactics and tools we use to write, for example, &lt;a href=&#34;http://hh360.user.srcf.net/blog/2015/03/part-3-running-your-own-dns-resolver-with-mirageos/&#34;&gt;DNS resolvers&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;building-a-typical-stack-from-scratch&#34;&gt;Building A Typical Stack From Scratch&lt;/h2&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s have a look at the &lt;code&gt;ethif-v4&lt;/code&gt; example in the &lt;a href=&#34;http://github.com/mirage/mirage-skeleton&#34;&gt;mirage-skeleton example repository&lt;/a&gt;.  This example unikernel shows how to build a network stack &amp;ldquo;by hand&amp;rdquo; from a bunch of different functors, starting from a physical device (provided by &lt;code&gt;config.ml&lt;/code&gt; at build time, representing either a Xen backend if you configure with &lt;code&gt;mirage configure --xen&lt;/code&gt; or a Unix tuntap backend if you build with &lt;code&gt;mirage configure --unix&lt;/code&gt;).  I&amp;rsquo;ve reproduced the network setup bits from &lt;a href=&#34;https://github.com/mirage/mirage-skeleton/blob/694162bfa37b055786a1f4a0bb4c9ca7f08c9ef0/ethifv4/unikernel.ml&#34;&gt;the most recent version as of now&lt;/a&gt; and annotated them a bit:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Things Routers Do: Network Address Translation</title>
      <link>http://localhost:1313/blog/2015/04/01/things-routers-do-network-address-translation/</link>
      <pubDate>Wed, 01 Apr 2015 11:40:47 +0000</pubDate>
      <guid>http://localhost:1313/blog/2015/04/01/things-routers-do-network-address-translation/</guid>
      <description>&lt;p&gt;WiFi is fairly ubiquitous in 2015.  In most of the nonprofessional contexts in which we use it, it&amp;rsquo;s provided by a small box that&amp;rsquo;s plugged into mains power and an Ethernet cable, usually with an antenna or two sticking out of it.  I&amp;rsquo;ve heard these boxes called all kinds of things - hotspots, middleboxes, edge routers, home routers, NAT devices, gateways, and probably a few more I&amp;rsquo;ve forgotten; there are surely more I haven&amp;rsquo;t heard.  &amp;ldquo;Router&amp;rdquo; is the word I hear and use most often myself, despite the unfortunate overlap with a more specific meaning (a device with multiple network links, capable of sending traffic between them).  There are an awful lot of things these boxes do which aren&amp;rsquo;t implied by &amp;ldquo;router&amp;rdquo;!&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
