SUBNETS, CIDR, AND CLASSLESS ADDRESSING



Similar documents
Savera Tanwir. Internet Protocol

How To Make A Network Address Prefix Smaller

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

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

Internetworking and Internet-1. Global Addresses

Lecture Computer Networks

Tutorial (03) IP addresses & Sub netting

CIDR: Classless Interdomain Routing

IP Subnetting and Addressing

Introduction. Internet Address Depletion and CIDR. Introduction. Introduction

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

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

Internet Addresses (You should read Chapter 4 in Forouzan)

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

8.2 The Internet Protocol

Variable length subnetting

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

Efficient Addressing. Outline. Addressing Subnetting Supernetting CS 640 1

ICS 351: Today's plan

Classful IP Addressing (cont.)

Scaling the Network: Subnetting and Other Protocols. Networking CS 3470, Section 1

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.

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

Network layer: Overview. Network layer functions IP Routing and forwarding

VLSM and CIDR Malin Bornhager Halmstad University

Subnetting/Supernetting and Classless Addressing

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.

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

Advanced IP Addressing

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

IP Addressing A Simplified Tutorial

(Refer Slide Time: 02:17)

TCP/IP Basis. OSI Model

IP Addressing Introductory material.

04 Internet Protocol (IP)

IP Addressing. IP Addresses. Introductory material.

Future Internet Technologies

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

RARP: Reverse Address Resolution Protocol

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

Lecture 10. Subnetting & Supernetting. Supernetting. Subnetting. Outline. medium org: N x class C? Class B? Variable Length Subnet Mask (VLSM)

DG Forwarding Algorithm

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

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

CSC458 Lecture 6. Homework #1 Grades. Inter-domain Routing IP Addressing. Administrivia. Midterm will Cover Following Topics

Lecture 10. Subnetting & Supernetting

PART IV. Network Layer

Chapter 19 Network Layer: Logical Addressing 19.1

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

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

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

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

We Are HERE! Subne\ng

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

Module 2: Assigning IP Addresses in a Multiple Subnet Network

Internet Protocols Fall Lectures 7-8 Andreas Terzis

Internet Protocol version 4 Part I

Internet Working 5 th lecture. Chair of Communication Systems Department of Applied Sciences University of Freiburg 2004

The Subnet Training Guide

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

IP address format: Dotted decimal notation:

Module 10 Subnetting Class A, B and C addresses. Solutions to the Lab Exercises a, b, c and d

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

Internet Protocol Address

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

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

Outline. Internet Routing. Alleviating the Problem. DV Algorithm. Routing Information Protocol (RIP) Link State Routing. Routing algorithms

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.

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

Lab IP Addressing Overview

Objectives. Upon completing this chapter, you will be able to

Source net: Destination net: Subnet mask: Subnet mask: Router Hub

Lecture 8. IP Fundamentals

CSE331: Introduction to Networks and Security. Lecture 8 Fall 2006

Internetworking With TCP/IP

Lab a Basic Subnetting

IP Addressing. and Subnetting. Workbook Version 1.5. Student Name:

CLASSLESS INTER DOMAIN ROUTING - CIDR

Understanding IP Addressing: Everything You Ever Wanted To Know

HOST AUTO CONFIGURATION (BOOTP, DHCP)

ITRI CCL. IP Routing Primer. Paul C. Huang, Ph.D. ITRI / CCL / N300. CCL/N300; Paul Huang 1999/6/2 1

CCNA Tutorial Series SUBNETTING

Subnetting and Network Management Omer F. Rana. Networks and Data Communications 1

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

CS 43: Computer Networks IP. Kevin Webb Swarthmore College November 5, 2013

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

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

Internetworking and IP Address

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

Border Gateway Protocol (BGP)

Ref: A. Leon Garcia and I. Widjaja, Communication Networks, 2 nd Ed. McGraw Hill, 2006 Latest update of this lecture was on

IP Addressing and Subnetting for New Users

Network Layer IPv4. Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS. School of Computing, UNF

Network layer. Assignment 3

Module 4, Assignment 3-2

Transcription:

Announcements SUBNETS, CIDR, AND CLASSLESS ADDRESSING Internet Protocols CSC / ECE 573 Fall, 005 No office hours tomorrow (Wednesday) out of town No class on Thursday Fall break! Midterm exam next Tuesday! Study guide is online, as well as old exams HW3 Part solutions will be online today N C State University copyright 005 Douglas S Reeves Today s Lecture I Problems with Classful Addresses II Subnetting III Supernetting CLASSFUL ADDRESS PROBLEMS IV CIDR V IP Routing example copyright 005 Douglas S Reeves 3 Class A B C Classful Addresses (Review) 0 Network ID 0 3 0 7 4 Network ID ID 4 Network ID ID 6 8 ID Classful Addressing Issues Three Bears problem class A (6M hosts) too large for most organizations, and there aren t very many of them (8) class C (54 hosts) too small for most class B (65,534 hosts) is just right, but there aren t enough of them (6,384) Class A B C Potential Number of Networks 7 (8) 4 (6K) (M) Potential Number of s Per Network 4 (6M) 6 (64K) 8 (56) Flat host ID part of the address means very large routing tables within an organization eg, one network with 50,000 hosts each router has to know 50,000 routes?! copyright 005 Douglas S Reeves 5 copyright 005 Douglas S Reeves 6

A Hypothetical Solution: Redefine Class C Eg, use 9 bits for network ID, 0 bits for host ID result: 5K such networks, each with 0 host addresses Problem: not backwards compatible with original addressing scheme ie, old class B and C address space allocations would have to be reclaimed and reassigned copyright 005 Douglas S Reeves 7 An Actual Solution: Assign Multiple Networks Assign one organization multiple class C networks Eg, an organization having 000 hosts would get 4 class C networks (4 * 54 host addresses = 06 > 000) Problem: no longer have one network address for one organization increases routing table sizes for routing between organizations is that serious? Doesn t fix massive size of class A networks copyright 005 Douglas S Reeves 8 Requirements for Address Modifications Any solution should be backwards compatible with the original addressing scheme Each organization should be free to interpret the host ID part of its addresses any way it wishes only the network ID part of addresses is used by other organizations SUBNETTING If there is a new interpretation of the host ID all hosts and routers in the organization s network must use the new addressing scheme the internal routing protocol must support this new scheme copyright 005 Douglas S Reeves 9 Subnet Addressing (RFCs 950, ) Particularly useful for class B sized networks Example local (internal) part 0 6 4 3 0 Network ID Subnet ID ID ID Internet (external) part Address of the physical network Result: three-level hierarchical addressing good for routing inside an organization (reduces the size of internal routing tables) network structure not revealed to outsiders, since structure of local part only locally known copyright 005 Douglas S Reeves Subnet Addressing (cont d) Result: large organizations may have many separate LANs, sharing a single network address network administrators must decide how many bits to allocate to the subnet ID and host ID s must support this capability Does not change classful addressing only affects interpretation of local (internal) part of address copyright 005 Douglas S Reeves

Example: Without Subnetting Example: With Subnetting 445 449 4437 447 44703 445 449 4437 subnet 440 447 44703 Router R Network 4400 Router R subnet 440 subnet 4470 44 443 446 4470 to network 4400 44 443 446 4470 copyright 005 Douglas S Reeves 3 copyright 005 Douglas S Reeves 4 How Long is the Subnet ID? ing (Bitwise-AND Operation) ing: the process of extracting a portion of the IP address subnet masking: extracting the subnet ID masks are 3 bits long for IPv4 addresses If a bit in a subnet mask = this bit position is part of the physical network ID (network ID + subnet ID) 0 this bit position is part of the host ID How split physical network ID into network and subnet parts? without subnetting with subnetting copyright 005 Douglas S Reeves 5 copyright 005 Douglas S Reeves 6 Example Step : determine network ID IP Address = 44 Use first bits to determine it s a Class B address Step : determine physical network address IP Address = 44 with subnet mask 5555550 Step 3: determine subnet ID Physical Network = 44, Class B address = 44 Network ID = 44 Physical Network = 44 Subnet ID = Questions How can you tell if a destination IP address is On the same subnet as you??? On the same network as you??? copyright 005 Douglas S Reeves 7 copyright 005 Douglas S Reeves 8 3

