Re: Is 1111 1110 10 equal to 0xfe80 or 0x3fa?

Warren Kumari <warren@kumari.net> Sat, 15 June 2019 17:28 UTC

Return-Path: <warren@kumari.net>
X-Original-To: ipv6@ietfa.amsl.com
Delivered-To: ipv6@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2453212006A for <ipv6@ietfa.amsl.com>; Sat, 15 Jun 2019 10:28:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=kumari-net.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mbZZQ5C_LAAt for <ipv6@ietfa.amsl.com>; Sat, 15 Jun 2019 10:28:54 -0700 (PDT)
Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E1FF4120052 for <ipv6@ietf.org>; Sat, 15 Jun 2019 10:28:53 -0700 (PDT)
Received: by mail-qt1-x830.google.com with SMTP id d17so1293276qtj.8 for <ipv6@ietf.org>; Sat, 15 Jun 2019 10:28:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kumari-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=VtyrtBywcZm3MfroGJLbYZhINy4Ue0MVEVI6c17cmVY=; b=yfC2PoZEIyvaPD5E+dRIY+9lYQMgQ2PBSMcauUqxfZSJZKDHdNE+Mw0HCUu7vOgNNa XQZdpaADTx1LmDbml/xmr7vj3d5Jy0JhLXyXgKCpRLCZ87Zf4U+o4XlpKgjd8W/laufW cHyZo2HIbIPkQvp6DyiLYPFu3/XKyRbJkvMP4TbvwGMcDWSpm67EfRnndcC1yLkTTEyL 2Cbqzwg+ycf7lK6Y5FwJ3D7wHfAthT7xrNgL3AnQEBm54FUtsV764WgBN6Ay6A2hyP0r YHhr7/ntoDlh4CTltDD27dUAuewsQmQFZqT29kKQULnHmW2qrJZZdtbrGwX7VBUef6Cc 1/xQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=VtyrtBywcZm3MfroGJLbYZhINy4Ue0MVEVI6c17cmVY=; b=p5/+sHyUskNnnx05GGTBup+bnm0oaxxbQCLAJff9bcllZ1lmRsRHc7igjDAEfcgqM+ 3MrTK3WSDP+DRgP3L4lX1SDFMT2pM4Arp90ZMGreMNDup37rs2sJbfx0S81QRqiybIPu wJjDBiHLv1Nl2xN8c114fZFj0VD+Cu+hnYkeS5aFf0mmOI1Np204xmZziG6zZbWPBR5U j9oDLPbW65rXyJ1x3c/uK6v8qml/i1U+oD1kyYI3i61TfG1xnIcCGDK/EBu+Hi3G2Rz2 uyGYElzQuCj+1g3S4LMO9kjFuwNLgPOaoeFCw6nKZYIV2AlWMcK2kA/KxpcKQJzMwiNh ybsA==
X-Gm-Message-State: APjAAAX+5KHOE96t5XH4W1LqagV0PF7VNdHzQB2nMoCgi3BZ9bDAw88t sQIdQL2IK0cnUmtxb3Czlt2Wk6d/UN9SxgBZ2IMM0w==
X-Google-Smtp-Source: APXvYqzx0QJaRCLtTWPdoGjIdA6aVArYk98Q+pVGansz7IYnJtjeebLnACsu5ibuHigdQVW6Ceyrl4b8lbuP+GbssUg=
X-Received: by 2002:a0c:9151:: with SMTP id q75mr14185374qvq.168.1560619732564; Sat, 15 Jun 2019 10:28:52 -0700 (PDT)
MIME-Version: 1.0
References: <a71b00b7-0e0c-242a-b3f7-147f4c6b2eb0@gmail.com> <D05C857F-42F6-4F17-8520-A0BF4C8FB775@steffann.nl> <CAHw9_i+U90wczYJ9RwBnzqCd09qfjoPBhNv5sH_wRHfJ9RkGjQ@mail.gmail.com> <e0d8f4a9-848e-ff8f-0031-ed8afa100560@gmail.com>
In-Reply-To: <e0d8f4a9-848e-ff8f-0031-ed8afa100560@gmail.com>
From: Warren Kumari <warren@kumari.net>
Date: Sat, 15 Jun 2019 13:28:15 -0400
Message-ID: <CAHw9_iLmfv0zJEwn_0yHo5wi9Bj+S5huXzQ3DxvnXmDGMHcnFg@mail.gmail.com>
Subject: Re: Is 1111 1110 10 equal to 0xfe80 or 0x3fa?
To: Alexandre Petrescu <alexandre.petrescu@gmail.com>
Cc: Sander Steffann <sander@steffann.nl>, IPv6 <ipv6@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipv6/Z9ggU-hox15q1eA5Ji2nLJR_JQM>
X-BeenThere: ipv6@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "IPv6 Maintenance Working Group \(6man\)" <ipv6.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipv6>, <mailto:ipv6-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ipv6/>
List-Post: <mailto:ipv6@ietf.org>
List-Help: <mailto:ipv6-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipv6>, <mailto:ipv6-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 15 Jun 2019 17:28:56 -0000

 ' i

