Network Layer
Network Layer Tasks
Logical Addressing: The network layer adds a header that includes the logical
addresses of the sender and receiver to the packet coming from the upper layer.
Routing: When independent networks or links are connected together to create
an internetwork, routers or switches route packets to their final destination.
The network layer is responsible for the delivery of individual packets from the
source host to the destination host
Number System
• Unary
• Binary
• Octal
• Decimal
• Hexadecimal
• Ex. Convert into decimal,
hexadecimal and binary
Binary Number
System
• If n bit space is divided into k
parts, then the
• Total possible numbers in k
parts = 2^k
• Size of each part = 2^n/2^k =
2^(n-k)
1 bit 2 bits 3 bits
0 00 000
1 01 001
10 010
11 011
100
101
110
111
k n-k
n bits
IP Addressing Schemes : Static Partitioning (ARPANET)
8 bits 24 bits
NID HID
32 bits IPv4
address
Total number of network addresses = 2^8 = 256
Total number of hosts with one network = 2^24 = 16 M (approx.)
IPv4 ADDRESSES
• An IPv4 address is a 32-bit address that uniquely and
universally defines the connection of a device (for
example, a computer or a router) to the Internet.
• The address space of IPv4 is 232
or
4,294,967,296.
Dotted-decimal notation and binary notation for
an IPv4 address
Lecture_Network_Layer-IP Addressing.pptx
Lecture_Network_Layer-IP Addressing.pptx
Q1. Change the following IPv4 addresses from binary notation to dotted-decimal
notation.
 Solution
