0% found this document useful (0 votes)
29 views43 pages

Week 5 IPv4 Addressing

Uploaded by

lynaahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views43 pages

Week 5 IPv4 Addressing

Uploaded by

lynaahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 43

Lec 9

IPv4
Addressing
CONTENTS

Introduction
Notations
Classful addressing
Classless addressing

UTeM
INTRODUCTION

 An address that identifies the


connection of a host to network.
 The IPv4 addresses are unique
and universal.
 The address space of IPv4 is
232 or 4,294,967,296.
 Consists of 4 bytes (32 bits)

UTeM
NOTATIONS

UTeM
Binary Notation

 Display as 32 bits
 4 bytes
 Each octet referred as a byte

Octet

UTeM
Dotted Decimal Notation

 To make 32 bit form shorter and easier to read


 Easier to determine the classes of Ips
 Dot separating the octets

UTeM
 Value range every octet are 0 to 255 or 00000000 to
11111111

UTeM
Example

 Change the following IP addresses from binary notation


to dotted-decimal notation.
 10000001 00001011 00001011 11101111
 11111001 10011011 11111011 00001111

 Solution
 129.11.11.239
 249.155.251.15

UTeM
Example

 Change the following IP addresses from dotted-decimal


notation to binary notation.
 111.56.45.78
 75.45.34.78

 Solution
 01101111 00111000 00101101 01001110
 01001011 00101101 00100010 01001110

UTeM
CLASSFUL ADDRESSING

 IPv4 used the concept of classes called classful


Addressing
 divided into FIVE classes A,B,C,D and E

UTeM
Address Classes
5 different classes of address – A,B,C,D & E
 Designed to cover the needs of different types
 Class A :: First bit is 1
 Class B :: 1st bit is 1 and 2nd bit is 0
 Class C :: 1st bit is 1, 2nd bit is 1 and 3rd bit is 0
 Class D :: 1st bit is 1, 2nd bit is 1, 3rd bit is 1 and 4th is 0
 Class E :: All first 4 bit are 1

UTeM
Classes (cont.)

0 10 110 1110 1111

UTeM
Example
 Find the class of each address:
 00000001 00001011 00001011 11101111
 11110011
1111 10011011 11111011 00001111

 Solution
 The first bit is 0; this is a class A address.
 The first 4 bits are 1s; this is a class E address.

UTeM
Example

 Find the class of each address:


 227.12.14.87
 252.5.15.111
 134.11.78.56

 Solution
 The first byte is 227 (between 224 and 239); the class is D.
 The first byte is 252 (between 240 and 255); the class is E.
 The first byte is 134 (between 128 and 191); the class is B.

UTeM
Netid and Hostid

 IP address in class A, B and C are divided into netid and


hostid
 Class A: 1 netid and 3 hostid
 Class B: 2 netid and 2 hostid
 Class C: 3 netid and 1 hostid
 BUT not on class D and E

Class type

netid hostid
4 bytes
UTeM
UTeM
Example

 192.168.2.1
 Class C which is “192.168.2” is netid while “.1” is hostid

 60.5.6.244
 Class A which is “60” is netid while “.5.6.244” is host id

UTeM
Classes and Block

 Each class is divide into a fixed number of block


 Each block having a fixed size
 A large part of the available addresses were wasted

Number of blocks and block size in classful IPv4 addressing

UTeM
Block in class A

UTeM
Block in class B

UTeM
Block in class C

UTeM
Network Address

 Inclassful addressing, the network address is the


one that is assigned to the organization.
A network address is different from a netid. A
network address has both netid and hostid, with
0s for the hostid.

UTeM
Example

 Given the address 23.56.7.91, find the network address.

 The class is A. Only the first byte defines the netid.


We can find the network address by replacing the
hostid bytes (56.7.91) with 0s. Therefore, the
network address is 23.0.0.0

UTeM
Broadcast Address
 Broadcast address refers to the ability to
address a message that is broadcast to all
stations or hosts on a network.
Abroadcast address has both netid and hostid,
with 1s for all bits in the hostid
All 1s

123.255.255.255 141.14.255.255 221.45.71.255

UTeM
Example

 Given the address 128.56.7.91, find the network


address

 The class is B. The first and second byte defines the