On Sat, Jun 15, 2019 at 10:59 AM Alexandre Petrescu
<alexandre.petrescu@gmail.com> wrote:
>
>
>
> Le 06/06/2019 à 22:17, Warren Kumari a écrit :
> > On Thu, Jun 6, 2019 at 2:46 PM Sander Steffann <sander@steffann.nl> wrote:
> >>
> >> Hi Alexandre,
> >>
> >>> I maintain that 1111 1110 10 equals 0x3fa, because that's what my Windows Calculator says: I type 1111 1110 10 and it converts to 0x3fa.
> >>>
> >>> On another hand, I am rhetorically asked how can 1111 1110 10 be 0x3fa?
> >>>
> >>> (the 1111 1110 10 are the 10 leading bits of the IPv6 link local addresses, which is familiarly known to start with an fe80).
> >>>
> >>> On my side, this is a difficulty to understand this 0xfe80, especially since 1111 1110 10 is so printed in Figure in RFC4291.
> >>
> >> It's a prefix of an IPv6 address. IPv6 addresses are 128 bits long. Expand to 128 bits and try again :)
> >>
> >> 1111 1110 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 equals 0xfe800000000000000000000000000000. Not sure if Windows Calculator can handle that though…
> >
> > Windows calc probably can't, but:
> > $ echo 'print hex(0b1111111010 << (128-10))'  | python
> >
> > or https://repl.it/repls/AwareDecentGeeklog if you don't have Python
> > (because windows :-p)
>
> For sake of completeness, google puts '1111111010 in hex' as 0x423A3562.

Your point?
One billion, one hundred and eleven million, one hundred and eleven
thousand and ten is, in fact, 0x423A3562
In exactly the same way, if you enter '1+1' it gives you 2, and not 0b10.

Perhaps you actually meant "0b1111111010  to hex", which it correctly
converts to 0x3FA.

A number of people have (in my opinion very politely) suggested that
you spend some time reading up on subnetting. I'd second this
recommendation, and suggest "Internet Routing Architectures" by Sam
Halabi (http://www.ciscopress.com/store/internet-routing-architectures-9781578702336
) - while it was written in 2000, and is focused on IPv4, the concept
is *exactly* the same.

I suspect that, at this point, I'm simply being trolled --
unfortunately though, as the Operations AD I often have to counter the
accusation that the IETF is detached from operations and doesn't
understand how protocols we design are used -- this thread fully plays
into that.

W

>
> qwant does not convert it.
>
> Alex
>
> >
> > W
> >>
> >> Cheers,
> >> Sander
> >>
> >> --------------------------------------------------------------------
> >> IETF IPv6 working group mailing list
> >> ipv6@ietf.org
> >> Administrative Requests: https://www.ietf.org/mailman/listinfo/ipv6
> >> --------------------------------------------------------------------
> >
> >
> >



-- 
I don't think the execution is relevant when it was obviously a bad
idea in the first place.
This is like putting rabid weasels in your pants, and later expressing
regret at having chosen those particular rabid weasels and that pair
of pants.
   ---maf