{"id":8,"date":"2006-05-15T11:09:43","date_gmt":"2006-05-15T18:09:43","guid":{"rendered":"http:\/\/www.freesoft.org\/blogs\/newnet\/?p=8"},"modified":"2008-05-28T23:48:30","modified_gmt":"2008-05-29T06:48:30","slug":"nat-and-the-failure-of-source-routing","status":"publish","type":"post","link":"https:\/\/www.freesoft.org\/blogs\/soapbox\/nat-and-the-failure-of-source-routing\/","title":{"rendered":"NAT and the Failure of Source Routing"},"content":{"rendered":"<p><a href=\"http:\/\/www.cs.cornell.edu\/People\/francis\/\">Paul Francis<\/a>, in the conclusion of <a href=\"http:\/\/citeseer.ist.psu.edu\/francis94addressing.html\">his 1994 Ph.D. thesis<\/a>, traces the evolution of the IPv4 address scheme.  After quoting a June 1978 Clark\/Cohen paper (IEN 46), Francis notes:<\/p>\n<ul>\n<p>Well, something happened here.  An argument was put forth that 32 bits is enough because the address does not have to do routing &#8211; the source route can handle the rest.  Clearly it was recognized that a variable length <i>something<\/i> was needed, but the source route was deemed sufficient for that, and the 32-bit address won out in the end.  So, perhaps what killed IP is not that the address is too short (though probably it is), but that the ability for DNS to hand a host a source route (which it could then put in the header so that the right thing could happen in the network) was not created.<\/p>\n<p>(p. 177)\n<\/ul>\n<p>Not only did the failure to fully implement source routing (in DNS) make it impossible to address into a private network, it also created the situation where NAT had to be implemented as it was.<\/p>\n<p><!--more--><\/p>\n<p>Consider the following network:<\/p>\n<pre>\r\n          \/----------X-Y------------\r\n         \/          \/   \\\\           \\\\\r\n        \/          \/     \\\\   public  \\\\\r\n       \/ 10.0.0.0 \/       \\\\    net    \\\\\r\n      \/          \/         \\\\           \\\\\r\n     H1---------\/           \\\\-----------H2\r\n<\/pre>\n<p>H1 is on a private network.  H2 is a server of some kind on the public network.  The two networks are interconnected by a router with address X on the private network and address Y on the public net.<\/p>\n<p>Can H1 initiate a working TCP session to H2 without NAT tables on the router?  The answer is yes!  H1 addresses its packet as follows. Address X is the IP Destination Address.  A Loose Source and Record Route (LSRR) option is also used with a single address &#8211; H2&#8217;s.  What happens?<\/p>\n<p>Well, the packet routes first to X on the private network, then the LSRR is processed.  RFC 791:<\/p>\n<ul>\nIf the address in destination address field has been reached and the pointer is not greater than the length, the next address in the source route replaces the address in the destination address field, and the recorded route address replaces the source address just used, and pointer is increased by four.<\/p>\n<p>The recorded route address is the internet module&#8217;s own internet address as known in the environment into which this datagram is being forwarded.\n<\/ul>\n<p>So H2&#8217;s address is moved into the destination address field.  Yet note carefully what else happens.  The &#8220;recorded route address replaces the source address&#8221;, and the &#8220;recorded route address is the&#8230; internet address <i>as known in the environment into which this datagram is being forwarded<\/i>&#8220;.  So address Y is placed into the LSRR option!<\/p>\n<p>So H2 receives a packet addressed to it (of course), with H1&#8217;s private IP address as the source address and an LSRR option listing the address Y.  This is enough information to construct a return packet addressed to Y with H1 listed in an LSRR option.  Now, can H1 count on H2 to do this?  According to RFC 1122 (section 4.2.3.8) it can:<\/p>\n<ul>\nWhen a TCP connection is OPENed passively and a packet arrives with a completed IP Source Route option (containing a return route), TCP MUST save the return route and use it for all segments sent on this connection.\n<\/ul>\n<p>So far, it certainly seems like we don&#8217;t need NAT!  What&#8217;s the problem, then?  Well, consider what H1&#8217;s routing table has to look like:<\/p>\n<pre>\r\n        Destination                  Action\r\n        -----------                  ------\r\n        H1's local subnet            direct delivery\r\n        10.0.0.0\/8                   local subnet's router\r\n        default                      LSRR via X\r\n<\/pre>\n<p>It&#8217;s the default route that&#8217;s the problem.  As far I know, there is not a single operating system today that can specify a loose source route as a target in a routing table entry.  And even if the operating system supported it, how would such an entry be configured?  Neither DHCP nor PPP can deliver such a route, and of course no routing protocol can communicate such a thing.  Not to mention the simple fact that source routing is so heavily filtered that it is essentially unusable in the Internet.<\/p>\n<p>So, not only was IP &#8220;killed&#8221; by the failure of DNS to hand out a source route (which would have let H2 connect to H1), but also by the failure to specify a source route in a routing table entry (to let H1 connect to H2).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Paul Francis, in the conclusion of his 1994 Ph.D. thesis, traces the evolution of the IPv4 address scheme. After quoting a June 1978 Clark\/Cohen paper (IEN 46), Francis notes: Well, something happened here. An argument was put forth that 32 bits is enough because the address does not have to do routing &#8211; the source &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.freesoft.org\/blogs\/soapbox\/nat-and-the-failure-of-source-routing\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;NAT and the Failure of Source Routing&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"episode_type":"","audio_file":"","podmotor_file_id":"","podmotor_episode_id":"","cover_image":"","cover_image_id":"","duration":"","filesize":"","filesize_raw":"","date_recorded":"","explicit":"","block":"","footnotes":""},"categories":[3],"tags":[],"series":[],"class_list":["post-8","post","type-post","status-publish","format-standard","hentry","category-networking"],"episode_featured_image":false,"episode_player_image":"https:\/\/www.freesoft.org\/blogs\/soapbox\/wp-content\/uploads\/2021\/03\/brent-300x300-1.jpeg","download_link":"","player_link":"","audio_player":false,"episode_data":{"playerMode":"dark","subscribeUrls":{"apple_podcasts":{"key":"apple_podcasts","url":"","label":"Apple Podcasts","class":"apple_podcasts","icon":"apple-podcasts.png"},"google_podcasts":{"key":"google_podcasts","url":"","label":"Google Podcasts","class":"google_podcasts","icon":"google-podcasts.png"},"spotify":{"key":"spotify","url":"","label":"Spotify","class":"spotify","icon":"spotify.png"},"stitcher":{"key":"stitcher","url":"","label":"Stitcher","class":"stitcher","icon":"stitcher.png"}},"rssFeedUrl":"https:\/\/www.freesoft.org\/blogs\/soapbox\/feed\/podcast\/the-soapbox","embedCode":"<blockquote class=\"wp-embedded-content\" data-secret=\"9XWvnaL3TC\"><a href=\"https:\/\/www.freesoft.org\/blogs\/soapbox\/nat-and-the-failure-of-source-routing\/\">NAT and the Failure of Source Routing<\/a><\/blockquote><iframe sandbox=\"allow-scripts\" security=\"restricted\" src=\"https:\/\/www.freesoft.org\/blogs\/soapbox\/nat-and-the-failure-of-source-routing\/embed\/#?secret=9XWvnaL3TC\" width=\"500\" height=\"350\" title=\"&#8220;NAT and the Failure of Source Routing&#8221; &#8212; freesoft.org\" data-secret=\"9XWvnaL3TC\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" class=\"wp-embedded-content\"><\/iframe><script>\n\/*! This file is auto-generated *\/\n!function(d,l){\"use strict\";l.querySelector&&d.addEventListener&&\"undefined\"!=typeof URL&&(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&&!\/[^a-zA-Z0-9]\/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret=\"'+t.secret+'\"]'),o=l.querySelectorAll('blockquote[data-secret=\"'+t.secret+'\"]'),c=new RegExp(\"^https?:$\",\"i\"),i=0;i<o.length;i++)o[i].style.display=\"none\";for(i=0;i<a.length;i++)s=a[i],e.source===s.contentWindow&&(s.removeAttribute(\"style\"),\"height\"===t.message?(1e3<(r=parseInt(t.value,10))?r=1e3:~~r<200&&(r=200),s.height=r):\"link\"===t.message&&(r=new URL(s.getAttribute(\"src\")),n=new URL(t.value),c.test(n.protocol))&&n.host===r.host&&l.activeElement===s&&(d.top.location.href=t.value))}},d.addEventListener(\"message\",d.wp.receiveEmbedMessage,!1),l.addEventListener(\"DOMContentLoaded\",function(){for(var e,t,s=l.querySelectorAll(\"iframe.wp-embedded-content\"),r=0;r<s.length;r++)(t=(e=s[r]).getAttribute(\"data-secret\"))||(t=Math.random().toString(36).substring(2,12),e.src+=\"#?secret=\"+t,e.setAttribute(\"data-secret\",t)),e.contentWindow.postMessage({message:\"ready\",secret:t},\"*\")},!1)))}(window,document);\n\/\/# sourceURL=https:\/\/www.freesoft.org\/blogs\/soapbox\/wp-includes\/js\/wp-embed.min.js\n<\/script>\n"},"_links":{"self":[{"href":"https:\/\/www.freesoft.org\/blogs\/soapbox\/wp-json\/wp\/v2\/posts\/8","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freesoft.org\/blogs\/soapbox\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freesoft.org\/blogs\/soapbox\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freesoft.org\/blogs\/soapbox\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freesoft.org\/blogs\/soapbox\/wp-json\/wp\/v2\/comments?post=8"}],"version-history":[{"count":0,"href":"https:\/\/www.freesoft.org\/blogs\/soapbox\/wp-json\/wp\/v2\/posts\/8\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.freesoft.org\/blogs\/soapbox\/wp-json\/wp\/v2\/media?parent=8"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freesoft.org\/blogs\/soapbox\/wp-json\/wp\/v2\/categories?post=8"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freesoft.org\/blogs\/soapbox\/wp-json\/wp\/v2\/tags?post=8"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.freesoft.org\/blogs\/soapbox\/wp-json\/wp\/v2\/series?post=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}