Sie sind auf Seite 1von 37

2/9/2020

LEC

ADDRESSING IN COMPUTER NETWORKS


• Addressing In different Layers
• IPv4 Addresses
• Subnetting, CIDR, VLSM
• Supernetting
• Special Addresses
• Public Private IP addresses
• IPV4 Current Status

Lt Col Dr HASNAT KHURSHID

ADDRESSING in Different LAYERS


LAYER ADDRESS USE Example

Application Assigned by Applications


Layer Application
Developer/Engineer
Transport Layer Port Numbers Application Port 80 used for web services
Processes and (HTTP),
Transport Layer Svcs TCP Port 20 used for FTP

Network Layer IP Address Routing 192.168.123.12

Link Layer MAC Address Switching 00:A0:C9:14:C8:29

Physical Layer

Lt Col Dr HASNAT KHURSHID

1
2/9/2020

ADDRESSING in Different LAYERS


PORT ADDRESSING BRING PACKETS TILL APP Process
Why different Addresses in different Layers ?
IP ADDS MAC ADDS PORT ADDS DATA

ROUTER, routes
mail server
the packet basing
to Internet on IP address
web server

IP ADDRESSING BRING PACKETS TILL SUBNET SWITCH, switches


the packet basing
MCS IP subnet on MAC address

OS, demux the


packet to the correct
app process basing
on Port
MAC ADDRESSING No PACKETS TILL HOST
BRING
Lt Col Dr HASNAT KHURSHID

ADDRESSING in Different LAYERS

Why different Addresses in different Layers ?


• ANALOGY: POSTAL ADDRESS: Country, City, Street, Person Name

• As every letter must have all parts of the address written on it, similarly every
packet must have addresses of all layers to be able to be delivered to the
correct destination process.

• Source Address is also required for all Layers in the letters/packets for
reply/response.

Lt Col Dr HASNAT KHURSHID

2
2/9/2020

ADDRESSING in Different LAYERS

 LAYER 4 ADDRESS: Port Numbers

 LAYER 2 ADDRESS: MAC Address

 LAYER 3 ADDRESS: IP Address

Lt Col Dr HASNAT KHURSHID

ADDRESSING in Different LAYERS


LAYER 4 ADDRESS: PORT NUMBERS
• These are Software ports (not hardware)
• Range is 0 – 65535 (=2^16)
• Registered and Unregistered Port Numbers
• Internet Assigned Numbers Authority (IANA) is responsible for maintaining the
official assignments of port numbers for specific uses
• The range 49152–65535 contains dynamic or private ports that cannot be
registered with IANA.
• The port numbers in the range from 0 to 1023 are the well-known ports or
system ports. Example 80: HTTP, 20:FTP, 443:HTTPS
https://www.yahoo.com:443
• APP developer can assign port numbers on his own will.
• We can block all HTTP/WEB traffic by blocking the Port 80 in our network
through firewall or e.g Block HTTPS by blocking Port 443

3
2/9/2020

ADDRESSING in Different LAYERS


LAYER 4 ADDRESS: PORT NUMBERS
• How to see your port Numbers Open on Windows OS
• C:\netstat

Lt Col Dr HASNAT KHURSHID

ADDRESSING in Different LAYERS

 LAYER 4 ADDRESS: Port Numbers

 LAYER 2 ADDRESS: MAC Address

 LAYER 3 ADDRESS: IP Address

Lt Col Dr HASNAT KHURSHID

4
2/9/2020

ADDRESSING in Different LAYERS


LAYER 2 ADDRESS: MAC (Media Access Control)
• Also called LAN or physical or Ethernet address.
• Function: get frame from one interface to another physically-connected
interface (on same network)
• 48 bit address
• burned in NIC ROM (Hardware) by manufacturer
• Ideally can not be changed ( although not difficult to do so….)
• Unique for every device.
• Allocated by the Institute of Electrical and Electronics Engineers (IEEE)
• Manufacturer buys portion of MAC address space (to assure uniqueness)
• MAC address with all 48 bits as 1’s = FF FF FF FF FF FF is the broadcast address
• MAC flat address ➜ portability can move LAN card from one LAN to another
• IP hierarchical address ➜NOT portable
Lt Col Dr HASNAT KHURSHID

MAC Addresses
• 48 bit hex decimal value
• c:\> ipconfig / all ( to see your Mac addresses of all interfaces)

5: DataLink Layer 5-10


Lt Col Dr HASNAT KHURSHID

5
2/9/2020

MAC Addresses

• A network node with multiple NICs; each NIC must have a unique MAC address