We replace each group of 8 bits with its equivalent
decimal number and add dots for separation.
Lecture_Network_Layer-IP Addressing.pptx
Lecture_Network_Layer-IP Addressing.pptx
Lecture_Network_Layer-IP Addressing.pptx
Lecture_Network_Layer-IP Addressing.pptx
Classes in binary and
dotted-decimal
notation
• IPv4 addressing, at its inception, used the concept of classes. This architecture is called classful addressing.
• In classful addressing, the address space is divided into five classes: A, B, C, D, and E.
Classful addressing
• In classful addressing, an IP address in class A, B, or C is divided into netid and hostid.
• A mask (also called the default mask), a 32-bit number made of contiguous 1s followed by contiguous
0s.
Lecture_Network_Layer-IP Addressing.pptx
Number of blocks and block size in classful IPv4
addressing
Default masks for classful addressing
Lecture_Network_Layer-IP Addressing.pptx
A subnet mask is a 32-bit number used to divide an IP
address into network and host portions. It helps
determine which part of an IP address belongs to the
network and which part belongs to the hosts (devices like
PCs, routers, etc.).
Lecture_Network_Layer-IP Addressing.pptx
Lecture_Network_Layer-IP Addressing.pptx
Classless
Addressing
• In classful addressing, a large part of the
available addresses were wasted. It is
replaced with classless addressing.
• To overcome address depletion and give
more organizations access to the Internet,
classless addressing was designed and
implemented.
• In IPv4 addressing, a block of addresses can
be defined as x.y.z.t /n (Classless Inter-
Domain Routing(CIDR) notation)
Where x.y.z.t defines one of the
addresses and the /n defines the mask.
• To simplify the handling of addresses, the Internet authorities
impose, three restrictions on classless address blocks:
1. The addresses in a block must be contiguous, one after
another.
2. The number of addresses in a block must be a power of
2 (I, 2, 4, 8, ... ).
3. The first address must be evenly divisible by the
number of addresses.
• The first address in the block can be found by setting the
rightmost 32 − n bits to 0s
Classless Addressing
Q2
Solution:
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000 or 205.16.37.32.
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111 or 205.16.37.47
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 and
last address in the block?
A network configuration for the block 205.16.37.32/28
• The first address in a block is normally not assigned to any device; it is used as the network
address that represents the organization to the rest of the world.
First address is: 205.16.37.32 (Network Address) Subnet Mask:255.255.255.240
Last address is: 205.16.37.47(Broadcast Address) Total Subnet Addresses: 2^4=16 But usable is
14.
usable ip: 205.16.37.33-205.16.37.46(total is 14)
• A block of 16 addresses granted to a small organization
•Total Addresses in Subnet: 2^(32-28) = 16
•Subnet Block Size: 256 - 240 = 16
Lecture_Network_Layer-IP Addressing.pptx
Lecture_Network_Layer-IP Addressing.pptx
First and Last Address: AND/OR Operations
The first address can be found by ANDing the given addresses with the mask
The last address can be found by ORing the given addresses with the
complement of the mask.
Lecture_Network_Layer-IP Addressing.pptx
Two-Level Hierarchy:
No Subnetting
• Each address in the block can be considered as a two-
level hierarchical structure the leftmost n bits (prefix)
define the network; the rightmost 32 − n bits define the
host.
What is
Subnetting?
Subnetting is the process of dividing a
network into multiple logical sub-
networks.
1
1
2
1 2
1 2
4 3
Lecture_Network_Layer-IP Addressing.pptx
Lecture_Network_Layer-IP Addressing.pptx
Three-level hierarchy in an IPv4 address
• If an organization was granted a large block in class A or B, it could divide the addresses
into several contiguous groups and assign each group to smaller networks (called
subnets)
Subnetting and Supernetting
• In supernetting, an organization can combine several class C blocks to create a larger
range of addresses.
• Supernetting decreases the number of 1s in the mask.
Subnetting
Types
• Fixed Length Subnet Mask
(FLSM)- This strategy allows
all subnet masks to be
the same size.
• Variable Length Subnet
Mask (VLSM)- This strategy
allows all subnet masks to
be variable sizes.
Que. There is a requirement in a university to setup five Computer Labs (Lab1- 7 PCs; Lab2- 14
PCs; Lab3- 28 PCs; Lab4- 14 PCs; Lab5- 11 PCs ) in different departments for a Class C IPV4
address - 200.15.5.0/24, using Fixed Length Subnet Mask (FLSM).
IP Address
Decimal- 200.15.5.0
Binary- 11001000.00001111.00000101.00000000
Subnet Mask- 255.255.255.0
For setting up five departments, We need five subnetworks to be setup
Therefore, 3 bits need to be borrowed from host bits
Using 3bits, 2^3 =8 subnets can be created
11001000.00001111.00000101.00000000
New Subnet Mask- 11111111. 11111111. 11111111.11100000 or 255.255.255.224
No. of Host in each subnet= 2^5= 32
Usable IP address in each subnet= 32-2=30
IP Address
Decimal- 200.15.5.0
Binary- 11001000.00001111.00000101.00000000
Subnet 1- 11001000.00001111.00000101.00000000
Subnet 2- 11001000.00001111.00000101.00100000
Subnet 3- 11001000.00001111.00000101.01000000
Subnet 4- 11001000.00001111.00000101.01100000
Subnet 5- 11001000.00001111.00000101.10000000
Subnet 8- 11001000.00001111.00000101.11100000
How Do You Get IPs?
• IP address ranges controlled by IANA
Internet Assigned Number Authority
Roots go back to 1972, ARPANET, UCLA
Today, part of ICANN
IANA grants IPs to regional authorities
ARIN (American Registry of Internet Numbers) may grant you a range of IPs
You may then advertise routes to your new IP range
There are now secondary markets, auctions, …
Classless Addressing: The Two Level Hierarchy
Classless Addressing: Class Sizes and Issues
Classless
Addressing:
N-Level
Subnet
Hierarchy
Classless Addressing Examples
1. In a classless addressing scheme, a network has a /20 CIDR block assigned to it. What is the maximum
number of useful addresses that can be assigned to a host?
a. 4096
b. 4094
c. 4098
d. 2048
Solution:
For a /20 CIDR block, the network portion occupies 20bits,
leaving 12bits for the host portion (32−20=12).
Therefore, the total number of addresses in this subnet is:
2^12=4096 (total addresses).
In a typical IPv4 subnet, you lose two addresses for the network and
broadcast addresses.
Hence, the number of useful (assignable) host addresses is:
4096−2=4094.
Thus, the correct answer is 4094.
Classless Addressing Example
Consider a class B network address 130.50.0.0. The last 7 bits of the host id are allotted for host
number and the remaining 9 bits are reserved for subnet number. How many usable subnets and
usable number of hosts in each subnet are possible with the above addressing scheme?
a. 128, 512
b. 512, 128
c. 126, 510
d. None of these
• Since a Class B network by default has 16 host bits, subdividing them
into 9 bits for subnetting and 7 bits for host numbering yields:
1.Subnets:
2^9=512 possible subnets (modern practice allows using them all).
2.Hosts per Subnet:
2^7=128 total addresses per subnet →
126 usable host addresses (subtracting network and broadcast).
• Hence, there are 512 usable subnets, each providing 126 host
addresses
Configuration and addresses in a subnetted network
suppose an organization is given the block
17.12.14.0/26, which contains 64 addresses.
The organization has three offices and needs to divide
the addresses into three subblocks of 32, 16, and 16
addresses.
• Suppose the mask for the first subnet is n1, then 2^32- n1 must be
32, which means that n1 =27.
• Suppose the mask for the second subnet is n2, then 2^32- n2 must
be 16, which means that n2 = 28.
• Suppose the mask for the third subnet is n3, then 2^32- n3 must be
16, which means that n3 =28.

