<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2657.73">
<TITLE>RE: Today's quiz question</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Gerald Combs wrote:</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; What happens when you run</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; ping 0x7f.1</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; and why?</FONT>
</P>

<P><FONT SIZE=2>I came in late and only guessed part of it myself. Here's the short summary of what's going on for those who didn't bother to follow the link...</FONT></P>

<P><FONT SIZE=2>You ping 127.0.0.1.</FONT>
</P>

<P><FONT SIZE=2>ping uses inet_aton from the standard c library to convert the string 0x7f.1 into a 32 bit integer value.</FONT>
</P>

<P><FONT SIZE=2>The string is assumed to be a series of numbers separated by .'s.</FONT>
</P>

<P><FONT SIZE=2>A number prefixed with 0x is assumed to be hexidecimal. Likewise, were it to be prefixed with only a 0 it would be assumed to be octal. This is standard practice for ascii to number conversions.</FONT></P>

<P><FONT SIZE=2>Each number is assumed to be an 8 bit value. However, the rightmost number in the series is as big as the remaining number of bits to be populated in the 32 bit value.</FONT></P>

<P><FONT SIZE=2>So...</FONT>
</P>

<P><FONT SIZE=2>127.1&nbsp;&nbsp;&nbsp;&nbsp; = 01111111 000000000000000000000001</FONT>
<BR><FONT SIZE=2>127.0.1&nbsp;&nbsp; = 01111111 00000000 0000000000000001</FONT>
<BR><FONT SIZE=2>127.0.0.1 = 01111111 00000000 00000000 00000000</FONT>
</P>
<BR>

<P><FONT SIZE=2>I wonder how it works out under IPv6?</FONT>
</P>

<P><FONT SIZE=2>Garrett</FONT>
</P>

</BODY>
</HTML>