27
IPv6 Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF

Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

IPv6

Dr. Sanjay P. Ahuja, Ph.D.

Professor

School of Computing, UNF

Page 2: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

2

Goals of IPv6

1. Support billions of hosts, even with inefficient address space utilization.

2. Reduce the size of routing tables.

3. Simplify the protocol to allow routers to process packets faster.

4. Provide better security.

5. Support for real-time data.

6. Permit the old and new protocols to co-exist for years.

Page 3: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

3

IPv6 vs. IPv4 1. IPv6 is compatible with TCP, UDP, ICMP, OSPF, and DNS.

2. IPv6 addresses are 128 bits (16-bytes) providing an effectively unlimited

supply of Internet addresses.

3. IPv6 header is simplified compared to IPv4 header. It contains only 8 fields

(vs. 13 in IPv4) thus allowing routers to process packets faster and so

improving throughput.

4. IPv6 has better support for options. Options are represented so that it is

simpler for routers to skip over options not intended for them. This speeds up

packet processing.

5. IPv6 represents an advance in security: authentication and privacy are

features of the new IP.

Page 4: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

4

IPv6 Formats

• The IPv6 packet has the general form:

40 bytes | 0 or more extension headers -------- |

Extension headers defined include:

1. Hop-by-hop Options header: defines special options that require hop-by-hop

(at each router) processing at every router.

2. Routing header: similar to IPv4 source routing.

3. Fragment header: contains fragmentation and reassembly information.

4. Authentication header: provides packet integrity and authentication.

5. Encapsulating Security Payload header: provides privacy (encryption).

6. Destination Options header: contains optional information to be examined by

the ultimate destination of the IP datagram.

IPv6 header Extension

Header ………Extension

header

Transport level

PDU (e.g. TCP

segment)

Page 5: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

5

IPv6 Formats …

• Note that the IPv6 header and each extension header include a NextHeader field

(except the Encapsulating Security Payload header). This field identifies the type (of

header) immediately following the header.

• If the next header is an extension header then this field contains the type ID of that

header. Else this field contains the protocol ID of the higher layer (transport layer)

protocol using IPv6 (e.g. TCP or UDP). This ID is the same as used by IPv4 to

identify the receiving transport protocol.

Page 6: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

6

IPv6 Formats …

Page 7: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

7

IPv6 Header

Page 8: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

8

IPv6 Header Fields

• Version (4-bits): Specifies the IP version, i.e. 6.

• DS (6-bits) and ECN (2-bits): These are fields represent Differentiated Services and

Explicit Congestion Notification, respectively. These 2 fields have replaced the old

Type of Service field (also 8-bits) in IPv4. – DS field is similar to the Type of Service field and marks how the router should treat packets and if the

router treats packets differently based on the service.

– ECN field lets the source routers know of a router’s congestion before the router actually starts to drop

packets so that the source routers can slow down their data transmission rate before the router actually

needs to drop packets. Of the 2-bits in this field, the most significant bit (MSB) represents ECT (ECN

Capable Transport) and the LSB represents CE (Congestion Experienced).

• Flow Label (20-bits): Relates to QoS issues. It allows source and destination to set

up a pseudo-connection within the IP layer (not an actual VC) with particular

properties and requirements. Each flow is identified by <source address, destination

address, flow #> so that many flows may be active between a given pair of IP

addresses.

Page 9: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

9

IPv6 Header Fields …

• Payload Length (16-bits): Its name has been changed from Total Length in IPv4

since the 40 header bytes is no longer counted as part of the length as it used to be.

• Next Header (8-bits): The reason that the IPv4 header could be simplified is that now

there can be additional (optional) extension headers. The Next Header field

indicates what this optional header is (if any). If none, this field specifies the TCP or

UDP protocol used, thus replacing 2 fields of IPv4: IP Options and Protocol.– If there is an extension header(s), then the last extension header’s Next Header field will indicate TCP or

UDP protocol (i.e. TCP or UDP segment will follow).

• Hop Limit (8-bits): Is the TTL of IPv4, renamed to reflect the way it is actually used.

• Source and Destination Addresses (128-bits or 16-bytes each): Thus the IPv6

header is always 40 bytes long. Considering that IPv6 addresses are 4-times the

length of IPv4 addresses, the IPv6 header size (40 bytes) compares favorably with

the IPv4 header size of 20 bytes in the absence of options.

Page 10: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

10

