Subject: draft-ietf-6man-addr-select-opt

From: Mark Andrews <[email-masked]>
Date: Wed, 06 Feb 2013 14:12:12 +1100

prefix:  A variable-length field containing an IP address or the
           prefix of an IP address.  An IPv4-mapped address [RFC4291] must
           be used to represent an IPv4 address as a prefix value.  The
           prefix should be left aligned, big-endian, and zero padded on
           the right up to the next octet boundary.  So the length of this
           field should be between 0 and 16 bytes

	is ambigious on the encoding of 2002:1234:8734::/64

	is it:
	40:20:02:12:34:87:34:00:00:00:00:00:00:00:00:00:00
	or
	40:20:02:12:34:87:34:00:00:00:00:00:00:00:00:00
	or
	40:20:02:12:34:87:34:00:00:00:00:00:00:00:00
	or
	40:20:02:12:34:87:34:00:00:00:00:00:00
	or
	40:20:02:12:34:87:34:00:00:00:00:00
	or
	40:20:02:12:34:87:34:00:00:00:00
	or
	40:20:02:12:34:87:34:00:00:00
	or
	40:20:02:12:34:87:34:00:00
	or
	40:20:02:12:34:87:34:00
	or
	40:20:02:12:34:87:34

	All appear to be legal.  It would be cleaner if the
	floor((prefix-len+7)/8) gave the number of octets in
	the prefix field.

-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE:	+61 2 9871 4742		         INTERNET: [email-masked]

---

From: Cutler James R <[email-masked]>
Date: Tue, 5 Feb 2013 22:53:57 -0500

> 	is ambigious on the encoding of 2002:1234:8734::/64

Mark,

You have me confused here.  /64 defines a prefix length of 64 bits, exactly 8 octets. Octet for Octet, 20:02:12:34:87:34:00:00 is unambiguously correct and in accordance with the definition cited.  Please explain where the leading 40 originates.

James R. Cutler
[email-masked]

---

From: Mark Andrews <[email-masked]>
Date: Wed, 06 Feb 2013 15:50:12 +1100

In message <[email-masked]>, Cutler James 
R writes:
> >           prefix of an IP address.  An IPv4-mapped address [RFC4291] =
> must
> >           prefix should be left aligned, big-endian, and zero padded =
> on
> >           the right up to the next octet boundary.  So the length of =
> this
> >=20
> >=20
> >=20
> You have me confused here.  /64 defines a prefix length of 64 bits, =
> exactly 8 octets. Octet for Octet, 20:02:12:34:87:34:00:00 is =
> unambiguously correct and in accordance with the definition cited.  =
> Please explain where the leading 40 originates.

The 40 was the prefix length octet (0x40 == 64). Sorry for not being
clear on that.

The sub-option has a length field which means that you can append
zeros up to the defined maximum (16).  As it is a zero padded field
you can also theoretically remove trailing zeros without loss of
information.  Nothing in the definition says that you can't do that.

prefix-len:  An 8-bit unsigned integer; the number of leading bits in
        the prefix that are valid.  The value ranges from 0 to 128.

Mark