netid. We can find the broadcast address by replacing
the hostid bytes (7.91) with 1s. Therefore, the
network address is 128.56.255.255

UTeM
Masking

 Inclassful address, we can use mask (default


mask) to determine the address classes.
 32 bits contiguous 1s followed by contiguous
0s

UTeM Default masks for classful addressing


Example
 A router outside the organization
receives a packet with destination
address 190.240.7.91. Show how it finds
the network address to route the
packet.

 The router looks at the first byte of


the address to find the class. It is class
B.
 The default mask for class B is
255.255.0.0. The router ANDs this
mask with the address to get
190.240.0.0.

UTeM
Subnetting

 Used in classful addressing.


 Introduced to divide a large block in class A and B into
several contiguous groups.
 Increase the number of 1s in the mask.
 Example:
 Default class A mask is 255.0.0.0
 Subnetmask class A can be 255.255.0.0 or 255.255.255.0

UTeM
UTeM
Supernetting

 Combination of several class C blocks to create a larger


range of addresses.
 Example:
 An organization that need 1000 addresses can be granted
FOUR contiguous class C blocks.
 No. of class C usable addresses is 254
 So, 4 x 254 = 1016 and >1000

UTeM
Supernetting (cont.)

 Decrease the number of 1s in the default mask


 Default class C mask is 255.255.255.0 or
11111111.11111111.11111111.00000000 or /24
 To combine 4 addresses by decrease TWO of 1s
 11111111.11111111.11111100.00000000 or 255.255.252.0
or /22

UTeM
CLASSLESS ADDRESSING

 In classful addressing, a large part of


the available addresses were wasted
 Classful addressing, which is almost
obsolete, is replaced with classless
addressing
 To overcome address depletion.
 No more classes but still granted in
blocks.

UTeM
Address Block

 No fix range as classful addresses


 Size of the block varies base on nature and size of
entity
 Example: House may be given only two addresses or a
large organization may be hundreds.
 Restriction
 Addresses in block must be contiguous
 Address must be power of 2 (1,2,4,8 …)

UTeM
Mask

 The address and the “/” notation completely define the


whole block.
 First address, last address and number of addresses
 Use formula
 256 ÷ a = b, a is no. of needed addresses
 b = 2n, n = bit to borrow

UTeM
Example

 Network address for single LAN is 192.168.2.0, required


5 addresses for subnetwork.
 Nearest to 5 is 8, so a =8
 256 ÷ 8 = b, so b = 32, then
 b = 2n, n = bit to borrow
 32 = 2n, n = 5

UTeM
 Default class C mask is
 255.255.255.0 or 111111111.11111111.11111111.00000000
 Mask after subnetting
 Borrow n value, n=5,
 111111111.11111111.11111111.11111000
 255.255.255.248 or /29

UTeM
 Range of address
 192.168.2.0 to 192.168.2.7
 192.168.0 is network address
 192.168.2.7 is broadcast address
 Useable address is 192.168.2.1 to 192.168.2.6
 6 addresses

UTeM
or

 Range of address
 192.168.2.8 to 192.168.2.15
 192.168.8 is network address
 192.168.2.15 is broadcast address
 Useable address is 192.168.2.7 to 192.168.2.14
 6 addresses

UTeM
Example

 Find the network and broadcast address for host with an


address 192.168.3.20/28
 /28 mean borrow 4 bits
 Mask
 11111111.11111111.11111111.11110000
 255.255.255.240

UTeM
 Use ANDing proccess
 192.168.3.20 AND 255.255.255.240
 Convert to binary

11000000101010000000001100010100
11111111111111111111111111110000
11000000101010000000001100010000
 192.168.3.16 is network address
 192.168.3.23 is broadcast address

UTeM
Example:
i. A block of addresses is granted to a small organization. We
know that one of the addresses is 205.16.37.39/28. What is
the first address (network 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, rest is 1s we get
11111111 11111111 11111111 11110000
Using ANDing process
11001101 00010000 00100101 00100000
or
UTeM
19.41 205.16.37.32
Cont.

ii. Find the last address (broadcast address) for the block

Solution
If we set 32 − 28 rightmost bits from 0 to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47

iii. The number of addresses.

Solution
Convert to decimal and adding with 1
1111 = 15 , then + 1
= 16 addresses
UTeM
Any Questions ?

You might also like