1A-2F-BB-76-09-AD Broadcast address =


FF-FF-FF-FF-FF-FF
19-61-FF-2B-08-54

LAN
(wired or
wireless) = NIC (Network Interface Card)
71-65-F7-2B-08-53
58-23-D7-FA-20-B0 adapter

0C-C4-11-6F-E3-98

Lt Col Dr HASNAT KHURSHID

ADDRESSING in Different LAYERS


But before that lets revisit,….
Who alloc these addresses in NWs
 LAYER 4 ADDRESS: Port Numbers Software Programmers, OS

 LAYER 2 ADDRESS: MAC Address Fixed, by Manufacturer

Network Administrators
 LAYER 3 ADDRESS: IP Address Requires Planning

Lt Col Dr HASNAT KHURSHID

6
2/9/2020

IPv4 ADDRESSES
• Who should Have an IP Address?
– IP Address is given to only those devices which have layer 3 in them. e.g Router, Computer,
Camera…… but what about Switch, hub ?

• IP address is a configurable address (Can be changed, it is not hard coded)


• Any Organization/Network with large number of hosts need to plan in advance the
IPV4 Addressing scheme for it’s network…. i.e can not be done randomly.

Lt Col Dr HASNAT KHURSHID

IP ADDRESS
• IPv4 addresses are 32 bit binary addresses (divided into 4 octets)
• ( 32 bits = 4 Octets of 8 bits each)

– Dotted Decimal Notation

192 . 168 . 1 . 3

– Dotted Binary Notation

01100000 . 010101000 . 00000001 . 00000011

Lt Col Dr HASNAT KHURSHID

7
2/9/2020

IP ADDRESS – Network and Host


• IP address identifies host and also the network of the host.
• Analogy : Your cell phone number has 2 parts Network and Host
– 0321 8580901
Network Host Digits

• Similarly, An IPv4 address has two components, the network part and the host part.
– IP Address = 192.168.1.3
01100000 . 10101000 . 00000001. 00000011
Network bits Host bits
Some of the 32 Bits represent Network and Remaining bits represent Host Part in a IP
Address of 32 bits. It is important to mention here that here the separation of NW/HOST
part is in bits and not in digits ( as in cell phone separation is in digits).
Lt Col Dr HASNAT KHURSHID

SUBNET MASK
– QUESTION: How to determine which bits will depict NETWORK and which bits will
depict HOST part in an IP Address?
– Solution: Use a Mask of 1’s and 0’s where 1’s will depict Network and 0’s will
depict Host part. This Mask is known Subnet Mask.

– IP Address = 192.168.1.3
01100000 . 10101000 . 00000001. 00000011
11111111 . 11111111 . 111111111. 00000000 Subnet Mask. 255.255.255.0
Network Host
– IP Address = 128.1.0.1
10000000 . 00000001 . 00000000. 00000001
11111111 . 111111111 . 00000000. 00000000 Subnet Mask. 255.255. 0. 0
Network Host
Lt Col Dr HASNAT KHURSHID

8
2/9/2020

SUBNET MASK
– So an IPV4 Address has two components
• IP ADDRESS itself and a SUBNET MASK

– IP Address = 192.168.1.3
01100000 . 010101000 . 00000001. 00000011

– Subnet Mask = 255.255.255.0


11111111 . 11111111 . 11111111. 0000000

– Note: Subnet mask will always have contiguous 1’s on the left. i.e it can
NOT be 10111101.111…..
– Subnet Mask is also specified using CIDR notation as / xx
( = number of 1’s in subnet Mask) Example: 192.168.1.3 / 24

Lt Col Dr HASNAT KHURSHID

NW, HOST & BROADCAST ADDRESS


• In a given range/block of IP addresses. There would always be:
– Network Address ( First Usable IP Address)
– Host Address Range ( 2nd to 2nd last Usable IP Address)
– Broadcast Address ( Last Usable IP Address)

192.168.10.0 Network Address


192.168.10.1
192.168.10.2
. Host Addresses Range
.
.
192.168.10.254
192.168.10.255 Broadcast Address
Lt Col Dr HASNAT KHURSHID

9
2/9/2020

IPv4 ADDRESSES
• Infact we can also see that
– Network address: is an IPv4 address with all host bits are "0“
– Broadcast address: is an IPv4 address with all host bits are "1“

Network bits host bits

192.168.10.0 Network Address 01100000 . 10101000 . 00001010. 00000000


192.168.10.1 01100000 . 10101000 . 00001010. 00000001
192.168.10.2 01100000 . 10101000 . 00001010. 00000000
. Host Addresses Range
.
.
192.168.10.254
192.168.10.255 Broadcast Address 01100000 . 10101000 . 00001010. 11111111

