Networking - TCP/IP stack introduction and IPv6

124
IPv6 and Mobile IPv6 Fundamentals, new services, and applications Rodolfo Kohn

Transcript of Networking - TCP/IP stack introduction and IPv6

Page 1: Networking - TCP/IP stack introduction and IPv6

IPv6 and Mobile IPv6Fundamentals, new services, and

applications

Rodolfo Kohn

Page 2: Networking - TCP/IP stack introduction and IPv6

10/17/2006 IPv6 and MIPv6 - Fundamentals,

new services, and applications

2

Agenda

• Introduction

• Reference Model– Physical Layer

– Data Link Layer

– Network Layer

– Transport Layer

– Application Layer

• Data Link Layer: IEEE 802.3

• Network and Transport Layers– IP

– Routing

– UDP

– TCP

• IPv6– Introduction

– Main Features

– Headers

– MTU and Fragmentation

– QoS Support

– Addressing Architecture

– Autoconfiguration

– Neighbor Discovery Protocol

– Comments on Routing Protocols

– Why do I need IPv6?

– New Challenges and Applications• P2P

• Embedded Systems

• Telecommunications – IMS

• Low-power devices

• The Long Transition from IPv4 to IPv6

– IPv6 Current Status and Trends

• Mobile IPv6– Mobility in Distributed Systems

– Mobile IPv6 Fundamentals

– New applications

– Existing MIPv6 stacks

Page 3: Networking - TCP/IP stack introduction and IPv6

10/17/2006 IPv6 and MIPv6 - Fundamentals,

new services, and applications

3

Introduction

• ARPANET

• TCP/IP in universities since early eighties.

• Then to the rest of the public

• Internet in the nineties: The network of networks where any host can contact any other host, no matter where it is physically set up.

• People connected: chat, B2B, news, FTP, HTTP, e-mail, low-quality voice and video.

Page 4: Networking - TCP/IP stack introduction and IPv6

10/17/2006 IPv6 and MIPv6 - Fundamentals,

new services, and applications

4

Introduction

Internet

Ethernet

Router

Workstation

Token-ring

Router

Server

Computer

Router

Router

FDDI Ring

Computer

Printer

Bridge

Ethernet

Computer

Laptop

Page 5: Networking - TCP/IP stack introduction and IPv6

10/17/2006 IPv6 and MIPv6 - Fundamentals,

new services, and applications

5

OSI and TCP/IP Models

Application

Presentation

Session

Transport

Network

Data Link

Physical

Application

Transport

Network

Network Access

• Open Systems Interconnection Reference Model. It divides the

communication functionalities into different layers.

• Its protocols are rarely used. The TCP/IP model is not used but

its protocols are widely used.

Page 6: Networking - TCP/IP stack introduction and IPv6

10/17/2006 IPv6 and MIPv6 - Fundamentals,

new services, and applications

6

Physical Layer

• It defines the media as well as the electrical and physical specifications of transceivers and receivers. It includes cabling specifications, coding schemes, voltages, RF bandwidths, etc.

• Some examples are the physical specifications for Ethernet (e.g. 10Base-T, 100Base-TX) and for 802.11 (e.g. RF bands)

Page 7: Networking - TCP/IP stack introduction and IPv6

10/17/2006 IPv6 and MIPv6 - Fundamentals,

new services, and applications

7

Data Link Layer

• It is responsible for creating the frames and sending them to the destination using the physical layer. It deals with access contention, framing, bit stuffing, error detection, error correction, flow control as the main functionalities.

• It provides a well-defined service interface to the network layer.

• IEEE has standardized the different DLLs under the 802 standards. It has divided this layer into two sub-layers: Medium Access Control (MAC), and Logical Link Control (LLC).

• Some examples: – 802.11, 802.3, 802.5, 802.15, 802.16 for MAC

– 802.2 for LLC

– HDLC (High-Level Data Link Control), defined as ISO 13239, for DLL (with no sub-layers)

• The MAC 802 standards also specify physical layer characteristics.

Page 8: Networking - TCP/IP stack introduction and IPv6

10/17/2006 IPv6 and MIPv6 - Fundamentals,

new services, and applications

8

Medium Access Control

• A challenging problem in communications is how many devices share the same medium to transmit (fiber optics, twisted pair, coaxial cable, RF, etc.). Collisions are possible.– There are different techniques depending on the medium. Two

very popular are (NOT the only ones): • Carrier Sense Multiple Access with Collision Detection (CSMA/CD)

used in 802.3 (and Ethernet).

• CSMA/CA (Collision Avoidance) used in 802.11

• MAC’s main objective is to allocate a channel to transmit in a medium where there are competing users.

• Error detection is performed in this layer.

Page 9: Networking - TCP/IP stack introduction and IPv6

10/17/2006 IPv6 and MIPv6 - Fundamentals,

new services, and applications

9

Logical Link Control

• IEEE specifies LLC in the standard 802.2

• Thus different 802 specifications (802.3, 802.11, etc.) can provide a common interface to the network layer.

• It can provide 3 different type of services:– Unreliable Datagram Service (could be used with 802.3, in very

reliable media, for streaming, etc.).

– Acknowledged Datagram Service (useful for wireless technologies like 802.11)

– Reliable Connection-Oriented Service (frames are received in the order they were sent and are not duplicated).

• It provides multiplexing for applications in the layer above (with source and destination service access points).

Page 10: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

10

Network Layer

• DLL is enough to provide an application reliable

communication between different nodes in the same

LAN or a few LANs connected by bridges (or switches),

usually (not always, think of 802.3-802.11b/g bridges) of

the same technology.

• In a more complex network encompassing a large

number of LANs, MANs, and WANs of many different

technologies, the network layer is necessary to provide

end-to-end communication.

Page 11: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

11

Network Layer

• The network layer basically routes a datagram from one node to other in a network of networks.

• It hides different technologies from upper layers, provides a common addressing architecture, and involves devices called routers which connect different networks.

• A network layer could offer a connection-oriented service (mainly for QoS) or a connectionless service (Internet).

• IP (Internet Protocol) and IPX are examples of network protocols. IP is widely used. It is used by the Internet.

• It relies on Routing Protocols which updates the routes a datagram must wind to reach a destination node. Examples are: RIP, OSPF, BGP.

Page 12: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

12

Transport Layer

• This layer basically provides end-to-end service between entities (usually processes) in the application layer. It multiplexes network services between different TSAPs (ports in TCP and UDP).

