SlideShare a Scribd company logo
1 of 92
Network Layer Part I
Computer Networks
Tutun Juhana
Telecommunication Engineering
School of Electrical Engineering & Informatics
Institut Teknologi Bandung
4
INTRODUCTION
Other Network Layer Issues
• Error Control
• Flow Control
• Congestion control
• Quality of Service
• Routing
• Security
IPV4 ADDRESSES
• The IPv4 addresses are unique and
universal
• An IPv4 address is 32 bits long
– The address space of IPv4 is 232 or
4.294.967.296
• Notation: Dotted-Decimal Notation (Base
256)
Range of Address
• To find the number of addresses in a range if the
first and last address is given  we can perform
subtraction or addition
• Example #1
Find the number of addresses in a range if the first
address is 146.102.29.0 and the last address is
146.102.32.255
Ans:
• 146.102.32.255 - 146.102.29.0 = 0.0.3.255
• Number of addresses= (0 2563+ 0 2562+ 3 2561+
255 2560)+ 1= 1024
• Example #2
The first address in a range of addresses is
14.11.45.96. If the number of addresses in the range is
32, what is the last address?
Ans:
• Convert the number of addresses minus 1 to base
256  0.0.0.31
• We then add it (in base 256) to the first address to get
the last address
Last address = (14.11.45.96 + 0.0.0.31)256 = 14.11.45.127
CLASSFUL ADDRESSING
Recognizing Classes
Classes and Blocks
• In classful addressing , each class is
divided into a fixed number of blocks (each
block having a fixed size)  can be a
problem
Two-Level Addressing
• The range of addresses allocated to an
organization in classful addressing was a block
of addresses in Class A, B, or C
• Since all addresses in a network belonged to a
single block, each address in classful
addressing contains two parts: netid and hostid
– The netid defines the network
– The hostid defines a particular host connected to that
network
Extracting Information in a Block
• A block is a range of addresses
• Given any address in the block, we normally like
to know :
1. The number of addresses
2. The first address
3. The last address
• To extract the above information, we need to
know the class of the address  we will know
the value of n (the length of netid in bits)
• Example #3
An address in a block is given as 73.22.17.25. Find the
number of ddresses in the block, the first address, and
the last address
N = 232 −n = 224 = 16,777,216
not assigned to any host
Network Address
• The first address in a block is network address
 important because it is used in routing a
packet to its destination network
Network Mask
• Routers in the Internet need to know the
network mask to extract the network
address from the destination address of a
packet
• A network mask (default mask in classful
addressing) is a 32-bit number with n
leftmost bits all set to 1s and (32 − n)
rightmost bits all set to 0s
• Example #4
A router receives a packet with the destination
address 201.24.67.32. Show how the router
finds the network address of the packet
Something Wrong here
Three-Level Addressing: Subnetting
• We need more than two hierarchical levels for two reasons
1. An organization that was granted a block in class A or B needed to
divide its large network into several subnetworks for better security
and management
2. Since the blocks in class A and B were almost depleted and the
blocks in class C were smaller than the needs of most organizations,
an organization that has been granted a block in class A or B could
divide the block into smaller subblocks and share them with other
organizations
• The idea of splitting a block to smaller blocks is referred
to as subnetting
• In subnetting, a network is divided into several smaller
subnetworks (subnets) with each subnetwork having its
own subnetwork address
• Example #5
Before subnetting
Length of netid
After subnetting
Length of subnetid
Subnet Mask
• The network mask is used when a network
is not subnetted
• When we divide a network to several
subnetworks, we need to create a
subnetwork mask (or subnet mask) for
each subnetwork
• A subnetwork has subnetid and hostid
Subnetting increases the length of the netid and decreases the length of
hostid
• When we divide a network to s number of
subnetworks (each of equal numbers of hosts)
we can calculate the subnetid for each
subnetwork as
– n is the length of netid
– nsub is the length of each subnetid
– s is the number of subnets (must be a power of 2)
• Example #6
– In Example #5, we divided a class B network
into four subnetworks. The value of n = 16
and the value of n1= n2= n3= n4= 16 + log24 =
18  The subnet mask has eighteen 1s and
fourteen 0s  255.255.192.0 (different from
the network mask for class B (255.255.0.0))
Subnet Address
• When a network is subnetted, the first
address in the subnet is the identifier of
the subnet and is used by the router to
route the packets destined for that
subnetwork
• Example #7
– In Example #5, we show that a network is divided into
four subnets. Since one of the addresses in subnet 2
is 141.14.120.77, we can find the subnet address as
Supernetting
• In supernetting, an organization can combine
several class C blocks to create a larger range
of addresses (several networks are combined to
create a supernetwork)
– By doing this, an organization can apply for several
class C blocks instead of just one
– For example, an organization that needs 1000
addresses can be granted four class C blocks.
Supernet Mask
• A supernet mask is the reverse of a
subnet mask
• A supernet mask for class C has less 1s
than the default mask for this class.
• In supernetting, the number of class C addresses that
can be combined to make a supernet needs to be a
power of 2
• The length of the supernetid can be found using the
formula
 nsuper defines the length of the supernetid in bits
 c defines the number of class C blocks that are
