ipv6: a tutorial

98
IPv6: A Tutorial Ravi Prakash Department of Computer Science University of Texas at Dallas [email protected]

Upload: phungtuyen

Post on 14-Feb-2017

234 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: IPv6: A Tutorial

IPv6: A TutorialRavi PrakashDepartment of Computer ScienceUniversity of Texas at [email protected]

Page 2: IPv6: A Tutorial

Outline• Motivation• IPv6 packet format• IPv6 addressing• ICMPv6• Interoperability• Support for mobility

3/16/2016 2Ravi Prakash, U.T. Dallas

Page 3: IPv6: A Tutorial

IPV6 MOTIVATION

3/16/2016 3Ravi Prakash, U.T. Dallas

Page 4: IPv6: A Tutorial

IPv4 Address Space• 32 bit address• Managed by

– Internet Assigned Numbers Authority (IANA)– Five Regional Internet Registries (RIRs)

• American Registry for Internet Numbers (ARIN)• Latin American and Caribbean Internet Address Registry (LACNIC)• Asia-Pacific Network Information Center (APNIC)• Réseaux IP Européens Network Coordination Centre (RIPE NCC)• African Network Information Center (AfriNIC)• Blocks of 224 addresses assigned by IANA to RIRs.

3/16/2016 4Ravi Prakash, U.T. Dallas

Page 5: IPv6: A Tutorial

Regional Internet Registries

Source: Wikimedia Commons3/16/2016 5Ravi Prakash, U.T. Dallas

Page 6: IPv6: A Tutorial

Assignment Rate of IPv4 Addresses

Source: Wikimedia Commons3/16/2016 6Ravi Prakash, U.T. Dallas

Page 7: IPv6: A Tutorial

Diminishing /8 Blocks over time

Source: Wikimedia Commons3/16/2016 7Ravi Prakash, U.T. Dallas

Page 8: IPv6: A Tutorial

How Did We Get Here?• Increasing penetration of the Internet.• Greater number of always on devices.• Inefficient address allocation:

– Large chunks of addresses unavailable for allocation.“Fixes” that helped delay the inevitable:

– Classless Inter-Domain Routing (CIDR)– NAT and internal use of private IP addresses.

• Some fixes have side-effects:– NAT breaks end-to-end addressing and creates problems for several applications.

3/16/2016 8Ravi Prakash, U.T. Dallas

Page 9: IPv6: A Tutorial

What Lies in the Future?• Ever increasing demand for IP addresses driven by:

– Mobile devices– Internet of things– Economic development in Asia/Pacific and Latin America.

• Desire for better security.• Increased Quality-of-Service (QoS) expectations.3/16/2016 9Ravi Prakash, U.T. Dallas

Page 10: IPv6: A Tutorial

IPv6 to the Rescue!• Extended address space: 128-bit addressing.• Autoconfiguration of hosts.• Better support for mobility.• Streamlined header format and flow identification.• Improved support for options and extensions.• Enhanced support for multicast and QoS.• End-to-end security support.3/16/2016 10Ravi Prakash, U.T. Dallas

Page 11: IPv6: A Tutorial

IPV6 PACKET FORMAT

3/16/2016 11Ravi Prakash, U.T. Dallas

Page 12: IPv6: A Tutorial

IPv6 Packet

Packet

Header

Main Header Optional Extension(s)

Payload

3/16/2016 12Ravi Prakash, U.T. Dallas

Page 13: IPv6: A Tutorial

Main Header

Source: Wikimedia Commons3/16/2016 13Ravi Prakash, U.T. Dallas

Page 14: IPv6: A Tutorial

Header Fields• Version: 6• Traffic class

– Used to indicate data that needs special handling.• Flow Label

– Along with source address it uniquely identifies a flow.• Payload length

– Support for 216 bytes (64KB)– Length of data after IPv6 header (including extension headers)– Larger payloads use Jumbogram extension.

• Next header– Either upper layer protocol number or extension header.

• Hop Limit– Decremented by each forwarding router

3/16/2016 14Ravi Prakash, U.T. Dallas

Page 15: IPv6: A Tutorial

So, what’s no longer there?• Header length• Identification• Flags• Fragment Offset• Header checksum

3/16/2016 15Ravi Prakash, U.T. Dallas

Page 16: IPv6: A Tutorial

Extension Headers

Main Header Upper Layer Header Data

Main Header Extension Header Upper Layer Header Data

Main Header Extension Header 1 Extension Header 2 Upper Layer Header Data

