COM204 Computer Networks Chapter 4 PDF

Summary

This document is a chapter from a computer networks textbook, focusing on the Network Layer, IPv4, and IPv6 protocols. It includes definitions, examples, and explanations of key concepts in networking.

Full Transcript

COM204 Computer Networks Chapter 4 Network Layer Prof. Mahmoud Elmesalawy Electronics and Communication Engineering Department Faculty of Engineering Helwan University Chapter 4: Network Layer 4.1 Netw...

COM204 Computer Networks Chapter 4 Network Layer Prof. Mahmoud Elmesalawy Electronics and Communication Engineering Department Faculty of Engineering Helwan University Chapter 4: Network Layer 4.1 Network Layer Functions and Protocols 4.1.1 Network Layer Functions 4.1.2 Network Layer Protocols 4.2 IPv4 Protocol and Addressing 4.2.1 IPv4 Protocol 4.2.2 IPv4 Addresses and its Representation 4.2.3 IPv4 Address Classes 4.2.4 IPv4 Subnet Mask 4.2.5 IPv4 Unicast, Multicast and Broadcast Transmissions 4.2.6 Public and Private IPv4 Addresses 4.2.7 Subnetting an IPv4 Network 4.2.8 Assignment of IPv4 Addresses 4.2.9 IPv4 Protocol Encapsulation 4.3 IPv6 Protocol and Addressing 4.3.1 The Need for IPv6 4.3.2 IPv6 Address Representation 4.3.3 IPv6 Protocol Encapsulation 4.1 Network layer functions and Protocols 4.1.1 Network Layer Functions The network layer, or OSI Layer 3, provides services to allow end devices to exchange data across the network. To accomplish this, the network layer have the following four basic functions: Addressing end device Routing Encapsulation and Decapsulating 4.1.2 Network Layer Protocols Common network layer protocols include: IP version 4 (IPv4) IP version 6 (IPv6) Legacy network layer protocols include: AppleTalk Novell Internetwork Packet Exchange (IPX) Connectionless Network Service (CLNS/DECNet) Fig. 4.1 Network Layer Functions. Routing protocols include: RIP, OSPF, IGRP, EIGRP and BGP 4.2 IPv4 Protocol and Addressing 4.2.1 IPv4 Protocol IPv4 is an unreliable connectionless datagram protocol providing best effort services. Best-effort means that IPv4 provides no error control or flow control. If reliability is important, IPv4 must be paired with a reliable protocol such as TCP. IPv4 is also a connectionless protocol for a packet-switching network that uses the datagram approach. This means that each datagram is handled independently, and each datagram can follow a different route to the destination. Position of IPv4 in TCP/IP protocol. 4.2 IPv4 Protocol and Addressing 4.2.1 IPv4 Protocol Characteristics of IP Protocol 4.2 IPv4 Protocol and Addressing 4.2.1 IPv4 Protocol IP Services IP supports the following services as shown in Fig. 4.2: - one-to-one (Unicast). - one-to-all (Broadcast). - one-to-several (Multicast). IP multicast requires support of other protocols (IGMP, multicast routing) unicast broadcast multicast Fig. 4.2 IP Services. 4.2 IPv4 Protocol and Addressing 4.2.2 IPv4 Addresses and its Representation IP address is a logical (Software) address. Uniquely and universally defines the device. An IPv4 address is a 32-bit address. Address space is the total number of addresses used by the protocol. If a protocol uses n bits to define an address, the address space is 2n. The address space of IPv4 is 232 or 4,294,967,296. There are two prevalent notations to show an IPv4 address: – binary notation – dotted decimal notation In binary notation, the IPv4 address is displayed as 32 bits. In Dotted-Decimal Notation addresses are usually written in decimal form with a decimal point (dot) separating the bytes. 4.2 IPv4 Protocol and Addressing 4.2.2 IPv4 Addresses and its Representation Example 4.1 Change the following IPv4 addresses from binary notation to dotted-decimal notation. a) 10000001 00001011 00001011 11101111 b) 11000001 10000011 00011011 11111111 c) 11100111 11011011 10001011 01101111 d) 11111001 10011011 11111011 00001111 Solution We replace each group of 8 bits with its equivalent decimal number and add dots for separation: a) 129.11.11.239 b) 193.131.27.255 c) 231.219.139.111 d) 249.155.251.15 4.2 IPv4 Protocol and Addressing 4.2.2 IPv4 Addresses and its Representation Example 4.2 Change the following IPv4 addresses from dotted-decimal notation to binary notation. a. 111.56.45.78 b. 221.34.7.82 c. 241.8.56.12 d. 75.70.34.78 Solution We replace each decimal number with its binary equivalent: a. 01101111 00111000 00101101 01001110 b. 11011101 00100010 00000111 01010010 c. 11110001 00001000 00111000 00001100 d. 01001011 00101101 00100010 01001110 4.2 IPv4 Protocol and Addressing 4.2.2 IPv4 Addresses and its Representation Example 4.3 Find the error, if any, in the following IPv4 addresses. Solution a. There must be no leading zero (045). b. There can be no more than four numbers. c. Each number needs to be less than or equal to 255. d. A mixture of binary notation and dotted-decimal notation is not allowed. 4.2 IPv4 Protocol and Addressing 4.2.3 IPv4 Address Classes (Classful Addressing) The IPv4 address space is divided into five classes, each of which is designated with the alphabetic letters : A, B, C, D, and E. Classes A, B and C addresses are used for unicast services. Class D addresses are used for multicast services. Class E addresses are reserved for testing and some future use. Example 4.4: Find the class of each address: a. 227.12.14.87  The first byte is 227 (between 224 and 239); the class is D. b. 193.14.56.22  The first byte is 193 (between 192 and 223); the class is C. c. 14.23.120.8  The first byte is 14 (between 0 and 127); the class is A. d. 252.5.15.111  The first byte is 252 (between 240 and 255); the class is E. 4.2 IPv4 Protocol and Addressing 4.2.3 IPv4 Address Classes (Classful Addressing) Example 4.5: Find the class of each address. a. 00000001 00001011 00001011 11101111 b. 11000001 10000011 00011011 11111111 c. 14.23.120.8 d. 252.5.15.111 Solution a. The first bit is 0. This is a class A address. b. The first 2 bits are 1; the third bit is 0. This is a class C address. c. The first byte is 14; the class is A. d. The first byte is 252; the class is E. 4.2 IPv4 Protocol and Addressing 4.2.3 IPv4 Address Classes (Classful Addressing) The 32 bits of the IP address are divided into Network and Host portions, with the octets assigned as a part of one or the other. Each Network is assigned a network address & every device or interface (such as a router port) on the network is assigned a host address. There are only 2 specific rules that govern the value of the address: - A host address cannot be designated by all zeros or all ones: These are special addresses that are reserved for special purposes. Network & Host Representation By IP Address Class Class Octet1 Octet2 Octet3 Octet4 Class A Network Host Host Host Class B Network Network Host Host Class C Network Network Network Host 4.2 IPv4 Protocol and Addressing 4.2.3 IPv4 Address Classes (Classful Addressing) Network Id (Net Id) and Host Id netid 000... 0 First address 4.2 IPv4 Protocol and Addressing 4.2.3 IPv4 Address Classes (Classful Addressing) Classes and Blocks  Class A Class A IP addresses use the 1st 8 bits (1st Octet) to designate the Network address. The 1st bit which is always a 0, is used to indicate the address as a Class A address and the remaining 7 bits are used to designate the Network. The other 3 octets contain the Host address. There are 128 Class A Network Addresses, but because addresses with all zeros aren’t used & address 127 is a special purpose address, So, (27 – 2) = 126 Class A Networks are available. There are 16,777,214 Host addresses available in a Class A address. Rather than remembering this number exactly, you can use the following formula to compute the number of hosts available in any of the class addresses, where “n” represents the number of bits in the host portion: (2n – 2) = Number of available hosts. For a Class A network, there are: 224 – 2 or 16,777,214 hosts. Half of all IP addresses are Class A addresses. 4.2 IPv4 Protocol and Addressing 4.2.3 IPv4 Address Classes (Classful Addressing) Classes and Blocks  Class A Fig. 4.3 Class A address. 4.2 IPv4 Protocol and Addressing 4.2.3 IPv4 Address Classes (Classful Addressing) Classes and Blocks  Class B Class B addresses use the 1st 16 bits (two octets) for the Network address. The last 2 octets are used for the Host address. The 1st 2 bits, which are always 10, designate the address as a Class B address and 14 bits are used to designate the Network. This leaves 16 bits (two octets) to designate the Hosts. So how many Class B Networks can there be? Using our formula, (214), there can be 16,384 Class B Networks and each Network can have (216 – 2) Hosts, or 65,534 Hosts. 4.2 IPv4 Protocol and Addressing 4.2.3 IPv4 Address Classes (Classful Addressing) Classes and Blocks  Class B Fig. 4.5 Class B address. 4.2 IPv4 Protocol and Addressing 4.2.3 IPv4 Address Classes (Classful Addressing) Classes and Blocks  Class C Class C addresses use the 1st 24 bits (three octets) for the Network address & only the last octet for Host addresses. the 1st 3 bits of all class C addresses are set to 110, leaving 21 bits for the Network address, which means there can be 2,097,150 (221) Class C Networks, but only 254 (28 – 2) Hosts per Network. Fig. 4.6 Class C address. 4.2 IPv4 Protocol and Addressing 4.2.3 IPv4 Address Classes (Classful Addressing) 4.2 IPv4 Protocol and Addressing 4.2.4 IPv4 Subnet Mask To define the network and host portions of an address, a devices use a separate 32-bit pattern called a subnet mask. The subnet mask does not actually contain the network or host portion of an IPv4 address, it just says where to look for these portions in a given IPv4 address. /8 /16 /24 4.2 IPv4 Protocol and Addressing 4.2.4 IPv4 Subnet Mask Finding the Network (Subnet) Address Given an IP address, we can find the network (subnet) address by applying the mask to the address. We can do this in two ways: straight or short-cut. 1. Straight Method: In the straight method, we use binary notation for both the address and the mask and then apply the AND operation. 1 AND 1 = 1 1 AND 0 = 0 0 AND 1 = 0 0 AND 0 = 0 Bitwise AND Operation 4.2 IPv4 Protocol and Addressing 4.2.4 IPv4 Subnet Mask Finding the Network (Subnet) Address 2. Short-Cut Method: If the byte in the mask is 255, copy the byte in the address. If the byte in the mask is 0, replace the byte in the address with 0. If the byte in the mask is neither 255 nor 0, we write the mask and the address in binary and apply the AND operation. Example 4.9 What is the subnetwork address if the destination address is 19.30.84.5 and the mask is 255.255.192.0? Solution The solution is Shown in the Figure. to find 4.2 IPv4 Protocol and Addressing 4.2.4 IPv4 Subnet Mask Finding the Network (Subnet) Address Example 4.9 What is the subnetwork address if the destination address is 200.45.34.56 and the subnet mask is 255.255.240.0? Solution 11001000 00101101 00100010 00111000 11111111 11111111 11110000 00000000 11001000 00101101 00100000 00000000 The subnetwork address is 200.45.32.0. to find 4.2 IPv4 Protocol and Addressing 4.2.5 IPv4 Unicast, Multicast and Broadcast Transmissions In an IPv4 network, the hosts can communicate one of three different ways: Unicast, Broadcast, and Multicast; discussed as follows: 1) Unicast – the process of sending a packet from one host to an individual host. Fig. 4.7 Unicast transmissions. 4.2 IPv4 Protocol and Addressing 4.2.5 IPv4 Unicast, Multicast and Broadcast Transmissions 2) Broadcast – the process of sending a packet from one host to all hosts in the network. NOTE: Routers do not forward a limited broadcast! Directed broadcast - Destination 172.16.255.255 - Hosts within the 172.16.0.0/16 network Fig. 4.8 Broadcast transmissions. 4.2 IPv4 Protocol and Addressing 4.2.5 IPv4 Unicast, Multicast and Broadcast Transmissions 3) Multicast – The process of sending a packet from one host to a selected group of hosts, possibly in different networks.  Reduces traffic  Reserved for addressing multicast groups – 224.0.0.0 to 239.255.255.255.  Link local – 224.0.0.0 to 224.0.0.255 (Example: routing information exchanged by routing protocols).  Globally scoped addresses – 224.0.1.0 to 238.255.255.255 (Example: 224.0.1.1 has been reserved for Network Time Protocol). 4.2 IPv4 Protocol and Addressing 4.2.6 Public and Private IPv4 Addresses Private address blocks are:  Hosts that do not require access to the Internet can use private addresses  10.0.0.0 to 10.255.255.255 (10.0.0.0/8)  Class A  172.16.0.0 to 172.31.255.255 (172.16.0.0/12)  Class B  192.168.0.0 to 192.168.255.255 (192.168.0.0/16)  Class C Special Use of IPv4 Addresses Network and Broadcast addresses – within each network the first and last addresses cannot be assigned to hosts Loopback address – 127.0.0.1 a special address that hosts use to direct traffic to themselves (addresses 127.0.0.0 to 127.255.255.255 are reserved) Link-Local address – 169.254.0.0 to 169.254.255.255 (169.254.0.0/16) addresses can be automatically assigned to the local host TEST-NET addresses – 192.0.2.0 to 192.0.2.255 (192.0.2.0/24) set aside for teaching and learning purposes, used in documentation and network examples Experimental addresses – 240.0.0.0 to 255.255.255.254 are listed as reserved 4.2 IPv4 Protocol and Addressing Example of IP Addressing A router is necessary as a device to communicate between different networks (subnets). Each router interface must have an IP address that belongs to the network or subnet that the router interface is connected. Devices on a network and subnet use the router interface attached to their LAN as their default gateway. Fig. 4.9 IP Addressing Example. 4.2 IPv4 Protocol and Addressing 4.2.7 Subnetting an IPv4 Network Subnetting is the process of segmenting a network into multiple smaller network spaces called subnetworks or subnets. Large networks must be segmented into smaller subnetworks, creating smaller groups of devices and services to: Control traffic by containing broadcast traffic within each subnetwork. Reduce overall network traffic and improve network performance. Planning requires decisions on each subnet in terms of size, the number of hosts per subnet, and how host IP addresses will be assigned. Fig. 4.10 Subnetting. 4.2 IPv4 Protocol and Addressing 4.2.7 Subnetting an IPv4 Network Baisc Subnetting Borrowing bits to create subnets Subnetting Formulas Calculate number of subnets Calculate number of hosts Formula to determine number of usable hosts: 2^n-2  2^n (where n is the number of remaining host bits) is used to calculate the number of hosts.  -2 (The subnetwork ID and broadcast address cannot be used on each subnet.) 4.2 IPv4 Protocol and Addressing 4.2.7 Subnetting an IPv4 Network Basic Subnetting (Creating 2 Subnets) Subnets in Use Subnet 0 Network 192.168.1.0-127/25 Subnet Mask 255.255.255.128 Subnet 1 Network 192.168.1.128-255/25 Subnet Mask 255.255.255.128 Fig. 4.11 Two subnets. 4.2 IPv4 Protocol and Addressing 4.2.7 Subnetting an IPv4 Network Basic Subnetting (Creating 4 Subnets) Borrowing 2 bits to create 4 subnets. 22 = 4 subnets Creating 4 Subnets 4.2 IPv4 Protocol and Addressing 4.2.7 Subnetting an IPv4 Network Basic Subnetting (Creating 8 Subnets) Borrowing 3 bits to create 8 subnets. 23 = 8 subnets Subnet Mask 255.255.255.224  /27 4.2 IPv4 Protocol and Addressing 4.2.7 Subnetting an IPv4 Network Basic Subnetting (Creating 8 Subnets)  (Cont.) Borrowing 3 bits to create 8 subnets. 23 = 8 subnets Subnet Mask 255.255.255.224  /27 4.2 IPv4 Protocol and Addressing 4.2.7 Subnetting an IPv4 Network Basic Subnetting (Creating 8 Subnets)  (Cont.) Borrowing 3 bits to create 8 subnets. 23 = 8 subnets Fig. 4.12 Eight subnets. 4.2 IPv4 Protocol and Addressing 4.2.8 Assignment of IP Addresses Internet Assigned Numbers Authority (IANA) is responsible for global coordination of the Internet Protocol addressing systems, as well as the Autonomous System Numbers used for routing Internet traffic. Both IPv4 and IPv6 addresses are generally assigned in a hierarchical manner. Users are assigned IP addresses by Internet Service Providers (ISPs). ISPs obtain allocations of IP addresses from a Local Internet Registry (LIR) or National Internet Registry (NIR), or from their appropriate Regional Internet Registry (RIR) as shown in 4.18. The IANA's role is to allocate IP addresses from the pools of unallocated addresses to the RIRs according to their needs as described by global policy and to document protocol assignments made by the IETF. When an RIR requires more IP addresses for allocation or assignment within its region, the IANA makes an additional allocation to the RIR. IANA do not make allocations directly to ISPs or end users except in specific circumstances, such as allocations of multicast addresses or other protocol specific needs. 4.2 IPv4 Protocol and Addressing 4.2.8 Assignment of IP Addresses Regional Internet Registries (RIRs) Fig. 4.18 Regional Internet Registries (RIRs) and area covered. 4.2 IPv4 Protocol and Addressing 4.2.8 Assignment of IP Addresses Assigning a Static IPv4 Address to a Host LAN Interface Properties Configuring a Static IPv4 Address 4.2 IPv4 Protocol and Addressing 4.2.8 Assignment of IP Addresses Assigning a Dynamic IPv4 Address to a Host Dynamic Host Configuration Protocol version 4 (DHCPv4) The preferred method of assigning IPv4 addresses to hosts on large networks because it reduces the burden on network support staff and virtually eliminates entry errors. 4.2 IPv4 Protocol and Addressing 4.2.9 IPv4 Protocol Encapsulation Fig. 4.21 IPv4 Datagram Format. 4.2 IPv4 Protocol and Addressing IPv4 Datagram Format IPv4 Datagram Format is shown in Fig. 4.21. the length of the header is variable (between 20 and 60 bytes). it has the following fields: 1. Version (VER) Field This 4-bit field defines the version of the IPv4 protocol. Currently the version is 4. 2. Header length (HLEN) or Internet Header Length (IHL) Field This 4-bit field defines the total length of the datagram header in 4-byte words. This field is needed because the length of the header is variable (between 20 and 60 bytes). When there are no options, the header length is 20 bytes, and the value of this field is 5 (5 x 4 = 20). When the option field is at its maximum size, the value of this field is 15 (15 x 4 = 60). Example 4.10 An IPv4 packet has arrived with the first 8 bits as shown: 01000010 The receiver discards the packet. Why? Solution: There is an error in this packet. The 4 leftmost bits (0100) show the version, which is correct. The next 4 bits (0010) show an invalid header length (2 × 4 = 8). The minimum number of bytes in the header must be 20. The packet has been corrupted in transmission. 4.2 IPv4 Protocol and Addressing IPv4 Datagram Format Example 4.11 In an IPv4 packet, the value of HLEN in binary is: 1000. How many bytes of options are being carried by this packet? Solution: The HLEN value is 8, which means the total number of bytes in the header is 8 × 4, or 32 bytes. The first 20 bytes are the base header, the next 12 bytes are the options. 3. Service Field the first 3 bits are called precedence bits. The next 4 bits are called type of service (TOS) bits and the last bit is not used. 3.1 Precedence subfield Precedence is a 3-bit subfield ranging from 0 (000 in binary) to 7 (111 in binary). It defines the priority of the datagram in issues such as congestion. If a router is congested and needs to discard some datagrams. 4.2 IPv4 Protocol and Addressing IPv4 Datagram Format 3.2 Type of Service (TOS) subfield TOS is a 4-bit subfield each bit having a special meaning as indicated by: Note: The precedence subfield was part of version 4, but never used. 4.2 IPv4 Protocol and Addressing IPv4 Datagram Format 4. Total length Field defines the total length (header plus data) of the IPv4 datagram in bytes. To find the length of the data coming from the upper layer, subtract the header length from the total length. Length of data =total length - header length Since the field length is 16 bits, the total length of the IPv4 datagram is limited to 65,535 (2^16 - 1) bytes, of which 20 to 60 bytes are the header and the rest is data from the upper layer. Note: The total length field defines the total length of the datagram including the header. Example 4.12 In an IPv4 packet, the value of HLEN is 5, and the value of the total length field is 40. How many bytes of data are being carried by this packet? Solution The HLEN value is 5, which means the total number of bytes in the header is 5 × 4, or 20 bytes (no options). The total length is 40 bytes, which means the packet is carrying 20 bytes of data (40 − 20). 4.2 IPv4 Protocol and Addressing IPv4 Datagram Format 5. Identification Field 16-bit field identifies a datagram originating from the source host. The combination of the identification and source IPv4 address must uniquely define a datagram. The value in the identification field is copied to all fragments. All fragments having the same identification value must be assembled into one datagram. 6. Flags Field Flag is a 3-bit field. The first bit is reserved. The second bit is called the do not fragment bit. Flags used in fragmentation - If its value is D = 1, the machine must not fragment the datagram. - If its value is D = 0, the datagram can be fragmented if necessary. The third bit is called the more fragment bit. - If its value is M = 1, it means the datagram is not the last fragment; there are more fragments after this one. - If its value is M = 0, it means this is the last or only fragment 4.2 IPv4 Protocol and Addressing IPv4 Datagram Format 7. Fragmentation Offset Field Fragmentation offset is a 13-bit field shows the relative position of this fragment with respect to the whole datagram. the value of the offset is measured in units of 8 bytes. The bytes in the original datagram are numbered 0 to 3999. The first fragment carries bytes 0 to 1399. The offset for this datagram is 0/8 =0. The second fragment carries bytes 1400 to 2799; the offset value for this fragment is 1400/8 = 175. Finally, the third fragment carries bytes 2800 to 3999. The offset value for this fragment is 2800/8 =350. 4.2 IPv4 Protocol and Addressing IPv4 Datagram Format 8. Time To Live Field this field is used mostly to control the maximum number of hops (routers) visited by the datagram. Each router that processes the datagram decrements this number by 1. The datagram discarded when the value became zero. 9. Protocol Type This 8-bit field defines the higher-level protocol that uses the services of the IPv4 layer. Higher-level protocols such as TCP, UDP, ICMP, and IGMP. since the IPv4 protocol carries data from different other protocols, the value of this field helps the receiving network layer know to which protocol the data belong. Protocol type values Protocol Field and Encapsulated Data 4.2 IPv4 Protocol and Addressing IPv4 Datagram Format 10. Header Check Sum Header check sum is used for error detection on header and options only. Using block size of 16 bits to generate header check sum. The header is divided into 16-bit sections. All the sections are added and the sum is complemented. The result is inserted in the checksum field. An example of a checksum calculation for an IPv4 header without options 4.3 IPv6 Protocol and Addressing 4.3.1 The Need for IPv6 Despite all short-term solutions, address depletion is still a long-term problem for the Internet. This and other problems in the IP protocol itself have been the motivation for IPv6. IPv6 is designed to be the successor to IPv4. Depletion of IPv4 address space has been the motivating factor for moving to IPv6. Projections show that all five RIRs will run out of IPv4 addresses between 2015 and 2020. With an increasing Internet population, a limited IPv4 address space, issues with NAT and an Internet of things, the time has come to begin the transition to IPv6! IPv4 has a theoretical maximum of 4.3 billion addresses, plus private addresses in combination with NAT. IPv6 larger 128-bit address space provides for 340 undecillion addresses. IPv6 fixes the limitations of IPv4 and includes additional enhancements, such as ICMPv6. 4.3 IPv6 Protocol and Addressing 4.3.1 The Need for IPv6 Despite all short-term solutions, address depletion is still a long-term problem for the Internet. This and other problems in the IP protocol itself have been the motivation for IPv6. IPv6 is designed to be the successor to IPv4. Depletion of IPv4 address space has been the motivating factor for moving to IPv6. Projections show that all five RIRs will run out of IPv4 addresses between 2015 and 2020. With an increasing Internet population, a limited IPv4 address space, issues with NAT and an Internet of things, the time has come to begin the transition to IPv6! IPv4 has a theoretical maximum of 4.3 billion addresses, plus private addresses in combination with NAT. IPv6 larger 128-bit address space provides for 340 undecillion addresses. IPv6 fixes the limitations of IPv4 and includes additional enhancements, such as ICMPv6. 4.3 IPv6 Protocol and Addressing 4.3.2 IPv6 Address Representation 128 bits in length and written as a string of hexadecimal values In IPv6, 4 bits represents a single hexadecimal digit, 32 hexadecimal value = IPv6 address 2001:0DB8:0000:1111:0000:0000:0000:0200 FE80:0000:0000:0000:0123:4567:89AB:CDEF Hextet used to refer to a segment of 16 bits or four hexadecimals Can be written in either lowercase or uppercase 4.3 IPv6 Protocol and Addressing 4.3.2 IPv6 Address Representation Rule 1- Omitting Leading 0s The first rule to help reduce the notation of IPv6 addresses is any leading 0s (zeros) in any 16-bit section or hextet can be omitted. 01AB can be represented as 1AB. 09F0 can be represented as 9F0. 0A00 can be represented as A00. 00AB can be represented as AB. Rule 2 - Omitting All 0 Segments A double colon (::) can replace any single, contiguous string of one or more 16-bit segments (hextets) consisting of all 0’s. Double colon (::) can only be used once within an address otherwise the address will be ambiguous. Known as the compressed format. Incorrect address - 2001:0DB8::ABCD::1234. 4.3 IPv6 Protocol and Addressing 4.3.2 IPv6 Address Representation Rule 2 - Omitting All 0 Segments Example 4.19 Example 4.20 4.3 IPv6 Protocol and Addressing 4.3.2 IPv6 Address Representation Example 4.21: Expand the address 0:15::1:12:1213 to its original. This means that the original address is: Example 4.22: Fig. 4.22 Abbreviated IPv6 addresses. 4.3 IPv6 Protocol and Addressing 4.3.2 IPv6 Address Representation IPv6 Prefix Length IPv6 does not use the dotted-decimal subnet mask notation Prefix length indicates the network portion of an IPv6 address using the following format: – IPv6 address/prefix length – Prefix length can range from 0 to 128 – Typical prefix length is /64 4.3 IPv6 Protocol and Addressing IPv4 Addressing Concepts and Their IPv6 Equivalents IPv4 Address IPv6 Address Address Length – 32 bits 128 bits Address Representation - decimal hexadecimal Internet address classes Not applicable in IPv6 Multicast addresses (224.0.0.0/4) IPv6 multicast addresses (FF00::/8) Broadcast addresses Not applicable in IPv6 Unspecified address is 0.0.0.0 Unspecified address is :: Loopback address is 127.0.0.1 Loopback address is ::1 Public IP addresses Global unicast addresses Private IP addresses (10.0.0.0/8, Site-local addresses (FEC0::/10) 172.16.0.0/12, and 192.168.0.0/16) Autoconfigured addresses (169.254.0.0/16) Link-local addresses (FE80::/64) 4.3 IPv6 Protocol and Addressing 4.3.3 IPv6 Protocol Encapsulation 4.3 IPv6 Protocol and Addressing IPv6 Datagram Format 1. Version (4 bits) 4 bits are used to indicate the version of IP and is set to 6 2. Traffic Class (8 bits) same function as the Type of Service field in the IPv4 header. 3. Flow Label (20 bits) identifies a flow and it is intended to enable the router to identify packets that should be treated in a similar way without the need for deep lookups within those packets. set by the source and should not be changed by routers along the path to destination. unique & powerful tool to IPv6 4. Payload Length (16 bits) With the header length fixed at 40 bytes, it is enough to indicate the length of the payload to determine the length of the entire packet. 5. Next Header (8 bits) Indicates either the first extension header (if present) or the protocol in the upper layer PDU (such as TCP, UDP, or ICMPv6). When indicating an upper layer protocol above the Internet layer, the same values used in the IPv4 Protocol field are used here. 4.3 IPv6 Protocol and Addressing IPv6 Datagram Format 6. Hop Limit (8 bits) In IPv6, the IPv4 TTL was appropriately renamed Hop Limit because it is a variable that is decremented at each hop, and it does not have a temporal dimension. 7. Source IPv6 Address (128 bits) Stores the IPv6 address of the originating host. 8. Destination IPv6 Address (128 bits) Stores the IPv6 address of the current destination host.

Use Quizgecko on...
Browser
Browser