Sei sulla pagina 1di 84

2

Sajid Ali Gillal


IP Addressing Scheme

Introduction to Sub-netting

February 26, 2014 Sajid Ali Gillal 2


IP - Internet Protocol
(computing) Internet Protocol address; a sequence of numbers used
to identify a particular computer or domain name on the Internet

February 26, 2014 Sajid Ali Gillal 3


cont.. .

IP - Internet Protocol
(computing) Internet Protocol address; a sequence of numbers used
to identify a particular computer or domain name on the Internet

February 26, 2014 Sajid Ali Gillal 4


Classful network is a term used to describe the network architecture of
the Internet until around 1993. It divided the address space for Internet
Protocol Version 4 (IPv4) into five address classes.

Each class, coded by the first four bits of the address, defined a different
size or type (unicast or multicast) of the network.

February 26, 2014 Sajid Ali Gillal 5


cont.. .

All networks in practical use have different sizes.

For example, a company that will have 50 computers, will not need a
network of 5000 computers, And on the contrary, a company that needs
5000 computers does not need a network that can only hold 50
computers. This is the main reason that engineers decided that IP address
space should be divided in different classes in order to meet different
requirements.

February 26, 2014 Sajid Ali Gillal 6


cont.. .

This addressing scheme is illustrated below.

February 26, 2014 Sajid Ali Gillal 7


cont.. .

Addressing scheme of Network Classes.

February 26, 2014 Sajid Ali Gillal 8


cont.. .

IP Address as a 32-Bit Binary Number

February 26, 2014 Sajid Ali Gillal 9


cont.. .

Addressing scheme of Network Classes.

February 26, 2014 Sajid Ali Gillal 10


cont.. .

Addressing scheme of Network Classes.

February 26, 2014 Sajid Ali Gillal 11


cont.. .

Class A (24 bits for hosts) 224 - 2* = 16,777,214 maximum hosts


Class B (16 bits for hosts) 216 - 2* = 65,534 maximum hosts
Class C (8 bits for hosts) 28 - 2* = 254 maximum hosts
* Subtracting the network and broadcast reserved address

February 26, 2014 Sajid Ali Gillal 12


cont.. .

This addressing scheme is illustrated below.

Leading
Number of
bits in Range of first Network ID Host ID Number of
Class addresses per
address octet (decimal) format format networks
network
(binary)

A 0 0 - 127 a b.c.d 27 = 128 224 = 16777216

B 10 128191 a.b c.d 214 = 16384 216 = 65536

C 110 192223 a.b.c d 221 = 2097152 28 = 256

February 26, 2014 Sajid Ali Gillal 13


cont.. .
Addressing scheme

February 26, 2014 Sajid Ali Gillal 14


Class A Network (/ 8 Prefixes)
This network is 8-bit network prefix. Its highest bit is set to 0, and contains
a 7-bit network number and a 24-bit host number.
A maximum of 126, which is (27 -2,) networks can be defined; two is
subtracted because all an (0 and 1) subnet cannot be used in certain routers
using RIP-1 Protocol. Each network supports a maximum of 16,777,214
(224 -2) hosts per network. You must subtract two because the base network
represents host 0, and the last host on the network is actually used for 1s
("broadcast") and may not be assigned to any host.
The class A network address block contains 231 power (2,147,483,648)
individual addresses. The IPv4 address space contains a maximum of
232 power (4,294,967,296) addresses, which mean that a class A network
address space is 50% of the total IPv4 unicast, address space.

February 26, 2014 Sajid Ali Gillal 15


cont.. .

Class A Network (/ 8 Prefixes)

N.H.H.H
1-126
0 can not be used as Net ID
127 is reserved for loop back functions
126 Different Networks
16,777,214 Hosts per Network

February 26, 2014 Sajid Ali Gillal 16


Class B Network (/ 16 Prefixes)

This network is a 16-bit network prefix; its highest bit order is set to 1-0.
It is a 14-bit network number with a 16-bit host number.

This class defines 16,384 (214) /16 networks, and supports a maximum of
65,534 (216 -2) hosts per network. Class B /16 block address is (1,073,741,824)
= 230; therefore it represent 25% of the total IPV4.

February 26, 2014 Sajid Ali Gillal 17


cont.. .

Class B Network (/ 16 Prefixes)

N.N.H.H
128-191
The first IP Address is the NET ID
The last IP Address is the Broadcast Address
16,384 Different Networks
65543 Hosts per Network

February 26, 2014 Sajid Ali Gillal 18


Class C Network (/ 24 Prefixes)

This is a 24-bit network prefix; it has a 3 bit set to the highest order 1-1-0.
It is a 21-bit network number with 8-bit host number.

This class defines a maximum of 2,097,152 (221 ) /24 networks. And each
network supports up to 254 (28 -2) hosts. The entire class C network
represents 229 (536,870,912) addresses; therefore it is only 12.5 % of the total
IPv4.

February 26, 2014 Sajid Ali Gillal 19


cont.. .

Class C Network (/ 24 Prefixes)

N.N.N.H
192-223
The first IP Address is the NET ID
The last IP Address is the Broadcast Address
2,097,152 Different Networks
254 Hosts per Network

February 26, 2014 Sajid Ali Gillal 20


There are two other networks that are not commonly used, class D and Class E.

Class D has its highest bit order set to 1-1-1-0 it is used to support
multicasting.

Class E has its highest bit order set to 1-1-1-1 which is reserved for
experimental use.

February 26, 2014 Sajid Ali Gillal 21


cont.. .
Network classes are summarized in following table.

February 26, 2014 Sajid Ali Gillal 22


Task 1
For The IP address 192.168.0.1 find the network mask, broadcast
address number of hosts, IP address of first and last host.

Task 2
Implement the above network in Packet Tracer with at least 7 hosts
also show the first and last host.

February 26, 2014 Sajid Ali Gillal 23


Introduction to Sub-netting

February 26, 2014 Sajid Ali Gillal 24


cont.. .

Purpose:
The lab is intended to familiarize the students with a networking technique of
SUBNETTING.

At the end of the lab the student must know:


The Purpose of SUBNETTING.
Steps of SUBNETTING.
How to perform SUBNETTING on different IP Classes.
Calculating the ranges of Hosts in the Subnet.
Finding the Broadcast address of the Subnet.
How to make a SUBNET on Linux machines.
How to Broadcast on that Subnet.

February 26, 2014 Sajid Ali Gillal 25


cont.. .
Addressing scheme

February 26, 2014 Sajid Ali Gillal 26


cont.. .

In subnetting, a network is divided into smaller subnets with each subnet having
its own subnet address.

Reasons for Subnetting


Imagine a Network Class A with over 16 millions of hosts or a Class B
Network with 65 thousand hosts, it is impractical
Most IP address assignments were not used very efficiently.
Broadcast problem.
Many sites were requesting multiple network numbers due to variable
amounts of networks at their sites.

February 26, 2014 Sajid Ali Gillal 27


cont.. .

In subnetting, a network is divided into smaller subnets with each subnet having
its own subnet address.

Benefits of subnetting
Reduced network traffic
Simplified management
Smaller broadcast domains

February 26, 2014 Sajid Ali Gillal 28


cont.. .

February 26, 2014 Sajid Ali Gillal 29


cont.. .

Network before Subnetting

February 26, 2014 Sajid Ali Gillal 30


cont.. .

Network after Subnetting

February 26, 2014 Sajid Ali Gillal 31


cont.. .

The purpose of subnetting is that by using only one given IP we can make
different networks.

E.g. If the Given IP is: 172.16.0.0 and we are required to make 169 Subnets,
then, by using the following formula for subnets we can find the no. of bits
required for the subnets:

2n 2 >= No. of Subnets.


Where n is No. of Bits further required as network address field in the
given IP.

Therefore for 169 subnets we get n = 8. So the new mask becomes:


255.255.255.0

February 26, 2014 Sajid Ali Gillal 32


cont.. .

First subnet IP address: 172.16.1.0


First PC IP address in this Subnet: 172.16.1.1
Last PC IP address in this Subnet: 172.16.1.254
Broadcast IP address in this Subnet: 172.16.1.255

Last subnet IP address: 172.16.254.0


First PC IP address in this Subnet: 172.16.254.1
Last PC IP address in this Subnet: 172.16.254.254
Broadcast IP address in this Subnet: 172.16.254.255

February 26, 2014 Sajid Ali Gillal 33


cont.. .

February 26, 2014 Sajid Ali Gillal 34


cont.. .

Subnet Mask
One solution to the IP address shortage was thought to be the subnet
mask.
Formalized in 1985 (RFC 950), the subnet mask breaks a single class A,
B or C network in to smaller pieces.

February 26, 2014 Sajid Ali Gillal 35


cont.. .

Addressing without Subnets

A class B Flat Network, more than 65000 hosts


How to manage?
Performance?
February 26, 2014 Sajid Ali Gillal 36
cont.. .

Addressing with Subnets

A class B subdivided network, smaller groups with routers


February 26, 2014 Sajid Ali Gillal 37
cont.. .

Subnetwork benefits

February 26, 2014 Sajid Ali Gillal 38


cont.. .

Subnet Address

A subnet address is created by borrowing bit from the Host


ID and designated it as a Subnet ID field

February 26, 2014 Sajid Ali Gillal 39


cont.. .

How to assign subnet


Each class can have different size of subnet field

February 26, 2014 Sajid Ali Gillal 40


cont.. .

Subnet Example
Class B address such as 172.16.0.0 might use its third byte to identify subnet

February 26, 2014 Sajid Ali Gillal 41


cont.. .

subnet mask is a 32 bit number, use to identify a subnet

February 26, 2014 Sajid Ali Gillal 42


cont.. .

Masking

A bitwise-and between IP address and subnet mask yields a network


address.
Note that zeros bit are used to mask out the host number resulting the
network address

February 26, 2014 Sajid Ali Gillal 43


cont.. .

Subnet mask in Prefix format


The number of routing bits (network and subnet bits) in each subnet
mask can also be indicated by the "/n " format.

February 26, 2014 Sajid Ali Gillal 44


cont.. .

Routing
Hosts and routers perform logical AND to send packets

172.16.1.3 has a packet for 172.16.4.2 and determine that it is on other subnetwork
The packet is sent to the router
The router performs a subnet masking and sends the packet to the destination
network
February 26, 2014 Sajid Ali Gillal 45
cont.. .

Subnet interpretation

February 26, 2014 Sajid Ali Gillal 46


cont.. .

Default Subnet mask


A default subnet mask : a subnet mask with no subnetting

February 26, 2014 Sajid Ali Gillal 47


cont.. .

Computing subnet mask


Decimal equivalents of bit patterns

February 26, 2014 Sajid Ali Gillal 48


cont.. .

Compute Net and host


How many subnet and host are there with 172.16.0.0/24

8 bit subnet ID = 28=256-2 => 254 subnets


8 bit host ID = 28=256-2 => 254 hosts per subnet

February 26, 2014 Sajid Ali Gillal 49


cont.. .

Given the Class B address 190.52.0.0


Class B Network Network Host Host

Using /24
subnet Network Network Subnet Host

Internet routers still see this net as 190.52.0.0

190.52.1.2 But internal routers think all these


190.52.2.2 addresses are on different networks, called
subnetworks
190.52.3.2
February 26, 2014 Sajid Ali Gillal 50
cont.. .

The purpose of subnetting is that by using only one given IP we can make
different networks.

E.g. If the Given IP is: 172.16.0.0 and we are required to make 169 Subnets,
then, by using the following formula for subnets we can find the no. of bits
required for the subnets:

2n 2 >= No. of Subnets.


Where n is No. of Bits further required as network address field in the
given IP.

Therefore for 169 subnets we get n = 8. So the new mask becomes:


255.255.255.0

February 26, 2014 Sajid Ali Gillal 51


cont.. .

First subnet IP address: 172.16.1.0


First PC IP address in this Subnet: 172.16.1.1
Last PC IP address in this Subnet: 172.16.1.254
Broadcast IP address in this Subnet: 172.16.1.255

Last subnet IP address: 172.16.254.0


First PC IP address in this Subnet: 172.16.254.1
Last PC IP address in this Subnet: 172.16.254.254
Broadcast IP address in this Subnet: 172.16.254.255

February 26, 2014 Sajid Ali Gillal 52


cont.. .

Suppose you are starting with a class C address like


192.168.0.0/24

This would be a subnet:


Subnet Address: 192.168.0.0 / 26
Subnet Mask: 11111111 11111111 11111111 11000000
255 255 255 192
Usable address range: 192.168.0.1 - 192.168.0.62
This would be a supernet:
Subnet Address: 192.168.0.0 / 22
Subnet Mask: 11111111 11111111 11111100 00000000
255 255 252 0
Usable address range: 192.168.0.1 - 192.168.3.254
February 26, 2014 Sajid Ali Gillal 53
cont.. .

Network and Host relationship


Sample class C

February 26, 2014 Sajid Ali Gillal 54


Packet Tracer is a self-paced, visual, interactive teaching and learning tool
developed by Cisco. Lab activities are an important part of networking
education. However, lab equipment can be a scarce resource. Packet Tracer
provides a visual simulation of equipment and network processes to offset
the challenge of limited equipment. Students can spend as much time as they
like completing standard lab exercises through Packet Tracer, and have the
option to work from home. Although Packet Tracer is not a substitute for real
equipment, it allows students to practice using a command-line interface.
This e-doing capability is a fundamental component of learning how to
configure routers and switches from the command line.

February 26, 2014 Sajid Ali Gillal 55


cont.. .

Steps for First Simulation


1. Familiarize yourself with the packet tracer. Check all the devices and type of connections
available in it.
2. To implement very basic subnetting scenario. Select a switch from switches tab in the
bottom right corner of screen.
3. Drag it to the middle of the screen.
4. Then from the end devices tab select desktop PC and drag them to screen. At least 8 of
them.
5. Connect these computers to switch using straight-over cable.
6. Next task is to configure all the computers with IP addresses from the subnet they belong.
7. To configure IP address double clicks on any computer. You will see three tabs on top of the
window. Go to the Desktop Tab, last one. There you will see different configuration
utilities. Use them to assign IP address to computer. Pay special attention to subnet mask.
8. Repeat step 7 for all computers.
9. Now use ping utility to check to communication between computers of same subnet and
then among different subnets.

February 26, 2014 Sajid Ali Gillal 56


Additional Information About
Network
Cisco Icons and Symbols

February 26, 2014 Sajid Ali Gillal 58


A network interface card (NIC) is a printed circuit board that provides
network communication capabilities to and from a personal computer. Also
called a LAN adapter.

February 26, 2014 Sajid Ali Gillal 59


Cisco technology is built around the Cisco Internetwork Operating System
(IOS), which is the software that controls the routing and switching functions
of internetworking devices.

A solid understanding of the IOS is essential for a network administrator.

February 26, 2014 Sajid Ali Gillal 60


As with a computer, a router or switch cannot function without an operating
system. Cisco calls its operating system the Cisco Internetwork Operating
System or Cisco IOS.

February 26, 2014 Sajid Ali Gillal 61


A router is a special type of computer. It has the same basic components as a
standard desktop PC. However, routers are designed to perform some very
specific functions. Just as computers need operating systems to run software
applications, routers need the Internetwork Operating System software (IOS) to
run configuration files. These configuration files contain the instructions and
parameters that control the flow of traffic in and out of the routers. The many
parts of a router are shown below:

February 26, 2014 Sajid Ali Gillal 62


ROM - Read Only Memory Bootstrap/POST

FLASH Memory- IOS Images are kept here


- Erasable reprogrammable ROM
- Contents are kept on Power down or reload

RAM - Random Access memory


- Routing Tables
- Running Configuration
- Contents are lost on reboot

NVRAM - Start up configuration


- Configuration Register
- Contents are kept on reload

February 26, 2014 Sajid Ali Gillal 63


Read-Only Memory

ROM has the following characteristics and functions:

Maintains instructions for power-on self test


(POST) diagnostics
Stores bootstrap program and basic operating
system software
Mini IOS

February 26, 2014 Sajid Ali Gillal 64


Random Access Memory, also called dynamic RAM (DRAM)

RAM has the following characteristics and functions:

Stores routing tables


Holds ARP cache
Performs packet buffering (shared RAM)
Provides temporary memory for the configuration file of
the router while the router is powered on
Loses content when router is powered down or restarted

February 26, 2014 Sajid Ali Gillal 65


Non-Volatile RAM

NVRAM has the following characteristics and functions:

Provides storage for the startup configuration file


Retains content when router is powered down or
restarted
Configuration Register 16 bit register which decides
boot sequence

February 26, 2014 Sajid Ali Gillal 66


Flash memory has the following characteristics and
functions:

Holds the operating system image (IOS)


Allows software to be updated without
removing and replacing chips on the processor
Retains content when router is powered down
or restarted
Can store multiple versions of IOS software
Is a type of electronically erasable,
programmable ROM (EEPROM)
February 26, 2014 Sajid Ali Gillal 67
Interfaces have the following characteristics and functions:

Connect router to network for frame entry and exit


Can be on the motherboard or on a separate module

Types of interfaces:

Ethernet
Fast Ethernet
Serial
ISDN BRI
Loopback
Console
Aux

February 26, 2014 Sajid Ali Gillal 68


February 26, 2014 Sajid Ali Gillal 69
Perform power-on self test (POST).
Load and run bootstrap code.
Find the Cisco IOS software.
Load the Cisco IOS software.
Find the configuration.
Load the configuration.
Run the configured Cisco IOS software.

February 26, 2014 Sajid Ali Gillal 70


The flash memory file is decompressed into RAM.

February 26, 2014 Sajid Ali Gillal 71


Load and execute the configuration from NVRAM.
If no configuration is present in NVRAM, enter setup mode.

February 26, 2014 Sajid Ali Gillal 72


February 26, 2014 Sajid Ali Gillal 73
February 26, 2014 Sajid Ali Gillal 74
February 26, 2014 Sajid Ali Gillal 75
February 26, 2014 Sajid Ali Gillal 76
February 26, 2014 Sajid Ali Gillal 77
February 26, 2014 Sajid Ali Gillal 78
February 26, 2014 Sajid Ali Gillal 79
February 26, 2014 Sajid Ali Gillal 80
February 26, 2014 Sajid Ali Gillal 81
In RAM In NVRAM
wg_ro_c#show running-config wg_ro_c#show startup-config
Building configuration... Using 1359 out of 32762 bytes
Current configuration: !
! version 12.0
version 12.0 !
! -- More --
-- More --

Displays the current and saved configuration

February 26, 2014 Sajid Ali Gillal 82


Task 1
For The following IPs find the first two and last two Subnets and give
their Pc range and Broadcast address.
1. 10.0.0.0 for 1025 subnets.
2. 212.31.30.0 for 21 subnets.
3. 190.38.0.0 for 645 subnets.

Task 2
Implement first two subnets created in Task (1-2)
in Packet Tracer.

February 26, 2014 Sajid Ali Gillal 83


February 26, 2014 Sajid Ali Gillal 84

Potrebbero piacerti anche