• This service can also provide efficiency and reliability to the communication between application layer entities.

• It provides a set of service primitives to be used at the application layer.

• The service can be connectionless or connection oriented.

• Examples: TCP, UDP, SCTP.

Page 13: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

13

Application Layer

• This layer involves protocols implemented for

specific applications.

• Name Services turn essential in this layer: DNS,

OSI X.500 directory service, LDAP.

• Examples: SMTP and POP3 for e-mail, HTTP,

WAP, SNMP, DNS protocol, LDAP, RTP, RTSP,

H.323, SIP.

Page 14: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

14

General Model

LLC

Physical

Application

Transport

Network

• Neither the OSI model nor the TCP/IP model are perfectly

implemented. Rather a mixed model is used.

• Each layer in one node communicates with the corresponding

layer in other node.

MAC

Physical

MAC

LLC

Physical

Network

MAC

LLC

Physical

Application

Transport

Network

MAC

Page 15: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

15

How does a packet travel from A to B?

Internet

Ethernet

Router

Workstation

Token-ring

Router

Server

Computer

Router

Router

FDDI Ring

Computer

Printer

Bridge

Ethernet

Computer

Laptop

A

B

Page 16: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

16

IEEE 802.3 LANs

• In order to understand how a packet is routed from a source node to a destination node it is necessary to understand how a frame is transmitted in a LAN.

• IEEE 802.3 LANs will be used as a reference.

• We will only focus on how a frame is transmitted from a source to a destination node.

Page 17: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

17

Ethernet II and IEEE 802.3

• Ethernet II is a standard created by DEC, Intel,

and Xerox in 1978 based on Xerox Ethernet.

The transmission speed was 10 Mbps.

• The IEEE created the standard 802.3 based on

Ethernet II with two minor changes.

Page 18: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

18

IEEE 802.3 Frames

S

F

D

Preamble Destination

Address

Source

Address

Length/

Type

802.2 Header

and/or Data

FCS

17 6 6 2 46 - 1500 4

• Type/Length: if <= 1500 then it is length. If it is >= 1536 (0x600)then it

is type.

• If Type/Length contains a length, the next field is an 802.2 Header

followed by the data.

• The frame contains a minimum of 64 Bytes.

• Common Type values: 0x0800 for IPv4, 0x86DD for IPv6, 0x806, etc.

• Ethernet II does not distinguish SFD and after the Source Address only

has the “Type” field. It does not distinguish an LLC sub-layer.

Page 19: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

19

MAC Address

• MAC Addresses are 48-bit long:

– 3 Less significant octets: Vendor ID.

– 3 Most significant octets: Unique Identifier.

• IEEE defines 3 general categories:

– Unicast: identifies a single NIC.

– Broadcast: refers to all NICs in a LAN. It is the value FF-FF-FF-

FF-FF-FF.

– Multicast: refers to a group of NICs. Multicast addresses have

the least significant bit of the Most significant octet set to 1.

Page 20: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

20

Other features

• Although we will not focus on them it is worth

mentioning other two 802.3 important features:

– CSMA/CD

– Back off exponential algorithm

Page 21: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

21

Typical 802.3 LANs

• The most common 802.3 LANs today are:

– A multidrop configuration with a Hub.

– A point-to-point configuration with an Ethernet switch.

• Both LANs have a star physical topology.

• A LAN with a hub has a bus logical topology.

Page 22: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

22

Hubs and Switches

• A Hub is a L1 device:– Receives a signal in one port and transmits it through all other

ports.

– All connected nodes receive a sent frame.

• A switch works at the MAC layer:– Based on the destination address it looks for the appropriate port

in its MAC table and sends the frame through indicated port.

– If an entry is not found in the MAC table, it performs flooding (the frame is sent out all ports except the receiving one).

Page 23: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

23

A Frame in the LAN

• When a node wants to transmit message to

other node in the same LAN over layer two, it

creates an IEEE 802.3 frame setting the

destination address, the source address with its

own MAC address, the Type/Length, and the

message in the data field. Then it sends the

frame.

Page 24: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

24

A Frame in the LAN (2)

• The frame is transmitted through the cable:

– A switch relays it to the appropriate output port or generates

flooding.

• The destination node NIC receives the frame from the

cable, checks correctness, and then discovers it is

destined to itself by looking at the destination MAC

address.

• Then the data is grabbed and passed to the upper layer.

Page 25: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

25

Fast Ethernet

• Standard Addendum IEEE 802.3u (1995).

• It only based on 10Base-T (100Base-T4/TX/FX). No

multidrop cables.

• Different coding scheme from 802.3

• 100Base-TX is Full Duplex unless hubs are used

(which require half-duplex communication).

• To make upgrading easier, all switches and almost

all 100-Mbps NICs support automatic negotiation of

optimum speed and duplexity.

Page 26: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

26

Gigabit Ethernet

• Standard Addendum IEEE 802.3z (1998).

• Backward Compatibility is maintained.

• All configurations are point-to-point.

• The normal mode is full duplex:

• Since there is no CSMA/CD, there is no limit for the

cable length (only determined by signal strength

issues).

Page 27: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

27

Point-to-point connections

`

`

` `

switch switch

Page 28: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

28

Gigabit Ethernet with hubs

• But Hubs are still allowed for compatibility:

• CSMA/CD protocol must still be used.

• The maximum cable length would be 25 meters.

• To extend the cable length to 100 m, two variants

were created:

• Carrier Extension: the sending HW adds padding to

extend the frame to 512 Bytes and the receiving HW

removes it (Low Efficiency).

• Frame Bursting: the sender transmits a concatenated

sequence of multiple frames up to 512 Bytes, padding if

necessary.

Page 29: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

29

Gigabit Ethernet more

• Types: 1000Base-SX, 1000Base-Lx, 1000Base-CX,

1000Base-T.

• New coding schemes.

• Buffer overflows are pretty probable when transmitting at 1

Gbps. So, flow control is supported:

• The receiving end can send back a control frame (Type 0x8808)

telling the sender to pause for some period of time.

• First 2 Bytes of the payload convey the command and then follow

the parameters.

• PAUSE frames are used for flow control. The parameter tells how

long to pause.

Page 30: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

30

10-Gigabit Ethernet

• Standard approved as addendum 802.3ae in 2002.

• No official effort to achieve 100-Gbps Ethernet yet

but some have begun to talk about it

(http://www.ethernetalliance.org/technology/presenta

tions/ )

• Anyway, a 100-Gbps Ethernet standard would not