More Related Content

PPTX
NP - Unit 2 - Internet Addressing, ARP and RARP
PPTX
IPv4 addressing and subnetting
PPTX
computer network notes in network layer.
PDF
IP Address & Its Classes .pdf
PPTX
Ch7 IP addressing.pptx
PPTX
chapter 4.pptx
PPTX
Chapter_5, Internet Protocol and IP addressing
PPTX
Lecture 03 networking
NP - Unit 2 - Internet Addressing, ARP and RARP
IPv4 addressing and subnetting
computer network notes in network layer.
IP Address & Its Classes .pdf
Ch7 IP addressing.pptx
chapter 4.pptx
Chapter_5, Internet Protocol and IP addressing
Lecture 03 networking

Similar to Lecture_Network_Layer-IP Addressing.pptx (20)

PPTX
evolution of mobile communication from 1g-5g.pptx
PDF
subnet network Addressing Network v1.pdf
PPTX
IP_ADDRESSING_AND_SUBNETTING.pptx
PPTX
ipv4subnettingstrategy-140207112043-phpapp02.pptx
PPTX
IP_ADDRESSING_AND_SUBNETTIN networkG.pptx
PPT
Ipaddress presentationdemoclass
PDF
Basics of IP address ,IP-address classes, Subnet mask
PPTX
IP Addressing & subnetting strategy
PPTX
IPv4 Addressing
PPT
Expl net fund_chapter_06_i_pv4_part_2
PPTX
NDC Chapter 1.pptx for all this is veriy importan pwor point for all students
PPTX
NDC Chapter 1.pptx for all this is veriy importan pwor point for all students
PPTX
Cn ipv4 addressing
DOCX
Subnetting class C
PPTX
00.2_IP_Addressing lecture about IPV.pptx
PPTX
CN Unit 3
PPTX
IP Subneting and Bassic network fundamental.pptx
PPTX
Ramakant tyagi presentation on ip addressing
PPT
subnetting ipv4-Ipv4 subneeting methodologies
PPTX
An IPv4 address is a 32-bit address, typically represented in dotted decimal ...
evolution of mobile communication from 1g-5g.pptx
subnet network Addressing Network v1.pdf
IP_ADDRESSING_AND_SUBNETTING.pptx
ipv4subnettingstrategy-140207112043-phpapp02.pptx
IP_ADDRESSING_AND_SUBNETTIN networkG.pptx
Ipaddress presentationdemoclass
Basics of IP address ,IP-address classes, Subnet mask
IP Addressing & subnetting strategy
IPv4 Addressing
Expl net fund_chapter_06_i_pv4_part_2
NDC Chapter 1.pptx for all this is veriy importan pwor point for all students
NDC Chapter 1.pptx for all this is veriy importan pwor point for all students
Cn ipv4 addressing
Subnetting class C
00.2_IP_Addressing lecture about IPV.pptx
CN Unit 3
IP Subneting and Bassic network fundamental.pptx
Ramakant tyagi presentation on ip addressing
subnetting ipv4-Ipv4 subneeting methodologies
An IPv4 address is a 32-bit address, typically represented in dotted decimal ...
Ad