combined
Problems
1. The number of blocks to combine needs
to be a power of 2
 An organization that needed seven blocks
should be granted at least eight blocks
(address wasting)
2. Supernetting and subnetting complicated
the routing of packets in the Internet.
Subnetting and
supernetting in
classful addressing
did not solve the
address depletion
problem and made the
distribution of
addresses and the
routing process more
difficult
47
CLASSLESS ADDRESSING
48
• The size of the blocks
was predefinedClassful
• The whole address
space is divided into
variable length blocks
Classless
49
The number of addresses in a block needs to be a power of 2
(20, 21, 22, . . . , 232)
50
Two-Level Addressing
• The prefix plays the same role as the netid; the
suffix plays the same role as the hostid
• All addresses in the block have the same prefix;
each address has a different suffix
51
• In classful addressing, the length of the netid, n,
depends on the class of the address (it can be only 8,
16, or 24)
• In classless addressing, the length of the prefix, n,
depends on the size of the block (it can be 0, 1, 2, 3, . . .
, 32)
• In classless addressing, the value of n is referred to as
prefix length; the value of (32 − n) is referred to as suffix
length
• The number of addresses in a block is inversely related
to the value of the prefix length, n
– A small n means a larger block; a large n means a small block.
52
Slash Notation
• In classful addressing, the
netid length is inherent in the
address
– Given an address, we know the
class of the address that allows
us to find the netid length (8, 16,
or 24)
• In classless addressing, the
prefix length cannot be found if
we are given only an address
in the block
– The given address can belong to
a block with any prefix length
53
• In classless addressing, we need to include the prefix
length to each address if we need to find the block of the
address  the prefix length, n, is added to the address
separated by a slash  slash notation
54
The slash notation is formally referred to as classless interdomain routing or
CIDR (pronounced cider) notation
• Example 5.25
In classless addressing, an address cannot per se define the block
the address belongs to. For example, the address 230.8.24.56 can
belong to many blocks some of them are shown below with the
value of the prefix associated with that block:
55
Network Mask
• The idea of network mask in classless
addressing is the same as the one in
classful addressing
• A network mask is a 32-bit number with
the n leftmost bits all set to 0s and the rest
of the bits all set to 1s
56
• Example 5.26
The following addresses are defined using slash
notations.
a. In the address 12.23.24.78/8, the network mask is 255.0.0.0,
the prefix length is 8, the suffix length is 24
b. In the address 130.11.232.156/16, the network mask is
255.255.0.0, the prefix length is 16, the suffix length is 16
c. In the address 167.199.170.82/27, the network mask is
255.255.255.224, the prefix length is 27, the suffix length is 5.
57
Extracting Block Information
• An address in slash notation (CIDR)
contains all information we need about the
block:
– the first address (network address)
– the number of addresses, and
– the last address
58
59
60
61
Block Allocation
• The ultimate responsibility of block
allocation is given to a global authority
called the Internet Corporation for
Assigned Names and Addresses (ICANN)
 distribute the block thorough ISPs