be ready before 2010.

Page 31: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

31

Introduction to IP

• IP: Internet Protocol.

• Described by RFC 791.

• Network Layer: it provides the routing of datagrams (or packets) from one node (host) to another one, hiding the existence of possibly different networks (and different technologies) between them.

• Internet: the network of networks where any host can contact any other host, no matter where it is physically set up.

Page 32: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

32

Introduction

Internet

Ethernet

Router

Workstation

Token-ring

Router

Server

Computer

Router

Router

FDDI Ring

Computer

Printer

Bridge

Ethernet

Computer

Laptop

Page 33: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

33

Internet Address

• Each host in the internet is assigned a unique 4-

octet address that is used in all communications

with that host.

• Each address is a pair (netid, hostid).

– netid: network in the internet.

– hostid: host in the network.

• One host can have more than one physical

connections, each one with its one IP address:

multi-homed hosts (e.g. routers).

Page 34: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

34

Classful Addressing Architecture

• Each address is self-identifying: the prefix and suffix can be determined from the address alone. RFC 790, 1981. Useful for the next 12 years.

1 2 3

Class 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

A |0| NETID | HOSTID |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

B |1|0| NETID | HOSTID |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

C |1|1|0| NETID | HOSTID |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

D |1|1|1|0| Multicast Address |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

D |1|1|1|1| Reserved |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Page 35: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

35

Classful Addressing

• There are especial prefixes and addresses,

e.g., the loopback address (127.x.x.x,

127.0.0.1).

Page 36: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

36

Networks and routers

• All nodes in one network will have the same netid.

• Different L3 networks are connected through routers.

• When a node has to send a packet to a node in a

different network it has to send it to the router, the router

will take care of it.

• One way to do this: the node detects the destination

node is in a different network and sends it to the default

gateway, which is set beforehand.

• Other possibility is the use of proxy ARP.

Page 37: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

37

A packet sent (I)

• From host 192.13.13.2 to 192.15.13.201.

C

R3

E

F

G

R1 R2

192.13.13.2

192.13.13.23

192.230.215.7 192.230.215.2

192.230.215.0

192.13.13.0

192.211.7.0

192.211.7.3 192.211.7.2

192.15.13.201

192.15.13.0

192.15.13.76

R4

R1 receives the pkt, it looks at the destination address,

it sends the pkt to 192.230.215.2

R2 sends the pkt to 192.211.7.2

R3 sends the pkt to 192.15.13.201

Page 38: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

38

Questions

• Having R1’s IP address, how does node G know the physical address of router R1 in order to send him the IP datagram?

• How does R2 know R3’s physical address?

• How does R3 know E’s physical address?

C

R3

E

F

G

R1 R2

192.13.13.2

192.13.13.23

192.230.215.7 192.230.215.2

192.230.215.0

192.13.13.0

192.211.7.0

192.211.7.3 192.211.7.2

192.15.13.201

192.15.13.0

192.15.13.76

R4

Page 39: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

39

ARP

• ARP: Address Resolution Protocol.

• In order to send an IP datagram through a physical

link, the datagram must be conveyed by a lower layer

frame containing physical addresses.

• An IP address must be mapped into a physical

address. For example, an Ethernet address (48 bits).

• ARP is a protocol that lets a node obtain the physical

address of a destination node, given the destination IP

address.

Page 40: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

40

ARP Procedure

• Host A wants to send a packet to Host B:

• Host A only knows the IP address of the destination host B. A needs to know B’s physical address.

• Host A broadcasts an ARP frame asking for the physical address of the IP address owner (B).

• Host B receives the frame, it recognizes itself as the destination and it sends a unicast reply with its physical address to A. Every other node drops the broadcast frame.

• A receives the reply, it updates an ARP cache with mappings IP address-Physical address. Afterwards, it sends out the frame within the physical network.

• Next time A will obtain B’s physical address from its ARP cache.

Page 41: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

41

Questions (II)

• Having E’s address, how does G know that it has to send the packet to R1?

• How does R1 send the packet to the next hop?

• How is the packet routed from G to E?

C

R3

E

F

G

R1 R2

192.13.13.2

192.13.13.23

192.230.215.7 192.230.215.2

192.230.215.0

192.13.13.0

192.211.7.0

192.211.7.3 192.211.7.2

192.15.13.201

192.15.13.0

192.15.13.76

R4

Page 42: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

42

Routing I

The main responsibility of the network layer is to make a

packet reach a destination interface from a source interface.

IP provides a Connectionless Delivery Service.

IP implements the mechanism to route one packet through

possibly different physical networks.

This function is implemented by routers. Multi-homed hosts

can provide this service as well.

Page 43: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

43

Routing II

The routing of a packet is based on the netid part of the destination address.

A Router maintains a routing table in which, for each network known to this

router, there is an entry indicating the next hop (maybe next router) through

which the destination is to be reached.

Network

192.13.13.0

Network

192.230.215.0

Network

192.211.7.0

Network

192.15.13.0R1 R2 R3

192.13.13.0 192.230.215.7

192.230.215.0 Interface 0

192.211.7.0 Interface 1

192.15.13.0 192.211.7.2

192.13.13.0 Interface 0

192.230.215.0 Interface 1

192.211.7.0 192.230.215.2

192.15.13.0 192.230.215.2

Page 44: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

44

Routing III

To determine which is the next hop to access a destination

network different criteria can be used. It can be based on the

number of hops, delay, etc.

An algorithm is used to choose one among different paths.

Most used routing algorithms:

• Distance Vector Routing: RIP (Bellman-Ford)

• Link State Routing: OSPF

• Between Autonomous Systems: BGP

Routers have to exchange information with neighbors in order

to let them know the networks it can reach and to know the

networks it can access through the neighbors.

Page 45: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

45

Routing IV

RIP

Each router advertises the networks that it can reach and the number of

hops to access it.

These advertisements are broadcasted every 30 seconds.

A router receives the advertisement from its networks and it updates its

routing tables:

• An entry for that network does not exist- It adds the entry

• There is an entry with a higher number of hops - It is updated.

Every entry has a timeout of 180 seconds.

network next-hop cost

Page 46: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

46

A packet sent II

A packet is sent from host 192.13.13.2 to 192.15.13.201

C

R3

E

F

G

R1 R2

192.13.13.2

192.13.13.23

192.230.215.7 192.230.215.2

192.230.215.0

192.13.13.0

192.211.7.0

192.211.7.3 192.211.7.2