Main Header Extension Header 1 Extension Header 2 ….. Extension Header N Upper Layer Header Data

3/16/2016 16Ravi Prakash, U.T. Dallas

Page 17: IPv6: A Tutorial

Extension Headers: permitted sequenceHop-by-Hop Options header

Destination Options header

Routing header

Fragment header

Authentication header

Destination options header

3/16/2016 17Ravi Prakash, U.T. Dallas

Page 18: IPv6: A Tutorial

Extension Headers• Identified by Next Header field in preceding header.• Processed only by node listed in Destination Address field.• Exception: Hop-by-Hop Options header

3/16/2016 18Ravi Prakash, U.T. Dallas

Page 19: IPv6: A Tutorial

IPV6 ADDRESSING

3/16/2016 19Ravi Prakash, U.T. Dallas

Page 20: IPv6: A Tutorial

Addressing Model• Unicast: identifies a specific IPv6 interface.

– Exception: multiple interfaces may share an address to enable load-sharing.• Multicast: identifies a group of IPv6 interfaces.

– Packets destined to this address delivered to all interfaces belonging to multicast group.• Anycast: unicast address that identifies a group of IPv6 interfaces.

– Packets sent to this address delivered to only one of the interfaces.– Usually, the nearest interface.

3/16/2016 20Ravi Prakash, U.T. Dallas

Page 21: IPv6: A Tutorial

Address Notation• 128 bits = eight 16-bit hexadecimal blocks.

– 2000:03DA:0000:0000:0033:0000:3456:8520• Can also be written as:

– 2000:3DA:0:0:33:0:3456:8520– 2000:3DA::33:0:3456:8520– 2000:3DA:0:0:33::3456:8520

• Why can’t it be written as follows?– 2000:3DA::33::3456:8520– 2:3DA::33:0:3456:8520

3/16/2016 21Ravi Prakash, U.T. Dallas

Page 22: IPv6: A Tutorial

Some Assigned PrefixesAllocation Prefix Binary Prefix Hexadecimal Fraction of address spaceGlobal Unicast 001 2000::/3 1/8

Unique Local Unicast 1111 110 FC00::/7 1/128

Link-Local Unicast 1111 1110 10 FE80::/10 1/1024

Multicast 1111 1111 FF00::/8 1/256

Loopback ::1/1283/16/2016 22Ravi Prakash, U.T. Dallas

Page 23: IPv6: A Tutorial

Global Unicast Address and Site Prefix Sizes

Global routing prefix Subnet ID Interface IDstarting with 001 Identifies link withinsite

64 bits64-n bitsn bits

•Earlier suggestions: assign /48 prefix blocks to sites.•Appears to be rigid

•Need for flexibility•Address block greater than /64 advisable so site can have multiple subnets.•Smaller than /48 advisable to prevent wastage of address space.

•Assignment of /56 address blocks to sites is encouraged.3/16/2016 23Ravi Prakash, U.T. Dallas

Page 24: IPv6: A Tutorial

Interface ID• Extended Unique Identifier (EUI)-64

– Can be derived from 48-bit Ethernet MAC address.• Insert 0xFF and 0xFE (total of 16 bits) between third and fourth octet of Ethernet address.• Set the universal/local bit (2nd least significant bit of first octet) to 1.

00 02 B3 A5 88 72FF FE2

3/16/2016 24Ravi Prakash, U.T. Dallas

Page 25: IPv6: A Tutorial

Interface ID: Alternatives• Manually configured.• Dynamically assigned by a DHCP server.

3/16/2016 25Ravi Prakash, U.T. Dallas

Page 26: IPv6: A Tutorial

Anycast Addresses• Assigned from the unicast address space.• Nodes assigned an anycast address must be configured with this knowledge.• Within topological region of anycast address, all hosts with that address must be advertised as a separate routing table entry.• Outside the region, all can be aggregated to one entry.• Sender has no control over which host receives the packet destined to anycast address.

– Determined by underlying routing protocol and its cost metric.3/16/2016 26Ravi Prakash, U.T. Dallas

Page 27: IPv6: A Tutorial

Multicast Address1111 1111 Flags Scope Group Id

4 4 112 bits

•Flag•T=0: known, permanent multicast addressed assigned by IANA.•T=1: transient address

•Scope•0, 3, F: reserved•1: Interface-local scope •2: Link-local scope•4: Admin-local scope•5: Site-local scope•8: Organization-local scope•E: Global scope•Others: unassigned