Lt Col Dr HASNAT KHURSHID

MCNA -Executive
– Uptill 1997? The complete 32 bit range of IP addresses was divided into
blocks, known as Class A, Class B, Class C. with fixed subnet masks as
– 255.255.255.0 (Class C) , (small networks 255 users)
– 255.255.0.0 (Class B) , ( medium networks ? Users)
– 255.0.0.0 (Class A) (Large networks ? Users)
– Problem with Classful Addressing ?.....
– But in 1997 this system was abolished and CIDR was introduced. Now
any number of bits can be used for NW and Host bits.

Lt Col Dr HASNAT KHURSHID

10
2/9/2020

IP ADDRESS ALLOC - EX
Given Block : 192.168.1.0 / 24
NW Address : 192.168.1.0
HOST Range : 192.168.1.1 till 192.168.1.254
Wateen mail server
Internet 192.168.1.11
255.255.255.0
172.xx.xx.xx web server
172.xx.xx.xx

192.168.1.1
255.255.255.0
192.168.1.10
255.255.255.0

192.168.1.2
255.255.255.0

192.168.1.3
255.255.255.0

IP ADDRESS ALLOC
Given Block : 192.168.1.0 / 24 DHCP: Dynamic Host Control Protocol
NW Address : 192.168.1.0 enables auto allocation of IP Addresses
HOST Range : 192.168.1.1 till 192.168.1.254 from a pool. e.g in your houses, cellphones.
Wateen mail server
Internet 192.168.1.11
255.255.255.0
172.xx.xx.xx web server
172.xx.xx.xx

192.168.1.1
255.255.255.0
192.168.1.10
255.255.255.0

192.168.1.2
255.255.255.0

192.168.1.3
255.255.255.0

11
2/9/2020

SUBNET MASK
EXAMPLE
• Extracting the Network Address from any given Host Address
– IP Address = 192.168.1.3
• 01100000 . 010101000 . 00000001. 00000011

– Subnet Mask = 255.255.255.0


• 11111111. 11111111. 11111111. 00000000

– Network Address = 192.168.1.0 (Logical AND op b/w IP and SUBNET MASK)

Lt Col Dr HASNAT KHURSHID

SUBNET MASK
EXAMPLE
• Extracting the Network Address from any given Host Address
– IP Address = 10.20.15.5
???????? . ????????. ????????. ????????
– Subnet Mask = 255.0.0.0
????????. ????????. ????????. ????????
– Network Address = ? .?.?.?
(Logical AND op b/w IP and SUBNET MASK)

Lt Col Dr HASNAT KHURSHID

12
2/9/2020

SUBNET MASK
EXAMPLE
• Extracting the Network Address from any given Host Address
– IP Address = 10.20.15.5
00001010. 00010100. 00001111. 00000101
– Subnet Mask = 255.0.0.0
11111111. 00000000. 00000000. 00000000
– Network Address = 10.20.15.5
(Logical AND op b/w IP and SUBNET MASK)

Lt Col Dr HASNAT KHURSHID

SUBNET MASK
EXAMPLE
• Find the Network address ?
– Host IP Address of some host in the NW is = 10. 0.115.140 / 8

Lt Col Dr HASNAT KHURSHID

13
2/9/2020

Any Questions so far…. ?

• IP address is specified using IP ADDRESS and SUBNET MASK


• IP address can be written in Dotted Decimal Notation and Dotted
Binary Notation
• Subnet Mask is written in Dotted or CIDR notation
• You should be able to extract a NETWORK ADDRESS from a
given IP address and subnet Mask

Lt Col Dr HASNAT KHURSHID

IPv4 ADDRESSES

• IP Addressing schemes
– Classfull Addressing Scheme
• Used in INTERNET from 1981-1993

– Classless Addressing Scheme (CIDR)


• Used in Internet from 1993-till date

Lt Col Dr HASNAT KHURSHID

14
2/9/2020

CLASSFUL ADDRESSING

• We know that in IP address some bits represent “NW” and others


“Hosts”
• So in our 32 bit IP Address space:
– Possible number of Networks = 2n n = number of bits representing Network

– Possible Number of Hosts = 2(32-n) - 2 32-n = number of bits representing Hosts

-2 is for subtracting 2 x Not Host-useabe addresses i.e Network Address & Broadcast Address

Lt Col Dr HASNAT KHURSHID

IPv4 ADDRESS CLASSES


In Classful Addressing the 32bit-space was divided into 5 Classes by fixing number
of bits which can be used for Network and Host part.