192.15.13.201

192.15.13.0

192.15.13.76

R4

• Before sending the packet in the physical network the destination physical address has to be

obtained.

• Each router looks into its routing table in order to get the next hop for the packet.

• R1 knows it can reach network 192.15.13 in 3 hops by R2 (192.230.215.2).

Page 47: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

47

IP characteristics

The service characteristics are:

• It is connectionless

• It is unreliable

• It provides a best-effort delivery.

Page 48: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

48

IP datagram I

The unit of data that is transferred in IP is a datagram (packet).

It is made up of (RFC 791):

• Header

• Data

0 1 2 3

0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

|Version| IHL |Type of Service| Total Length |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| Identification |Flags| Fragment Offset |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| Time to Live | Protocol | Header Checksum |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| Source Address |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| Destination Address |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| Options | Padding |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Page 49: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

49

Fragmentation

A datagram may have to travel through different networks to reach

the destination.

Each physical network has its MTU: Maximum Transfer Unit.

The datagram size may be too long for transmission in one physical

network: it has to be fragmented.

Each fragment is sent independently.

In the destination host, fragments are reassembled.

Fragment offset indicates the offset of the data inside the non

fragmented datagram.

Identification field is equal in all fragment.

The Flags field is used: do not fragment bit, more fragments bit.

Page 50: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

50

Transport Layer

It provides:

The interface for applications to access the network services. TSAPs.

It permits a communication between one entity in the source host

and another entity in the destination host.

A message is received from any application, through the TSAP and

sent to the network layer: Multiplexing.

When a message is received from the network layer it is delivered to

the appropriate application (TSAP): Demultiplexing.

Page 51: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

51

UDP

It provides an unreliable, connectionless delivery service over IP to

transport a message from one application in one machine to other

application in the destiantion host.

It uses the port concept to multiplex and demultiplex messages

between the applications and the UDP layer.

In a UDP message a source port and a destination port are specified.

Page 52: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

52

TCP I

It provides a connection oriented and reliable service for

messages transmission between two applications in possibly

different hosts. Described by RFC 793.

Its features:

• Connection oriented.

• Stream oriented.

• Buffered transfer.

• Unstructured stream.

• Full duplex.

Page 53: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

53

TCP II

A connection is established between two end points

characterized by:

• Host id.

• Port.

Page 54: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

54

TCP-Segment Format

The TCP segment format:

0 1 2 3

0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| Source Port | Destination Port |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| Sequence Number |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| Acknowledgment Number |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| Data | |U|A|E|R|S|F| |

| Offset| Reserved |R|C|O|S|Y|I| Window |

| | |G|K|L|T|N|N| |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| Checksum | Urgent Pointer |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| Options | Padding |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| data |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Page 55: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

55

TCP-Reliability and Window Size

Reliability is achieved by the acknowledgement of the data

sent and retransmission.

Sequence number: sequence number of the first byte sent in the

segment.

Acknowledgement number: sequence number of the last byte

being acknowledged.

Flow control and window size: the field Window let one end-

point control the flow of data sent by the other end-point by

varying the size of the window that can be sent. If it wants the

other application to stop sending data it sends an

acknowledgement segment with Window size = 0.

Page 56: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

56

TCP-Connection establishment

The connection is established by a three-way handshake.

To initiate a connection a segment is sent with the SYN flag

set.

In the destination host one application has to be listening.

Page 57: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

57

TCP-Connection establishment

The connection is established by a three-way handshake.

To initiate a connection a segment is sent with the SYN flag

set.

In the destination host one application has to be listening.

Host 1 - Connects Host 2 - ListeningMessages

Send SYN seq=x

Receive SYN

Send SYN seq=y, ACK=x+1Receive SYN + ACK segments

Send ACK=y+1

Receive ACK segment

Page 58: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

58

TCP– The state machine

PICTURE SOURCE: http://en.wikipedia.org/wiki/Image:TCP_state_diagram.png

Page 59: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

59

TCP-Congestion

Whenever there is a timeout of a segment that did not receive

its corresponding ACK, TCP considers there is congestion in

the network and it tries to avoid it.

It lowers the sending rate. Algorithms slow start and

congestion avoidance.

It sends one segments and waits for the ACK.

When the ACK arrives it sends two segments and as long as

there is no timeout expiration the rate keeps on increasing.

Page 60: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

60

A message sent

A segment is sent from host 192.13.13.2 to 192.15.13.201

C

R3

E

F

G

R1 R2

192.13.13.2

192.13.13.23

192.230.215.7 192.230.215.2

192.230.215.0

192.13.13.0

192.211.7.0

192.211.7.3 192.211.7.2

192.15.13.201

192.15.13.0

192.15.13.76

R4

• Application A1, in G, wants to send a message to application A2 that is listening in a port P2 of E.

• It connects to the port (E,P2) a port P1 is assigned by the OS to A1 in G. A TCP connection is

Established: two sockets are created.

• A1 sends a message to A2 through its socket. A TCP segment is sent. TCP in E sends an

acknowledgement.

• The TCP connection is closed.

Page 61: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

61

Address shortage

Subnetting, CIDR, and NAT

• During its whole evolution , as it expanded, IP had to

deal with address shortage.

• In 1984, RFC 917 described subnetting. This helped the

distribution of aggregated addresses.

• In 1993, to solve the problem of Class-B Address

Exhaustion and routing information overload, Classless

Inter-Domain Routing was standardized (RFC 1519).

• Also NAT has collaborated to provide connectivity to

many nodes with only one public address.

Page 62: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

62

Internet scales up

Different devices connected

• From the academic world, Internet has expanded to connect the rest of the public. It is already widely used in the business world and new applications are continuously dreamt up.

• Now many devices are offered a limited connectivity.

• Cellular phones might have Internet connectivity as long as they are within the Carrier Provider Radio Area Network.

• Other type of devices can be connected (Camera, Camcorder, robots, cars, etc.). Today some have limited PAN connectivity with Bluetooth (802.15.1) or Zigbee (802.15.4) but they rarely have Internet access.

• As the necessity to connect all type of devices increases, it is more obvious that the current IP address space is not enough.

Page 63: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

63

Internet scales up

More people connected

• As a result of many societies development, more

people gets access to the Internet.

• This is another challenge the current IP address

space could hardly cope with.

Page 64: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

64

IPv6 - Agenda

• A packet in the Internet.

• IPv6 main features.

• IPv6 Headers.

• MTU.

• QoS Support.

• IPv6 Addresses.