3/16/2016 27Ravi Prakash, U.T. Dallas

Page 28: IPv6: A Tutorial

SECTION 4: INTERNET CONTROL MESSAGE PROTOCOL FOR IPV6 (ICMPV6)3/16/2016 28Ravi Prakash, U.T. Dallas

Page 29: IPv6: A Tutorial

Functions• Reports network errors.• Sends informational messages.• Multicast group management.• Neighbor discovery and address resolution.

3/16/2016 29Ravi Prakash, U.T. Dallas

Page 30: IPv6: A Tutorial

ICMPv6 Message Types• Error messages

– Destination Unreachable– Packet Too Big– Time Exceeded– Parameter Problem

• Informational messages– Echo Request– Echo Reply

3/16/2016 30Ravi Prakash, U.T. Dallas

Page 31: IPv6: A Tutorial

Header Format

•Type: determines the rest of the message.•Code: more detailed information about message.•Checksum: helps detect corruption of IPv6 header and ICMPv6 header.•Message body: contents depend on message type and code.

3/16/2016 31Ravi Prakash, U.T. Dallas

Page 32: IPv6: A Tutorial

Destination Unreachable• Generated when an IP packet cannot be delivered to destination.• Sent to source address of packet.• Code can indicate:

– No route to destination.– Communication with destination administratively prohibited.– Beyond scope of source address.– Address unreachable.– Port unreachable.– Source address failed ingress/egrees policy.– Reject route to destination.

3/16/2016 32Ravi Prakash, U.T. Dallas

Page 33: IPv6: A Tutorial

Packet Too Big• Generated by router when packet larger than MTU of outgoing link.• Contains MTU size of outgoing link.• Useful for Path MTU discovery.

3/16/2016 33Ravi Prakash, U.T. Dallas

Page 34: IPv6: A Tutorial

Time Exceeded• Data portion contains as much of original message as possible.• Code=1: Hop limit exceeded

– Used by traceroute.• Code=2: Fragment reassembly time exceeded.

3/16/2016 34Ravi Prakash, U.T. Dallas

Page 35: IPv6: A Tutorial

Parameter Problem• Sent to source address.• When node unable to process a packet due to problems processing:

– IPv6 header, or– Next header type, or– Extension header.

3/16/2016 35Ravi Prakash, U.T. Dallas

Page 36: IPv6: A Tutorial

Echo Request and Reply• Employed for ping.

– Source issues Echo Request for target.– Target node responds with Echo Reply.

If target of Echo Request = multicast address:Source of Echo Reply = unicast address of responding interface3/16/2016 36Ravi Prakash, U.T. Dallas

Page 37: IPv6: A Tutorial

ICMPv6 Processing Rules• Error messages of unknown type must be passed to upper layer.• Information messages of unknown type must be silently discarded.• As much as possible of packet triggering error message will be included in the ICMP message body (not to exceed minimum IPv6 MTU: 1280 bytes)• To find relevant upper layer protocol, look at protocol type field in included IPv6 packet.3/16/2016 37Ravi Prakash, U.T. Dallas

Page 38: IPv6: A Tutorial

Router Solicitation• Destination address = FF02::2

– All-router multicast address.• Hop count = 255

– Makes protocol immune to remote hosts trying to inject router solicitation messages.

3/16/2016 38Ravi Prakash, U.T. Dallas

Page 39: IPv6: A Tutorial

Router Advertisement• Sent:

– Periodically: Destination = FFO2::1• All nodes multicast address

– In response to Router Solicitations:• Destination = Interface address of solicitation sender

3/16/2016 39Ravi Prakash, U.T. Dallas

Page 40: IPv6: A Tutorial

Router Advertisement (contd.) • Hop limit: cofigures nodes on link with default hop limit in outgoing packets. • Flags:

– M=1: stateful configuration used– O=1: stateful configuration other than IP address– H=1: Home agent for the link

• Router lifetime > 0: default router on link– Value = lifetime in seconds (max = 18.2 hours)

3/16/2016 40Ravi Prakash, U.T. Dallas

Page 41: IPv6: A Tutorial

Router Advertisement (contd.)• Reachable time: time for which a node is considered reachable (milliseconds)• Retrans time: time between retransmitted Neighbor Solicitation messages.• Options:

– MTU size to be used on link.– All prefixes for the link that nodes need to know.

3/16/2016 41Ravi Prakash, U.T. Dallas