IPv6 Address Space Allocation

• There are 2^128 = 3 * 10^38 addresses (of 16-bytes each) if the addresses are

assigned with 100% efficiency. This gives 7 * 10^23 addresses per square meter if

the entire earth, land and water were covered with computers! – In practice, the address space will not be used efficiently. Still, IPv6 is predicted to provide over 1000 addresses per

square meter of the earth’s surface!

• There are 2^128 = 3 * 10^38 addresses (of 16-bytes each) if the addresses are

assigned with 100% efficiency. This gives 7 * 10^23 addresses per square meter if

the entire earth, land and water were covered with computers! – In practice, the address space will not be used efficiently. Still, IPv6 is predicted to provide over 1000 addresses per

square meter of the earth’s surface! This is more than enough even if toasters, computers, TVs, PDAs, smart phones

have IP addresses (toasters even on Mars)!!

Page 11: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

11

IPv6/IPv4 Address Embedding

• IPv4 and IPv6 will coexist for at least a decade. IPv6 hosts must be capable of

talking to each other with some of the infrastructure between them only supporting

IPv4. Also IPv4 nodes (routers) should be able to talk to other IPv4 and IPv6 nodes

indefinitely.

• Two types of mechanisms: dual-stack and tunneling.

• In dual-stack mode, IPv6 nodes run both IPv6 and IPv4 and use the Version field to

decide which stack should process an arriving packet. Here the IPv6 address could

be unrelated to IPv4 address or the ―IPv4-mapped IPv6 address‖ (80 zeros – 16

ones – IPv4 address) is used (arriving from nodes that only understand IPv4).

• In tunneling, an IPv6 packet is encapsulated within an IPv4 header that has the

tunnel end point in its header and then transmitted across the IPv4 only network and

de-encapsulated at the end point (either a node or a host). In either case, the end

point must be able to process the IPv6 packet after de-encapsulation.

Page 12: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

12

IPv4-Mapped IPv6 Addresses

• These are regular IPv4 addresses that have been mapped into the IPv6 address

space, and are used for devices that are only IPv4-capable. They have a set of 16

ones (FFFF in hex) after the initial string of 80 zeroes, and then the IPv4 address.

So, if an IPv4 device has the address 222.1.41.90, it would be represented as

0:0:0:0:0:FFFF:222.1.41.90, or ::FFFF:222.1.41.90.

Page 13: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

13

IPv4-Compatible IPv6 Addresses

• These are special addresses assigned to IPv6-capable devices, such as so-called

―dual stack‖ devices that speak both IPv4 and IPv6. They have all zeroes for the

middle 16 bits; thus, they start off with a string of 96 zeroes, followed by the IPv4

address. An example of such an address, would be 0:0:0:0:0:0:101.45.75.219 in

mixed notation, or more succinctly, ::101.45.75.219.

Page 14: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

14

IPv6 Extension Headers

Page 15: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

15

IPv6 Extension Headers …

• The only field common to all extension header types is the Next Header field. The 8-bit Next

Header field is used to logically link all the headers in an IPv6 datagram as follows:– The Next Header field in the main header contains a reference number for the first extension header type.

– The Next Header field in the first extension header contains the number of the second extension header type, if there is a

second one. If there's a third, the second header's Next Header points to it, and so on.

– The Next Header field of the last extension header contains the protocol number of the encapsulated higher-layer protocol

(e.g. TCP).

• Example: An IP datagram that encapsulates TCP has a Hop-By-Hop Options extension header and a Fragment extension

header. Then, the Next Header fields of these headers would contain the following values:

• The main header would have a Next Header value of 0, indicating the Hop-By-Hop Options header.

• The Hop-By-Hop Options header would have a Next Header value of 44 (decimal), the value for the Fragment extension

header.

• The Fragment header would have a Next Header value of 6

(for TCP).

Page 16: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

16

IPv6 Option Extension Header Types

• The two extension header types are:

• Destination Options: Contains options that are intended only for the ultimate

destination of the datagram

• Hop-By-Hop Options: Contains options that carry information for every router

between the source and destination

• IPv6 Option Format

• Each of these header types has a

one-byte Next Header field, and a

one-byte Header Extension Length field

that indicates the header’s overall length

in 8-byte words. The rest of the header

has one or more option fields. Each option

is expressed as a

<Type, Data Length, Data Value>

tuple.

Page 17: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

17