• Autoconfiguration.

• Neighbor Discovery Protocol.

• Why do I need IPv6?

• IPv6 new challenges.

Page 65: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

65

The Internet

Internet

Ethernet

Router

Workstation

Token-ring

Router

Server

Computer

Router

Router

FDDI Ring

Computer

Printer

Bridge

Computer

Laptop

switch

UMTS Core Network & UTRAN

Node-B

UMTS Mobile Node

GGSN

Router

VideoAccess Point switch

Router

802.11g

IP routes a packet in the

Internet from a source

node to one or many

destination nodes.

Page 66: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

66

How is this task carried out?

• A Protocol is needed that basically indicates each node which is the next node (next hop) a packet must be sent to.

• The Protocol must define a packet that conveys data from a source node to a destination node.

• The protocol must define an addressing mechanism to be able to locate a destination node and route a packet to it.

• The Protocol must run on different types of networks.

• The Protocol can provide security.

• The Protocol can provide mechanisms for service extensions.

Page 67: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

67

In the Internet model.How does a packet sent from G arrive to E?

C

R3

E

F

G

R1 R2

R4

Routers

Page 68: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

68

IPv6

• Internet Protocol (IP) version 6 provides all the

required services.

• IPv6 is the next version of the Internet Protocol

after IPv4. Some documents call it IPng (IP next

generation).

Page 69: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

69

IPv6 - Main Features

• Address size is 16 Bytes.

• Extended address hierarchy.

• New header format: 1 Base Header + n

Extension Headers.

• Different support for options (comparing to IPv4).

• Support for protocol extensions (e.g. Mobility

support).

Page 70: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

70

IPv6 - Main Features

• Support for autoconfiguration and renumbering.

• Support for resource allocation: Flow label and

service type.

• Support for authentication and privacy is

specified: IPsec natively supported

Page 71: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

71

IPv6 Packet

• In all protocols, a message usually has a basic

structure made of:• A Header: contains Protocol information.

• A Payload: contains data relative to the current layer that must be

passed to the layer above (it could be a message belonging to the

layer above).

• In IP the message relayed is called “packet”.

Page 72: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

72

IPv6 – Headers

• An IPv6 datagram has 40-octect Base Header

and n Extension Headers.

• Advantages:

– Improves performance on header processing.

– The user can choose which extension headers to

include and which to omit.

– Flexibility for new options: more extension

headers can be added.

Page 73: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

73

IPv6 – Base Header

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

|Version| Traffic Class | Flow Label |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| Payload Length | Next Header | Hop Limit |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| |

+ +

| |

+ Source Address +

| |

+ +

| |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| |

+ +

| |

+ Destination Address +

| |

+ +

| |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Page 74: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

74

IPv6 – Headers

• In order to Extract any header information from an IPv6 datagram a sequential search from the base header is required. Every header has a “next header” field.

• Different possibilities for datagrams with base header and n extension headers:

Base Header

NEXT=TCPTCP segment

Base Header

NEXT=hbh

hbh Header

NEXT=TCPTCP segment

Base Header

NEXT=hbh

hbh Header

NEXT=AUTH

AUTH Header

NEXT=TCPTCP segment

Page 75: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

75

IPv6 – Extension Headers

• There are Extension headers useful for each hop from the source to the destination and extension headers to be processed at the destination node.

• A full implementation of IPv6 includes implementation of the following extension headers:

– Hop-by-Hop options: to be processes by routers.

– Routing (Type 0): source routing.

– Fragment: fragmentation header (instead of IPv4 fields).

– Destination Options: to be processed by the destination node.

– Authentication (AH).

– Encapsulating Security Payload (ESP).

Page 76: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

76

Hop-by-Hop and Destination Options

C

R3

E

F

G

R1 R2

R4

Hop-by-Hop OptionsDestination Options

Page 77: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

77

IPv6 – Extension Headers

• When there are more than one header there is a recommended order:

– Base header

– Hop-by-Hop options header

– Destination options header-1

– Source Routing header (Type 0)

– Type 2 routing header (for mobility)

– Fragment header

– Authentication header (AH).

– Encapsulating Security Payload (ESP) header

– Destination Options header-2

– Upper-layer header

Page 78: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

78

Different frame sizes in different link

technologies (different MTU)

C

R3

E

F

G

R1 R2

R4

MTU: nMTU: m

MTU: Maximum Transfer Unit.

MTU: k

Page 79: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

79

IPv6 – Path MTU Discovery and

Fragmentation

• Unlike IPv4, Fragmentation is only performed by source nodes, not by routers along the path.

• IPv6 requires that every link in the Internet have an MTU of 1280 octets or greater.

• Path MTU discovery is recommended for source nodes in order to discover a path MTU larger than 1280 octets.

• It is not as easy as in IPv4 to change the route from the source to the destination. If a route turns unavailable and the alternative route has a smaller MTU, the packet could be dropped.

Page 80: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

80

IPv6 – Quality Of Service

Flow Label• It is intended to define a flow of packets from a source to

a destination for which special handling is required, for example for a “real-time” service.

Traffic Class• This field is intended to define one of different traffic

classes. Used for DiffServ. Along with the flow label it is going to be used to define QoS.

Page 81: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

81

IPv6 –Addresses

• IPv6 addresses are 128-bit “identifiers” for interfaces and sets of interfaces.

• Length: 16 Bytes or 128 bits.

• IPv6 addresses of all types are assigned to interfaces, not nodes.

• Since each interface belongs to a single node, the interface’s unicast addresses can be used as an “identifier” for that node.

• IPv6 Addressing Architecture defined by RFC 4291 (IETF).

Page 82: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

82

IPv6 – Text Representation of Addresses

• 16 Bytes: 128 bits.

• Text representation: Colon Hexadecimal

Notation.

2004:FFED:01:0:0:0:0CC:A1BC

2004:FFED:1::0CC:A1BC

0:0:0:0:128:FA:1234:5678

::128:F0A:1234:5678

::192.168.0.5 (x:x:x:x:x:x:d.d.d.d for embeddedIPv4

addresses)

Note: Zero compression can be applied only once.

Page 83: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

83

IPv6 – Text Representation of Addresses

• Prefixes: the leftmost bits of an address

expressing certain information about it.

FC00::/7 => A 7-bit prefix specified as 1111 110b

2004:FFED:1::/64 => A 64-bit prefix

2001:0DB8:0000:CD30:0000:0000:0000:0000/60

2001:0DB8::cd30:0:0:0:0/60