Page 42: IPv6: A Tutorial

Neighbor Solicitation• Used for:

– Link-layer address resolution:• Destination IP address = solicited node multicast address• Options: Link-layer source address

– Network unreachability detection• Destination IP address = unicast address.

– Duplicate Address Detection (DAD)• Source address = unspecified (all zeros)

3/16/2016 42Ravi Prakash, U.T. Dallas

Page 43: IPv6: A Tutorial

Neighbor Advertisement• Sent:

– In response to Neighbor Solicitation• Destination IP address: source address of interface that sent solicitation• If solicitation source address = unspecified (all zeros: DAD)

– Destination address = All-nodes multicast address (FF02::1)– To propagate new information

• Destination address = All-nodes multicast address

3/16/2016 43Ravi Prakash, U.T. Dallas

Page 44: IPv6: A Tutorial

Neighbor Advertisement (contd.)• R=1: sent by router• S=1: sent in response to Neighbor Solicitation• O=1: information should override existing Neighbor Cache entries

– Update cached link-layer addresses• Target address:

– For solicited advertisements: address of soliciting interface– For unsolicited advertisements: address of interface whose link-layer address has changed.

• Options: target link-layer address3/16/2016 44Ravi Prakash, U.T. Dallas

Page 45: IPv6: A Tutorial

ICMP Redirect Message• Issued by routers.• Informs node(s) of better first-hop node on the path to given destination.• Can inform node that destination is a neighbor on the same link.

3/16/2016 45Ravi Prakash, U.T. Dallas

Page 46: IPv6: A Tutorial

Stateless Autoconfiguration

3/16/2016 46Ravi Prakash, U.T. Dallas

Page 47: IPv6: A Tutorial

Path MTU Discovery4680 5200 4000 4200 5000 2460

PMTU4680 ICMPv6 Packet too bigLink MTU=4000PMTU4000 ICMPv6 Packet toobigLink MTU=2460PMTU2460

3/16/2016 47Ravi Prakash, U.T. Dallas

Page 48: IPv6: A Tutorial

Path MTU Discovery (contd.)• Employed for multicast, too.• Network path may change over time.• If PMTU reduced:

– Triggers ICMPv6 Packet Too Big Message.• What if PMTU increased?

– Associate PMTU cache age duration (e.g. 10 minutes)– When cache entry for path ages:

• Next packet size = first hop link MTU.3/16/2016 48Ravi Prakash, U.T. Dallas

Page 49: IPv6: A Tutorial

INTEROPERABILITY

3/16/2016 49Ravi Prakash, U.T. Dallas

Page 50: IPv6: A Tutorial

Tunneling

= IPv6 packet: Source = A, Dest = B= IPv4 packet encapsulating Source = R1’s IPv4 interfaceDest = R2’s IPv4 interface

3/16/2016 50Ravi Prakash, U.T. Dallas

Page 51: IPv6: A Tutorial

Limits to Tunneling

3/16/2016 51Ravi Prakash, U.T. Dallas

Page 52: IPv6: A Tutorial

6to4: Connecting IPv6 Networks via IPv4 Clouds

• No explicit tunnel setup.• Abstraction: IPv4 network is like a point-to-point link layer connecting IPv6 networks.

1. IPv6 island to IPv6 island2. IPv6 island to Native IPv6 network

• 6to4 (Gateway) Router: connects IPv6 island to IPv4 Internet.• 6to4 Relay Router: connects IPv6 Internet to IPv4 Internet.

3/16/2016 52Ravi Prakash, U.T. Dallas

Page 53: IPv6: A Tutorial

6to4 Example

Source: Wikimedia Commons3/16/2016 53Ravi Prakash, U.T. Dallas

Page 54: IPv6: A Tutorial

6to4 Router• Globally unique IPv4 address (A) on the IPv4 Internet side.• IPv6 address block for island: 2002::/16 concatenated with 32-bit IPv4 address (A)

– 80 bits for subnet number + interface identifier.

Source: Wikimedia Commons3/16/2016 54Ravi Prakash, U.T. Dallas

Page 55: IPv6: A Tutorial

6to4 Example

Source: Wikimedia Commons3/16/2016 55Ravi Prakash, U.T. Dallas

2002:C000:0204::5

192.0.2.4 224.1.5.2

2002:E000:0501::3

S=2002:C000:0204::5D=2002:E000:0501::3S=192.0.2.4D=224.1.5.2

Page 56: IPv6: A Tutorial

