Network Protocols Chapter 5 (TCP/IP Suite Book): IPv4 Addresses

Slides:



Advertisements
Similar presentations
Chapter 5 IPv4 Addresses TCP/IP Protocol Suite
Advertisements

19.1 Chapter 19 Network Layer: Logical Addressing Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 19 Network Layer: Logical Addressing Stephen Kim.
1 Computer Communication & Networks Lecture 17 & 18 Network Layer: Logical Addressing Waleed Ejaz.
IPv4 Addresses. Internet Protocol: Which version? There are currently two versions of the Internet Protocol in use for the Internet IPv4 (IP Version 4)
Logical addressing Engr.Jawad Ali.
Network Layer: Logical Addressing. 4-1 IPv4 ADDRESSES An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a device.
TCP/IP Protocol Suite 1 Chapter 4 Objectives Upon completion you will be able to: IP Addresses: Classful Addressing Understand IPv4 addresses and classes.
Chapter 5 IPv4 Addresses TCP/IP Protocol Suite
TCP/IP Protocol Suite 1 Chapter 5 Objectives Upon completion you will be able to: IP Addresses: Classless Addressing Understand the concept of classless.
1 IP Addressing (IPv4 ADDRESSES). 2 Universal Service Concept Any computer can communicate with any other computer in the world. Multiple independently.
TCP/IP Protocol Suite 1 Chapter 4 Objectives Upon completion you will be able to: IP Addresses: Classful Addressing Understand IPv4 addresses and classes.
TCP/IP Protocol Suite 1 Chapter 5 Objectives Upon completion you will be able to: IP Addresses: Classless Addressing Understand the concept of classless.
7/3/2015 Unit-3 : Network Layer 1 CS 1302 Computer Networks — Unit - 3 — — Network Layer — Text Book Behrouz.A. Forouzan, “Data communication and Networking”,
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 4 IP Addresses: Classful Addressing.
NETE0510 Presented by Dr.Apichan Kanjanavapastit
NETWORK LAYER (2) T.Najah AlSubaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.
19.1 Chapter 19 Network Layer: Logical Addressing Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 19 Network Layer: Logical Addressing
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 19 Network Layer Logical Addressing © 2012 by McGraw-Hill Education. This is proprietary material.
Layering and the TCP/IP protocol Suite  The TCP/IP Protocol only contains 5 Layers in its networking Model  The Layers Are 1.Physical -> 1 in OSI 2.Network.
IP-adresses and subnet masks. Figure 19.9 Dotted-decimal notation.
Fall 2006Computer Networks19-1 Chapter 19. Host-to-Host Delivery: Internetworking, Addressing, and Routing 19.1 Internetworks 19.2 Addressing 19.3 Routing.
IP Addressing and Network Software. IP Addressing  A computer somewhere in the world needs to communicate with another computer somewhere else in the.
IPv4 Addresses. Internet Protocol: Which version? There are currently two versions of the Internet Protocol in use for the Internet IPv4 (IP Version 4)
1 Kyung Hee University Prof. Choong Seon HONG IP Addressing : Classful Addressing.
Copyright © Lopamudra Roychoudhuri
19.1 Chapter 19 Network Layer: Logical Addressing Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 IP Addresses: Classful Addressing Teeratorn Saneeyeng, KMUTNB.
Network Layer: Logical Addressing. Address Space Notations Classful Addressing Classless Addressing Network Address Translation (NAT) Topics Discussed.
19.1 Chapter 19 Network Layer: Logical Addressing Computer Communication & Networks.
19.1 Chapter 19 Network Layer: Logical Addressing Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 4 IP Addressing : Classful Addressing
HANNAM UNIVERSITY TCP/IP Protocol Suite 1 Chapter 5 Objectives Upon completion you will be able to: IP Addresses: Classless Addressing.
Chapter 4 Objectives Upon completion you will be able to: Classful Internet Addressing Understand IPv4 addresses and classes Identify the class of an.
1 Chapter 4 IP Addressing : Classful Addressing Chapter 4 IP Addressing : Classful Addressing Mi-Jung Choi Dept. of Computer Science, KUN
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 5 IPv4 Addresses.
19.1 Chapter 19 Network Layer: Logical Addressing Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 5 IPv4 Address.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Network Layer PART IV.
CS470 Computer Networking Protocols
IP Addresses: Classful Addressing IP Addresses. INTRODUCTION 4.1.
IP ADDRESSING Lecture 2: IP addressing Networks and Communication Department 1.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 5 IPv4 Addresses.
TCP/IP Protocol Suite 1 Chapter 4 Objectives Upon completion you will be able to: IP Addresses: Classful Addressing Understand IPv4 addresses and classes.
TCP/IP Protocol Suite 1 Objectives Upon completion you will be able to: IP Addresses: Classful Addressing Understand IPv4 addresses and classes Identify.
Network Layer/IP Protocols 1. Outline IP Datagram (IPv4) NAT Connection less and connection oriented service 2.
19.1 Chapter 19 Network Layer: Logical Addressing Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 IP Addresses: Classful Addressing.
19.1 Chapter 19 Network Layer: Logical Addressing Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
UNIT 4 NETWORK LAYER. Position of network layer 7/8/2016 UNIT-3 : NETWORK LAYER 2.
IP Addresses: Classful Addressing
NET 221D:Computer Networks Fundamentals
4.3 Network Layer Logical Addressing
IP Addresses: Classful Addressing IP Addresses. CONTENTS INTRODUCTION CLASSFUL ADDRESSING Different Network Classes Subnetting Classless Addressing Supernetting.
Chapter 5 IPv4 Addresses TCP/IP Protocol Suite
Chapter-5 TCP/IP Suite.
PART IV Network Layer.
4 Network Layer Part I Computer Networks Tutun Juhana
IP Addresses: Classful Addressing
An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a device (for example, a computer or a router) to the Internet.
CS 1302 Computer Networks — Unit - 3 — — Network Layer —
IP Addresses: Classful Addressing
Chapter 19 Network Layer: Logical Addressing
Network Layer: Logical Addressing
CPEG512 Advanced Computer Networks
Data Communications and Networking
Part IV Network layer 10. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Introduction to Network
Presentation transcript:

Network Protocols Chapter 5 (TCP/IP Suite Book): IPv4 Addresses Copyright © Lopamudra Roychoudhuri

Agenda IPv4 Addresses: IPv4 addresses and classes Classful addressing Network addresses and masks Network Address Translation (NAT) 2

Network Layer The network layer is designed as a packet-switched network. Packet-switched network can provide either a connectionless service or a connection-oriented service. When the network layer provides a connectionless service, each packet traveling in the Internet is an independent entity; there is no relationship between packets belonging to the same message. In a connection-oriented service, there is a virtual connection between all packets belonging to a message.

Network Layer This means that the packet at the source is divided into manageable packets, normally called datagrams. Individual datagrams are then transferred from the source to the destination. The received datagrams are assembled at the destination before recreating the original message. The packet-switched network layer of the Internet was originally designed as a connectionless service.

Figure 4.3 A connectionless packet-switched network The network layer is responsible for delivery of packets from the source to the destination.

Figure 4.4 Forwarding process in a connectionless network The source address may be used to send an error message to the source if the packet is discarded. The forwarding decision is based on the destination address of the packet.

IP Addresses The identifier used in the IP layer of the TCP/IP protocol suite to identify each device connected to the Internet Uniquely and universally defines the connection of a host or a router to the Internet 32 bits, 4 bytes long dotted decimal notation Each of the 4 values is in range 0 – 255, such as, 150.21.39.52 The address space of IPv4 is 232 or 4,294,967,296. 2

IP Addresses cont. How does every device on the Internet get a different IP address? IP Address Prefixes assigned to organizations by the Internet Assigned Numbers Authority (IANA) Distributes IP address pools to Regional Internet Registry (RIR) organizations, such as Réseaux IP Européens Network Coordination Centre (RIPE NCC) http://www.iana.org/numbers/ 2

IP Addresses cont. RIPE NCC hands over IP address prefixes to Organizations: ISPs, Universities, large businesses These organizations then control all IP addresses starting with that prefix Small businesses are loaned a group of IP addresses by ISP Individual PCs get a dynamically assigned IP address from ISP each time they dial up. 2

IP Addresses cont. 0x80 0x0B 0x03 0x3F Hexadecimal notation 0x80 0x0B 0x03 0x3F Binary notation Dotted Decimal notation An IP address can also be thought of as a number in base 256. i.e., 128.11.3.31 is nothing but 128*256^3 + 11*256^2 + 3*256^1 + 31*256^0 (See TCP/IP Textbook appendix B, Page 898)

IP Addresses IP address is designed to identify A particular IP Network that this packet should be delivered to by Internet routers A particular IP host machine on that network that this packet should be delivered to by local router at the destination site 2