IPv6 Option Extension Header Types …

Page 18: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

18

IPv6 Extension Headers (Jumbograms)

• The Hop-By-Hop Options is used to support datagrams that exceed 64K

(jumbograms).

• The Next Header specifies the type of the next header. The Header Extension Length field is 0 because this

extension header’s length is 8-bytes, which is expressed as 0 since the first 8 bytes are not included in this

field. The 8-bit Option Type field contains the value 194, which indicates the Jumbo Payload option. The 8-bit

Option Data Length field contains the value 4, which indicates that 4 bytes of data will follow—that is, the

Jumbo Payload Length field. The last one indicates the packet length in bytes, excluding the IPv6 header but

including the Hop-by-Hop Options header. Since the packet length field is 32-bits wide, the jumbogram can be

up to 4 GB in size (2^32) (this length must be more than 65,535 bytes). The Payload Length field of the IPv6

header must be set to zero in every packet that carries the Jumbo Payload option.

• The format of the header is:

Next Header 0 194 4

Jumbo Payload Length

Page 19: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

19

IPv6 Extension Headers (Fragmentation)

• Next Header (8-bits): Contains the protocol number of the next header after the Fragment header.

• Reserved (8-bits): Not used; set to zeroes.

• Fragment Offset (13-bits): Specifies the offset, or position, in the overall message where the data in this

fragment goes. It is specified in units of 8 bytes and used in a manner very similar to the field of the same

name in the IPv4 header.

• Reserved (2-bits): Not used; set to zeroes.

• More Fragments Flag (1-bit): Same as the flag of the same name in the IPv4 header—when set to 0,

indicates the last fragment in a message; when set to 1, indicates that more fragments are yet to come in the

fragmented message.

• Identification (32-bits): Same as the Identification field of the same name in the IPv4 header, but expanded

to 32 bits. It contains a fragmentation ID that is common to each of the fragments belonging to a particular

message, to ensure that pieces from different fragmented messages are not mixed together.

Page 20: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

20

IPv6 Extension Headers (Fragmentation) …

• Fragmentation is needed since a 1 MB packet would tie up a 1.5 Mbps T1 line for 5

seconds. In IPv6 (unlike IPv4), only the source host may fragment a datagram.

Routers along the way cannot do this. This simplifies the router’s work and routing

goes faster.

• If a router is confronted with a datagram that is too big, it discards the datagram

(packet) and sends an ICMP message to the source which uses this information to

fragment packets into smaller pieces and try again.

Page 21: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

21

IPv6 Extension Headers (Routing)

• The Routing header supports a function very similar to the IPv4 packet Source Route option and specifies a

list of intermediate nodes that a packet has to traverse on the path to its destination.

• The Routing header is identified by a Next Header value of 43. The Type 0 Routing Header has the fields

Next Header, HdrExt Len, Routing Type, Segment Left, Reserved, and Strict/Loose Bit Map, followed by up to

23 actual IPv6 addresses. This format is shown below.

Page 22: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

22

IPv6 Extension Headers (Routing) …

• The 8-bit Next Header field uses the same values as the field with the same name in the IPv6 header. The 8-

bit Hdr Ext Len (Header Extension Length) field contains the length of the Routing header in 8-byte (64-bit)

units, not including the first 8 bytes. In the case of a Type 0 Routing header, the Hdr Ext Len value must be

less than or equal to 46, equal to twice the number of addresses in the header itself, and therefore even. In

fact, the first 8-bytes contain the fixed part of the Type 0 Routing header (Next Header, HdrExt Len, Routing

Type, Segment Left, Reserved, and Strict/Loose Bit Map), and each address has 16 bytes, i.e., two times 8-

bytes. The 8-bit Routing Type field always contains, in this case, the zero value. Different values can be used

in the future to support new types of Routing headers.

• The 8-bit Segments Left field contains the number of explicitly listed intermediate nodes still to be visited on

the path to the destination— i.e., the number of addresses not yet used. The maximum legal value for this

field is 23.

• The 8-bit Reserved field is reserved for future uses. It must be set to zero for transmission and ignored on

reception.

• The 24-bit Strict/Loose Bit Map field is a mask containing a Strict/Loose bit for each address. If the

Strict/Loose bit associated with an address is zero, then the address must be treated as Loose; if equal to 1,

the address must be treated as Strict.

• Each Address field is 16-bytes (128 bits) long, and up to 23 Address fields can be used.