6to4 Relay• IANA assigned 6to4 anycast prefix:

– 192.88.99.0/24• 6to4 routers configured with default route to 192.88.99.1 anycast address.• Packets destined for native IPv6 network forwarded to closest 6to4 Relay.

3/16/2016 56Ravi Prakash, U.T. Dallas

Page 57: IPv6: A Tutorial

SUPPORT FOR MOBILE AND LOW-POWERED WIRELESS DEVICES IN IPV63/16/2016 57Ravi Prakash, U.T. Dallas

Page 58: IPv6: A Tutorial

Motivation• Two areas of network growth:

1. Mobile (wireless) devices.2. Low-power (multi-hop) wireless personal area networks.

• Challenges:– Changing network connectivity.– Low-bandwidth.– Lossy links.– Low energy storage.

3/16/2016 58Ravi Prakash, U.T. Dallas

Page 59: IPv6: A Tutorial

MOBILE IPV6

3/16/2016 59Ravi Prakash, U.T. Dallas

Page 60: IPv6: A Tutorial

Operation Scenario• Mobile node moves out of its home network, and into a foreign network.• Other nodes unaware of the current location of mobile node.• Situation: other nodes send packets addressed to mobile node’s home address.• Goal: deliver these packets to the mobile node at its current location.3/16/2016 60Ravi Prakash, U.T. Dallas

Page 61: IPv6: A Tutorial

IP Forwarding Without Mobility Support

• Routers forward the packet based on destination’s home IP address.• Packet reaches a router with interface to the destination’s home network.• The router injects the packet into the home network.• Delivery failure because destination is not present.

Home Network

Foreign Network

3/16/2016 61Ravi Prakash, U.T. Dallas

Page 62: IPv6: A Tutorial

Adding Mobility Support• Transparency: node mobility should be hidden from other nodes.• Interoperability: mobile node should be able to communicate with other nodes, mobile as well as stationary.• Security: unauthorized nodes should not be able to forge movement of nodes.• Efficiency: keep protocol overheads small.• Unconstrained addressing: Mobile IP should not place any additional constraint on assigning IP addresses to nodes.3/16/2016 62Ravi Prakash, U.T. Dallas

Page 63: IPv6: A Tutorial

Network Entities to Support Mobility• Home Agent (HA): acts on behalf of mobile node when it is away from home network.• Correspondent node: A node with which the mobile node is communicating.

Home Network

Foreign Network

HA

3/16/2016 63Ravi Prakash, U.T. Dallas

Page 64: IPv6: A Tutorial

Mobility Support Operations• Agent discovery: operations performed to determine the identity of Home Agent(s).• Registration: informing HA about the care-of address while mobile node is in a foreign network.• Bidirectional Tunneling: Correspondent node and mobile node exchanging packets via HA.• Route Optimization: Correspondent node and mobile node directly exchange packets.• Deregistration: removing old care-of address when mobile node moves out of a foreign network.3/16/2016 64Ravi Prakash, U.T. Dallas

Page 65: IPv6: A Tutorial

Mobility Header in IPv6• Specified by Next Header value = 135• Specifies messages for:

– Binding update– Binding refresh– Return routability procedure.

3/16/2016 65Ravi Prakash, U.T. Dallas

Page 66: IPv6: A Tutorial

Home Agent Address Discovery• Router advertisement: lists only the link-local address of router.• H bit: when set, advertising router is a HA.• Prefix option modified in ICMPv6 .• R-flag added.

– When set, Prefix option field contains router’s global unicast IPv6 address(es).• Each HA maintains (sorted by preference):– list of home agents on a link, – their global unicast IPv6 address(es), – their remaining lifetime.

3/16/2016 66Ravi Prakash, U.T. Dallas

Page 67: IPv6: A Tutorial

Home Agent Advertisement• Preference level associated with each advertised address.• Each advertisement has a lifetime.• Interval between successive advertisements: a fraction of the advertisement lifetime.• Possibly multiple HAs on a link with different preferences: load balancing.

3/16/2016 67Ravi Prakash, U.T. Dallas

Page 68: IPv6: A Tutorial

Home Agent Discovery• Mobile node sends ICMP “Home Agent Address Discovery Request” request message to “Mobile IPv6 Home Agents” anycast address in its home network.• Router acting as home agent responds with an ICMP “Home Agent Address Discovery Reply” message.• Binding Update message: Visiting mobile node sends its primary care-of address to its home agent.• Home agent responds with a Binding Acknowledgment message.• Dynamic home agent discovery useful when home network gets reconfigured or old home agent is no longer in the network.3/16/2016 68Ravi Prakash, U.T. Dallas