Recently uploaded (20)

PDF
ITEC 1010 - Networks and Cloud Computing
PDF
Introduction to Machine Learning -Basic concepts,Models and Description
PPTX
sinteringn kjfnvkjdfvkdfnoeneornvoirjoinsonosjf).pptx
PDF
1.-fincantieri-investor-presentation2.pdf
PPTX
22ME926Introduction to Business Intelligence and Analytics, Advanced Integrat...
PDF
Project_Mgmt_Institute_- Marc Marc Marc.pdf
PDF
Application of smart robotics in the supply chain
PDF
B461227.pdf American Journal of Multidisciplinary Research and Review
PPTX
Unit I - Mechatronics.pptx presentation
PPTX
MODULE 02 - CLOUD COMPUTING-Virtual Machines and Virtualization of Clusters a...
PDF
Recent Trends in Network Security - 2025
PPTX
5-2d2b20afbe-basic-concepts-of-mechanics.ppt
PDF
AI agent, robotics based Smart Construction 2025
PDF
Manual variador de corriente directa parker.pdf
PDF
August 2025 Top Read Articles in - Bioscience & Engineering Recent Research T...
PDF
August 2025 Top read articles in International Journal of Database Managemen...
PPTX
MODULE 3 SUSTAINABLE DEVELOPMENT GOALSPPT.pptx
PDF
CBCN cam bien cong nghiep bach khoa da năng
PPTX
Electric vehicle very important for detailed information.pptx
PPTX
quantum theory on the next future in.pptx
ITEC 1010 - Networks and Cloud Computing
Introduction to Machine Learning -Basic concepts,Models and Description
sinteringn kjfnvkjdfvkdfnoeneornvoirjoinsonosjf).pptx
1.-fincantieri-investor-presentation2.pdf
22ME926Introduction to Business Intelligence and Analytics, Advanced Integrat...
Project_Mgmt_Institute_- Marc Marc Marc.pdf
Application of smart robotics in the supply chain
B461227.pdf American Journal of Multidisciplinary Research and Review
Unit I - Mechatronics.pptx presentation
MODULE 02 - CLOUD COMPUTING-Virtual Machines and Virtualization of Clusters a...
Recent Trends in Network Security - 2025
5-2d2b20afbe-basic-concepts-of-mechanics.ppt
AI agent, robotics based Smart Construction 2025
Manual variador de corriente directa parker.pdf
August 2025 Top Read Articles in - Bioscience & Engineering Recent Research T...
August 2025 Top read articles in International Journal of Database Managemen...
MODULE 3 SUSTAINABLE DEVELOPMENT GOALSPPT.pptx
CBCN cam bien cong nghiep bach khoa da năng
Electric vehicle very important for detailed information.pptx
quantum theory on the next future in.pptx
Ad