62
• For the proper operation of the CIDR, three
restrictions need to be applied to the allocated
block.
63
64
Relation to Classful Addressing
• All issues discussed for classless
addressing can be applied to classful
addressing
65
Subnetting
• The concept is the same as we discussed
for classful addressing
• Note: nothing stops the organization from
creating more levels
– A subnetwork can be divided into several sub-
subnetworks  sub-subnetwork can be
divided into several sub-sub-subnetworks,
and so on
66
Designing Subnets
67
Finding Information about Each Subnetwork
• After designing the subnetworks, the
information about each subnetwork, such
as first and last address, can be found
using the process we described to find the
information about each network in the
Internet.
68
69
70
71
72
73
74
75
Address Aggregation
• One of the advantages of CIDR
architecture is address aggregation
• ICANN assigns a large block of addresses
to an ISP  Each ISP divides its assigned
block into smaller subblocks and grants
the subblocks to its customers
• Many blocks of addresses are aggregated
in one block and granted to one ISP
76
77
78
(the first hierarchical level)
79
SPECIAL ADDRESSES
80
Special Blocks
• All-Zeros Address
– The block 0.0.0.0/32 (contains only one single address) is
reserved for communication when a host needs to send an IPv4
packet but it does not know its own address
– The host sends an IPv4 packet to a bootstrap server (DHCP
server) using this address as the source address and a limited
broadcast address as the destination address to find its own
address
81
• All-Ones Address: Limited Broadcast Address
– The block 255.255.255.255/32 (contains one single address) is
reserved for limited broadcast address in the current network
– A host that wants to send a message to every other host can use
this address as a destination address in an IPv4 packet 
routers will block such packet
82
• Loopback Addresses
– The block 127.0.0.0/8 is used for the loopback
address, which is an address used to test the
software on a machine  packet never leaves the
machine
– It can be used only as a destination address in an
IPv4 packet
83
• Private Addresses
– Assigned for private use, not recognized
globally
– These addresses are used either in isolation
or in connection with network address
translation techniques (NAT)
84
• Multicast Addresses
– The block 224.0.0.0/4 is reserved for multicast
communication
85
Special Addresses in Each block
• Network Address
– The first address in a block
– The suffix set all to 0s
• Direct Broadcast Address
– The last address in a block or subblock
– The suffix set all to 1s
– Usually used by a router to send a packet to all hosts in a
specific network
– can be used only as a destination address in an IPv4 packet
86
NAT
NETWORK ADDRESS TRANSLATION
87
88
Address Translation
89
How does the NAT router know the
destination address for a packet coming
from the Internet?
Translation Table
• Using One IP Address
90
• In this strategy, communication must always be initiated by the private
network  A private network cannot run a server program for clients
outside of its network
• Using a Pool of IP Addresses
– For example, instead of using only one global
address (200.24.5.8), the NAT router can use four
addresses (200.24.5.8, 200.24.5.9, 200.24.5.10, and
200.24.5.11)  four private-network hosts can
communicate with the same external host at the same
time because each pair of addresses defines a
connection
– Drawbacks:
• No more than four connections can be made to the same
destination
• No private-network host can access two external server programs
(e.g., HTTP and TELNET) at the same time
• Two private-network hosts cannot access the same external server
program (e.g., HTTP or TELNET) at the same time 91
• Using Both IP Addresses and Port
Addresses
92

More Related Content

What's hot

Network Layer Part 1
Network Layer Part 1Network Layer Part 1
Network Layer Part 1
Tutun Juhana
 
Network layer Part 2
Network layer Part 2Network layer Part 2
Network layer Part 2
Tutun Juhana
 

What's hot (20)

Network layer
Network layerNetwork layer
Network layer
 
Lecture 3 network layer
Lecture 3 network layerLecture 3 network layer
Lecture 3 network layer
 
Ch 19 Network-layer protocols Section 1
Ch 19  Network-layer protocols Section 1Ch 19  Network-layer protocols Section 1
Ch 19 Network-layer protocols Section 1
 
Network layer ip address assignment and routing
Network layer ip address assignment and routingNetwork layer ip address assignment and routing
Network layer ip address assignment and routing
 
Network Layer Part 1
Network Layer Part 1Network Layer Part 1
Network Layer Part 1
 
Routing
RoutingRouting
Routing
 
Network layer Part 2
Network layer Part 2Network layer Part 2
Network layer Part 2
 
Et3003 sem2-1314-3 ethernets
Et3003 sem2-1314-3 ethernetsEt3003 sem2-1314-3 ethernets
Et3003 sem2-1314-3 ethernets
 
Underlying Technologies Part I (Lecture #4 ET3003 Sem1 2014/2015)
Underlying Technologies Part I (Lecture #4 ET3003 Sem1 2014/2015)Underlying Technologies Part I (Lecture #4 ET3003 Sem1 2014/2015)
Underlying Technologies Part I (Lecture #4 ET3003 Sem1 2014/2015)
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
 
Ch 18 intro to network layer - section 4
Ch 18   intro to network layer - section 4Ch 18   intro to network layer - section 4
Ch 18 intro to network layer - section 4
 
Computer Network
Computer NetworkComputer Network
Computer Network
 
The Internet Protocol version 4 (IPv4)
The Internet Protocol version 4 (IPv4)The Internet Protocol version 4 (IPv4)
The Internet Protocol version 4 (IPv4)
 
IP Datagram Structure
IP Datagram StructureIP Datagram Structure
IP Datagram Structure
 
Mod9
Mod9Mod9
Mod9
 
Routing, Different types of forwarding technique
Routing, Different types of forwarding techniqueRouting, Different types of forwarding technique
Routing, Different types of forwarding technique
 
Ch 19 Network-layer protocols - section 2
Ch 19   Network-layer protocols - section 2Ch 19   Network-layer protocols - section 2
Ch 19 Network-layer protocols - section 2
 
Computer networks unit iii
Computer networks    unit iiiComputer networks    unit iii
Computer networks unit iii
 
COMPUTER NETWORKS UNIT 2
COMPUTER NETWORKS UNIT 2COMPUTER NETWORKS UNIT 2
COMPUTER NETWORKS UNIT 2
 
Cs8591 Computer Networks
Cs8591 Computer NetworksCs8591 Computer Networks
Cs8591 Computer Networks
 

Viewers also liked (7)

Ch19
Ch19Ch19
Ch19
 
Chap 04
Chap 04Chap 04
Chap 04
 
Chap 05
Chap 05Chap 05
Chap 05
 
Ch12
Ch12Ch12
Ch12
 
Ipv4 ppt
Ipv4 pptIpv4 ppt
Ipv4 ppt
 
Classless addressing
Classless addressingClassless addressing
Classless addressing
 
Ipv4 vs Ipv6 comparison
Ipv4 vs Ipv6 comparisonIpv4 vs Ipv6 comparison
Ipv4 vs Ipv6 comparison
 

Similar to Et3003 sem2-1314-4 network layers i (ipv4 addressing)

AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
IDC lectureA - Network Layer & IP Addressing with Cisco Notes.ppt
IDC lectureA - Network Layer & IP Addressing with Cisco Notes.pptIDC lectureA - Network Layer & IP Addressing with Cisco Notes.ppt
IDC lectureA - Network Layer & IP Addressing with Cisco Notes.ppt
Jayaprasanna4
 

Similar to Et3003 sem2-1314-4 network layers i (ipv4 addressing) (20)

NP - Unit 2 - Internet Addressing, ARP and RARP
NP - Unit 2 - Internet Addressing, ARP and RARP NP - Unit 2 - Internet Addressing, ARP and RARP
NP - Unit 2 - Internet Addressing, ARP and RARP
 
IPv4
IPv4IPv4
IPv4
 
Subentting, Supernetting and VLSM presentation
Subentting, Supernetting and VLSM presentationSubentting, Supernetting and VLSM presentation
Subentting, Supernetting and VLSM presentation
 
Lecture 03 networking
Lecture 03 networkingLecture 03 networking
Lecture 03 networking
 
IP-address trial.ppt
IP-address trial.pptIP-address trial.ppt
IP-address trial.ppt
 
Lecture 1-Networl Layer Services (1).pdf
Lecture 1-Networl Layer Services (1).pdfLecture 1-Networl Layer Services (1).pdf
Lecture 1-Networl Layer Services (1).pdf
 
IPv4 Address uploading.ppt
IPv4 Address uploading.pptIPv4 Address uploading.ppt
IPv4 Address uploading.ppt
 
Sub Netting
Sub NettingSub Netting
Sub Netting
 
08 - IP Subnetting.ppt
08 - IP Subnetting.ppt08 - IP Subnetting.ppt
08 - IP Subnetting.ppt
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
CCNA IP Address,Subnet mask (part 2)
CCNA IP Address,Subnet mask (part 2)CCNA IP Address,Subnet mask (part 2)
CCNA IP Address,Subnet mask (part 2)
 
CN Unit 3
CN Unit 3 CN Unit 3
CN Unit 3
 
Explaining ip address
Explaining ip addressExplaining ip address
Explaining ip address
 
Week10 lec1
Week10 lec1Week10 lec1
Week10 lec1
 
Network_layer_addressing.pptx
Network_layer_addressing.pptxNetwork_layer_addressing.pptx
Network_layer_addressing.pptx
 
IDC lectureA - Network Layer & IP Addressing with Cisco Notes.ppt
IDC lectureA - Network Layer & IP Addressing with Cisco Notes.pptIDC lectureA - Network Layer & IP Addressing with Cisco Notes.ppt
IDC lectureA - Network Layer & IP Addressing with Cisco Notes.ppt
 
Vlsm workbook instructors edition v2 0-solucionario
Vlsm workbook  instructors edition   v2 0-solucionarioVlsm workbook  instructors edition   v2 0-solucionario
Vlsm workbook instructors edition v2 0-solucionario
 
03 coms 525 tcpip - ip address
03   coms 525 tcpip -  ip address03   coms 525 tcpip -  ip address
03 coms 525 tcpip - ip address
 
Week9 lec1
Week9 lec1Week9 lec1
Week9 lec1
 
Reserved ip addresses
Reserved ip addressesReserved ip addresses
Reserved ip addresses
 

More from Tutun Juhana

6 2 transport layer (tcp)
6 2 transport layer (tcp)6 2 transport layer (tcp)
6 2 transport layer (tcp)
Tutun Juhana
 
Transport Layer (UDP)
Transport Layer (UDP)Transport Layer (UDP)
Transport Layer (UDP)
Tutun Juhana
 
Network layer Part 7
Network layer Part 7Network layer Part 7
Network layer Part 7
Tutun Juhana
 

More from Tutun Juhana (20)

What should you prepare for industry 4.0 era
What should you prepare for industry 4.0 eraWhat should you prepare for industry 4.0 era
What should you prepare for industry 4.0 era
 
Internet of Things Security
Internet of Things SecurityInternet of Things Security
Internet of Things Security
 
Et4045-3-attacks-2
Et4045-3-attacks-2Et4045-3-attacks-2
Et4045-3-attacks-2
 
ET4045-3-attacks-1
ET4045-3-attacks-1ET4045-3-attacks-1
ET4045-3-attacks-1
 
ET4045-2-cryptography-3
ET4045-2-cryptography-3ET4045-2-cryptography-3
ET4045-2-cryptography-3
 
ET4045-2-cryptography-2
ET4045-2-cryptography-2ET4045-2-cryptography-2
ET4045-2-cryptography-2
 
ET4045-2-cryptography-1-2014
ET4045-2-cryptography-1-2014ET4045-2-cryptography-1-2014
ET4045-2-cryptography-1-2014
 
ET4045-1-Introduction-2014
ET4045-1-Introduction-2014ET4045-1-Introduction-2014
ET4045-1-Introduction-2014
 
OSI Reference Model and TCP/IP (Lecture #3 ET3003 Sem1 2014/2015)
OSI Reference Model and TCP/IP (Lecture #3 ET3003 Sem1 2014/2015)OSI Reference Model and TCP/IP (Lecture #3 ET3003 Sem1 2014/2015)
OSI Reference Model and TCP/IP (Lecture #3 ET3003 Sem1 2014/2015)
 
Switching Techniques (Lecture #2 ET3003 Sem1 2014/2015)
Switching Techniques (Lecture #2 ET3003 Sem1 2014/2015)Switching Techniques (Lecture #2 ET3003 Sem1 2014/2015)
Switching Techniques (Lecture #2 ET3003 Sem1 2014/2015)
 
Introduction to Computer Networks (Lecture #1 ET3003 Sem1 2014/2015)
Introduction to Computer Networks (Lecture #1 ET3003 Sem1 2014/2015)Introduction to Computer Networks (Lecture #1 ET3003 Sem1 2014/2015)
Introduction to Computer Networks (Lecture #1 ET3003 Sem1 2014/2015)
 
Et3003 sem2-1314-10 vlans
Et3003 sem2-1314-10 vlansEt3003 sem2-1314-10 vlans
Et3003 sem2-1314-10 vlans
 
ET3003-1 introduction (Semester II 2013-2014)
ET3003-1 introduction (Semester II 2013-2014)ET3003-1 introduction (Semester II 2013-2014)
ET3003-1 introduction (Semester II 2013-2014)
 
ET3003-2 OSI-TCPIP (Semester II 2013-2014)
ET3003-2 OSI-TCPIP (Semester II 2013-2014)ET3003-2 OSI-TCPIP (Semester II 2013-2014)
ET3003-2 OSI-TCPIP (Semester II 2013-2014)
 
IPv6 Introduction
IPv6 IntroductionIPv6 Introduction
IPv6 Introduction
 
6 2 transport layer (tcp)
6 2 transport layer (tcp)6 2 transport layer (tcp)
6 2 transport layer (tcp)
 
VLANs
VLANsVLANs
VLANs
 
Application Layer
Application LayerApplication Layer
Application Layer
 
Transport Layer (UDP)
Transport Layer (UDP)Transport Layer (UDP)
Transport Layer (UDP)
 
Network layer Part 7
Network layer Part 7Network layer Part 7
Network layer Part 7
 

Et3003 sem2-1314-4 network layers i (ipv4 addressing)

  • 1. Network Layer Part I Computer Networks Tutun Juhana Telecommunication Engineering School of Electrical Engineering & Informatics Institut Teknologi Bandung 4
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Other Network Layer Issues • Error Control • Flow Control • Congestion control • Quality of Service • Routing • Security
  • 9. • The IPv4 addresses are unique and universal • An IPv4 address is 32 bits long – The address space of IPv4 is 232 or 4.294.967.296 • Notation: Dotted-Decimal Notation (Base 256)
  • 10. Range of Address • To find the number of addresses in a range if the first and last address is given  we can perform subtraction or addition • Example #1 Find the number of addresses in a range if the first address is 146.102.29.0 and the last address is 146.102.32.255 Ans: • 146.102.32.255 - 146.102.29.0 = 0.0.3.255 • Number of addresses= (0 2563+ 0 2562+ 3 2561+ 255 2560)+ 1= 1024
  • 11. • Example #2 The first address in a range of addresses is 14.11.45.96. If the number of addresses in the range is 32, what is the last address? Ans: • Convert the number of addresses minus 1 to base 256  0.0.0.31 • We then add it (in base 256) to the first address to get the last address Last address = (14.11.45.96 + 0.0.0.31)256 = 14.11.45.127
  • 13.
  • 15.
  • 16. Classes and Blocks • In classful addressing , each class is divided into a fixed number of blocks (each block having a fixed size)  can be a problem
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Two-Level Addressing • The range of addresses allocated to an organization in classful addressing was a block of addresses in Class A, B, or C • Since all addresses in a network belonged to a single block, each address in classful addressing contains two parts: netid and hostid – The netid defines the network – The hostid defines a particular host connected to that network
  • 22.
  • 23. Extracting Information in a Block • A block is a range of addresses • Given any address in the block, we normally like to know : 1. The number of addresses 2. The first address 3. The last address • To extract the above information, we need to know the class of the address  we will know the value of n (the length of netid in bits)
  • 24.
  • 25.
  • 26. • Example #3 An address in a block is given as 73.22.17.25. Find the number of ddresses in the block, the first address, and the last address N = 232 −n = 224 = 16,777,216 not assigned to any host
  • 27.
  • 28. Network Address • The first address in a block is network address  important because it is used in routing a packet to its destination network
  • 29. Network Mask • Routers in the Internet need to know the network mask to extract the network address from the destination address of a packet • A network mask (default mask in classful addressing) is a 32-bit number with n leftmost bits all set to 1s and (32 − n) rightmost bits all set to 0s
  • 30.
  • 31.
  • 32. • Example #4 A router receives a packet with the destination address 201.24.67.32. Show how the router finds the network address of the packet Something Wrong here
  • 33. Three-Level Addressing: Subnetting • We need more than two hierarchical levels for two reasons 1. An organization that was granted a block in class A or B needed to divide its large network into several subnetworks for better security and management 2. Since the blocks in class A and B were almost depleted and the blocks in class C were smaller than the needs of most organizations, an organization that has been granted a block in class A or B could divide the block into smaller subblocks and share them with other organizations • The idea of splitting a block to smaller blocks is referred to as subnetting • In subnetting, a network is divided into several smaller subnetworks (subnets) with each subnetwork having its own subnetwork address
  • 34. • Example #5 Before subnetting Length of netid
  • 36. Subnet Mask • The network mask is used when a network is not subnetted • When we divide a network to several subnetworks, we need to create a subnetwork mask (or subnet mask) for each subnetwork • A subnetwork has subnetid and hostid
  • 37. Subnetting increases the length of the netid and decreases the length of hostid
  • 38. • When we divide a network to s number of subnetworks (each of equal numbers of hosts) we can calculate the subnetid for each subnetwork as – n is the length of netid – nsub is the length of each subnetid – s is the number of subnets (must be a power of 2)
  • 39. • Example #6 – In Example #5, we divided a class B network into four subnetworks. The value of n = 16 and the value of n1= n2= n3= n4= 16 + log24 = 18  The subnet mask has eighteen 1s and fourteen 0s  255.255.192.0 (different from the network mask for class B (255.255.0.0))
  • 40. Subnet Address • When a network is subnetted, the first address in the subnet is the identifier of the subnet and is used by the router to route the packets destined for that subnetwork
  • 41. • Example #7 – In Example #5, we show that a network is divided into four subnets. Since one of the addresses in subnet 2 is 141.14.120.77, we can find the subnet address as
  • 42. Supernetting • In supernetting, an organization can combine several class C blocks to create a larger range of addresses (several networks are combined to create a supernetwork) – By doing this, an organization can apply for several class C blocks instead of just one – For example, an organization that needs 1000 addresses can be granted four class C blocks.
  • 43. Supernet Mask • A supernet mask is the reverse of a subnet mask • A supernet mask for class C has less 1s than the default mask for this class.
  • 44.
  • 45. • In supernetting, the number of class C addresses that can be combined to make a supernet needs to be a power of 2 • The length of the supernetid can be found using the formula  nsuper defines the length of the supernetid in bits  c defines the number of class C blocks that are combined
  • 46. Problems 1. The number of blocks to combine needs to be a power of 2  An organization that needed seven blocks should be granted at least eight blocks (address wasting) 2. Supernetting and subnetting complicated the routing of packets in the Internet.
  • 47. Subnetting and supernetting in classful addressing did not solve the address depletion problem and made the distribution of addresses and the routing process more difficult 47
  • 49. • The size of the blocks was predefinedClassful • The whole address space is divided into variable length blocks Classless 49
  • 50. The number of addresses in a block needs to be a power of 2 (20, 21, 22, . . . , 232) 50
  • 51. Two-Level Addressing • The prefix plays the same role as the netid; the suffix plays the same role as the hostid • All addresses in the block have the same prefix; each address has a different suffix 51
  • 52. • In classful addressing, the length of the netid, n, depends on the class of the address (it can be only 8, 16, or 24) • In classless addressing, the length of the prefix, n, depends on the size of the block (it can be 0, 1, 2, 3, . . . , 32) • In classless addressing, the value of n is referred to as prefix length; the value of (32 − n) is referred to as suffix length • The number of addresses in a block is inversely related to the value of the prefix length, n – A small n means a larger block; a large n means a small block. 52
  • 53. Slash Notation • In classful addressing, the netid length is inherent in the address – Given an address, we know the class of the address that allows us to find the netid length (8, 16, or 24) • In classless addressing, the prefix length cannot be found if we are given only an address in the block – The given address can belong to a block with any prefix length 53
  • 54. • In classless addressing, we need to include the prefix length to each address if we need to find the block of the address  the prefix length, n, is added to the address separated by a slash  slash notation 54 The slash notation is formally referred to as classless interdomain routing or CIDR (pronounced cider) notation
  • 55. • Example 5.25 In classless addressing, an address cannot per se define the block the address belongs to. For example, the address 230.8.24.56 can belong to many blocks some of them are shown below with the value of the prefix associated with that block: 55
  • 56. Network Mask • The idea of network mask in classless addressing is the same as the one in classful addressing • A network mask is a 32-bit number with the n leftmost bits all set to 0s and the rest of the bits all set to 1s 56
  • 57. • Example 5.26 The following addresses are defined using slash notations. a. In the address 12.23.24.78/8, the network mask is 255.0.0.0, the prefix length is 8, the suffix length is 24 b. In the address 130.11.232.156/16, the network mask is 255.255.0.0, the prefix length is 16, the suffix length is 16 c. In the address 167.199.170.82/27, the network mask is 255.255.255.224, the prefix length is 27, the suffix length is 5. 57
  • 58. Extracting Block Information • An address in slash notation (CIDR) contains all information we need about the block: – the first address (network address) – the number of addresses, and – the last address 58
  • 59. 59
  • 60. 60
  • 61. 61
  • 62. Block Allocation • The ultimate responsibility of block allocation is given to a global authority called the Internet Corporation for Assigned Names and Addresses (ICANN)  distribute the block thorough ISPs 62
  • 63. • For the proper operation of the CIDR, three restrictions need to be applied to the allocated block. 63
  • 64. 64
  • 65. Relation to Classful Addressing • All issues discussed for classless addressing can be applied to classful addressing 65
  • 66. Subnetting • The concept is the same as we discussed for classful addressing • Note: nothing stops the organization from creating more levels – A subnetwork can be divided into several sub- subnetworks  sub-subnetwork can be divided into several sub-sub-subnetworks, and so on 66
  • 68. Finding Information about Each Subnetwork • After designing the subnetworks, the information about each subnetwork, such as first and last address, can be found using the process we described to find the information about each network in the Internet. 68
  • 69. 69
  • 70. 70
  • 71. 71
  • 72. 72
  • 73. 73
  • 74. 74
  • 75. 75
  • 76. Address Aggregation • One of the advantages of CIDR architecture is address aggregation • ICANN assigns a large block of addresses to an ISP  Each ISP divides its assigned block into smaller subblocks and grants the subblocks to its customers • Many blocks of addresses are aggregated in one block and granted to one ISP 76
  • 77. 77
  • 79. 79
  • 81. Special Blocks • All-Zeros Address – The block 0.0.0.0/32 (contains only one single address) is reserved for communication when a host needs to send an IPv4 packet but it does not know its own address – The host sends an IPv4 packet to a bootstrap server (DHCP server) using this address as the source address and a limited broadcast address as the destination address to find its own address 81
  • 82. • All-Ones Address: Limited Broadcast Address – The block 255.255.255.255/32 (contains one single address) is reserved for limited broadcast address in the current network – A host that wants to send a message to every other host can use this address as a destination address in an IPv4 packet  routers will block such packet 82
  • 83. • Loopback Addresses – The block 127.0.0.0/8 is used for the loopback address, which is an address used to test the software on a machine  packet never leaves the machine – It can be used only as a destination address in an IPv4 packet 83
  • 84. • Private Addresses – Assigned for private use, not recognized globally – These addresses are used either in isolation or in connection with network address translation techniques (NAT) 84
  • 85. • Multicast Addresses – The block 224.0.0.0/4 is reserved for multicast communication 85
  • 86. Special Addresses in Each block • Network Address – The first address in a block – The suffix set all to 0s • Direct Broadcast Address – The last address in a block or subblock – The suffix set all to 1s – Usually used by a router to send a packet to all hosts in a specific network – can be used only as a destination address in an IPv4 packet 86
  • 88. 88
  • 89. Address Translation 89 How does the NAT router know the destination address for a packet coming from the Internet?
  • 90. Translation Table • Using One IP Address 90 • In this strategy, communication must always be initiated by the private network  A private network cannot run a server program for clients outside of its network
  • 91. • Using a Pool of IP Addresses – For example, instead of using only one global address (200.24.5.8), the NAT router can use four addresses (200.24.5.8, 200.24.5.9, 200.24.5.10, and 200.24.5.11)  four private-network hosts can communicate with the same external host at the same time because each pair of addresses defines a connection – Drawbacks: • No more than four connections can be made to the same destination • No private-network host can access two external server programs (e.g., HTTP and TELNET) at the same time • Two private-network hosts cannot access the same external server program (e.g., HTTP or TELNET) at the same time 91
  • 92. • Using Both IP Addresses and Port Addresses 92