Page 69: IPv6: A Tutorial

Move Detection• Network-prefix-based:

– Mobile node detects a change in the on-link subnet prefix– This indicates move to a new subnet.

3/16/2016 69Ravi Prakash, U.T. Dallas

Page 70: IPv6: A Tutorial

Registration• Mobile node moves into foreign network.• Node sends registration message to HA.• HA sends registration response, containing outcome (granted or denied) to mobile node.

Home Network

Foreign Network

HA

3/16/2016 70Ravi Prakash, U.T. Dallas

Page 71: IPv6: A Tutorial

Registration Reply• Indicates whether registration request has been granted, or denied by home agent.• Format similar to request message.• Lifetime field indicates duration for which registration has been granted.

– Once request issued, no node can increase the duration of the lifetime field.– Home agent can grant request for duration less than requested lifetime.

3/16/2016 71Ravi Prakash, U.T. Dallas

Page 72: IPv6: A Tutorial

Determining Registration Duration• Mobile node requests registration for T time units.• Positive response received after time t.• Let value of received lifetime = T’.• If T=T’, remaining registration lifetime = T-t.• If T>T’, remaining registration lifetime = T’-t.

3/16/2016 72Ravi Prakash, U.T. Dallas

Page 73: IPv6: A Tutorial

Packet Delivery• Address resolution: determining the hardware address of the node to which a packet has to be delivered.• Tunneling: forwarding packet(s) to care-of address.• Decapsulation: delivering packet to mobile node in its current network.

3/16/2016 73Ravi Prakash, U.T. Dallas

Page 74: IPv6: A Tutorial

Address Resolution• HA sends Neighbor Discovery advertisements to All-nodes multicast address:

– Source address: IPv6 address of HA– Target IP address: IPv6 address of mobile node– Target Link-Layer address: link-layer address of HA– Router Flag (R-flag): 0– Override Flag (O-flag): set

• HA responds to Neighbor Solicitations for mobile node’s IPv6 address.• HA Defends mobile node’s home address during Duplicate Address Detection. 3/16/2016 74Ravi Prakash, U.T. Dallas

Page 75: IPv6: A Tutorial

Bidirectional Tunneling: IPv6 Encapsulation• HA intercepts packet destined to mobile node’s home address and decrements hop limit by 1.• If hop limit > 0, encapsulate in IPv6 packet:

– Source address of tunnel IP header = HA’s IPv6 address.– Destination address = mobile node’s primary care-of address.

• Path from HA to decapsulator is one logical hop.

3/16/2016 75Ravi Prakash, U.T. Dallas

Page 76: IPv6: A Tutorial

Multicast Datagram Delivery• Mobile node visiting a foreign network may receive multicast messages in the following ways:1. Join the multicast group via a multicast router in the visited network.2. Join via a bidirectional tunnel to its home agent, provided the home agent is a multicast router.• Sending packets to multicast groups can be performed in a similar manner. • If sending directly from the foreign network, use care-of address as the source address.

3/16/2016 76Ravi Prakash, U.T. Dallas

Page 77: IPv6: A Tutorial

Reverse TunnelingScenario: Packets sent by visiting node X to another node Y.Source address in packets: Home address of X.Ingress Filtering: Examination of the packet source address by router, and discarding the packet if source address seems to be topologically “incorrect.”Reason for ingress filtering?Solution: Tunnel packets from mobile node to home agent, and then forward them to destination (correspondent node).

3/16/2016 77Ravi Prakash, U.T. Dallas

Page 78: IPv6: A Tutorial

Reverse Tunneling (contd.)• Forward tunnel: starts at the home agent and terminates at the mobile node’s care-of address.• Reverse tunnel: starts as the mobile node’s care-of address and terminates at the home agent.

3/16/2016 78Ravi Prakash, U.T. Dallas

Page 79: IPv6: A Tutorial

Communication with Correspondent Node

• Scenario: Mobile node receives a packet sent by a correspondent node such that:– The packet was tunneled using IPv6 encapsulation.– Destination address in the outer header is equal to the mobile node’s care-of address.– Destination address in the inner header is the mobile node’s home address.– Source addresses in the headers are different.