Special Addresses (Subnetting) Possible Subnet Sizes for a Class B Network Net ID (normal) Subnet ID (normal) ID All s Description Broadcast to a specific subnet # of bits for subnet ID 0 (ie, subnetting not used) 3 # of subnets possible 3 # of hosts / subnet 6-5 - 4-3 - What happened to 5 bits for subnet ID??? 3 4 3 4 3 = 4 = copyright 005 Douglas S Reeves 9 What happened to 6 bits for subnet ID??? copyright 005 Douglas S Reeves 0 Subnet Routing Recommendations Use simple subnet masks (sequence of all s followed by string of all 0 s) eg, 00000000 is not OK Use the same mask for all subnets of the network 3 All subnets should be physically contiguous (connected) drawbacks? Forwarding Decisions with Subnetting Reminder: a forwarding table consists of <key, next IP address> entries key in forwarding table entries needs to consist of a mask a network identifier Examples for network 5400 mask = 555500, identifier = 5400 for subnet 540 mask = 5555550, identifier = 540 copyright 005 Douglas S Reeves copyright 005 Douglas S Reeves Forwarding Decisions (cont d) Forwarding Table Example Steps in determining a forwarding table match (in order of the table entries) AND the packet s destination IP address with the mask compare the result to the identifier to see if there is a match 3 use the first match found 55555555 555500 0000 Destination Identifier 5455 5400 0000 Next hop IP address Which entry does 5455 match? Which entry does 5459 match? Which entry does 5436 match? Which entry does 530 match? Why choose this ordering of the routing table entries? copyright 005 Douglas S Reeves 3 copyright 005 Douglas S Reeves 4 4

Remember This Algorithm? Extract destination address Hd, compute network part N if (N matches any directly connected networks) deliver to Hd directly else if (there is a host-specific route for Hd) forward datagram to specified next hop else if (there is a route for network N) forward datagram to specified next hop else if (there is a default route) forward datagram to default router else /* Hd is not directly connected and we */ /* don t know how to get to it */ discard the datagram and declare routing error copyright 005 Douglas S Reeves 5 The New Forwarding Algorithm extract destination address Hd for forwarding table entries i=n { if (Hd AND mask[i]) == destination[i] { forward datagram to specified next_hop[i] exit } } /* we don t know how to get to Hd */ discard the datagram and declare routing error copyright 005 Douglas S Reeves 6 Variable-Length Subnetting Site with a Class C address 95340, needs five subnets with 60, 60, 60, 30, and 30 hosts Problems cannot use subnet mask 5555559, since it allows only 4 subnets, each with ( 8 / 4) - = 6 hosts cannot use subnet mask 5555554, since it allows 8 subnets, each with only ( 8 / 8) - = 30 hosts SUPERNETTING Solution: use two masks of different lengths router requirements RFC requires support for this however, not all routing protocols provide the subnet mask along with the destination network ID copyright 005 Douglas S Reeves 7 Supernet Addressing Supernetting Example Possible solution to exhaustion of Class B addresses use multiple Class C addresses instead Assign organizations blocks of n contiguous Class C addresses ex: if 000 addresses (hosts) are needed, allocate a block of 048 addresses ( = 8 contiguous Class C networks) (Note: subnets not shown for simplicity; subnets and supernets can be used together) Problem: no longer have one network address for each organization inter-organization routing tables will be larger copyright 005 Douglas S Reeves 9 5

CLASSLESS INTERDOMAIN ROUTING (CIDR) Classless InterDomain Routing (CIDR) (RFC59) Idea: allocate IP addresses in a block of size n, for n=,3, In a block means IP addresses must be allocated contiguously (ie, share the same high-order bits) A block is summarized by a single routing table key of the form <network_address, CIDR_mask> network_address: the smallest (first) address in the block CIDR_mask: the size of the address block No longer need classful addresses; the network size is now explicit but, backwards compatible with classful addresses copyright 005 Douglas S Reeves 3 Classless InterDomain Routing (CIDR) (RFC59) (cont d) CIDR_mask: number of 0 s indicates value of n 000 00000000: n = 00000000 00000000 00000000: n = 4 (ie, class A address) More conveniently for people: /3-n to indicate number of s in the mask 000 00000000: / 00000000 00000000 00000000: /8 CIDR ing + Subnet ing IP address: 0000 0000 0000 000000 CIDR : 00 00000000 Network ID: 0000 0000 000000 00000000 Subnet : 000000 Network + Subnet ID: 0000 0000 0000 0000000 copyright 005 Douglas S Reeves 33 copyright 005 Douglas S Reeves 34 Address Allocation and s Ex: allocate a block of 3 (= 8M) addresses, starting at address 94000 Regional Aggregation of Class C Addresses All sites in a region (eg, Europe) have a common prefix Addre ss Lowest Highest Dotted Decimal 94000 9475555 55800 ( /9 ) Binary 00000 00000000 00000000 00000000 00000 0 0000000 00000000 00000000 How can you tell what the mask should be Lowest 94000 98000 00000 0000 Highest 95555555 99555555 0555555 03555555 Region Europe North America Central and South America Asia and the Pacific knowing the number of addresses? knowing the lowest and highest addresses? copyright 005 Douglas S Reeves 35 copyright 005 Douglas S Reeves 36 6

