CE363 Data Communications & Networking. Chapter 6 Network Layer: Logical Addressing

Similar documents
Chapter 19 Network Layer: Logical Addressing 19.1

Chapter 5. IPv4 Addresses. TCP/IP Protocol Suite 1 Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

TCP/IP Basis. OSI Model

Subnetting/Supernetting and Classless Addressing

Classful IP Addressing (cont.)

IP Subnetting and Addressing

Internet Addresses (You should read Chapter 4 in Forouzan)

Chapter 4. IP Addresses: Classful Addressing

WHITE PAPER. Understanding IP Addressing: Everything You Ever Wanted To Know

PART IV. Network Layer

Computer Network Foundation. Chun-Jen (James) Chung. Arizona State University

Computer Networks. Introduc)on to Naming, Addressing, and Rou)ng. Week 09. College of Information Science and Engineering Ritsumeikan University

Internetworking and IP Address

APPENDIX B. Routers route based on the network number. The router that delivers the data packet to the correct destination host uses the host ID.

Savera Tanwir. Internet Protocol

CCNA Tutorial Series SUBNETTING

Topics. Subnetting. The Basics of Subnetting Subnet Mask Computing subnets and hosts Subnet Routing Creating a Subnet Example of Subnetting 1/37

Lab#2: IP Addressing and Subnetting

IP Addressing. -Internetworking (with TCP/IP) -Classful addressing -Subnetting and Supernetting -Classless addressing

IP Addressing A Simplified Tutorial

1. How many unique network IDs are there in class A addresses? # of unique hosts?

Future Internet Technologies

Tutorial (03) IP addresses & Sub netting

IP Addressing Introductory material.


Network and Host Addresses , Cisco Systems, Inc. All rights reserved. INTRO v1.0a 6-4

IP Addressing. IP Addresses. Introductory material.

256 4 = 4,294,967,296 ten billion = 18,446,744,073,709,551,616 ten quintillion. IP Addressing. IPv4 Address Classes

Internet Protocol Address

(Refer Slide Time: 02:17)

How To Make A Network Address Prefix Smaller

IP address format: Dotted decimal notation:

Subnet + CIDR. Internet Networking recitation #1. 11: , Internet Networking,

TCP/IP works on 3 types of services (cont.): TCP/IP protocols are divided into three categories:

How to Create Subnets To create subnetworks, you take bits from the host portion of the IP address and reserve them to define the subnet address.

TCP/IP Addressing and Subnetting. an excerpt from: A Technical Introduction to TCP/IP Internals. Presentation Copyright 1995 TGV Software, Inc.

Table of Contents. Cisco IP Addressing and Subnetting for New Users

Variable length subnetting

CCNA R&S: Introduction to Networks. Chapter 9: Subnetting IP Networks

Internet Protocol (IP) IP - Network Layer. IP Routing. Advantages of Connectionless. CSCE 515: Computer Network Programming IP routing

8.2 The Internet Protocol

IP addressing. Interface: Connection between host, router and physical link. IP address: 32-bit identifier for host, router interface

Lecture 15. IP address space managed by Internet Assigned Numbers Authority (IANA)

IP Networking Part 3- IP Address Management A webinar to help you prepare for the CBNE Certification

Internet Protocols. Addressing & Services. Updated:

Guide to TCP/IP, Third Edition. Chapter 2: IP Addressing and Related Topics

Internet Protocol version 4 Part I

Computer Networks By Bahaa Q. Al-Mussawi Subnetting Basics Reduced network traffic Optimized network performance Simplified management

2. IP Networks, IP Hosts and IP Ports

Desirable Properties Of An Internet Addressing Scheme

You can probably work with decimal. binary numbers needed by the. Working with binary numbers is time- consuming & error-prone.

Chapter 3: Review of Important Networking Concepts. Magda El Zarki Dept. of CS UC Irvine

Network Layer: Logical Addressing

We Are HERE! Subne\ng

The Subnet Training Guide

IP Addressing and Subnetting for New Users

Number of bits needed to address hosts 8

SUPPORT DE COURS. Dr. Omari Mohammed Maître de Conférences Classe A Université d Adrar Courriel : omarinmt@gmail.com

IP Addressing and Subnetting. 2002, Cisco Systems, Inc. All rights reserved.

Chapter 4 IP Addresses: Classful Addressing

Networking Test 4 Study Guide

5. Classless and Subnet Address Extensions 최 양 희 서울대학교 컴퓨터공학부

Classless Subnetting Explained

2.3 IPv4 Address Subnetting Part 2

VLSM and CIDR Malin Bornhager Halmstad University