• Indication: Original sender of the packet (correspondent node) does not know current care-of address of the mobile node.• Mobile node should send Binding Update message to correspondent node with its current care-of address.• Correspondent node sends packets directly after that.3/16/2016 79Ravi Prakash, U.T. Dallas

Page 80: IPv6: A Tutorial

Mobile NodeHome address=HCare-of address=C

Home agent

Correspondent NodeIP address=AKey =Kcn

1. Care-of Test Init(Source=C, C/o cookie)

1. Home Test Init(Source=H, HA cookie)

2. Home Test

2. Care-of Test

3. Generatebinding management key (Kbm)Kbm = SHA-1 (home keygen token | care-of keygen token)

4. Binding update5. Binding acknowledgement

Home Test = (HA cookie, home keygen token, index_i)Home keygen token = First(64, HMAC_SHA1(Kcn, (H | noncei | 0)))

Care-of Test = (C/o cookie, Care-of keygen token, index_j)Care-of keygen token = First(64, HMAC_SHA1(Kcn, (C | noncej | 1)))

3/16/2016 80Ravi Prakash, U.T. Dallas

Page 81: IPv6: A Tutorial

Route Optimization• Mobile node constructs packets with:

– Source address = care-of address in foreign network– Destination address = correspondent node’s IPv6 address– Home address option field = home address of mobile node.

• Correspondent node sends packets with Type 2 Routing header:– Source address = correspondent node’s IPv6 address.– Destination address = mobile node’s care-of address.– Final destination (last hop) = mobile node’s home address.– Processing of last hop: internal to mobile node.

3/16/2016 81Ravi Prakash, U.T. Dallas

Page 82: IPv6: A Tutorial

On Returning to Home Network• Mobile Node sends Binding Update to HA:

– Source address = node’s home address.– Acknowledgment (A) and Home Registration (H) bits set.– Lifetime = 0– Care-of address = Home address

• HA no longer acts as proxy for mobile node.

3/16/2016 82Ravi Prakash, U.T. Dallas

Page 83: IPv6: A Tutorial

6LoWPAN: IPv6 over IEEE 802.15.4

3/16/2016 83Ravi Prakash, U.T. Dallas

Page 84: IPv6: A Tutorial

Motivation• Enable IPv6 to run over a network of wireless, low power personal area networks.• Provides an adaptation layer between link and network layers.• Use link and adaptation layer information to compress network and transport layer headers.

3/16/2016 84Ravi Prakash, U.T. Dallas

Page 85: IPv6: A Tutorial

Problem• Minimum IPv6 MTU requirement = 1280 bytes.• IPv6 fragmentation: only at endpoints.• IEEE 802.15.4:

– Maximum frame length = 128 bytes– Link-layer payload may be limited to 81 bytes– Max throughput = 250 kbps– Limited buffering and processing capability at nodes.

3/16/2016 85Ravi Prakash, U.T. Dallas

Page 86: IPv6: A Tutorial

6LoWPAN Adaptation Layer• Header compression when information can be retrieved using shared context or link-layer information:

– Compressed fields– Elided fields.

• Fragmentation into multiple link-layer frames.• Layer-two, mesh forwarding.

3/16/2016 86Ravi Prakash, U.T. Dallas

Page 87: IPv6: A Tutorial

6LoWPAN Header Stacking

802.15.4 header IPv6 CompressedHeader IPv6 Payload

802.15.4 header IPv6 PayloadIPv6 CompressedHeaderFragment Header

802.15.4 header IPv6 PayloadIPv6 CompressedHeaderFragment HeaderMesh RoutingHeader

From: 6LoWPAN: Incorporating IEEE 802.15.4 into the IP architecture; Internet Protocol for Smart Objects (IPSO) Alliance White paper # 3, Jonathan Hui, David Culler, Samita Chakrabarty

3/16/2016 87Ravi Prakash, U.T. Dallas

Page 88: IPv6: A Tutorial

Fragment Header (4 or 5 bytes)• Datagram size: of unfragmented payload• Datagram tag: same for all fragments of a payload• Datagram offset: position of fragment in unfragmented payload (in multiples of 8 bytes)

3/16/2016 88Ravi Prakash, U.T. Dallas

Page 89: IPv6: A Tutorial

Mesh Routing Header (5-17 bytes)

• Supports multi-hop, layer two forwarding.• End-points of an IP hop (extended or short address):

– Source address– Destination address

• Hop limit: decremented with each hop.– Frame discarded if 0.– S, D: indicate short or extended source, destination address, respectively.

3/16/2016 89Ravi Prakash, U.T. Dallas

