Skip to content

Instantly share code, notes, and snippets.

@jbweber
Last active August 14, 2017 00:49
Show Gist options
  • Save jbweber/22b465a461f17077359532e3886199e4 to your computer and use it in GitHub Desktop.
Save jbweber/22b465a461f17077359532e3886199e4 to your computer and use it in GitHub Desktop.

https://www.internetsociety.org/tutorials/exploring-ipv6/introduction-ipv6 https://www.internetsociety.org/tutorials/exploring-ipv6/understanding-ipv6-addresses https://www.internetsociety.org/tutorials/exploring-ipv6/protocol-neighbor-discovery-and-slaac

4.2 billion -> ipv4 340 trillion trillion trillion

ipv6 -> 128 bits (binary)

zero compression - consecutive blocks of all zero compressed to :: can only be used once on longest section of consec zero supression - leading zeros remove, all zeros -> 0

all options are correct as long as valid...

network prefix -> high order bits that match the prefix length means all systems on that network start with that address -> device address

ipv6 ->

no broadcast in ipv6 that function is served by multicast

unicast -> individual address for interface global unicast addresses 2000::/3 -> IANA (internet) link-local site-local unique local special addresses

3 bits 001

45 bits global routing prefix -> prefix assigned to a site, hierarchy structured to pass down into smaller prefixes

16 bits subnet id -> prefix assigned to a particular link or LAN within the site in the case of a /48 being assigned to a site there are 16 bits available for subnet ids this allows 65,535 /64 subnet prefixes at a location

64 bits interface id unicast ipv6 addresses except ones beinging with 000 are required by rfc 4291 to have a 64bit interface id interface id must be unique within a subnet prefix and are used to identify interfaces on a link because of this /64 prefixes are the smallest common subnet used in ipv6

anycast -> identify groups of interfaces, sent to nearest interface in the group as determined by routing protocols allocated from unicast space so indistinguishable

multicast -> identify groups of interfaces, packets sent to all interfaces in the group

facilitate single sender multiple recievers

ff00::/8

indicator -> 8 bits 11111111 -> ff scope -> 4 bits how broad node-local - 1 , link-local - 2, site-local - 5, global - e group -> 32 bits group within the given scope all nodes, all routers, ospf routers, ntp

special addresses unspecified ::/128 - used when a host doesn't know address e.g. prior to having an assignment loopback ::1/128 - loopback ipv4 mapped ::ffff:0:0/96 - map ipv4 address into ipv6 format, used to help with conversion to ipv6 unique local unicast (ula) fc00::/7 - like 1918 space, not routable on the global internet link-local unicast fe80::/10 - used on a single link, neighbor discovery , auto address config, no routers

ipv6 header 40 bytes, more simple than v4, extensions only when needed, streamlines version - 4 bits, 6 for ipv6 packet traffic class - 8 bits, QoS flow label - 20 bits, experimental label sequences of packets that require special handling payload length - 16 bits, specifies length of packet following header. includes extensions and data next header - 8 bits, same as ipv4 protocol field id type of header following ipv6 header hop limit - 8 bits, like ipv4 ttl decremented by 1 each forward reaches 0 -> discard source address - 128 bits, source destination address - 128 bits, dest

six extension headers - 1 - hop-by-hop options info which must be examined by all routers 2 - dest options info for the destination node 3 - routing specifies one or more intermediate nodes which must be included in the packets path 4 - fragment path mtu discovery makes this almost moot, must be fragemented by origin 5 - authentication ipsec integrity header 6 - encap security payload ipsec integrity

neighbor discovery uses ICMP so no more blocking ICMP determine the link layer address of a neighbor on the same network, verify the reachability of a neighbor, and track neighboring devices.

router discovery router solicitation message to multicast address routers respond with router advertisement routers periodically send out router advertisement

  • announce presence
  • advertise prefixes on the link
  • assist in address config
  • share link info

neighbor discovery communicate link layer addresses neighbor solicitation neighbor advertisement

neighbor unreachability detection listen for acks if acks not recieved send unicast solicitation

redirects allow routers to help hosts make routing decisions

ipv6 discovery improvements move address resolution to icmp instead of arp, also allows security in the ip layer uses link local addresses, maintain router association even when renumbering neighbor discovery messages carry link layer address info so pair of messages is all that is needed

unreachability detection built in to make things robust can detect router failure, link failure, partial link failure

router advertisements carry prefixes including netmasks and support multiple prefixes on one link

SLAAC - stateless address auto configuration

phase 1 - link local address ipv6 nodes require link-local address dervied from mac address fe80::/10 6a1a:abcd:1234:1234 fe80::6a1a:abcd:1234:1234

duplicate detection sends neighbor solicitation to the destination. if there is a reply we have dupe and operator must intervene

if the address is unique it is assigned an the host now has ipv6 connectivity to all other hosts on the same link (link is like a vlan yeah?)

Phase 2 - global address

  1. router solicitation - if the router is configured to provide stateless autoconfig the adverstisement will include subnet prefix e.g. 2001:db8::/32
  2. global address generation - once prefix is recieved generate global address by appending interface id to the prefix 2001:db8::6a1a:abcd:1234:1234
  3. duplicate address detection
  4. assuming no duplicates host assigns it to the interface and globally routable

network prefixes

Network : 64 bits Address : 64 bits

Prefix Length Details
2001:0db8 32 bits 65536 /48
2001:0db8:0000 48 bits 65536 /64
2001:0db8:0000:0 52 bits 4096 / 64
2001:0db8:0000:00 56 bits 256 / 64
2001:0db8:0000:000 60 bits 16 / 64
2001:0db8:0000:0000 64 bits 18,446,744,073,709,551,616 addresses

interesting rfcs

RFC Notes
rfc7136
rfc7217
rfc8064
rfc8135
rfc8200
rfc8201
draft-bourbaki-6man-classless-ipv6 Classless IPv6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment