0% found this document useful (0 votes)
0 views

Network layer

Uploaded by

brotadese50
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Network layer

Uploaded by

brotadese50
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 39

IP addressing and

subnetting
Chapter five
part2
What is IP address
 IP address is your digital identity.
 It’s a network address for your computer so the Internet
knows where to send you emails, data, etc.
 Note: IP address determines who and where you are in
the network of billions of digital devices that are
connected to the Internet.

2
What is Ipv4
 IP stands for Internet Protocol and v4 stands for Version
Four (IPv4).
 IPv4 was the primary version.
 IP version four addresses are 32-bit binary numbers.
 for example, 11000000101010000000000100010100.
 It can express using human readable format like 192.0.2.126
 Each 32-bit IP address consists of two sub addresses,
 One identifying the network and the other identifying the
host to the network, with an imaginary boundary separating
the two.

3
Cont.
 The location of the boundary between the network and host
portions of an IP address is determined through the use of
a subnet mask.
 A subnet mask is another 32-bit binary number, which acts
like a filter when it is applied to the 32-bit IP address.
 By comparing a subnet mask with an IP address, systems can
determine which portion of the IP address relates to the
network, and which portion relates to the host.
 Anywhere the subnet mask has a bit set to "1", the
underlying bit in the IP address is part of the network
address. Where as,
4
Cont.
 Anywhere the subnet mask is set to "0", the related bit in the IP
address is part of the host address.
 For example, assume IP address
11000000101010000000000100010100 has a subnet mask of
11111111111111111111111100000000.
 Here the first 24 bits of the 32-bit IP address are used to identify
the network, while the last 8 bits are used to identify the host on
that network.
 An IPv4 address consists of four numbers, each of which contains
one to three digits, with a single dot (.) separating each number or
set of digits.
 Each of the four numbers can range from 0 to 255.
5
Cont.
 Example:- 25.59.209.224
 This group of separated numbers creates the addresses
that let you and everyone around the globe to send and
retrieve data over our Internet connections.
 The IPv4 uses a 32-bit address scheme allowing to store
2^32 addresses or 2^32 address space[ total size of IPv4
address protocol].

6
What is IPv6
 It stands from Internet Protocol Version 6
 An IPv6 address consists of eight groups of four
hexadecimal digits.
 Example 3001:0da8:75a3:0000:0000:8a2e:0370:7334
 This new IP address version is being deployed to fulfill the
need for more Internet addresses
 It was aimed to resolve issues which are associated with
IPv4 .
 Uses 128-bit address scheme, 2^128 address spaces.
 IPv6 also called Internet Protocol next generation.

7
Classful IP Addressing
 As you know, IPv4 address is a 32 bit unique address
having an address space of 2^32.
 There are two notations in which IP address is written,
dotted decimal notation and binary notations.
 The value of any segment (byte) is between 0 and 255
(both included).
 There are no zeros preceding the value in any segment
(054 is wrong, 54 is correct).

8
:
Classful addressing
 The 32 bit IP address is divided into five sub-classes.

Classes Purpose

Class A unicast

Class B Unicast

Class C Unicast

Class D Multicast

Class E Reserve for experimental purposes.

 Each of these classes has a valid range of IP addresses.9


Classful addressing
 The order of bits in the first octet determine the classes of IP
address [in binary representation].
 IPv4 address is divided into two parts: Network ID and
Host ID
 The class of IP address is used to determine the bits used for
network ID & host ID and the number of total networks and
hosts possible in that particular class.
 Each ISP or network administrator assigns IP address to each
device that is connected to its network.
 IP addresses are globally managed by Internet Assigned
Numbers Authority(IANA) and regional Internet registries(RIR) 10
Classful addressing
o Note: While finding the total number of host IP addresses, two IP addresses
are not counted. therefore, decreased from the total count because the first
IP address of any network is the network number and whereas the last IP
address is reserved for broadcast IP.
o The above statement is very importance just focus and remember it always.