Classful IP Addresses IP addresses, when started a few decades ago, used the concept of classes. This architecture is called classful addressing. Class A: for Large networks Class B: for Medium networks Class C: for Small networks Class D: Multicast

Figure 5.7 Finding the class of an address using continuous checking

00000000 0 ……0 01111111 1 ……1 10000000 0 ……0 10111111 1 ……1 11000000 0 ……0 11011111 1 ……1 11100000 0 ……0 11101111 1 ……1 11110000 0 ……0 11111111 1 ……1

Occupation of the address space

Figure 5.15 Information extraction in classful addressing

Example 19.1 Change the following IPv4 addresses from binary notation to dotted-decimal notation. Solution We replace each group of 8 bits with its equivalent decimal number (see Appendix B) and add dots for separation.

Example 19.2 Change the following IPv4 addresses from dotted-decimal notation to binary notation. Solution We replace each decimal number with its binary equivalent .

Example 19.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.

Example 19.4 Find the class of each address. 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.

Note In classful addressing, a large part of the available addresses were wasted.

Note Classful addressing, which is almost obsolete, is replaced with classless addressing.

Example 5.5 Find the number of addresses in a range if the first address is 146.102.29.0 and the last address is 146.102.32.255. Solution We can subtract the first address from the last address in base 256 (see Appendix B). The result is 0.0.3.255 in this base. To find the number of addresses in the range (in decimal), we convert this number to base 10 and add 1 to the result. = 255 * 256^0 + 3 * 256^1 = 1023 + 1 = 1024

Net Address First address in the block Network address defines the network to rest of Internet Given network address we can find the class of the address, the block, and range of addresses in the block

Network Address

Blocks in class A

Class A Address First byte value between 1 and 127 ICANN specifies value of 1st byte Organization chooses IP address for each device by assigning value in last 3 bytes. Organization may have (256 * 256 * 256) = 16 million different IP addresses for devices!! Millions of class A addresses are wasted. List of Assigned class A addresses 2

Blocks in class B

Class B Address First byte has value between 128 and 191 ICANN specifies value of 1st and 2nd bytes Organization chooses IP address for each device by assigning value in last 2 bytes. Organization has (256 * 256) = 65,536 different IP addresses for devices!! Many class B addresses are wasted. 2

Blocks in class C

Class C Address First byte has value between 192 and 223 ICANN specifies value of 1st, 2nd and 3rd bytes Organization chooses particular IP address for each device by assigning value in last byte. Organization gets 256 different IP addresses for its devices The number of addresses in class C is smaller than the needs of most organizations Example: IP addresses 207.46.232.x are all controlled by Microsoft Corporation 2

Unicast, Multicast, and Broadcast Addresses Unicast communication is one-to-one. Multicast communication is one-to-many. Broadcast communication is one-to-all.

Class D Address First byte has value between 224 and 239 There is no Network ID or Host ID. The entire address is used for multicasting Each address represents a group of hosts that all listen to one sender Example: Address 224.0.0.9 can be used to send routing information to all RIP2-aware routers on a network segment. List of used multicast addresses 2

Multicast Category addresses Distance Vector Multicast Routing Protocol Open Shortest Path First Internet Stream Protocol Routing Information Protocol Interior Gateway Routing Protocol

IP Special Addresses Address Netid Hostid Src/Dest Network Address Specific All 0s None Direct Broadcast All 1s Dest Limited Broadcast This host Source Host on this network Loopback 127 Any 2

Direct Broadcast Direct broadcast address is used by a router to send a message to every host on a local network

Limited Broadcast Limited broadcast address is used by a host to send a packet to every host on the same network However, the packet is blocked by routers

This Host A host that does not know its IP address uses the IP address 0.0.0.0 as the source address and 255.255.255.255 as the destination address to send a message to a boot strap server Can be used only as a source address

Loopback A packet with loopback address will not reach the network Can be used by a client process to send a message to a server process on the same machine Can only be used as a destination address

Private Addresses A number of blocks in each class are assigned for private use. They are not recognized globally, hence cannot be used on public Internet

Multihomed devices A device that has more than one Internet address; a different address for each network connected to it

Sample internet A LAN with nw address 220.3.6.0 (class C) A LAN with nw address 134.18.0.0 (class B) A LAN with nw address 124.0.0.0 (class A) A point-to-point WAN A switched WAN Note: The book does not show any IP address for point-to-point link end-points But in reality point-to-point WAN interfaces are also assigned IP addresses.