2001:0DB8:0:cd30::/60

• Node address and prefix:

2001:0DB8:0000:CD31:AB01:3201:A00C:1AF8/60

• Zones?

Page 84: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

84

IPv6 - Addresses

Address types

• Unicast: specifies a single interface (a single node).

• Anycast: specifies a set of interfaces (typically

belonging to different nodes). They are unicast

addresses assigned to different interfaces. The pkt is

delivered to exactly one of them, the nearest one.

• Multicast: specifies a set of interfaces (typically

belonging to different nodes). The pkt is delivered to all

of them.

Note: broadcast is handled with multicast addresses.

Page 85: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

85

IPv6 - AddressesTypes and Scopes

Address Type Binary Prefix

IPv6

Notation

Unspecified 00…0 ::/128

Loopback 00…1 ::1/128

Multicast Addresses 1111 1111 FF00::/8

Link-Local Unicast Addresses 1111 1110 10 FE80::/10

Unique Local IPv6 Unicast Addresses (RFC 4193) 1111 1100 FC00::/7

Site-Local Unicast Addresses (Deprecated RFC 3879) 1111 1110 11 FEC0::/10

Global Unicast Addresses (Aggregatable) everything else

IPv4-Mapped IPv6 Address: ::FFF:d.d.d.d (used in dual-stack nodes)

Page 86: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

86

IPv6 – Scopes

Internet

ComputerComputer

Workstation

Server

Router

ComputerComputer

Computer

Server

Link-local

Site-local

Global(global, unique local)

Page 87: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

87

IPv6 – Addresses

Interface Identifier (ID)

• Interface IDs in IPv6 unicast addresses are used to identify interfaces on a link.

• They can be unique within a broader scope.

• For all unicast addresses, except those that start with the binary value 000, Interface IDs are required to be 64 bits long and to be constructed in Modified EUI-64 format.

• Modified EUI-64 format-based interface IDs may have universal scope (stemmed from IEEE 802 48-bit MAC or IEEE EUI-64 IDs, u bit=1) or local scope (u bit=0). Figure below shows the company ID part.

0 0 0 1 1 2

|0 7 8 5 6 3|

+----+----+----+----+----+----+

|cccc|ccug|cccc|cccc|cccc|cccc|

+----+----+----+----+----+----+

Page 88: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

88

IPv6 – AddressesModified EUI-64 format Interface Identifier (ID)

• Example: creation of a Modified EUI-64 format Interface Identifier from an IEEE 48-bit MAC identifier.

MAC Addr: 00:07:A5:60:0E:F0 (6 Bytes)

02:07:A5: FF:FE: 60:0E:F0Modified EUI-64 ID:

Page 89: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

89

IPv6 – AddressesConfiguration based on Interface Identifier (ID)

•MAC Addr: 00:07:A5:60:0E:F0 (6 Bytes)

•Modified EUI-64 ID: 02:07:A5:FF:FE:60:0E:F0

•Link Local Unicast Addr: FE80::0207:A5FF:FE60:0EF0

Page 90: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

90

IPv6 – AddressesGlobal Unicast Address

• General Format:

| n bits | m bits | 128-n-m bits |

+------------------------+-----------+----------------------------+

| global routing prefix | subnet ID | interface ID |

+------------------------+-----------+----------------------------+

• Global Routing Prefix is hierarchically-structured:

• Regional Internet Registries (RIPE, LACNIC, ARIN, APNIC, AfriNIC): /23 prefixes?

• Providers, research networks, etc.: usually /32 prefixes.

• Site with subnetworks: /48

• Subnetworks: /64

• Global Unicast Address: 2002:C3D4:6EED:1:0207:A5FF:FE60:0EF0 /64

Page 91: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

91

IPv6 – AddressesUnique Local Unicast Address

•General Format:

| 7 bits |1| 40 bits | 16 bits | 64 bits |

+--------+-+------------+-----------+----------------------------+

| Prefix |L| Global ID | Subnet ID | Interface ID |

+--------+-+------------+-----------+----------------------------+

•Prefix (FC00::/7), L (1 for locally assigned Global ID), Global ID (“Globally

unique” pseudo-random ID).

•Example: FDB2:C3D4:6EED:1:0207:A5FF:FE60:0EF0 /64

Page 92: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

92

IPv6 – AddressesZones

• A Zone (or scoped zone) is a connected region of topology of a given

scope.

• Determined by the context and not encoded in the address.

• Different types:

• An interface on a node comprises a single zone of interface-local scope.

• Each link and interfaces attached to it comprise a single zone of link-

local scope.

• A single zone of global scope comprises all links and interfaces in the

Internet.

• The boundaries of other zones are defined by network administrators.

• At each node, a zone is represented by an index.

Page 93: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

93

IPv6 – AddressesHow zones affect us

•Text representation:FE80::0207:A5FF:FE60:0EF0%2

•Programmer: the zone index is set in the sin6_scope_id field of the sockaddr_in6 structure (Socket API).

•Network Administrator: • When a router transmits routing information through one

interface it must not transmit information about zones the interface does not belong to.

• Probably different zones within an organization will be assigned different Unique Local IPv6 Unicast Addresses.

Page 94: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

94

IPv6 Addresses must be assigned to the

Network Interfaces

C

R3

E

F

G

R1 R2

R4

Page 95: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

95

IPv6 – Address Assignment

• It is necessary to assign addresses to a node’s

network interfaces so that packets destined to

this node can reach it.

• IPv6 allows Address Autoconfiguration.

Page 96: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

96

IPv6 – Address Autoconfiguration

• The procedure a host follows to create its interface addresses without manual assistance.

• Autoconfiguration is performed on a per-interface basis on multicast-capable links in multicast-capable interfaces. Begins when the interface becomes enabled.

• It uses Neighbor Discovery Protocol messages.

• Address Autoconfiguration can be:– Stateless: without assistance of stateful servers.

– Stateful: with assistance of a stateful server; for example DHCPv6.

• Both Stateless and Stateful are complementary.

Page 97: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

97

IPv6 – Address AutoconfigurationAddress Autoconfiguration Steps – Link-Local Address

PC3

switch

PC2

PC1

1. Interface is enabled.

2. “Tentative” link-local address

is formed.

3. Duplicate Address Detection

is performed: A Neighbor

Solicitation is sent to

Solicited-Node Multicast

Address of the Target Address

4. If the node ascertains the link-

local address is unique, it is

assigned to the interface.