Lt Col Dr HASNAT KHURSHID

15
2/9/2020

CLASS A IPv4 ADDRESSES

• "Class A" IPv4 addresses are for very large networks


• The left most bit of the left most octet of a "Class A" network is
reserved as "0“
• The first octet of a "Class A" IPv4 address is used to identify the
Network and the three remaining octets are used to identify the
host in that particular network
– (Network.Host.Host.Host)

Lt Col Dr HASNAT KHURSHID

CLASS A IPv4 ADDRESSES

• The 32 bits of a "Class A" IPv4 address can be represented as:-


– 0xxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx

• The min possible value for the leftmost octet in binaries is


00000000 (decimal equivalent is 0) and the max possible value
for the leftmost octet is 01111111 (decimal equivalent is 127)
• Therefore for a "Class A" IPv4 address, leftmost octet must have a
value between 0-127 (0.X.X.X to 127.X.X.X)

Lt Col Dr HASNAT KHURSHID

16
2/9/2020

CLASS B IPv4 ADDRESSES

• "Class B" IPv4 addresses are used for medium-sized networks


• Two left most bits of the left most octet of a "Class B" network is
reserved as "10“
• The first two octets of a "Class B" IPv4 address is used to identify
the Network and the remaining two octets are used to identify the
host in that particular network:-
– (Network.Network.Host.Host)

Lt Col Dr HASNAT KHURSHID

CLASS B IPv4 ADDRESSES

• The 32 bits of a "Class B" IPv4 address can be represented as:-


– 10xxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx

• The min possible value for the leftmost octet in binaries is


10000000 (decimal equivalent is 128) and the max possible value
for the leftmost octet is 10111111 (decimal equivalent is 191)
• Therefore for a "Class B" IPv4 address, leftmost octet must have
a value between 128-191 (128.X.X.X to 191.X.X.X)

Lt Col Dr HASNAT KHURSHID

17
2/9/2020

CLASS C IPv4 ADDRESSES

• "Class C" IPv4 addresses are commonly used for small to mid-
size businesses
• Three left most bits of the left most octet of a "Class C" network is
reserved as "110“
• The first three octets of a "Class C" IPv4 address is used to
identify the Network and the remaining one octet is used to
identify the host in that particular network:-
– (Network.Network.Networkt.Host)

Lt Col Dr HASNAT KHURSHID

CLASS C IPv4 ADDRESSES

• The 32 bits of a "Class C" IPv4 address can be represented as:-


– 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx.

• The min possible value for the leftmost octet in binaries is


11000000 (decimal equivalent is 192) and the max possible value
for the leftmost octet is 11011111 (decimal equivalent is 223)
• Therefore for a "Class C" IPv4 address, leftmost octet must have
a value between 192-223 (192.X.X.X to 223.X.X.X)

Lt Col Dr HASNAT KHURSHID

18
2/9/2020

CLASS D IPv4 ADDRESSES

• Class D IPv4 addresses are known as multicast IPv4 addresses


• Multicasting is a technique developed to send packets from one
device to many other devices, without any unnecessary packet
duplication
• In multicasting, one packet is sent from a source and is replicated
as needed in the network to reach as many end-users as
necessary
• You cannot assign these IPv4 addresses to your devices

Lt Col Dr HASNAT KHURSHID

CLASS D IPv4 ADDRESSES

• Four left most bits of the left most octet of a "Class D" network is reserved
as "1110“
• Other 28 bits are used to identify the group of computers the multicast
message is intended for
• The min possible value for the left most octet in binaries is 11100000
(decimal equivalent is 224) and the max possible value for the leftmost
octet is 11101111 (decimal equivalent is 239)
• Therefore for a "Class D" IPv4 address, leftmost octet must have a value
between 224-239 (224.X.X.X to 239.X.X.X)

Lt Col Dr HASNAT KHURSHID

19
2/9/2020

CLASS E IPv4 ADDRESSES

• Class E is used for experimental purposes only and you cannot assign these
IPv4 addresses to your devices
• Four left most bits of the left most octet of a "Class E" network is reserved as
"1111"
• The min possible value for the left most octet in binaries is 11110000 (decimal
equivalent is 240) and the max possible value for the leftmost octet is
11111111 (decimal equivalent is 255)
• Therefore for a "Class E" IPv4 address, leftmost octet must have a value
between 240-255 (240.X.X.X to 255.X.X.X)

Lt Col Dr HASNAT KHURSHID

Problem with Classful Addressing ?


CLASS Subnet Mask Number of Number of Hosts
Networks

A 255.0.0.0 2^7 = 254 2^24 = 16777216

B 255.255.0.0 2^14 = ? 2^16 = 65536

C 255.255.255.0 2^21 = ? 2^8 = 255

A typical org requires mote then 255 addresses so it is allocated Class B Block but it did
not require 65536 addresses, so many addresses are wasted.
We can not afford that wastage anymore ( IP Addresses are valuable now)
Lt Col Dr HASNAT KHURSHID

20
2/9/2020

Solution - CIDR

• IP Addressing schemes
– Classfull Addressing Scheme
• Used in INTERNET from 1981-1993

– Classless Addressing Scheme (CIDR)


• Used in Internet from 1993-till date

Lt Col Dr HASNAT KHURSHID

Solution - Subnetting

• Divide a network into sub-networks


• Example
– 192.168.1.0/24 (255.255.255.0)
• 01100000 . 010101000 . 00000001. 00000000
• 11111111 . 11111111. 11111111 .00000000

Host Range
Class Network Adds Broadcast Adds # of Hosts subnet Mask CIDR
First Last

C 192.168.1.0 192.168.1.1 192.168.1.254 192.168.1.255 255 - 2 255.255.255.0 /24

– Now Divide this network into 2 x subnets of 128 hosts each.

Lt Col Dr HASNAT KHURSHID

21
2/9/2020

Solution - Subnetting
• Example
– 192.168.1.0/24 (255.255.255.0)
• 01100000 . 010101000 . 00000001. 00000000

0
• 11111111 . 11111111. 11111111 . 0000000

– Now Divide this network into 2 x subnets of 128 hosts each.


• Borrow 1 bit from the host part and allocate it for network part
• New subnet mask becomes
– 11111111 . 11111111. 11111111 .10000000 = 255.255.255.128

Lt Col Dr HASNAT KHURSHID

Example- Subnetting

• Now the network is subnetted into 2 x subnets


• Example
– 192.168.1.0/25 (255.255.255.128)

Host Range
Class Network Adds Broadcast Adds # of Hosts subnet Mask CIDR
First Last

192.168.1.0 192.168.1.1 192.168.1.126 192.168.1.127 128 – 2 255.255.255.128 /25

192.168.1.128 192.168.1.129 192.168.1.254 192.168.1.255 128 - 2 255.255.255.128 /25

Lt Col Dr HASNAT KHURSHID

22
2/9/2020

Example- Subnetting

• For 4 x subnets borrow 2 bits from the host part of subnet mask
• Example
– 192.168.1.0/26 (255.255.255.192)

Host Range
Class Network Adds Broadcast Adds # of Hosts subnet Mask CIDR
First Last

192.168.1.0 192.168.1.1 192.168.1.62 192.168.1.63 64 – 2 255.255.255.192 /26

192.168.1.64 192.168.1.65 192.168.1.126 192.168.1.127 64 – 2 255.255.255.192 /26

192.168.1.128 192.168.1.129 192.168.1.190 192.168.1.191 64 – 2 255.255.255.192 /26

192.168.1.192 192.168.1.193 192.168.1.254 192.168.1.255 64 – 2 255.255.255.128 /26

Lt Col Dr HASNAT KHURSHID

Example- Subnetting

• For 8 x subnets borrow 3 bits from the host part of subnet mask
• Example
– 192.168.1.0/27 (255.255.255.224)

Host Range
Class Network Adds Broadcast Adds # of Hosts subnet Mask CIDR
First Last

192.168.1.0 192.168.1.1 192.168.1.30 192.168.1.31 32 – 2 255.255.255.224 /27

192.168.1.32 192.168.1.33 192.168.1.62 192.168.1.63 32 – 2 255.255.255.224 /27

… … … … … … …

… … … … … … …

Lt Col Dr HASNAT KHURSHID

23
2/9/2020

Example- Subnetting

• For 8 x subnets borrow 3 bits from the host part of subnet mask
• Example
– 192.168.1.0/27 (255.255.255.224)

Host Range
Class Network Adds Broadcast Adds # of Hosts subnet Mask CIDR
First Last

192.168.1.0 192.168.1.1 192.168.1.30 192.168.1.31 32 – 2 255.255.255.224 /27

192.168.1.32 192.168.1.33 192.168.1.62 192.168.1.63 32 – 2 255.255.255.224 /27

… … … … … … …

… … … … … … …

Lt Col Dr HASNAT KHURSHID

Example- Subnetting Class B


Host Range
Class Network Adds First Last Broadcast Adds # of Hosts subnet Mask CIDR

Given
B 172.16.0.0 172.16.0.1 172.16.255.254 172.16.255.255 65534 255.255.0.0 /16

Divide into 2 subnets


subnet 1 172.16.0.0 172.16.0.1 172.16.127.254 172.16.127.255 32766 255.255.128.0 /17
subnet 2 172.16.128.0 172.16.128.1 172.16.255.254 172.16.255.255 32766 255.255.128.0 /17

Divide into 4 subnets


subnet 1 172.16.0.0 172.16.0.1 172.16.63.254 172.16.63.255 16382 255.255.192.0 /18
subnet 2 172.16.64.0 172.16.64.1 172.16.127.254 172.16.127.255 16382 255.255.192.0 /18
subnet 3 172.16.128.0 172.16.128.1 172.16.191.254 172.16.191.255 16382 255.255.192.0 /18
subnet 4 172.16.192.0 172.16.192.1 172.16.255.254 172.16.255.255 16382 255.255.192.0 /18

Divide into 8 subnets


subnet 1 172.16.0.0 172.16.0.1 172.16.31.254 172.16.31.255 4094 255.255.240.0 /19
subnet 2 172.16.32.0 172.16.32.1 172.16.63.254 172.16.63.255 4094 255.255.240.0 /19
subnet 3 172.16.64.0 172.16.64.1 172.16.95.254 172.16.95.255 4094 255.255.240.0 /19
subnet 4 172.16.96.0 172.16.96.1 172.16.127.254 172.16.127.255 4094 255.255.240.0 /19
subnet 5 172.16.128.0 172.16.128.1 172.16.159.254 172.16.159.255 4094 255.255.240.0 /19
subnet 6 172.16.160.0 172.16.160.1 172.16.191.254 172.16.191.255 4094 255.255.240.0 /19
subnet 7 172.16.192.0 172.16.192.1 172.16.223.254 172.16.223.255 4094 255.255.240.0 /19
subnet 8 172.16.224.0 172.16.224.1 172.16.255.254 172.16.255.255 4094 255.255.240.0 /19

24
2/9/2020

Subnetting

• Similarly we can divide into 2,4,8,16,32,64 networks by borrowing


• 1,2,3,4,5,6, bits
• Why not 7 or 8 bits can be borrowed from the subnet mask ???

Lt Col Dr HASNAT KHURSHID

CIDR

• Even much more IPv4 addresses are wasted in the case of Class
A, where total usable IPv4 addresses per network is 16777214
((2^24) - 2)
• The original "IPv4 Class A networks" uses 8 bits to represent the
network part, "Class B networks" uses 16 bits to represent the
network part and "Class C networks" uses 24 bits to represent the
network part
• CIDR replaced these categories with a more generalized network
prefix

Lt Col Dr HASNAT KHURSHID

25
2/9/2020

CIDR

• This network prefix could be of any length, not just 8, 16, or 24


bits
• For example; 172.16.120.213 255.255.128.0 can be represented
in CIDR format as 172.16.120.213/17, because there are 17 bits
used for network part
• CIDR includes supernetting, VLSM and route aggregation

Lt Col Dr HASNAT KHURSHID

VLSM

• Variable Length Subnet Masking (VLSM) is a way of further


subnetting a subnet
• Using VLSM we can allocate IPv4 addresses to the subnets by
the exact need
• VLSM allows us to use more than one subnet mask within the
same network address space
• VLSM allows to create subnets from a single network with
unequal number of IPv4 addresses

Lt Col Dr HASNAT KHURSHID

26
2/9/2020

VLSM

• Example: Divide 192.168.10.0, which is a Class C network, into


four networks, each with unequal number of IPv4 addresses as
shown below:-
– Subnet 1: 128 IPv4 Addresses
– Subnet 2: 64 IPv4 Addresses
– Subnet 3: 32 IPv4 Addresses
– Subnet 4: 32 IPv4 Addresses

• Original Network (Network to be subnetted) – 192.168.10.0/24

Lt Col Dr HASNAT KHURSHID

EXAMPLE VLSM
Host Range
CLASS Network Adds First Last Broadcast Adds # of Hosts subnet Mask CIDR
Given
C 192.168.1.0 192.168.1.1 192.168.1.254 192.168.1.255 256 - 2 255.255.255.0 /24

2 Subnets
subnet 1 192.168.1.0 192.168.1.1 192.168.1.126 192.168.1.127 128 – 2 255.255.255.128 /25 pick this
subnet 2 192.168.1.128 192.168.1.129 192.168.1.254 192.168.1.255 128 - 2 255.255.255.128 /25 divide this further