11
Class A:
 IP address belonging to class A are assigned to the
networks that contain a large number of hosts.
 The network ID is 8 bits long and the host ID is 24 bits long.
 The higher order bit of the first octet in class A is always
set to 0.
 The remaining 7 bits in first octet are used to determine
network ID.
 The 24 bits of host ID are used to determine the host in any
network.
 The default subnet mask for class A is 255.x.x.x.

12
Class A:
 Class A has a total of:
 2^7-2= 126 network ID(Here 2 address is subracted
because 0.0.0.0 and 127.x.y.z are special address. )
 2^24 – 2 = 16,777,214 host ID
 IP addresses belonging to class A ranges from 1.x.x.x –
126.x.x.x

13
Class B:
 IP address belonging to class B are assigned to the
networks that ranges from medium-sized to large-sized
networks.
 The network ID is 16 bits long.
 The host ID is 16 bits long.
 The higher order bits of the first octet of IP addresses of
class B are always set to 10.
 The remaining 14 bits are used to determine network ID.
 The 16 bits of host ID is used to determine the host in
any network.
 The default sub-net mask for class B is 255.255.x.x. 14
Class B:
 Class B has a total of:
 2^14 = 16384 network address
 2^16 – 2 = 65534 host address
 IP addresses belonging to class B ranges from 128.0.x.x
– 191.255.x.x.

15
Class C:
 IP address belonging to class C are assigned to small-sized
networks.
 The network ID is 24 bits long.
 The host ID is 8 bits long.
 The higher order bits of the first octet of IP addresses of
class C are always set to 110.
 The remaining 21 bits are used to determine network ID.
 The 8 bits of host ID is used to determine the host in any
network. 16
Class C:
 The default sub-net mask for class C is 255.255.255.x.
Class C has a total of:
 2^21 = 2097152 network address
 2^8 – 2 = 254 host address
 IP addresses belonging to class C ranges from 192.0.0.x –
223.255.255.x.

17
Class D:

 IP address belonging to class D are reserved for multi-casting.


 The higher order bits of the first octet of IP addresses belonging to class D
are always set to 1110.
 The remaining bits are for the address that interested hosts recognize.
 Class D does not posses any sub-net mask.
 IP addresses belonging to class D ranges from 224.0.0.0 – 239.255.255.255.

18
Class E

 IP addresses belonging to class E are reserved for


experimental and research purposes.
 IP addresses of class E ranges from 240.0.0.0 –
255.255.255.254.
 This class doesn’t have any sub-net mask.
 The higher order bits of first octet of class E are always set
to 1111.

19
Rule for assigning host ID
 The host ID are assigned based on the following rules:
 Within any network, the host ID must be unique to that
network.
 Host ID in which all bits are set to 0 cannot be assigned
because this host ID is used to represent the network ID of
the IP address.
 Host ID in which all bits are set to 1 cannot be assigned
because this host ID is reserved as a broadcast address to
send packets to all the hosts present on that particular
network.
20
Rule for assigning network ID
 Hosts that are located on the same physical network are
identified by the network ID, as all host on the same physical
network is assigned the same network ID.
 The network ID is assigned based on the following rules:
 The network ID cannot start with 127 because 127 belongs to
class A address and is reserved for internal loop-back functions.
 All bits of network ID set to 1 are reserved for use as an IP
broadcast address and therefore, cannot be used.
 All bits of network ID set to 0 are used to denote a specific host
on the local network and are not routed and therefore, aren’t
used.
21
Summary
Class Leading bits NET ID bits HOST ID #Net Addresses Start End
bits s per network address address
Class A 0 8 24 0.0.0.0 127.255.2
55.255

Class B 10 16 16 128.0.0. 191.255.25


0 5.255
Class C 110 24 8 192.0.0. 223.255.25
0 5.255
Class D 1110 Not defined Not Not Not define 224.0.0. 239.255.25
define defin 0 5.255
e