Question How can you determine if an IP address belongs to a particular network? Answer: Apply a netmask A mask is a 32-bit binary number that gives the first address in the block, i.e. the network address when bitwise ANDed with an address in the block

Network Address The network address is the beginning address of each block. It can be found by applying the default mask to any of the addresses in the block (including itself). It keeps the netid of the block and sets the hostid to zero.

Masking concept bit bit

Anding & Oring Tables Anding 1 Oring 1

Default Masks 11111111 11111111 00000000 00000000 10001101 00001110 01001000 00011000 10001101 00001110 00000000 00000000

Example 19.6 A block of addresses is granted to a small organization. We know that one of the addresses is 205.16.37.39/24. What is the first address in the block? Solution The binary representation of the given address is 11001101 00010000 00100101 00100111 If we used the default mask and And it with the IP address, we get 11001101 00010000 00100101 00000000 or 205.16.37.0.

Note The last address in the block can be found by setting the rightmost 32 − n bits to 1s.

Example 5.13 An address in a block is given as 73.22.17.25. Find the number of addresses in the block, the first address, and the last address. Solution Figure 5.16 shows a possible configuration of the network that uses this block. 1. From the 1st byte we know that this is a class A address. Hence number of network bits (n) is 8. The number of addresses in this block is N = 232−n=232−8=224 =16,777,216. 2. To find the first address, we keep the leftmost 8 bits and set the rightmost 24 bits all to 0s. The first address is 73.0.0.0, in which 8 is the value of n. 3. To find the last address, we keep the leftmost 8 bits and set the rightmost 24 bits all to 1s. The last address is 73.255.255.255.

Figure 5.16 Solution to Example 5.13

Example 5.14 An address in a block is given as 180.8.17.9. Find the number of addresses in the block, the first address, and the last address. Solution Figure 5.17 shows a possible configuration of the network that uses this block. 1. The number of addresses in this block is N = 232−n = 65,536. 2. To find the first address, we keep the leftmost 16 bits and set the rightmost 16 bits all to 0s. The first address is 180.8.0.0, in which 16 is the value of n. 3. To find the last address, we keep the leftmost 16 bits and set the rightmost 16 bits all to 1s. The last address is 180.8.255.255.

Figure 5.17 Solution to Example 5.14

Example 5.15 An address in a block is given as 200.11.8.45. Find the number of addresses in the block, the first address, and the last address. Solution Figure 5.17 shows a possible configuration of the network that uses this block. 1. The number of addresses in this block is N = 232−n = 256. 2. To find the first address, we keep the leftmost 24 bits and set the rightmost 8 bits all to 0s. The first address is 200.11.8.0, in which 24 is the value of n. 3. To find the last address, we keep the leftmost 24 bits and set the rightmost 8 bits all to 1s. The last address is 200.11.8.255.

Figure 5.18 Solution to Example 5.15

Example 5.16 (Note that the book’s solution is incorrect) A router receives a packet with the destination address 201.24.67.32. Show how the router finds the network address of the packet. Solution Since the class of the address is C, we assume that the router applies the default mask for class C, 255.255.255.0 to find the network address. 255 67

Another way to find the first address, last address, , and the number of addresses Another way to find the first address, the last address, and the number of addresses is to represent the mask as a 32-bit binary (or 8-digit hexadecimal) number. a. The first address can be found by ANDing the given addresses with the mask. ANDing here is done bit by bit. The result of ANDing 2 bits is 1 if both bits are 1s; the result is 0 otherwise. b. The last address can be found by ORing the given addresses with the complement of the mask The complement of a number is found by changing each 1 to 0 and each 0 to 1. c. The number of addresses can be found by complementing the mask, interpreting it as a decimal number, and adding 1 to it.

Network Address Translation (NAT)  Network Address Translation (NAT): is the process of modifying  IP address information in IPv4 headers while in transit across a traffic  routing device. NAT is necessary when the number of IP addresses assigned to you by your ISP is less than the total number of computers that you wish to provide Internet access for. The simplest type of NAT provides a one-to-one translation of IP addresses. This refers to this type of NAT as basic NAT, which is often also called a one-to-one NAT.  Another way to map an entire network (or networks) to a single IP address (Security wise). NAT allows you to take advantage of the reserved address blocks. http://en.wikipedia.org/wiki/Network_address_translation http://www.openbsd.org/faq/pf/nat.html

Figure 19.10 A NAT implementation

Figure 19.11 Addresses in a NAT

Figure 19.12 NAT address translation

Table 19.4 Five-column translation table

Figure 19.13 An ISP and NAT