Pre-lab Preparation: 1. Read thoroughly and prepare the experiment sheet. 2. You must bring a printed copy of this experiment with you to the lab.

1 Data information is sent onto the network cable using which of the following? A Communication protocol B Data packet

Guide to Network Defense and Countermeasures Third Edition. Chapter 2 TCP/IP

Advanced IP Addressing

Introduction to IP v6

SNMP/HTTP Access Control User Manual

2. What is the maximum value of each octet in an IP address? A. 28 B. 255 C. 256 D. None of the above

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ

Subnetting IPv4 and IPv6

Lab IP Addressing Overview

Internetworking With TCP/IP

Module 2: Assigning IP Addresses in a Multiple Subnet Network

- IPv4 Addressing and Subnetting -

Understanding IP Addressing: Everything You Ever Wanted To Know

IPv6 in Axis Video Products

CS 348: Computer Networks. - IP addressing; 21 st Aug Instructor: Sridhar Iyer IIT Bombay

Expert Reference Series of White Papers. Binary and IP Address Basics of Subnetting

Part2. Chapter 8. Advanced TCP/IP Network Design - CLASSLESS ADDRESSING AND VARIABLE- LENGTH SUBNET MASKS

Activity 6.7.4: IPv4 Address Subnetting Part 2

One of the most important topics in any discussion of TCP/IP is IP. IP Addressing

Table of Contents 1 IP Addressing Configuration 1-1

ICS 351: Today's plan

TCP/IP Network Essentials. Linux System Administration and IP Services

Expert Reference Series of White Papers. Basics of IP Address Subnetting

Efficient Addressing. Outline. Addressing Subnetting Supernetting CS 640 1

IP Subnetting. Subnetting

Computer Networks. Lecture 3: IP Protocol. Marcin Bieńkowski. Institute of Computer Science University of Wrocław

Section #6: Addressing

CONFIGURING TCP/IP ADDRESSING AND SECURITY

Subnetting Study Guide

Introduction. Internet Address Depletion and CIDR. Introduction. Introduction

Networking Basics for Automation Engineers

VLSM & IP ADDRESSING EXAMPLE QUESTIONS with answers;

Concepts in IP Addressing...

Transcription:

CE363 Data Communications & Networking Chapter 6 Network Layer: Logical Addressing

TCP/IP and OSI model APPLICATION APPLICATION PRESENTATION SESSION TRANSPORT NETWORK Host-Network TRANSPORT NETWORK DATA LINK PHYSICAL 2

Chapter 6 - Network Layer: Logical Addressing IPv4 ADDRESSES Address Space Address Notation Classful Addressing Classless Addressing Address Hierarchy Network Address Translation (NAT) NAT implementation NAT address translation ISP and NAT IPv6 ADDRESSES Address Space Address Notation 3

IPv4 ADDRESSES 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. Topics discussed in this section: Address Space Address Notations Classful Addressing Classless Addressing Network Address Translation (NAT) 4

IPv4 ADDRESSES IP Address Space The IPv4 address is 32 bits long. The IPv4 addresses are unique and universal. The address space of IPv4 is (2) 32 or 4,294,967,296 5

IP Address Notations IPv4 ADDRESSES The IP addresses are written using binary notation To make things easier, the addresses are usually written using dotted decimal notation 6

Example 1 Change the following IPv4 addresses from binary notation to dotted-decimal notation. Solution Replace each group of 8 bits with its equivalent decimal number and add dots for separation. 7

Example 2 Change the following IPv4 addresses from dotted-decimal notation to binary notation. Solution Replace each decimal number with its binary equivalent. 8

Example 3 Find the error 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. 9

IPv4 ADDRESSES Classful Addressing In classful addressing, the address space is divided into five classes: A, B, C, D, and E. 10

IP Address Each IP address consists of 4 bytes, defining three fields : Class Type NetID (network identifier) HostID (host identifier) Class Type NetID HostID Network Classes IPv4 ADDRESSES Few networks, each with many hosts Medium # of networks, each with medium # of hosts Many networks, each with few hosts Send a packet to a selected group of hosts rather than to an individual host 11

IPv4 ADDRESSES Ranges of IP Addresses This allows for 2 7-2 (126) networks with 2 24 2 (16,777,214) hosts each; a total of over 2 billion addresses This allows for 2 14-2 (16,382) networks with 2 16 2 (65,534) hosts each; a total of over 1 billion addresses This allows for 2 21-2 (2,097,150) networks with 2 8 2 (254) hosts each; a total of over half a billion addresses 12

Example 4 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. 13