Lecture_Network_Layer-IP Addressing.pptx

  • 2. Network Layer Tasks Logical Addressing: The network layer adds a header that includes the logical addresses of the sender and receiver to the packet coming from the upper layer. Routing: When independent networks or links are connected together to create an internetwork, routers or switches route packets to their final destination. The network layer is responsible for the delivery of individual packets from the source host to the destination host
  • 3. Number System • Unary • Binary • Octal • Decimal • Hexadecimal • Ex. Convert into decimal, hexadecimal and binary
  • 4. Binary Number System • If n bit space is divided into k parts, then the • Total possible numbers in k parts = 2^k • Size of each part = 2^n/2^k = 2^(n-k) 1 bit 2 bits 3 bits 0 00 000 1 01 001 10 010 11 011 100 101 110 111 k n-k n bits
  • 5. IP Addressing Schemes : Static Partitioning (ARPANET) 8 bits 24 bits NID HID 32 bits IPv4 address Total number of network addresses = 2^8 = 256 Total number of hosts with one network = 2^24 = 16 M (approx.)
  • 6. IPv4 ADDRESSES • An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a device (for example, a computer or a router) to the Internet. • The address space of IPv4 is 232 or 4,294,967,296. Dotted-decimal notation and binary notation for an IPv4 address
  • 9. Q1. Change the following IPv4 addresses from binary notation to dotted-decimal notation.  Solution We replace each group of 8 bits with its equivalent decimal number and add dots for separation.
  • 14. Classes in binary and dotted-decimal notation • IPv4 addressing, at its inception, used the concept of classes. This architecture is called classful addressing. • In classful addressing, the address space is divided into five classes: A, B, C, D, and E. Classful addressing • In classful addressing, an IP address in class A, B, or C is divided into netid and hostid. • A mask (also called the default mask), a 32-bit number made of contiguous 1s followed by contiguous 0s.
  • 16. Number of blocks and block size in classful IPv4 addressing
  • 17. Default masks for classful addressing
  • 19. A subnet mask is a 32-bit number used to divide an IP address into network and host portions. It helps determine which part of an IP address belongs to the network and which part belongs to the hosts (devices like PCs, routers, etc.).
  • 22. Classless Addressing • In classful addressing, a large part of the available addresses were wasted. It is replaced with classless addressing. • To overcome address depletion and give more organizations access to the Internet, classless addressing was designed and implemented. • In IPv4 addressing, a block of addresses can be defined as x.y.z.t /n (Classless Inter- Domain Routing(CIDR) notation) Where x.y.z.t defines one of the addresses and the /n defines the mask.
  • 23. • To simplify the handling of addresses, the Internet authorities impose, three restrictions on classless address blocks: 1. The addresses in a block must be contiguous, one after another. 2. The number of addresses in a block must be a power of 2 (I, 2, 4, 8, ... ). 3. The first address must be evenly divisible by the number of addresses. • The first address in the block can be found by setting the rightmost 32 − n bits to 0s Classless Addressing
  • 24. Q2 Solution: The binary representation of the given address is 11001101 00010000 00100101 00100111 If we set 32−28 rightmost bits to 0, we get 11001101 00010000 00100101 0010000 or 205.16.37.32. The binary representation of the given address is 11001101 00010000 00100101 00100111 If we set 32 − 28 rightmost bits to 1, we get 11001101 00010000 00100101 00101111 or 205.16.37.47 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 and last address in the block?
  • 25. A network configuration for the block 205.16.37.32/28 • The first address in a block is normally not assigned to any device; it is used as the network address that represents the organization to the rest of the world. First address is: 205.16.37.32 (Network Address) Subnet Mask:255.255.255.240 Last address is: 205.16.37.47(Broadcast Address) Total Subnet Addresses: 2^4=16 But usable is 14. usable ip: 205.16.37.33-205.16.37.46(total is 14) • A block of 16 addresses granted to a small organization •Total Addresses in Subnet: 2^(32-28) = 16 •Subnet Block Size: 256 - 240 = 16
  • 28. First and Last Address: AND/OR Operations The first address can be found by ANDing the given addresses with the mask The last address can be found by ORing the given addresses with the complement of the mask.
  • 30. Two-Level Hierarchy: No Subnetting • Each address in the block can be considered as a two- level hierarchical structure the leftmost n bits (prefix) define the network; the rightmost 32 − n bits define the host.
  • 31. What is Subnetting? Subnetting is the process of dividing a network into multiple logical sub- networks. 1 1 2 1 2 1 2 4 3
  • 34. Three-level hierarchy in an IPv4 address • If an organization was granted a large block in class A or B, it could divide the addresses into several contiguous groups and assign each group to smaller networks (called subnets) Subnetting and Supernetting • In supernetting, an organization can combine several class C blocks to create a larger range of addresses. • Supernetting decreases the number of 1s in the mask.
  • 35. Subnetting Types • Fixed Length Subnet Mask (FLSM)- This strategy allows all subnet masks to be the same size. • Variable Length Subnet Mask (VLSM)- This strategy allows all subnet masks to be variable sizes.
  • 36. Que. There is a requirement in a university to setup five Computer Labs (Lab1- 7 PCs; Lab2- 14 PCs; Lab3- 28 PCs; Lab4- 14 PCs; Lab5- 11 PCs ) in different departments for a Class C IPV4 address - 200.15.5.0/24, using Fixed Length Subnet Mask (FLSM). IP Address Decimal- 200.15.5.0 Binary- 11001000.00001111.00000101.00000000 Subnet Mask- 255.255.255.0 For setting up five departments, We need five subnetworks to be setup Therefore, 3 bits need to be borrowed from host bits Using 3bits, 2^3 =8 subnets can be created 11001000.00001111.00000101.00000000 New Subnet Mask- 11111111. 11111111. 11111111.11100000 or 255.255.255.224 No. of Host in each subnet= 2^5= 32 Usable IP address in each subnet= 32-2=30
  • 37. IP Address Decimal- 200.15.5.0 Binary- 11001000.00001111.00000101.00000000 Subnet 1- 11001000.00001111.00000101.00000000 Subnet 2- 11001000.00001111.00000101.00100000 Subnet 3- 11001000.00001111.00000101.01000000 Subnet 4- 11001000.00001111.00000101.01100000 Subnet 5- 11001000.00001111.00000101.10000000 Subnet 8- 11001000.00001111.00000101.11100000
  • 38. How Do You Get IPs? • IP address ranges controlled by IANA Internet Assigned Number Authority Roots go back to 1972, ARPANET, UCLA Today, part of ICANN IANA grants IPs to regional authorities ARIN (American Registry of Internet Numbers) may grant you a range of IPs You may then advertise routes to your new IP range There are now secondary markets, auctions, …
  • 39. Classless Addressing: The Two Level Hierarchy
  • 40. Classless Addressing: Class Sizes and Issues
  • 42. Classless Addressing Examples 1. In a classless addressing scheme, a network has a /20 CIDR block assigned to it. What is the maximum number of useful addresses that can be assigned to a host? a. 4096 b. 4094 c. 4098 d. 2048
  • 43. Solution: For a /20 CIDR block, the network portion occupies 20bits, leaving 12bits for the host portion (32−20=12). Therefore, the total number of addresses in this subnet is: 2^12=4096 (total addresses). In a typical IPv4 subnet, you lose two addresses for the network and broadcast addresses. Hence, the number of useful (assignable) host addresses is: 4096−2=4094. Thus, the correct answer is 4094.
  • 44. Classless Addressing Example Consider a class B network address 130.50.0.0. The last 7 bits of the host id are allotted for host number and the remaining 9 bits are reserved for subnet number. How many usable subnets and usable number of hosts in each subnet are possible with the above addressing scheme? a. 128, 512 b. 512, 128 c. 126, 510 d. None of these
  • 45. • Since a Class B network by default has 16 host bits, subdividing them into 9 bits for subnetting and 7 bits for host numbering yields: 1.Subnets: 2^9=512 possible subnets (modern practice allows using them all). 2.Hosts per Subnet: 2^7=128 total addresses per subnet → 126 usable host addresses (subtracting network and broadcast). • Hence, there are 512 usable subnets, each providing 126 host addresses
  • 46. Configuration and addresses in a subnetted network suppose an organization is given the block 17.12.14.0/26, which contains 64 addresses. The organization has three offices and needs to divide the addresses into three subblocks of 32, 16, and 16 addresses. • Suppose the mask for the first subnet is n1, then 2^32- n1 must be 32, which means that n1 =27. • Suppose the mask for the second subnet is n2, then 2^32- n2 must be 16, which means that n2 = 28. • Suppose the mask for the third subnet is n3, then 2^32- n3 must be 16, which means that n3 =28.