Page 90: IPv6: A Tutorial

IPv6 Header Compression (3 bytes!)

• 64-bit network prefix compressed to 1 bit for source and destination address when they correspond to link local prefix. • 64-bit source and destination interface identifiers elided if derivable from link layer addresses or Mesh Routing Header.• Traffic class and flow label compressed to single bit, if both zero.• Next header = 2 bits, if TCP, UDP or ICMPv6.• Payload length elided:

– Can be derived from IEEE 802.15.4 frame or Fragment Header.• Not very useful for communication using global IPv6 addresses.

Dispatch: HC1 used

3/16/2016 90Ravi Prakash, U.T. Dallas

Page 91: IPv6: A Tutorial

Improved IPv6 Header Compression

• Up to 16 shared contexts to compress external source or destination prefix.• TF: traffic type and flow label separately compressed.• HLIM: if hop limit 1 or 255 and compressed, or carried inline.• CID: context identifier (0=default)• SAC/DAC: whether stateless (link local) or context-based compression of source/destination address employed.• SAM/DAM: whether full source/destination address is carried inline, upper 16 or 64 bits elided, or full address elided based on context.• M: whether destination address is unicast or multicast.3/16/2016 91Ravi Prakash, U.T. Dallas

Page 92: IPv6: A Tutorial

Conclusion• Mobile IPv6 supports communication by nodes on the move.• Return routability operations result in efficient forwarding of packets between mobile node and correspondent node.• 6LoWPAN helps run IPv6 over IEEE 802.15.4 personal area networks.

3/16/2016 92Ravi Prakash, U.T. Dallas

Page 93: IPv6: A Tutorial

Return Routability Operations• At correspondent node, on receiving Init messages:

– Home keygen token = SHF(Kcn, H, noncei).– Care-of keygen token = SHF(Kcn, C, noncej).

• Home Test message = (home init cookie, home keygen token, i).• Care-of Test message = (Care-of init cookie, care-of keygen token, j).3/16/2016 93Ravi Prakash, U.T. Dallas

Page 94: IPv6: A Tutorial

Return Routability Operations• At mobile node, on receiving the test messages:

– Kbm = SHF(home keygen token, care-of keygen token).– Binding Update message = (C, binding update sequence number, i, j, MAC).– Message authentication code (MAC) = SHF(Kbm, A, C, Binding Update message)

3/16/2016 94Ravi Prakash, U.T. Dallas

Page 95: IPv6: A Tutorial

Agent Advertisement: Fields• Sequence number: 16-bit field

– First advertisement after booting up has sequence number = 1.– Successive advertisements increased sequence number by 1.– On reaching max value (65,535), roll over to 256.Why?

• Registration lifetime: longest period for which mobile node can be registered with the advertiser.– Maximum duration = 65,535 seconds (indicates infinite lifetime).

Advertisement lifetime is not the same as registration lifetime.

3/16/2016 95Ravi Prakash, U.T. Dallas

Page 96: IPv6: A Tutorial

Agent Solicitations• Initially a mobile node can send up to three solicitations at maximum rate of 1/second.• If no response received:

– Interval between successive solicitations is doubled. – Exponential backoff continues until maximum interval is reached.– Helps limit solicitation overheads.

3/16/2016 96Ravi Prakash, U.T. Dallas

Page 97: IPv6: A Tutorial

Registration Message: Fields• Type: 1=request• Simultaneous binding bit: set if multiple address bindings are to be supported by HA.• Broadcast bit: if mobile node wishes to receive broadcast messages of its home network.• Decapsulation bit: set if mobile node is using colocated address.• Reverse tunneling bit: set if reverse tunneling requested.• Lifetime: registration duration (in seconds) requested by mobile node.

– Must be less than the registration lifetime advertised by FA.• Home address: home IP address of mobile node.• Home agent: IP address of mobile node’s HA.• Care-of address: either colocated address or FA’s advertised address.• Identification: 64-bit number generated by mobile node for security purposes, and matching request with reply.

3/16/2016 97Ravi Prakash, U.T. Dallas

Page 98: IPv6: A Tutorial

Loop Avoidance• Encapsulated packet received by HA of roaming mobile node.• Outer destination address = inner destination address = mobile node’s home IP address.• If outer source address = mobile node’s care-of address, discard the packet.

– Otherwise, packet will keep looping between HA and router with mobile node’s care-of address.

3/16/2016 98Ravi Prakash, U.T. Dallas