Page 23: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

23

IPv6 Extension Headers (Routing) …

• When a Routing header is processed by a router/node, the node checks whether the Segment Left field is

different from 0, and if so, it extracts the following address and the Strict/Loose bit associated with the

address. If the bit indicates that the address must be treated in the Strict way, the node checks that the

address belongs to an adjacent node (a neighbor on one of the links), and it delivers the packet on the

interface associated with that adjacent node; if the node is not adjacent, the packet is discarded. If the bit

indicates that the address must be treated in the Loose way, the node examines its routing tables and routes

the packet to the address.

Page 24: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

24

IPv6 Address Format

• IPv6 addresses consist of eight hexadecimal groups. Each hexadecimal group, separated by a colon (:),

consists of a 16-bit hexadecimal value. The following is an example of the IPv6 format:

• xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx

• A group of xxxx represents the 16-bit hexadecimal value. Each individual x represents a 4-bit hexadecimal

value. The following is an example of a possible IPv6 address:

4FDE:0000:0000:0002:0022:F376:FF3B:AB3F

Page 25: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

25

IPv6 Address Format …

• Some address prefixes:

0000 0000 Reserved (includes IPv4 which begin with 80 zeros)

010 Provider based addresses (each company like AT&T, Sprint etc. is given a fraction of this address space). The first 5 bits after the 010 prefix indicate which registry to look the provider up in (e.g. Europe, Asia, N. America). Each registry can divide up the remaining 15-bytes as it sees fit. Of these 15-bytes, 3-bytes are set aside for provider number, given about 16-million providers.

100 Geographic addresses where the address relates to where you are physically rather than who your provider is. So IPv6 can handle both provider and geography based addresses.

0000 0001 Reserved for encoding non-IP addresses (e.g. IPX from Novell); currently undefined.

0000 0010 Reserved for encoding non-IP addresses (e.g. IPX from Novell); currently undefined.

1111 1110 10 Link local use addresses allow communications between devices on a local link.

1111 1110 11 Site local use addresses (both site and link local use addresses have only local significance and can be used at each organization without conflict (e.g. within firewalls)).IPv6 routers must not forward packets that have site-local source or destination addresses outside the site.

Page 26: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

26

IPv6 Address Types

• IPv6 can use several types of addresses:

• Unicast - Used to identify a single interface.

• Multicast - Used for sending packets to multiple destinations. A multicast transmission sends packets to all interfaces that are part of a multicast group. The group is represented by the IPv6 destination address of the packet.

• Anycast - Used for a set of interfaces on different nodes. An anycast transmission sends packets to only one of the interfaces associated with the address, not to all of the interfaces. This interface is typically the closest interface, as defined by the routing protocol.

• Loopback - Used by a node to send an IPv6 packet to itself. An IPv6 loopback address functions the same as an IPv4 loopback address.

• Unspecified - Indicates the absence of an IPv6 address. For example, newly initialized IPv6 nodes may use the unspecified address as the source address in their packets until they receive an IPv6 address.

• IPv4-compatible - Contains a standard IPv4 address in the lower-order 32 bits of the address and zeros in the higher-order 96 bits of the address. For example, the format of an IPv4-compatible IPv6 address is 0:0:0:0:0:0:A.B.C.D (or condensed as ::A.B.C.D). In other words, devices using IPv6 use the entire 128-bit IPv4-compatible IPv6 address, whereas IPv4 devices use the IPv4 address embedded within the lower-order 32-bits of the address. You would use IPv4-compatible IPv6 addresses for devices that must support both IPv4 and IPv6 protocols.

Page 27: Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNFsahuja/cnt6707/IPv6.pdf · Dr. Sanjay P. Ahuja, Ph.D. Professor School of Computing, UNF. 2 Goals of IPv6 1. Support billions

27

IPv6 Header vs. IPv4 header

• The IHL field is gone because the IPv6 header has a fixed length (40 bytes).

• The Protocol field is because the Next Header field tells what follows the last IP header (e.g.

TCP or UDP).

• All fields related to fragmentation have been removed. All IPv6 conformant hosts/routers must

support packets of 576 bytes. So fragmentation is less likely to occur and so it has been moved

to the extension header.

• Checksum field is gone because calculating it greatly reduces performance. Error checking is

left to higher protocols such as TCP.

• In summary, the goal of a fast, yet flexible, protocol with plenty of address space has been met

with this design.