Regional Allocation of Class C Addresses (cont d) CIDR summarizes these 3M addresses into one entry ie, only a single entry needed in most US routers for all European destinations Once the packet gets to Europe, more detailed routing tables are needed to reach the specific network / host Example: Allocating Classless Addresses Site X Y Three sites X, Y, and Z in Europe ask for 048, 04, and 4096 addresses, in that order, starting from 94400 Result: # of Addresses 048 = 04 = 0 Lowest 94400 94480 Highest 944755 94455 5555480 (/) 555550 (/) Z 4096 = 94460 944355 5555400 (/0) Why is there a gap between site Y s allocation and site Z s allocation??? copyright 005 Douglas S Reeves 37 copyright 005 Douglas S Reeves 38 Allocating Classless Addresses (cont d) Result: routers all over Europe have the following 3 entries added to their routing tables Network Address Network Address Network Address 00000 000000 00000000 00000000 (94400) 000 00000000 (5555480, or /) 00000 000000 0000000 00000000 (94480) 00 00000000 (555550, or /) 00000 000000 0000000 00000000 (94460) 0000 00000000 (5555400, or /0) copyright 005 Douglas S Reeves 39 Example: CIDR Forwarding A packet arrives at a router with destination IP address = 94474; where should it be forwarded? 00000 000000 000000 0000000 ANDed with Site mask = 00000 000000 0000000 00000000 match site address? ANDed with Site mask = 00000 000000 0000000 00000000 match site address? ANDed with Site 3 mask = 00000 000000 0000000 00000000 match site 3 address? copyright 005 Douglas S Reeves 40 Longest Prefix Matching A forwarding table entry with a longer mask (ie, more s) is called more specific than another entry with a shorter mask There is a dilemma in classless network masking: address matching ambiguity X = 00000 00000000 00000000 00000000 (/4) Y = 0000 00000000 00000000 00000000 (/6) destination IP address 0000 00000000 00000000 000000 will match both of these entries! For forwarding purposes, the longest prefix (most specific match) wins! Ordering doesn t matter copyright 005 Douglas S Reeves 4 The CIDR Forwarding Algorithm Extract destination address Hd Use mask to find longest matching prefix if (match found) forward datagram to specified next hop else /* we don t know how to get to Hd */ discard the datagram and declare routing error Unified routing table lookup! Questions How deal with default addresses? How deal with host-specific addresses? copyright 005 Douglas S Reeves 4 7

CIDR Blocks Reserved for Private Networks Useful for intranets, testing, etc Should never see one of these addresses in IP packets in the public Internet Prefix 0 /8 6954 /6 76 / 968 /6 Lowest Address 0000 695400 7600 96800 Highest Address 0555555 69545555 735555 9685555 FORWARDING EXAMPLE copyright 005 Douglas S Reeves 43 Example Network Configuration Routing Table for Router R copyright 005 Douglas S Reeves 46 Summary What happens when R receives a packet with destination: 9674? 934576? 003434? Classful addressing is simple, but too restrictive Supernetting is a cheap (but not very clean) fix Subnetting creates a third level of address hierarchy useful for routing inside an organization requires the use of a mask 3 CIDR decreases routing table sizes, and increases flexibility in allocating addresses copyright 005 Douglas S Reeves 47 4 Both subnetting and CIDR require the use of masks copyright 005 Douglas S Reeves 48 8

Next Lecture Routing, Part I copyright 005 Douglas S Reeves 49 9