IPv4 ADDRESSES Number of blocks and block size in classful IPv4 addressing In classful addressing, a large part of the available addresses were wasted. Block in class A (and even some class B Blocks) are too large for any organization and blocks is class C is probably too small for many organizations. 14

IPv4 ADDRESSES Network Example A network address is the NetID with the host part set to 0s Any device connected to more than one networks (Router) must have more than one IP address. 15

IP Addresses Mask IPv4 ADDRESSES The mask can help us to find the netid and the hostid. For example, the mask for a class A address has eight 1s, which means the first 8 bits of any address in class A define the netid; the next 24 bits define the hostid. Default masks for classful addressing CIDR notation (slash notation): Classless Inter-Domain Routing. It shows the mask in the form /n format (e.g., /8, /16, /24). 16

IPv4 ADDRESSES Example: default subnet mask (class B) Network Host 180.10.84.20 10110100 00001010 01010100 00010100 255.255.0.0 11111111 11111111 00000000 00000000 10110100 01101100 00000000 00000000 180 10 0 0 * Router takes IP destination address and subnet Mask * Perform a logical AND operation * Routing decisions based on network number only 17

IPv4 ADDRESSES Subnetting Subnetting divides the addresses into several contiguous groups and assign each group to smaller networks (called subnets). 18

Using the new subnet mask IPv4 ADDRESSES * Router takes IP destination address and subnet Mask * Perform a logical AND operation * Routing decisions based on subnet number only Network subnet Host 180.10.84.20 10110100 00001010 010 10100 00010100 255.255.244.0 11111111 11111111 111 00000 00000000 10110100 01101100 010 00000 00000000 180 10 64 0 * subnet address = 180.10.64.0 19

Creating Class B subnets Suppose we have a class B network with address 180.10.0.0 and we want to create 6 subnets How? As mentioned earlier: IPv4 ADDRESSES IP address = <network number><main host number> The main host number is subdivided again into a network number and a host number: main host number = <subnet number><host number> For the above example, we need 3 bits to identify the subnet number The subnet mask : 11111111. 11111111. 11100000. 00000000 255. 255. 244. 0 20

The resulting subnets IPv4 ADDRESSES Subnet # Start Address 1 180.10.32.1 2 180.10.64.1 3 180.10.96.1 4 180.10.128.1 5 180.10.160.1 6 180.10.192.1 End Address 180.10.63.254 180.10.95.254 180.10.127.254 180.10.159.254 180.10.191.254 180.10.223.254 Subnet Mask 001 010 011 100 101 110 21

Classless Addresses IPv4 ADDRESSES Classless addresses overcomes address depletion and give more organizations access to the Internet. Classless addresses are granted in blocks. Internet authorities impose three restrictions on classless address blocks: 1. The addresses in a block must be contiguous, one after another. 2. The number of addresses in a block must be a power of 2 (1, 2, 4, 8,... ). 3. The first address must be evenly divisible by the number of addresses. 22

Example 5 A block of 16 addresses granted to a small organization The addresses are contiguous. The number of addresses is a power of 2 (16 = 2 4 ) The first address is divisible by 16 (3,440,387,360 divided by 16 results in 215,024,210). 23

Classless Addresses IPv4 ADDRESSES In IPv4 addressing, a block of addresses can be defined as x.y.z.t /n in which x.y.z.t defines one of the addresses and the /n defines the mask. 24

The first block address IPv4 ADDRESSES The first address in the block can be found by setting the rightmost 32 n bits to 0s. 25

Example 6 A block of addresses is granted to a small organization. One of the addresses is 205.16.37.39/28. What is the first address in the block? Solution The binary representation of the given address is 11001101 00010000 00100101 00100111 If we set 32 28 rightmost bits to 0, we get 11001101 00010000 00100101 00100000 or 205.16.37.32 26

The last block address IPv4 ADDRESSES The last address in the block can be found by setting the rightmost 32 n bits to 1s. 27

Example 7 Find the last address for the block in Example 6. Solution The binary representation of the given address is 11001101 00010000 00100101 00100111 If we set 32 28 rightmost bits to 1, we get 11001101 00010000 00100101 00101111 or 205.16.37.47 28

Example 7(continued) The block of 16 addresses granted to a small organization The first address: 205.16.37.32 The last address: 205.16.37.47 29

The number of addresses IPv4 ADDRESSES The number of addresses in the block can be found by using the formula 2 32 n 30

Example 8 Find the number of addresses in Example 6. Solution The value of n is 28, which means that number of addresses is 2 32 28 = 2 4 = 16. 31

Example 9 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. This is particularly useful when we are writing a program to find these pieces of information. In Example 5 the /28 can be represented as follows (twenty-eight 1s and four 0s): 11111111 11111111 11111111 11110000 Find a. The first address b. The last address c. The number of addresses. 32