5. The node has only link

connectivity.

FE80::0207:A5FF:FE60:0EF0

FE80::0207:A5FF:FE60:0EF0

Neighbor Solicitation to

FF02:0:0:0:0:1:FF60:0EF0

2

4

3

Page 98: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

98

IPv6 – Address AutoconfigurationStateless Address Autoconfiguration - Next Steps

PC3

switch

PC2

PC1

1. Routers periodically send out

Router Advertisements with

Prefix Information Options.

2. If a prefix published in the

Prefix Information Option has

the appropriate flag set, it can

be used to form a Global

Address or a Local Unicast

Address.

3. The node has Site or Internet-

wide connectivity. 2002:C3D4:6EED:1:0207:A5FF:FE60:0EF0

Router Advertisements.

Prefix:

2002:C3D4:6EED:1

ROUTER

1

2

Page 99: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

99

How is an IPv6 packet physically relayed

from a node’s NIC to the next hop’s NIC?

C

R3

E

F

G

R1 R2

R4A

NIC: Network Interface Card

Page 100: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

100

Neighbor Discovery Protocol for IPv6

• This protocol is used in IPv6 to:– Determine neighbor’s link-layer address, i.e. address

resolution (NO ARP).

– Determine neighbor bidirectional reachability: Neighbor Unreachability Detection.

– Discover neighboring routers.

– Learning link specific parameters: network prefixes, MTU, etc.

– Next-Hop determination and Redirect.

– Duplicate Address Detection in Address Autoconfiguration.

– Proxy support.

• Messages used in ND Protocol are part of ICMPv6.

Page 101: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

101

IPv6 – ND Protocol Address Resolution

PC3

switch

PC2

PC1

1. PC3 is to send a packet to

2002:C3D4:6EED:1:0207:A5FF:

FE61:2AB8 but first it needs to

know the corresponding HW

address.

2. PC3 sends a Neighbor

Solicitation asking for the owner

of the destination address: it is

sent to the solicited-node

multicast address for the target

addr.

3. PC1 reads the Neighbor

Solicitation and responds with a

Neighbor Advertisement telling

its link-layer address.

4. PC3 can physically send the

packet to the HW (link-layer)

address of PC1.

2002:C3D4:6EED:1:0207:A5FF:FE60:0EF0

2002:C3D4:6EED:1:0207:A5FF:FE61:2AB8

Page 102: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

102

IPv6 – Neighbor Discovery Protocol ICMPv6

Messages

• ND Protocol defines the following ICMPv6 messages:

– Neighbor Solicitation (Duplicate Address Detection, Address Resolution, Neighbor Unreachability Detection).

– Neighbor Advertisement (Duplicate Address Detection, Address Resolution , Neighbor Unreachability Detection, Proxy Support).

– Router Solicitation (Address Autoconfiguration, Network Parameters).

– Router Advertisement (Address Autoconfiguration, Network Parameters).

– Redirect (Next-Hop correction).

Page 103: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

103

Now a Packet sent from G arrives to A

C

R3

E

F

G

R1 R2

R4A

The packet is physically sent from G’NIC to A’s NIC

Neighbor

Solicitation

Page 104: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

104

Now a Packet sent from G arrives to A

C

R3

E

F

G

R1 R2

R4A

The packet is physically sent from G’NIC to A’s NIC

Neighbor

Advertisement

Page 105: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

105

Now a Packet sent from G arrives to E

C

R3

E

F

G

R1 R2

R4

Router

Advertisement

2002:C3D4:6EED:1:0207:A5FF:FE60:0EF0

20B1:CAD1:55ED:1:0207:A5FF:FE61:2AB8

For the sake of simplicity, in this presentation it is assumed intermediate routers know

where to send packets.

Page 106: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

106

Now a Packet sent from G arrives to E

C

R3

E

F

G

R1 R2

R4

2002:C3D4:6EED:1:0207:A5FF:FE60:0EF0

20B1:CAD1:55ED:1:0207:A5FF:FE61:2AB8

For the sake of simplicity, in this presentation it is assumed intermediate routers know

where to send packets.

Page 107: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

107

IPv6 Operation Summary

• The topics presented encompass the basics about IPv6:

• Packet Structure: Base Header and Extension Headers.

• IPv6 Addresses.

• Stateless Address Autoconfiguration.

• Neighbor Discovery Protocol Basics.

• The topics specified above are enough to send a packet from a source node to a destination node.

Page 108: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

108

IPv6 core specifications

• According to the IPv6 Forum (IPv6 Forum Roadmap & Vision, http://www.6journal.org/archive/00000261/02/WWC_IPv6_Forum_Roadmap__Visio

n_2010_v6.pdf)• RFC 1981: Path MTU Discovery.

• RFC 2460: IPv6 Protocol.

• RFC 2461: IPv6 Neighbor Discovery.

• RFC 2462: IPv6 Stateless Auto-Configuration.

• RFC 2463: Internet Control Message Protocol for IPv6 (ICMPv6).

• RFC 4291: IPv6 Address Architecture.

• RFC 4301: Security Architecture for IP (IPsec).

• IPv6 over “XYZ” Link Layer (Ethernet, ATM, PPP, etc.)

Page 109: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

109

Why do I need IPv6?

• There is no killer application for IPv6.

• Although not compatible, IPv6 can be seen as an evolution from the experience gained with IPv4 since 1981.

• The major great advantage is the wider address space. This brings a lot of changes to the communications industry.

Page 110: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

110

Why do I need IPv6?

• The wide address space allows each device in the world to have its own IPv6 address:

• Every device can be connected (PDA, cell phone, robot, sensor, camera, medical equipment, etc.).

• NAT is not necessary to save IP addresses. Without NAT it is possible to achieve E2E communications between nodes.

• This leverages the creation of new ubiquitous services without a centralized server, using P2P architectures:

• A digital camera can send a picture to a PDA without the need of a server in the middle.

• My MP3 Player can directly access my PC and get read music files.

• I can turn on the air conditioner at home from my cell phone without a server in the middle.

Page 111: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

111

Why do I need IPv6?

• IPsec is part of the Protocol.

• It is easier to extend the Protocol by adding new Extension Headers. For example: Mobile IPv6.

• Network parameters can be managed from the router configuration (Network Renumbering and new configuration features).

• Support for Stateless Address Autoconfiguration, allowing “Plug-and-Play” capability.

• Better support for QoS (based on Type of Service and flows).

• Better support for mobility: Route Optimization.

Page 112: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