2 sub-sub-nets
subsubnet 1 192.168.1.128 192.168.1.129 192.168.1.190 192.168.1.191 64 - 2 255.255.255.192 /26 pick this
subsubnet 2 192.168.1.192 192.168.1.193 192.168.1.254 192.168.1.255 64 - 2 255.255.255.192 /26 divide this further

2 sub sub sub nets


subsubsubnet 1 192.168.1.192 192.168.1.193 192.168.1.222 192.168.1.223 32 - 2 255.255.255.224 /27 pick this
subsubsubnet 2 192.168.1.224 192.168.1.225 192.168.1.254 192.168.1.255 32 - 2 255.255.255.224 /27 pick this

FINAL Selected Networks


subnet 1 192.168.1.0 192.168.1.1 192.168.1.126 192.168.1.127 128 – 2 255.255.255.128 /25 pick this
Subnet 2 192.168.1.128 192.168.1.129 192.168.1.190 192.168.1.191 64 - 2 255.255.255.192 /26 pick this
subnet 3 192.168.1.192 192.168.1.193 192.168.1.222 192.168.1.223 32 - 2 255.255.255.224 /27 pick this
subnet 4 192.168.1.224 192.168.1.225 192.168.1.254 192.168.1.255 32 - 2 255.255.255.224 /27 pick this

Lt Col Dr HASNAT KHURSHID

27
2/9/2020

VLSM

• Step 1
– Divide the two networks equally with 128 IPv4 addresses in each network
using 255.255.255.128 subnet mask (192.168.10.0/25)
– Two subnets each with 128 IPv4 addresses will be:-
• 192.168.10.0/25
• 192.168.10.128/25

Lt Col Dr HASNAT KHURSHID

VLSM

• Step 2
– Divide second subnet (192.168.10.128/25) obtained from the Step 1 again
into two Networks, each with 64 IP Addresses using 255.255.255.192
subnet mask
– Two subnets each with 64 IPv4 addresses will be:-
• 192.168.10.128/26
• 192.168.10.192/26

Lt Col Dr HASNAT KHURSHID

28
2/9/2020

VLSM

• Step 3
– Divide 192.168.10.192/26 Network again into two Networks, each with 32
IPv4 addresses using 255.255.255.224 subnet mask
– Two subnets each with 32 IPv4 addresses will be:-
• 192.168.10.192/27
• 192.168.10.224/27

Lt Col Dr HASNAT KHURSHID

VLSM

• 192.168.10.0/24 network is split into four subnets using VLSM,


with unequal number of IPv4 addresses as shown below:-
– 192.168.10.0 - 255.255.255.128 (128 Addresses)
– 192.168.10.128 - 255.255.255.192 (64 Addresses)
– 192.168.10.192 - 255.255.255.224 (32 Addresses)
– 192.168.10.224 - 255.255.255.224 (32 Addresses)

Lt Col Dr HASNAT KHURSHID

29
2/9/2020

Lt Col Dr HASNAT KHURSHID

SUPERNETTING

• Supernetting is the method for combining two or more contiguous


network address spaces to simulate a single, larger, address
space
• In Subnetting, bits from the host part are added to the network
part
• But in Supernetting, reverse is done
• In supernetting, bits from the network part are added to the host
part

Lt Col Dr HASNAT KHURSHID

30
2/9/2020

SUPERNETTING

• To supernet two contiguous networks, convert the networks into


binaries, compare the bits of the two networks
• Till where you have the similar bit pattern, use a subnet mask bit
of "1", and after that "0“
• Use the altered subnet mask for two networks

Lt Col Dr HASNAT KHURSHID

SUPERNETTING

• Example
– Network 1: 192.168.10.0
– Network 2: 192.168.11.0

• Step 1. Convert IP addresses to binary:-


– 11000000.10101000.00001010.00000000
– 11000000.10101000.00001011.00000000

• Step 2. Change subnet mask:-


– 11111111.11111111.11111110.00000000
– 255.255.254.0
Lt Col Dr HASNAT KHURSHID

31
2/9/2020

SUPERNETTING

• The changed subnet mask can be used to supernet 192.168.10.0


and 192.168.11.0
• The concept of supernetting is used in routing protocols for "route
summarization"

Lt Col Dr HASNAT KHURSHID

SPECIAL ADDRESSES

• Loop Back Address (also known as local Host). Loopback address is a


special IP address (127.0.0.1) that is designated for the
software loopback interface of a machine.
The loopback interface has no hardware associated with it, and it
is not physically connected to a network. The range of addresses
for loopback functionality is the range of 127.0.0.0 to
127.255.255.255. Loopback enables a user to test one's
own network to ensure the IP Stack is functioning properly.