Example 9 (continued) Solution a. The first address can be found by ANDing the given addresses (205.16.37.39/28) 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. The first address: 205.16.37.32 33

Example 9 (continued) b. The last address can be found by ORing the given addresses with the complement of the mask. ORing here is done bit by bit. The result of ORing 2 bits is 0 if both bits are 0s; the result is 1 otherwise. The complement of a number is found by changing each 1 to 0 and each 0 to 1. The last address: 205.16.37.47 34

Example 9 (continued) c. The number of addresses can be found by complementing the mask, interpreting it as a decimal number, and adding 1 to it. 35

Example 9 (continued) The block of 16 addresses granted to a small organization 36

The Network Address IPv4 ADDRESSES The first address in a block is normally not assigned to any device; it is used as the network address that represents the organization to the rest of the world. 37

The Address Hierarchy IPv4 ADDRESSES Example: Two levels of hierarchy in an IPv4 address The n leftmost bits of the address x.y.z.t/n define the network (the prefix). The 32 n rightmost bits define the particular host to the network (the suffix). The IP address can define only two levels of hierarchy when not subnetted. 38

IPv4 ADDRESSES Two-Level Hierarchy: No Subnetting Each address in the block can be considered as a twolevel hierarchical structure: the leftmost n bits (prefix) define the network; the rightmost 32 n bits define the host. 39

IPv4 ADDRESSES Three-Level Hierarchy: Subnetting Subnetting creates small subblocks of addresses, each assigned to specific subnets. From the outside, the organization seems as one entity with one address and one mask. All messages are sent to the main router address that connects the organization to the rest of the Internet. The router routes the message to the appropriate subnets. Each subnet has its own subnet address and its own mask. 40

The Address Hierarchy IPv4 ADDRESSES Two level Hierarchy: No Subnetting NetID HostID Three-Level Hierarchy: Subnetting NetID SubNetID HostID 41

IPv4 ADDRESSES Three-Level Hierarchy: Example An organization is given the block 17.12.14.0/26 How many address in this block? The number of addresses in the block can be found by using the formula 2 32 n The number of addresses = 2 32 26 = 2 6 = 64 NetID HostID 26 bits 6 bits 42

IPv4 ADDRESSES Three-Level Hierarchy: Example The organization has three offices and needs to divide the addresses into three subblocks of 32, 16, and 16 addresses. The first subnet has 32 addresses; then 32=2 32 n1 and n1=27 The first subnet has 16 addresses; then 16=2 32 n2 and n2=28 The first subnet has 16 addresses; then 16=2 32 n3 and n3=28 In subnet 1, the address 17.12.14.29 can give us the subnet address if we use the mask /27 Host: 00010001 00001100 00001110 00011101 (17.12.14.29) Mask: 11111111 11111111 11111111 11100000 (/27) Subnet: 00010001 00001100 00001110 00000000 (17.12.14.0) 43

IPv4 ADDRESSES Three-Level Hierarchy: Example (continued) The address of subnet 1 is (17.12.14.0/27) The first address and last address are: The binary representation of the given address 17.12.14.29: 00010001 00001100 00001110 00011101 If we set 32 27 rightmost bits to 0, we get the first address: 00010001 00001100 00001110 00000000 (17.12.14.0) The binary representation of the given address 17.12.14.29: 00010001 00001100 00001110 00011101 If we set 32 27 rightmost bits to 1, we get the last address: 00010001 00001100 00001110 00011111 (17.12.14.31) 44

IPv4 ADDRESSES Three-Level Hierarchy: Example (continued) Configuration and addresses in a 3-level subnetted network 45

IPv4 ADDRESSES Three-Level Hierarchy: Example (continued) In subnet 2, the address 17.12.14.45 can give us the subnet address if we use the mask /28 Host: 00010001 00001100 00001110 00101101 Mask: /28 Subnet: 00010001 00001100 00001110 00100000 (17.12.14.32) The last address is: The binary representation of the given address 17.12.14.45: 00010001 00001100 00001110 00101101 If we set 32 28 rightmost bits to 1, we get the last address: 00010001 00001100 00001110 00101111 (17.12.14.47) 46

IPv4 ADDRESSES Three-Level Hierarchy: Example (continued) In subnet 3, the address 17.12.14.50 can give us the subnet address if we use the mask /28 Host: 00010001 00001100 00001110 00110010 Mask: /28 Subnet: 00010001 00001100 00001110 00110000 (17.12.14.48) The last address is: The binary representation of the given address 17.12.14.50: 00010001 00001100 00001110 00110010 If we set 32 28 rightmost bits to 1, we get the last address: 00010001 00001100 00001110 00111111 (17.12.14.63) 47