112

IPv6 new challenges and opportunities

• IPv6 also involves new challenges:

• How can a chat application using E2E communications and

without a centralized server be implemented? How participating

nodes, which join and leave the chat session, can be tracked?

• A proprietary protocol can be implemented at layer 3 by just

adding new Extension Headers.

• TCP might need some changes in order to use all IPv6

advantages.

• Applications using TCP and UDP might need some changes (for

example, the case of prefix lifetime).

• Transition from IPv4 to IPv6 is said to be easy. However, some

features must be considered. In addition, IPv4 and IPv6 must

coexist for a long time (some say 25 years).

• In E2E connectivity, it is more obvious that Security is essential.

Page 113: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

113

IPv6 and other standards groups

• 3GPP mandates that IMS (IP Multimedia Subsystems) will

internally use IPv6 (Within the Core Network).

• 3GPP2 determined that IMS will internally use IPv4 or IPv6.

• In the IETF, 6lowpan WG (IPv6 over Low power WPAN) is

investigating the use of IPv6 over 802.15.4

• IMS Links:• http://www.motorola.com/networkoperators/pdfs/Motorola-IP-Multimedia-Subsystem-

Brochure.pdf#search=%22%2BIMS%20%2B%22Ip%20Multimedia%20Subsystem%22%22

• http://www.ericsson.com/technology/whitepapers/ims_ip_multimedia_subsystem.pdf#search=%22%2BIMS%20%2B%2

2Ip%20Multimedia%20Subsystem%22%22

Page 114: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

114

IPv6 Status and Future

• IPv6 Penetration estimates generated by RTI International in

United States (http://www.nist.gov/director/prog-ofc/report05-2.pdf).

Page 115: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

115

IPv6 Status and Future

• IPv6 Rollout in the world (IPv6 and Broadband, EC IST 6LINK,

http://www.ipv6tf.org/pdf/ISTClusterbooklet2005.pdf).

Page 116: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

116

IPv6 Status and Future

• Major IPv6 activities worldwide (IPv6 and Broadband, EC IST

6LINK, http://www.ipv6tf.org/pdf/ISTClusterbooklet2005.pdf).

Page 117: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

117

IPv6 Status and Future

• The Asia-Pacific region is leading IPv6 adoption with Japan at the

head.

• In most developed regions, government agencies have great

participation in the IPv6 adoption effort.

• The US DoD has announced support for IPv6 back in June 2003.

Its networks will completely be IPv6 capable by 2008.

• In Argentina there is a recently formed IPv6 Task Force

Page 118: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

118

Questions?

Page 119: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

119

Link References

• IST IPv6 Portal: http://www.ist-ipv6.org• IPv6 Forum: http://www.ipv6forum.org• Argentina IPv6 Task Force: http://www.ar.ipv6tf.org (?)• NTIA comments on IPv6: http://www.ntia.doc.gov/ntiahome/ntiageneral/ipv6• North American IPv6 Task Force: http://www.nav6tf.org/• IPv6 and Broadband: www.ist-ipv6.org/pdf/ISTClusterbooklet2005.pdf• IPv6 Forum Roadmap & Vision:

http://www.6journal.org/archive/00000261/02/WWC_IPv6_Forum_Roadmap__Vision_2010_v6.pdf

• IETF: www.ietf.org• HP IPv6 tutorial: http://h10026.www1.hp.com/netipv6/IPv6_seminar_Oct2004.pdf• IPv4-IPv6Transition:

• http://www.6journal.org/archive/00000046/01/trans_ipv6_v014.pdf• http://usipv6.unixprogram.com/North_American_IPv6_Summit_2004/

IPv6_Tutorial/marc_blanchet_tutorial_ipv6_transition.pdf

Page 120: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

120

C Source Code:

IPv6 Client and IPv6 Server

Page 121: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

121

Example: Server

Socket Creation (Family Type AF_INET6):if ((listenSocket = socket(AF_INET6, SOCK_STREAM, 0)) == -1)

{

printf("ERROR - Socket could not be open: %d\n", errno);

return 1;

}

Address and Port to bind to:bzero(&my_addr, sizeof(my_addr));

my_addr.sin6_family = AF_INET6;

my_addr.sin6_port = htons(LISTEN_PORT);

my_addr.sin6_addr = in6addr_any;

my_addr.sin6_scope_id = 2;

Socket Structure Data Type for IPv6:struct sockaddr_in6 my_addr;

struct sockaddr_in6 cliaddr;

Page 122: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

122

Example: Server

Listen to the socket (Like IPv4):res = listen(listenSocket, BACKLOG);

Bind to the interface and port (Like IPv4):res = bind(listenSocket, (struct sockaddr *)&my_addr,

sizeof(struct sockaddr_in6));

Accept connections (Like IPv4):newSocket = accept(listenSocket, (struct sockaddr *) &cliaddr,

(socklen_t*)&size);

Convert client address to print:if (inet_ntop(AF_INET6, (const void *)&cliaddr.sin6_addr,

addrBuffer, INET6_ADDRSTRLEN) == NULL)

Read message (Like IPv4):if ((bytesRead = read(newSocket, (void *)buffer, 100)) == -1)

Close sockets(Like IPv4):close(newSocket);

close(listenSocket);

Page 123: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

123

Example: Client

Socket Creation (Family Type AF_INET6):if ((listenSocket = socket(AF_INET6, SOCK_STREAM, 0)) == -1)

{

printf("ERROR - Socket could not be open: %d\n", errno);

return 1;

}

Address and Port to bind to:#define DEST_ADDR "::1“

bzero(&their_addr, sizeof(their_addr));

their_addr.sin6_family = AF_INET6;

their_addr.sin6_port = htons(LISTEN_PORT);

their_addr.sin6_scope_id = 2;

if (inet_pton(AF_INET6, DEST_ADDR,(void *)&their_addr.sin6_addr)

!= 1)

Socket Structure Data Type for IPv6:struct sockaddr_in6 their_addr;

Page 124: Networking - TCP/IP stack introduction and IPv6

6/28/2015 IPv6 and MIPv6 - Fundamentals,

new services, and applications

124

Example: Client

Connect to Destination (Like IPv4):if (connect(sock, (const struct sockaddr *)&their_addr,

(socklen_t)sizeof(their_addr)) == -1)

Address and Port to bind to (Like any fd):if ((bytesWritten = write(sock, (const void *)buffer,

sizeof(buffer))) == -1)

Close socket(Like any fd):close(sock);