Class E 11111 Not define Not. Not. Not define 240.0.0.0 255.255.255.
255
22
Problem of classful addressing
 millions of class A address are wasted.
 many of the class B address are wasted.
 number of addresses available in class C is so small that it cannot cater the
needs of organizations.
 Class D addresses are used for multicast routing and are therefore available
as a single block only.
 Class E addresses are reserved.
 This is why, Classful networking was replaced by Classless Inter-Domain
Routing (CIDR)-classless addressing

23
IP Addressing | Classless Addressing
 Network address – It identifies a network on internet. Using this,
we can find range of addresses in the network and total possible
number of hosts in the network.
 Mask – It is a 32-bit binary number that gives the network
address in the address block when AND operation is bitwise
applied on the mask and any IP address of the block.
 In other way A mask is a 32bit number in which the n left most
bits are 1s and the 32-n rightmost bits are 0s. Is it on my
network?
 The prefix and the subnet mask are different ways of
representing the network portion the address.
24
Cont.
 Why classless addressing ?
 To overcome the address depletion and give more
organizations access to the internet, classless addressing
was designed and implemented.
 Address blocks :- In classless addressing, when an entity,
small or large, needs to be connected to the internet, it
is granted a block (range) of addresses.
 The size of block (the number of addresses) varies
based on the nature and size of the entity.

25
Cont.
 To simplify the handling of addresses, the internet authorities impose three
restriction on classless address blocks
 The address in a block must be contiguous, one after another
 The number of addresses in a block must be a power of 2(1,2,4,8,16…)
 The first address must be evenly divisible
 Example: A classless IP address assigned to a small organization with only 16 IP
Addresses.
 205.16.37.32
 205.16.37.33
 ……
 205.16.37.47

26
Cont.
 A better way to define a block of address in classless addressing is
to select any address in the block and mask it.
 IPV4 classless addressing a block of addresses can be defined as