IPv4 ADDRESSES Three-level hierarchy in an IPv4 address Network Address: 17.12.14.0/26 Subnet 1 Address: 17.12.14.0/27 Subnet 2 Address: 17.12.14.32 /28 Subnet 3 Address: 17.12.14.48 /28 48

IPv4 ADDRESSES Creating subnets IP address = <network number><main host number> The main host number is subdivided again into a network number and a host number: main host number = <subnet number><host number> IP address = <network number> <subnet number><host number> 49

Example 10 An ISP is granted a block of addresses starting with 190.100.0.0/16 (65,536 addresses). The ISP needs to distribute these addresses to three groups of customers as follows: a. The first group has 64 customers; each needs 256 addresses. b. The second group has 128 customers; each needs 128 addresses. c. The third group has 128 customers; each needs 64 addresses. Design the subblocks and find out how many addresses are still available after these allocations. 50

Solution Example 10 (continued) Group 1 (64 customers) For this group, each customer needs 256 addresses. This means that 8 (log2 256) bits are needed to define each host. The prefix length is then 32 8 = 24. The addresses are 51

Example 10 (continued) Group 2 (128 customers) For this group, each customer needs 128 addresses. This means that 7 (log2 128) bits are needed to define each host. The prefix length is then 32 7 = 25. The addresses are 52

Example 10 (continued) Group 3 (128 customers) For this group, each customer needs 64 addresses. This means that 6 (log 2 64) bits are needed to each host. The prefix length is then 32 6 = 26. The addresses are Number of granted addresses to the ISP: 65,536 Number of allocated addresses by the ISP: 40,960 Number of available addresses: 24,576 53

Example 10 (continued) An example of address allocation and distribution by an ISP 54

Network Address Translation (NAT) NAT enables a user to have a large set of addresses internally and one address, or a small set of addresses, externally. The traffic inside can use the large set; the traffic outside, the small set. To separate the addresses used inside the home or business and the ones used for the Internet, the Internet authorities have reserved three sets of addresses as private addresses. Addresses for private networks 55

Network Address Translation (NAT) NAT implementation The private network uses private addresses. The router that connects the network to the global address uses one private address and one global address. The private network is transparent to the rest of the Internet; the rest of the Internet sees only the NAT router with the address 200.24.5.8. 56

Network Address Translation (NAT) Addresses in a NAT All the outgoing packets go through the NAT router, which replaces the source address in the packet with the global NAT address. All incoming packets also pass through the NAT router, which replaces the destination address in the packet (the NAT router global address) with the appropriate private address. 57

Network Address Translation (NAT) NAT address translation 58

Network Address Translation (NAT) Two columns translation table includes: The private address and The external address (destination address of the packet) When the router translates the source address of the outgoing packet, it also makes note of the destination address (where the packet is going) in the table. When the response comes back from the destination, the router uses the source address of the packet (as the external address) to find the private address of the packet from the table. In this strategy, (using the two columns translation table) communication must always be initiated by the private network (using a client program such as HTTP, TELNET, or FTP to access the corresponding server program). 59

Network Address Translation (NAT) Five-column translation table: Use IP Addresses and Port Numbers to allow a many-to-many relationship between private-network hosts and external server programs. For example, two hosts with addresses 172.18.3.1 and 172.18.3.2 inside a private network can access the HTTP server on external host 25.8.3.2. 60

Network Address Translation (NAT) ISP and NAT 61

Network Address Translation (NAT) ISP and NAT An ISP that serves dial-up customers can use NAT technology to conserve addresses. For example, suppose an ISP is granted 1000 addresses, but has 100,000 customers. Each of the customers is assigned a private network address. The ISP translates each of the 100,000 source addresses in outgoing packets to one of the 1000 global addresses. It translates the global destination address in incoming packets to the corresponding private address. 62

IPv6 Structure of IPv6 IPv6 address consists of 16 bytes (16 octets); it is 128 bits long. IPv6 Address Space: 2 128 addresses are available. IPv6 Hexadecimal Notation: the address consists of 32 hexadecimal digits, with every four digits separated by colon: FDEC:0074:0000:0000:0000:BOFF:0000: FFFF IPv6 length: 128 bits = 16 bytes = 32 hex digits 63

Chapter 6 - Network Layer: Logical Addressing IPv4 ADDRESSES Address Space Address Notation Classful Addressing Classless Addressing Address Hierarchy Network Address Translation (NAT) NAT implementation NAT address translation ISP and NAT IPv6 ADDRESSES Address Space Address Notation 64