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



Similar documents
SUBNETS, CIDR, AND CLASSLESS ADDRESSING

IP Addressing. IP Addresses. Introductory material.

IP Addressing Introductory material.

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

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

VLSM and CIDR Malin Bornhager Halmstad University

Internet Addresses (You should read Chapter 4 in Forouzan)

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.

Internetworking and Internet-1. Global Addresses

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

Subnetting/Supernetting and Classless Addressing

How To Make A Network Address Prefix Smaller

Efficient Addressing. Outline. Addressing Subnetting Supernetting CS 640 1

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

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

Lab#2: IP Addressing and Subnetting

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

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.

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

Savera Tanwir. Internet Protocol

Lecture Computer Networks

Introduction. Internet Address Depletion and CIDR. Introduction. Introduction

Chapter 19 Network Layer: Logical Addressing 19.1

IP Subnetting and Addressing

Tutorial (03) IP addresses & Sub netting

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

Internet Protocol Address

8.2 The Internet Protocol

Internet Protocols Fall Lectures 7-8 Andreas Terzis

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

CIDR: Classless Interdomain Routing

Classful IP Addressing (cont.)

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

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

Future Internet Technologies

ICS 351: Today's plan

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

DG Forwarding Algorithm

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

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

(Refer Slide Time: 02:17)

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

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

PART IV. Network Layer

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

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

We Are HERE! Subne\ng

Lab a Basic Subnetting


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

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

Section #6: Addressing

Advanced IP Addressing

Sybex CCENT Chapter 4: Easy Subnetting. Instructor & Todd Lammle

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

IP Addressing A Simplified Tutorial

Variable length subnetting

Chapter 5: Sample Questions, Problems and Solutions Bölüm 5: Örnek Sorular, Problemler ve Çözümleri Örnek Sorular (Sample Questions):

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

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

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

Internet Protocol version 4 Part I

IP Addressing and Subnetting for New Users

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

Type of addressing in IPv4

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

The Subnet Training Guide

SNMP/HTTP Access Control User Manual

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

Mobile IP Network Layer Lesson 02 TCP/IP Suite and IP Protocol

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

RARP: Reverse Address Resolution Protocol

Desirable Properties Of An Internet Addressing Scheme

Internetworking and IP Address

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

CONFIGURING TCP/IP ADDRESSING AND SECURITY

Module 4, Assignment 3-2

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

Advanced Topics: IP Subnetting A WHITE PAPER PREPARED FOR ASPE TECHNOLOGY. toll-free:

Understanding IP Addressing: Everything You Ever Wanted To Know

Chapter 4. IP Addresses: Classful Addressing

Module 2: Assigning IP Addresses in a Multiple Subnet Network

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

TCP/IP Basis. OSI Model

IT:101 Cisco Networking Academy I Subnetting

Table of Contents 1 IP Addressing Configuration 1-1

Decimal to Binary Conversion

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

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

Question Question Question EdTech 552: Lab 3 Answer Sheet

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

Subnetting. TELE301 Laboratory Manual. 1 In-Class Exercises Subnetting in IPv6... 4

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

Instructor Notes for Lab 3

Transcription:

CS445: IPv4 Addresses In-class activity Names: Part 1: Address Classes Original three classes of IPv4 addresses: A: 0 network (7 bits) host (24 bits) B: 10 network (14 bits) host (16 bits) C: 110 network (21 bits) host (8 bits) 1. How many unique network IDs are there in class A addresses? # of unique hosts? 2. How many unique network IDs are there in class B addresses? # of unique hosts? 3. How many unique network IDs are there in class C addresses? # of unique hosts? 4. Which type of address do you think is the most popular? Why? IP addresses are often written not in the binary form, but in decimal form as one number per byte. For example, here is an IP address written in decimal: 171.69.210.245 5. The 171 corresponds to the first byte, interpreted as the most significant bit being on the left. 171 (decimal) is what number in binary? 6. To which address class does this IP address belong? 7. Now you know about the IP address classes. You can quickly identify the address s class by looking at the first byte of the IP address. a. What is the numerical decimal range of the first byte for class A addresses? b. Range for class B? c. Range for class C? Now, let s consider the job of routers in the Internet. From prior lectures, you know that the routers do fragmentation and forwarding. Each IP packet has an IP address for the sender and another for the destination. Forwarding for routers becomes:

Router Forwarding Procedure If network address of destination is a network on one of my interfaces, deliver packet to that interface. Else If network address of destination is in my forwarding table, Deliver to next hop router Else Deliver packet to default router Part 2: Subnetting Ok, let s go back to discussing addresses. It seems that class B addresses would be most popular, yet there are not enough of these to satisfy everyone who wants a class B address. Recall that the class B address looks like: 10 network (14 bits) Host (16 bits) Hmmm, perhaps two or more companies/organizations could share a single class B address. This leads to subnetting. 8. What are advantages of using subnetting (think about scalability and effective use of address space)? Mechanics of subnetting: Create a mask (usually consecutive ones) to indicate the subnet ID. 10 network (14 bits) Host (16 bits) //original IP address 111111 1111 (20 bits) Host (12 bits) //subnet mask This creates a 3-part IP address: 10 network (14 bits) subnet (4 bits) host (12 bits) The size of the subnet portion of the address depends on the length of the subnet mask. In the case above, the mask is 20 bits long, carrying over 4 bits past the network portion of the class B address space. So, this subnet is 4 bits long. But, the subnet mask can be shorter or longer than 4 bits, depending on how much room each subnet wants to keep for the host IDs. Example Suppose we want to share an IP class B network address among several corporations. We could create the subnet mask: 255.255.255.128 (25 ones, 7 zeros)

This would create two subnets, each that could support 128 hosts. Corp A has subnet: 128.96.79.128 [so, it would have addresses 128.96.79.128 128.96.79.255] Corp B has subnet: 128.96.79.0 [so, it would have addresses 128.96.79.0 128.96.79.127] Suppose an IP packet arrives with IP address 128.96.79.89. The router needs to determine to which subnet to forward the packet. To determine the subnet, use the bit AND operator between IP address and the subnet mask: 128.96.79.89 & 255.255.255.128 = 128.96.79.0 (so, this is on Corp B) 9. Now, suppose a packet arrives with IP address 128.96.79.200. To which subnet should the packet be delivered (corp A or corp B)? Now, forwarding just got a little more complicated. Each router needs to have in its tables: Subnet Number Subnet Mask Next Hop 128.96.79.0 255.255.255.128 Interface 1 128.96.79.128 255.255.255.128 Interface 2 128.96.85.0 255.255.255.0 Router 2 Forwarding Algorithm with Subnets: If host, D = subnet mask of host & destination address If D = subnet # of host, deliver locally Else send to router for forwarding If router, For each entry in forwarding table: D = subnet mask of host & destination address If D == subnet # in table, deliver to next hop If no entry found, deliver to default router Part 3: Classless Addressing (CIDR) Perhaps we should just get rid of classes completely and use the address space more efficiently and more flexibly. This is what CIDR (classless interdomain routing) tries to do. In part 2, we created subnets of class B addresses. Now, classless addressing effectively creates supernets, too.

Another advantage of classless addressing is reducing the size of forwarding tables, if we can have one aggregate entry for several networks located at the same corporation. The idea of CIDR is to generalize IP addresses so the network part is any length. Then, we can give out several class C addresses to a single corporation (now that class B addresses are exhausted). For example, we might give one corporation the a chunk of network addresses with network portions 192.4.16 through 192.4.31 (remember, class C addresses have 110 and then 21 bits for the network portion). It would be a shame to put all 16 entries into a forwarding table for this single corporation (which is what we would do in the original class-based scheme). We could be smarter and just put the network value and its length in the forwarding table. Now, this corporation basically has an address with a network portion of 20 bits: 192.4.16 = 11000000 00000100 00010000 192.4.31 = 11000000 00000100 00011111 (So, the first 20 bits are the same and just these first 20 bits can be stored as a single entry in a forwarding table. Nice routing aggregation. But, this only works if the addresses are handed out in consecutive blocks.) The network address would now be written as: 192.4.16/20 //first 20 bits are the same CIDR addresses can also be written in hexadecimal (each 4-bit chunk is written with a single digit in hex). So, 192 (decimal) is 11000000 (binary). 192 in hex is C0 (C for 1100 and 0 for 0000). Note that standard class C addresses are referred to as slash 24 since the first 24 bits denote the network address. The one above would be called a slash 20 address. Impacts to forwarding Now, the router might have several addresses that share a common prefix. When determining where to forward packets, the router uses the longest match in the forwarding table to determine the next hop. 10. Suppose the table below is the forwarding table for a router and the addresses use CIDR. Addresses are written in hex. Suppose six packets arrive with destination addresses shown below. For each destination address, state the next hop for the packet. In the forwarding table, if there is a single entry between the dots, it means that there are leading zeros for this portion of the address. C4.5E.2.0 means C4.5E.02.00.

Forwarding table: Net/Length NextHop C4.5E.2.0/23 A C4.5E.4.0/22 B C4.5E.C0.0/19 C C4.5E.40.0/18 D C4.4C.0.0/14 E C0.0.0.0/2 F 80.0.0.0/1 G Determine the next hop for the following addresses: Destination Address C4.4B.31.2E C4.5E.05.09 C4.4D.31.2E C4.5E.03.87 C4.5E.7E.12 C4.5E.D1.02 Next Hop F The first entry above is done for you. C4.4B.31.2E has the longest match with C0.0.0.0/2 (just the first four bits match, but it matches at least the first 2, as given by the slash 2), so the router forwards it to next hop F. It might be tempting to forward it to E, since the address matches the first 12 bits. But, it needs to match at least 14 bits to have a match with C4.4C.0.0. Part 4: Summary IPv4 started with class-based addresses. Then, the Internet got too big and class B addresses were too popular. So, subnetting and CIDR are also used to create more addresses that make more effective use of the limited 32 bits by sharing class B addresses (subnetting) and aggregating class C addresses (CIDR, or supernetting ). IPv6 uses 128-bit addresses, so there are a whole lot more unique addresses. We will look at IPv6 in a future lecture. Part 5: Optional (if time) 11. Determine what the router will do with packets with IP addresses shown below. Assume the router has a forwarding table that uses subnetting: SubnetNumber SubnetMask NextHop 128.96.170.0 255.255.254.0 Interface 0 (directly connected network)

128.96.168.0 255.255.254.0 Interface 1 (directly connected network) 128.96.166.0 255.255.254.0 R2 128.96.164.0 255.255.252.0 R3 (default) R4 Determine the next hop for the following addresses: Destination Address Next Hop 128.96.171.92 Interface 0 128.96.167.151 128.96.163.151 128.96.169.192 128.96.165.121 The first entry is done for you. Applying the mask 255.255.254.0 to 128.96.171.92 gives us 128.96.170.0, so we use interface 0 for forwarding.