x.y.z.t/n in which x.y.z.t defines one of the addresses and the /n
defines the mask.
 The address and /n notation completely define the whole block ( the
first address, the last address , and the number of addresses.
 The first address in the block can be found by setting the 32-n right
most bits in the binary notation of the address 0.
 The last address in the block can be found by setting the rightmost
32-n bits to 1s.

27
Cont.
 The number of address in the block can be found by using the formula .
 Example: Find the first address, the last address and the number of
addresses in the following classless block 205.16.37.39/28
 Given address:205.16.37.39 & Subnet mask:/28
 Require 1st address, last address and number of address.
 Solution
 Step 1: Convert the dotted decimal representation into binary
representation 11001101 00010000 00100101 00100111
 Step 2: To find the first address in the block convert the 32-28 right most
bits to 0. 11001101 00010000 00100101 00100000=205.16.37.32.
 Step 3: To find the first address in the block convert the 32-28 right most
bits to 1. 11001101 00010000 00100101 00101111=205.16.37.47.
 Step 4: The number of address is 2^32-28 is 16.
 What is the range of the address.

28
Determine the network address by
Anding.
 ANDing of an IPv4 host address and subnet mask will determine the network ID of the
given address block.

 Using subnet mask determine the network address for host


172.16.132.70/20
Host address 172 16 132 70
Binary 10101100 00010000 10000100 01000110

Subnet mask 11111111 11111111 11110000 00000000

Anding value 10101100 00010000 10000000 00000000

Network 1 16 128 0
address 7
2
29
 Find the first address, the last address and the number of addresses.
Subnetting
 What is It?
 Why?
 How?
 Example
 Case study

30
What is subnetting
 Dividing a large block of addresses into several contiguous
sub-blocks and assigning these sub-blocks to different smaller
networks is called subnetting.
 It is a practice that is widely used when classless addressing is
done.
 It allows for creating multiple logical networks from a single
address block
 Why? To maximize address efficiency and extend the life of
IPV4.
 How? Transforming host bits in to network bits that creating
additional networks from single address block.
31
Formula for subnetting
 Number of subnets : Given bits for mask – No. of bits in default mask
 Subnet address : AND result of subnet mask and the given IP address
 Broadcast address : By putting the host bits as 1 and retaining the
network bits as in the IP address
 Number of hosts per subnet : 2(32 – Given bits for mask) – 2
 First Host ID : Subnet address + 1 (adding one to the binary
representation of the subnet address)
 Last Host ID : Subnet address + Number of Hosts.

32
Example
 Given IP Address – 172.16.0.0/25, find the number of subnets and
the number of hosts per subnet.
 For the first subnet block, find the subnet address, first host ID, last
host ID and broadcast address.
 Solution : This is a class B address. So, no. of subnets = 2 (25-16) = 29
= 512.
 No. of hosts per subnet = 2(32-25) – 2 = 27 – 2 = 128 – 2 = 126
[usable host ID]
 For the first subnet block, we have subnet address = 0.0, first host
id = 0.1, last host id = 0.126 and broadcast address = 0.127.

33
Others ways of formula for subnetting
 h= number of host bits.
 b= number of host bit transformed to network bit/
borrowed.
 N= number of networks/subnet
 So, number of new networks resulting from subnetting i.e.,
subnet
=2^b and number of hosts per new network/subnet=2^h-2.

34
Case study
 One day your supervisor walks to you, saying: here is the network ID
192.168.4.0/24. please create three separate networks/ subnets for coffee
shop and café. One subnet is for office, one is for front desk and storage
room and the rest is for public use.
 Solution . Your task is to list each network ID, subnet mask, host ID range,
number of usable host IDs and broadcast ID. We use a powerful table.

Subnet 1 2 4 8 16 32 64 128 256

Host 256 128 64 32 16 8 4 2 1

Subnet mask /24 /25 /26 /27 /28 /29 /30 /31 /32

35
Cont.
 1st try to find three in first row of the table. If no select the nearest. Then circle the hole
columns and ignore all other columns.

 So we can get all answers of the question from these three number. 4,64, and /26.
 4 means four subnet,64 means each subnet have 64 total host ID including network ID
and broadcast ID. Finally /26 is the new subnet mask for these four subnet.
 2nd find the network ID for each subnet,
 3rd find usable host number, 4 th find the broadcast ID then 5 th find the host ranges in
each subnet.

36
Original network ID. 192.168.4.0/24
● 1st Network ID First network ID always the original network ID, and we simply add 64 to find the next ID

Network ID Subnet mask Host ID range No. usable Broadcast ID


host ID

192.168.4.0 /26 192.168.4.1-192.168.4.62 62 192.168.4.63

192.168.4.64 /26 192.168.4.65-192.168.4.126 62 192.168.4.127

192.168.4.128 /26 192.168.4.129-192.168.4.190 62 192.168.4.191

192.168.4.192 /26 192.168.4.191-192.168.4.254 62 192.168.4.255

As you know the total number of host in each subnet is 64 but, the usable host id is 62. since the first
host ID is reserved for network ID and the last host ID also reserve for Broadcast ID. Keep in mind the
last host ID is broadcast id so, look the last column. 37
Cont.

 We can say, the broadcast ID equals next subnet’s


network ID minus one.
 Once you know the first broadcast ID, 63 you can simply
add 64 for each to get the second broadcast ID.
 When you try to find subnet’s host ID ranges any IDs
between the network ID and broadcast ID.
 Then you can assign three subnets although one subnet
is wasted.
 what is the drawback of subnetting?
38
Quiz [5pts]

 Given network address: 122.168.16.4\26


 How many number of subnet you require.
 What is the Network Address, broadcast Address,
number’s of usable host address, subnet mask and
Identify the host range in each subnet.

39

You might also like