Lt Col Dr HASNAT KHURSHID

32
2/9/2020

CLASS A IPv4 ADDRESSES

• The network 127.0.0.0 is known as loopback network


• The IPv4 address 127.0.0.1 is used by the host computer to send
a message back to itself
• It is commonly used for troubleshooting and network testing
• Computers not connected directly to the Internet need not have
globally-unique IPv4 addresses, they need an IPv4 addresses
unique to that network only

Lt Col Dr HASNAT KHURSHID

SPECIAL ADDRESSES
IP address 0.0.0.0
• In the IPV4, the address 0.0.0.0 is a non-routable meta-address
used to designate an invalid, unknown or non-applicable target.
• In the context of servers, 0.0.0.0 means "all IPv4 addresses on
the local machine". If a host has two IP addresses, 192.168.1.1
and 10.1.2.1, and a server running on the host listens on 0.0.0.0,
it will be reachable at both of those IPs.
• In the context of routing, 0.0.0.0 usually means the default route,
i.e. the route which leads to "the rest of" the internet instead of
somewhere on the local network.

Lt Col Dr HASNAT KHURSHID

33
2/9/2020

Public and Private IP Addresses


Public IP Addresses
• A public IP address is the address that is assigned to a computing device
to allow direct access over the Internet.
• A web server, email server and any server device directly accessible from
the Internet are candidate for a public IP address.
• A public IP address is globally unique, and can only be assigned to a
unique device.
• IANA Allocates Public Addresses.
• We can buy Static IP addresses from our ISP at a small cost.
Lt Col Dr HASNAT KHURSHID

Public and Private IP Addresses


Private IP Addresses
• A private IP address is the address space allocated by InterNIC to allow
organizations to create their own private network. There are three IP
blocks (1 class A, 1 class B and 1 class C) reserved for a private use.
• The computers, tablets and smartphones sitting behind your home, and
the personal computers within an organization are usually assigned
private IP addresses.
Class Starting IP Address Ending IP Address
A 10.0.0.0 10.255.255.255
B 172.16.0.0 172.31.255.255
C 192.168.0.0 192.168.255.255

Lt Col Dr HASNAT KHURSHID

34
2/9/2020

IPV4 Address Space Status


• IPV4 addresses are fewer then 4.3 Billion in total.
• The Internet Engineering Task Force (IETF) created the Routing and Addressing
Group (ROAD) in November 1991 to respond to the scalability problem caused
by the classful network allocation system in place at the time. creating and
adopting several new technologies, including
• network address translation (NAT),
• Classless Inter-Domain Routing (CIDR) in 1993
• IPv6 in 1998
• These technologies delayed the IPV4 exhaustion and thus IPV6 rollout a lot.
• NOTE: that problem is of global routability…. you can still run private networks
without any problem on IPV4

Lt Col Dr HASNAT KHURSHID

IPV4 Address Space Status


• The IP address space is managed by the Internet Assigned Numbers Authority (IANA) globally,
and by 5x regional Internet registries (RIR) responsible in their designated territories for
assignment to end users and local Internet registries, (such as Internet service providers)
• Addresses have been distributed by IANA to the RIRs in blocks of approximately 16.8 million
addresses each.

IANA

5 x RIRs

Network Layer 4-70

Lt Col Dr HASNAT KHURSHID

35
2/9/2020

IPV4 Address Space Status


• The top-level exhaustion occurred on 31 January 2011. On 31 January 2011,
the last two unreserved IANA /8 (255.0.0.0) address blocks were allocated to
APNIC according to RIR request procedures.

• Four of the five RIRs have exhausted allocation of all the blocks which they have
not reserved for IPv6 transition; this occurred on
• 15 April 2011 for the Asia-Pacific
• 14 September 2012 for Europe
• 10 June 2014 for Latin America and the Caribbean
• 24 September 2015 for North America.

Lt Col Dr HASNAT KHURSHID

IPV4 Address Space Status

Network Layer 4-72


Lt Col Dr HASNAT KHURSHID

36
2/9/2020

IPV4 Address Space Status

Network Layer 4-73

IPV6

• Why skip IPV5 ??? It was thought that a protocol ST-2 will become IPV5 but it

never lived long enough..

• IPV6 has 128 bits address…. every grain of sand on planet can have IP Address.

• Most of the NW Equipment and OS support both IPV4 and IPV6.

• IPV6 and IPV4 can operate simultaneously through a technique known as

tunneling.
Lt Col Dr HASNAT KHURSHID

37

Das könnte Ihnen auch gefallen