SlideShare a Scribd company logo
1 of 67
Download to read offline
19.1
Chapter 19
Network Layer:
Logical Addressing
Modified by Allam
AbuMwais
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
19.2
Introduction
 communication path through the network layer is hop-to-hop.
The packet transmitted by the sending computer may pass
through several LANs or WANs before reaching the destination
computer.
For this level of communication, we need a global addressing
scheme; we called this logical addressing IP in TCP/IP
protocol.
The Internet addresses are 32 bits in length; this gives us a
maximum of 232 addresses.
In this chapter, we will address the IPv4IPv6.
19.3
19-1 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.
Address Space
Notations
Classful Addressing
Classless Addressing
Network Address Translation (NAT)
Topics discussed in this section:
19.4
IPv4 addresses are unique:
1. each address defines one, and only one, connection to the
Internet.
2. Two devices on the Internet can never have the same
address at the same time.
IPv4 addresses are universal:
1. the addressing system must be accepted by any host that
wants to be connected to the Internet.
19.5
The IPv4 addresses are unique
and universal.
Note
An IPv4 address is 32 bits long.
Note
19.6
The address space of IPv4 is
232 or 4,294,967,296.
Note
Address Space
A protocol such as IPv4 that defines addresses has an
address space. An address space is the total number of
addresses used by the protocol.
19.7 Figure 19.1 Dotted-decimal notation and binary notation for an IPv4 address
Notations
There are two prevalent notations to show an IPv4
address: binary notation and dotted-decimal notation.
19.8
Numbering systems are reviewed in
Appendix B.
Note
19.9
Change the following IPv4 addresses from binary
notation to dotted-decimal notation.
Example 19.1
Solution
We replace each group of 8 bits with its equivalent
decimal number (see Appendix B) and add dots for
separation.
19.10
Change the following IPv4 addresses from dotted-
decimal notation to binary notation.
Example 19.2
Solution
We replace each decimal number with its binary
equivalent (see Appendix B).
19.11
Find the error, if any, in the following IPv4 addresses.
Example 19.3
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
19.12
Classful Addressing
The concept of classes. This architecture is
called classful addressing.
We can find the class of an address when given
the address in binary notation or dotted-decimal
notation.
19.13
In classful addressing, the address
space is divided into five classes:
A, B, C, D, and E.
Note
19.14
Figure 19.2 Finding the classes in binary and dotted-decimal notation
19.15
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
Example 19.4
Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class
C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
19.16
One problem with classful addressing is that each
class is divided into a fixed number of blocks with each
block having a fixed size as shown in Table.
Classes and Blocks
Table 19.1 Number of blocks and block size in classful IPv4 addressing
19.17
In classful addressing, a large part of the
available addresses were wasted.
Note
19.18
Netid and Hostid
IP address in class A, B, or C is divided into netid and
hostid. These parts are of varying lengths, depending
on the class of the address.
Table 19.2 Default masks for classful addressing
19.19
Mask
Although the length of the netid and hostid (in
bits) is predetermined in classful addressing,
we can also use a mask (also called the default
mask), a 32-bit .
Table 19.2 Default masks for classful addressing
19.20
Subnetting
During the era of classful addressing, subnetting
was introduced. 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)
19.21
Supernetting
 …class A and class B addresses were depleted.
There was still a huge demand for midsize blocks. The
size of a class C block with a
maximum number of 256 addresses did not satisfy the
needs of most organizations.
Even a midsize organization needed more addresses. One
solution was super-netting.
Several networks are combined to create a supernetwork
or a supemet.
19.22
Classless Addressing
To overcome address depletion and give more organizations access
to the Internet, classless addressing was designed and implemented.
In this scheme, there are no classes, but the addresses are still
granted in blocks.
Restriction
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 (1, 2, 4, 8, .
3. The first address must be evenly divisible by the number of addresses.
19.23
Classful addressing, which is almost
obsolete, is replaced with classless
addressing.
Note
19.24
Figure 19.3 shows a block of addresses, in both binary
and dotted-decimal notation, granted to a small
business that needs 16 addresses.
We can see that the restrictions are applied to this
block. The addresses are contiguous. The number of
addresses is a power of 2 (16 = 24), and the first address
is divisible by 16. The first address, when converted to a
decimal number, is 3,440,387,360, which when divided
by 16 results in 215,024,210.
Example 19.5
19.25
Figure 19.3 A block of 16 addresses granted to a small organization
19.26
In IPv4 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.
Note
19.27
The first address in the block can be
found by setting the rightmost
32 − n bits to 0s.
Note
19.28
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 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, we get
11001101 00010000 00100101 0010000
or
205.16.37.32.
This is actually the block shown in Figure 19.3.
Example 19.6
19.29
The last address in the block can be
found by setting the rightmost
32 − n bits to 1s.
Note
19.30
Find the last address for the block in Example 19.6.
Solution
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
This is actually the block shown in Figure 19.3.
Example 19.7
19.31
The number of addresses in the block
can be found by using the formula
232−n.
Note
19.32
Find the number of addresses in Example 19.6.
Example 19.8
Solution
The value of n is 28, which means that number
of addresses is 2 32−28 or 16.
19.33
Another way to find the first address, the last address,
and the number of addresses is to represent the mask as
a 32-bit binary (or 8-digit hexadecimal) number. This is
particularly useful when we are writing a program to
find these pieces of information. In Example 19.5 the
/28 can be represented as
11111111 11111111 11111111 11110000
(twenty-eight 1s and four 0s).
Find
a. The first address
b. The last address
c. The number of addresses.
Example 19.9
19.34
Solution
a. The first address can be found by ANDing the given
addresses with the mask. ANDing here is done bit by
bit. The result of ANDing 2 bits is 1 if both bits are
1s;
the result is 0 otherwise.
Example 19.9 (continued)
19.35
b. The last address can be found by ORing the given
addresses with the complement of the mask. ORing
here is done bit by bit. The result of ORing 2 bits is 0
if
both bits are 0s; the result is 1 otherwise. The
complement of a number is found by changing each 1
to 0 and each 0 to 1.
Example 19.9 (continued)
19.36
c. The number of addresses can be found by
complementing the mask, interpreting it as a
decimal number, and adding 1 to it.
Example 19.9 (continued)
19.37
Figure 19.4 A network configuration for the block 205.16.37.32/28
19.38
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.
Note
19.39 Figure 19.5 Hierarchy in a telephone network in North America
Hierarchy
19.40
Figure 19.6 Two levels ofhierarchy in an IPv4 address
The n leftmost bits of the address x.y.z.tJn define
the network (organization network); the 32 – n
rightmost bits define the particular host
(computer or router) to the network.
19.41
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.
Note
19.42
Figure 19.8 Three-level hierarchy in an IPv4 address
An organization that is granted a large block of addresses may want
to create clusters of networks (called subnets) and divide the
addresses between the different subnets.
As an example, suppose an organization is given the block
17.12.40.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.
19.43
Figure 19.7 Configuration and addresses in a subnetted network
1. Suppose the mask for the first
subnet is n1, then 232- n1 must
be 32, which means that n1 =27.
2. Suppose the mask for the
second subnet is n2, then 232- n2
must be 16, which means that n2
= 28.
3. Suppose the mask for the
third subnet is n3, then 232- n3
must be 16, which means that n3
=28.
19.44
An ISP is granted a block of addresses starting with
190.100.0.0/16 (65,536 addresses). The ISP needs to
distribute these addresses to three groups of customers
as follows:
a. The first group has 64 customers; each needs 256
addresses.
b. The second group has 128 customers; each needs 128
addresses.
c. The third group has 128 customers; each needs 64
addresses.
Design the subblocks and find out how many addresses
are still available after these allocations.
Example 19.10
19.45
Solution
Figure 19.9 shows the situation.
Example 19.10 (continued)
Group 1
For this group, each customer needs 256 addresses. This
means that 8 (log2 256) bits are needed to define each
host. The prefix length is then 32 − 8 = 24. The
addresses are
19.46
Example 19.10 (continued)
Group 2
For this group, each customer needs 128 addresses. This
means that 7 (log2 128) bits are needed to define each
host. The prefix length is then 32 − 7 = 25. The
addresses are
19.47
Example 19.10 (continued)
Group 3
For this group, each customer needs 64 addresses. This
means that 6 (log264) bits are needed to each host. The
prefix length is then 32 − 6 = 26. The addresses are
Number of granted addresses to the ISP: 65,536
Number of allocated addresses by the ISP: 40,960
Number of available addresses: 24,576
19.48
Figure 19.9 An example of address allocation and distribution by an ISP
19.49
Network Address Translation (NAT)
The number of home users and small businesses that
want to use the Internet is ever increasing.
many have created small networks with several hosts
and need an IP address for each host. With the
shortage of addresses, this is a serious problem.
A network address translation (NAT) is quick
solution to this problem.
NAT enables a user to have a large set of addresses
internally and one address, or a small set of addresses,
externally.
19.50
Table 19.3 Addresses for private networks
Everyone knows that these reserved addresses are for
private networks. They are unique inside the
organization, but they are not unique globally.
19.51
Figure 19.10 A NAT implementation
The private network is transparent to the rest of the
Internet; the rest of the Internet sees only the NAT router
with the address 200.24.5.8.
19.52
Address Translation
Figure 19.11 Addresses in a NAT
All the outgoing packets go through the NAT router, which replaces the source
address in the packet with the global NAT address.
 All incoming packets also pass through the NAT router, which replaces the
destination address in the packet with the appropriate private address
19.53 Figure 19.12 NAT address translation
Translation Table
How does the NAT
router know the
destination address for a
packet coming from the
Internet? There may be
tens or hundreds of
private IP The problem
is solved if the NAT
router has a translation
table.
19.54
Table 19.4 Five-column translation table
19.55
Figure 19.13 An ISP and NAT
19.56
19-2 IPv6 ADDRESSES
Despite all short-term solutions, address depletion is
still a long-term problem for the Internet. This and
other problems in the IP protocol itself have been the
motivation for IPv6.
Structure
Address Space
Topics discussed in this section:
19.57
An IPv6 address is 128 bits long.
Note
19.58
Figure 19.14 IPv6 address in binary and hexadecimal colon notation
19.59
Figure 19.15 Abbreviated IPv6 addresses
19.60
Expand the address 0:15::1:12:1213 to its original.
Example 19.11
Solution
We first need to align the left side of the double colon to
the left of the original pattern and the right side of the
double colon to the right of the original pattern to find
how many 0s we need to replace the double colon.
This means that the original address is.
19.61
Table 19.5 Type prefixes for IPv6 addresses
Address Space
The designers of IPv6 divided the address into several
categories. A few leftmost bits, called the type prefix.
19.62
Table 19.5 Type prefixes for IPv6 addresses (continued)
19.63 Figure 19.16 Prefixes for provider-based unicast address
Unicast Addresses
A unicast address defines a single computer. The packet sent to a
unicast address must be delivered to that specific computer.
 With two type geographically based and provider-based.
19.64 Figure 19.16 Prefixes for provider-based unicast address
Unicast Addresses
Type identifier. This 3-bit field defines the address as a provider-base.d
address.
 Registry identifier. This 5-bit field indicates the agency that has
registered the address. Currently three registry centers have been
defined.
Provider identifier. This variable-length field identifies the provider for
Internet access (such as an ISP). 16 bit
19.65 Figure 19.17 Multicast address in IPv6
Multicast Addresses---Anycaste
Multicast addresses are used to define a group of hosts instead of
just one.
19.66
Figure 19.18 Reserved addresses in IPv6
19.67
Figure 19.19 Local addresses in IPv6
These addresses are used when an organization wants
to use IPv6 protocol without being connected to the global
Internet.
A link local address is used in an isolated subnet; a site
local address is used in an isolated site with several
subnets.

More Related Content

What's hot

Chapter 2 - Network Models
Chapter 2 - Network ModelsChapter 2 - Network Models
Chapter 2 - Network ModelsWayne Jones Jnr
 
IP NETWORKING AND IP SUBNET MASKING
IP NETWORKING AND IP SUBNET MASKING IP NETWORKING AND IP SUBNET MASKING
IP NETWORKING AND IP SUBNET MASKING AYESHA JAVED
 
NETWORK LAYER - Logical Addressing
NETWORK LAYER - Logical AddressingNETWORK LAYER - Logical Addressing
NETWORK LAYER - Logical AddressingPankaj Debbarma
 
Chapter 26 - Remote Logging, Electronic Mail & File Transfer
Chapter 26 - Remote Logging, Electronic Mail & File TransferChapter 26 - Remote Logging, Electronic Mail & File Transfer
Chapter 26 - Remote Logging, Electronic Mail & File TransferWayne Jones Jnr
 
Ethernet Computer network
Ethernet Computer networkEthernet Computer network
Ethernet Computer networkmiteshppt
 
Classless addressing
Classless addressingClassless addressing
Classless addressingIqra Abbas
 
Media Access Control (MAC Layer)
Media Access Control (MAC Layer)Media Access Control (MAC Layer)
Media Access Control (MAC Layer)Meenakshi Paul
 
Advanced computer network lab manual (practicals in Cisco Packet tracer)
Advanced computer network lab manual (practicals in Cisco Packet tracer)Advanced computer network lab manual (practicals in Cisco Packet tracer)
Advanced computer network lab manual (practicals in Cisco Packet tracer)VrundaBhavsar
 

What's hot (20)

Chapter 14
Chapter 14Chapter 14
Chapter 14
 
TCP Vs UDP
TCP Vs UDP TCP Vs UDP
TCP Vs UDP
 
Chapter 8: Switching
Chapter 8: SwitchingChapter 8: Switching
Chapter 8: Switching
 
Chapter 2 - Network Models
Chapter 2 - Network ModelsChapter 2 - Network Models
Chapter 2 - Network Models
 
IP NETWORKING AND IP SUBNET MASKING
IP NETWORKING AND IP SUBNET MASKING IP NETWORKING AND IP SUBNET MASKING
IP NETWORKING AND IP SUBNET MASKING
 
NETWORK LAYER - Logical Addressing
NETWORK LAYER - Logical AddressingNETWORK LAYER - Logical Addressing
NETWORK LAYER - Logical Addressing
 
Chapter 26 - Remote Logging, Electronic Mail & File Transfer
Chapter 26 - Remote Logging, Electronic Mail & File TransferChapter 26 - Remote Logging, Electronic Mail & File Transfer
Chapter 26 - Remote Logging, Electronic Mail & File Transfer
 
Ethernet Computer network
Ethernet Computer networkEthernet Computer network
Ethernet Computer network
 
Chapter 13
Chapter 13Chapter 13
Chapter 13
 
Classless addressing
Classless addressingClassless addressing
Classless addressing
 
Chapter 15
Chapter 15Chapter 15
Chapter 15
 
Chapter 19: Logical Addressing
Chapter 19: Logical AddressingChapter 19: Logical Addressing
Chapter 19: Logical Addressing
 
Media Access Control (MAC Layer)
Media Access Control (MAC Layer)Media Access Control (MAC Layer)
Media Access Control (MAC Layer)
 
IPv4 Addressing
 IPv4 Addressing   IPv4 Addressing
IPv4 Addressing
 
Ch12
Ch12Ch12
Ch12
 
Sub Netting
Sub NettingSub Netting
Sub Netting
 
FDDI
FDDIFDDI
FDDI
 
Control Memory
Control MemoryControl Memory
Control Memory
 
Advanced computer network lab manual (practicals in Cisco Packet tracer)
Advanced computer network lab manual (practicals in Cisco Packet tracer)Advanced computer network lab manual (practicals in Cisco Packet tracer)
Advanced computer network lab manual (practicals in Cisco Packet tracer)
 
Application Layer
Application LayerApplication Layer
Application Layer
 

Viewers also liked

Viewers also liked (20)

Ch2020
Ch2020Ch2020
Ch2020
 
19 Network Layer_Logical_Addressing
19 Network Layer_Logical_Addressing19 Network Layer_Logical_Addressing
19 Network Layer_Logical_Addressing
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
Eve Reed-Hill 2015
Eve Reed-Hill 2015Eve Reed-Hill 2015
Eve Reed-Hill 2015
 
Angel6 e05
Angel6 e05Angel6 e05
Angel6 e05
 
Ch8
Ch8Ch8
Ch8
 
Ir 09
Ir   09Ir   09
Ir 09
 
Multiple Access Networking
Multiple Access NetworkingMultiple Access Networking
Multiple Access Networking
 
Ir 03
Ir   03Ir   03
Ir 03
 
Swe notes
Swe notesSwe notes
Swe notes
 
Ch12
Ch12Ch12
Ch12
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programming
 
Ir 08
Ir   08Ir   08
Ir 08
 
Ian Sommerville, Software Engineering, 9th Edition Ch 23
Ian Sommerville,  Software Engineering, 9th Edition Ch 23Ian Sommerville,  Software Engineering, 9th Edition Ch 23
Ian Sommerville, Software Engineering, 9th Edition Ch 23
 
Ch 4 software engineering
Ch 4 software engineeringCh 4 software engineering
Ch 4 software engineering
 
Ch7
Ch7Ch7
Ch7
 
Ai 01 introduction
Ai 01 introductionAi 01 introduction
Ai 01 introduction
 
Ai 03 solving_problems_by_searching
Ai 03 solving_problems_by_searchingAi 03 solving_problems_by_searching
Ai 03 solving_problems_by_searching
 
Ian Sommerville, Software Engineering, 9th Edition Ch1
Ian Sommerville,  Software Engineering, 9th Edition Ch1Ian Sommerville,  Software Engineering, 9th Edition Ch1
Ian Sommerville, Software Engineering, 9th Edition Ch1
 
Ai 02 intelligent_agents(1)
Ai 02 intelligent_agents(1)Ai 02 intelligent_agents(1)
Ai 02 intelligent_agents(1)
 

Similar to Ch19 network layer-logical add

Subnet Masking in Computer Network--CST 2nd year by Tanushree Bhadra
Subnet Masking in Computer Network--CST 2nd year by Tanushree BhadraSubnet Masking in Computer Network--CST 2nd year by Tanushree Bhadra
Subnet Masking in Computer Network--CST 2nd year by Tanushree BhadraSovonesh Pal
 
20CS2007 Computer Communication Networks
20CS2007 Computer Communication Networks 20CS2007 Computer Communication Networks
20CS2007 Computer Communication Networks Kathirvel Ayyaswamy
 
Forouzan-ch19-Network-Layer-Logical-Addressing.ppt
Forouzan-ch19-Network-Layer-Logical-Addressing.pptForouzan-ch19-Network-Layer-Logical-Addressing.ppt
Forouzan-ch19-Network-Layer-Logical-Addressing.pptJayaprasanna4
 
4a logical laddressing
4a logical laddressing4a logical laddressing
4a logical laddressingkavish dani
 
class 10_internetworking.ppt
class 10_internetworking.pptclass 10_internetworking.ppt
class 10_internetworking.pptprashant554034
 
Network_layer_addressing.pptx
Network_layer_addressing.pptxNetwork_layer_addressing.pptx
Network_layer_addressing.pptxlaiba29012
 
ccn-modummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmle 3.ppt
ccn-modummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmle 3.pptccn-modummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmle 3.ppt
ccn-modummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmle 3.pptsmanjunarayana
 
ETT 05203 Lecture 5 IP addressing.ppt
ETT 05203 Lecture 5 IP addressing.pptETT 05203 Lecture 5 IP addressing.ppt
ETT 05203 Lecture 5 IP addressing.pptListonKiwoli1
 
Subnetting in network layer in computer networks
Subnetting in network layer in computer networksSubnetting in network layer in computer networks
Subnetting in network layer in computer networkskarthiktyagi2
 
Chapter04 ip addressing networking
Chapter04 ip addressing networkingChapter04 ip addressing networking
Chapter04 ip addressing networkingAinuddin Yousufzai
 

Similar to Ch19 network layer-logical add (20)

Ch19
Ch19Ch19
Ch19
 
ch19 (1).ppt
ch19 (1).pptch19 (1).ppt
ch19 (1).ppt
 
ch19new.ppt
ch19new.pptch19new.ppt
ch19new.ppt
 
Chapter 19
Chapter 19Chapter 19
Chapter 19
 
Ch19
Ch19Ch19
Ch19
 
Subnet Masking in Computer Network--CST 2nd year by Tanushree Bhadra
Subnet Masking in Computer Network--CST 2nd year by Tanushree BhadraSubnet Masking in Computer Network--CST 2nd year by Tanushree Bhadra
Subnet Masking in Computer Network--CST 2nd year by Tanushree Bhadra
 
20CS2007 Computer Communication Networks
20CS2007 Computer Communication Networks 20CS2007 Computer Communication Networks
20CS2007 Computer Communication Networks
 
Forouzan-ch19-Network-Layer-Logical-Addressing.ppt
Forouzan-ch19-Network-Layer-Logical-Addressing.pptForouzan-ch19-Network-Layer-Logical-Addressing.ppt
Forouzan-ch19-Network-Layer-Logical-Addressing.ppt
 
4a logical laddressing
4a logical laddressing4a logical laddressing
4a logical laddressing
 
Ch 19
Ch 19Ch 19
Ch 19
 
class 10_internetworking.ppt
class 10_internetworking.pptclass 10_internetworking.ppt
class 10_internetworking.ppt
 
Network_layer_addressing.pptx
Network_layer_addressing.pptxNetwork_layer_addressing.pptx
Network_layer_addressing.pptx
 
20CS2008 Computer Networks
20CS2008 Computer Networks 20CS2008 Computer Networks
20CS2008 Computer Networks
 
CN Unit 3
CN Unit 3 CN Unit 3
CN Unit 3
 
chapter 6.pptx
chapter 6.pptxchapter 6.pptx
chapter 6.pptx
 
ccn-modummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmle 3.ppt
ccn-modummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmle 3.pptccn-modummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmle 3.ppt
ccn-modummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmle 3.ppt
 
Ch7 IP addressing.pptx
Ch7 IP addressing.pptxCh7 IP addressing.pptx
Ch7 IP addressing.pptx
 
ETT 05203 Lecture 5 IP addressing.ppt
ETT 05203 Lecture 5 IP addressing.pptETT 05203 Lecture 5 IP addressing.ppt
ETT 05203 Lecture 5 IP addressing.ppt
 
Subnetting in network layer in computer networks
Subnetting in network layer in computer networksSubnetting in network layer in computer networks
Subnetting in network layer in computer networks
 
Chapter04 ip addressing networking
Chapter04 ip addressing networkingChapter04 ip addressing networking
Chapter04 ip addressing networking
 

More from Mohammed Romi

Ian Sommerville, Software Engineering, 9th Edition Ch 4
Ian Sommerville,  Software Engineering, 9th Edition Ch 4Ian Sommerville,  Software Engineering, 9th Edition Ch 4
Ian Sommerville, Software Engineering, 9th Edition Ch 4Mohammed Romi
 
Ian Sommerville, Software Engineering, 9th Edition Ch2
Ian Sommerville,  Software Engineering, 9th Edition Ch2Ian Sommerville,  Software Engineering, 9th Edition Ch2
Ian Sommerville, Software Engineering, 9th Edition Ch2Mohammed Romi
 
Ian Sommerville, Software Engineering, 9th EditionCh 8
Ian Sommerville,  Software Engineering, 9th EditionCh 8Ian Sommerville,  Software Engineering, 9th EditionCh 8
Ian Sommerville, Software Engineering, 9th EditionCh 8Mohammed Romi
 

More from Mohammed Romi (7)

Swiching
SwichingSwiching
Swiching
 
Ir 02
Ir   02Ir   02
Ir 02
 
Ir 01
Ir   01Ir   01
Ir 01
 
Ian Sommerville, Software Engineering, 9th Edition Ch 4
Ian Sommerville,  Software Engineering, 9th Edition Ch 4Ian Sommerville,  Software Engineering, 9th Edition Ch 4
Ian Sommerville, Software Engineering, 9th Edition Ch 4
 
Ian Sommerville, Software Engineering, 9th Edition Ch2
Ian Sommerville,  Software Engineering, 9th Edition Ch2Ian Sommerville,  Software Engineering, 9th Edition Ch2
Ian Sommerville, Software Engineering, 9th Edition Ch2
 
Ian Sommerville, Software Engineering, 9th EditionCh 8
Ian Sommerville,  Software Engineering, 9th EditionCh 8Ian Sommerville,  Software Engineering, 9th EditionCh 8
Ian Sommerville, Software Engineering, 9th EditionCh 8
 
Ch 6
Ch 6Ch 6
Ch 6
 

Recently uploaded

Kolkata Call Girl Airport Kolkata 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Airport Kolkata 👉 8250192130 ❣️💯 Available With Room 24×7Kolkata Call Girl Airport Kolkata 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Airport Kolkata 👉 8250192130 ❣️💯 Available With Room 24×7Riya Pathan
 
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...ritikasharma
 
↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...
↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...
↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...noor ahmed
 
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near MeBook Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Meanamikaraghav4
 
Private Call Girls Durgapur - 8250192130 Escorts Service with Real Photos and...
Private Call Girls Durgapur - 8250192130 Escorts Service with Real Photos and...Private Call Girls Durgapur - 8250192130 Escorts Service with Real Photos and...
Private Call Girls Durgapur - 8250192130 Escorts Service with Real Photos and...Riya Pathan
 
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...Riya Pathan
 
Call Girls Jodhpur Park - [ Cash on Delivery ] Contact 8250192130 Escorts Ser...
Call Girls Jodhpur Park - [ Cash on Delivery ] Contact 8250192130 Escorts Ser...Call Girls Jodhpur Park - [ Cash on Delivery ] Contact 8250192130 Escorts Ser...
Call Girls Jodhpur Park - [ Cash on Delivery ] Contact 8250192130 Escorts Ser...Riya Pathan
 
Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...
Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...
Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...noor ahmed
 
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment BookingCall Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Bookingnoor ahmed
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448ont65320
 
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...noor ahmed
 
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
VIP Call Girl Kolhapur Aashi 8250192130 Independent Escort Service Kolhapur
VIP Call Girl Kolhapur Aashi 8250192130 Independent Escort Service KolhapurVIP Call Girl Kolhapur Aashi 8250192130 Independent Escort Service Kolhapur
VIP Call Girl Kolhapur Aashi 8250192130 Independent Escort Service KolhapurRiya Pathan
 
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...noor ahmed
 
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Low Rate Call Girls Gulbarga Anika 8250192130 Independent Escort Service Gulb...
Low Rate Call Girls Gulbarga Anika 8250192130 Independent Escort Service Gulb...Low Rate Call Girls Gulbarga Anika 8250192130 Independent Escort Service Gulb...
Low Rate Call Girls Gulbarga Anika 8250192130 Independent Escort Service Gulb...Riya Pathan
 
Call Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service NashikCall Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Beyond Bar & Club Udaipur CaLL GiRLS 09602870969
Beyond Bar & Club Udaipur CaLL GiRLS 09602870969Beyond Bar & Club Udaipur CaLL GiRLS 09602870969
Beyond Bar & Club Udaipur CaLL GiRLS 09602870969Apsara Of India
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...aamir
 

Recently uploaded (20)

Kolkata Call Girl Airport Kolkata 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Airport Kolkata 👉 8250192130 ❣️💯 Available With Room 24×7Kolkata Call Girl Airport Kolkata 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Airport Kolkata 👉 8250192130 ❣️💯 Available With Room 24×7
 
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
 
↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...
↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...
↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...
 
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near MeBook Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
 
Private Call Girls Durgapur - 8250192130 Escorts Service with Real Photos and...
Private Call Girls Durgapur - 8250192130 Escorts Service with Real Photos and...Private Call Girls Durgapur - 8250192130 Escorts Service with Real Photos and...
Private Call Girls Durgapur - 8250192130 Escorts Service with Real Photos and...
 
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
Housewife Call Girls Sonagachi - 8250192130 Booking and charges genuine rate ...
 
Call Girls Jodhpur Park - [ Cash on Delivery ] Contact 8250192130 Escorts Ser...
Call Girls Jodhpur Park - [ Cash on Delivery ] Contact 8250192130 Escorts Ser...Call Girls Jodhpur Park - [ Cash on Delivery ] Contact 8250192130 Escorts Ser...
Call Girls Jodhpur Park - [ Cash on Delivery ] Contact 8250192130 Escorts Ser...
 
Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...
Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...
Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...
 
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment BookingCall Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448
 
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
 
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
VIP Call Girl Kolhapur Aashi 8250192130 Independent Escort Service Kolhapur
VIP Call Girl Kolhapur Aashi 8250192130 Independent Escort Service KolhapurVIP Call Girl Kolhapur Aashi 8250192130 Independent Escort Service Kolhapur
VIP Call Girl Kolhapur Aashi 8250192130 Independent Escort Service Kolhapur
 
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
 
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
 
Low Rate Call Girls Gulbarga Anika 8250192130 Independent Escort Service Gulb...
Low Rate Call Girls Gulbarga Anika 8250192130 Independent Escort Service Gulb...Low Rate Call Girls Gulbarga Anika 8250192130 Independent Escort Service Gulb...
Low Rate Call Girls Gulbarga Anika 8250192130 Independent Escort Service Gulb...
 
Call Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service NashikCall Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
 
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goaGoa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
 
Beyond Bar & Club Udaipur CaLL GiRLS 09602870969
Beyond Bar & Club Udaipur CaLL GiRLS 09602870969Beyond Bar & Club Udaipur CaLL GiRLS 09602870969
Beyond Bar & Club Udaipur CaLL GiRLS 09602870969
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
 

Ch19 network layer-logical add

  • 1. 19.1 Chapter 19 Network Layer: Logical Addressing Modified by Allam AbuMwais Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
  • 2. 19.2 Introduction  communication path through the network layer is hop-to-hop. The packet transmitted by the sending computer may pass through several LANs or WANs before reaching the destination computer. For this level of communication, we need a global addressing scheme; we called this logical addressing IP in TCP/IP protocol. The Internet addresses are 32 bits in length; this gives us a maximum of 232 addresses. In this chapter, we will address the IPv4IPv6.
  • 3. 19.3 19-1 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. Address Space Notations Classful Addressing Classless Addressing Network Address Translation (NAT) Topics discussed in this section:
  • 4. 19.4 IPv4 addresses are unique: 1. each address defines one, and only one, connection to the Internet. 2. Two devices on the Internet can never have the same address at the same time. IPv4 addresses are universal: 1. the addressing system must be accepted by any host that wants to be connected to the Internet.
  • 5. 19.5 The IPv4 addresses are unique and universal. Note An IPv4 address is 32 bits long. Note
  • 6. 19.6 The address space of IPv4 is 232 or 4,294,967,296. Note Address Space A protocol such as IPv4 that defines addresses has an address space. An address space is the total number of addresses used by the protocol.
  • 7. 19.7 Figure 19.1 Dotted-decimal notation and binary notation for an IPv4 address Notations There are two prevalent notations to show an IPv4 address: binary notation and dotted-decimal notation.
  • 8. 19.8 Numbering systems are reviewed in Appendix B. Note
  • 9. 19.9 Change the following IPv4 addresses from binary notation to dotted-decimal notation. Example 19.1 Solution We replace each group of 8 bits with its equivalent decimal number (see Appendix B) and add dots for separation.
  • 10. 19.10 Change the following IPv4 addresses from dotted- decimal notation to binary notation. Example 19.2 Solution We replace each decimal number with its binary equivalent (see Appendix B).
  • 11. 19.11 Find the error, if any, in the following IPv4 addresses. Example 19.3 Solution a. There must be no leading zero (045). b. There can be no more than four numbers. c. Each number needs to be less than or equal to 255. d. A mixture of binary notation and dotted-decimal notation is not allowed.
  • 12. 19.12 Classful Addressing The concept of classes. This architecture is called classful addressing. We can find the class of an address when given the address in binary notation or dotted-decimal notation.
  • 13. 19.13 In classful addressing, the address space is divided into five classes: A, B, C, D, and E. Note
  • 14. 19.14 Figure 19.2 Finding the classes in binary and dotted-decimal notation
  • 15. 19.15 Find the class of each address. a. 00000001 00001011 00001011 11101111 b. 11000001 10000011 00011011 11111111 c. 14.23.120.8 d. 252.5.15.111 Example 19.4 Solution a. The first bit is 0. This is a class A address. b. The first 2 bits are 1; the third bit is 0. This is a class C address. c. The first byte is 14; the class is A. d. The first byte is 252; the class is E.
  • 16. 19.16 One problem with classful addressing is that each class is divided into a fixed number of blocks with each block having a fixed size as shown in Table. Classes and Blocks Table 19.1 Number of blocks and block size in classful IPv4 addressing
  • 17. 19.17 In classful addressing, a large part of the available addresses were wasted. Note
  • 18. 19.18 Netid and Hostid IP address in class A, B, or C is divided into netid and hostid. These parts are of varying lengths, depending on the class of the address. Table 19.2 Default masks for classful addressing
  • 19. 19.19 Mask Although the length of the netid and hostid (in bits) is predetermined in classful addressing, we can also use a mask (also called the default mask), a 32-bit . Table 19.2 Default masks for classful addressing
  • 20. 19.20 Subnetting During the era of classful addressing, subnetting was introduced. 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)
  • 21. 19.21 Supernetting  …class A and class B addresses were depleted. There was still a huge demand for midsize blocks. The size of a class C block with a maximum number of 256 addresses did not satisfy the needs of most organizations. Even a midsize organization needed more addresses. One solution was super-netting. Several networks are combined to create a supernetwork or a supemet.
  • 22. 19.22 Classless Addressing To overcome address depletion and give more organizations access to the Internet, classless addressing was designed and implemented. In this scheme, there are no classes, but the addresses are still granted in blocks. Restriction 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 (1, 2, 4, 8, . 3. The first address must be evenly divisible by the number of addresses.
  • 23. 19.23 Classful addressing, which is almost obsolete, is replaced with classless addressing. Note
  • 24. 19.24 Figure 19.3 shows a block of addresses, in both binary and dotted-decimal notation, granted to a small business that needs 16 addresses. We can see that the restrictions are applied to this block. The addresses are contiguous. The number of addresses is a power of 2 (16 = 24), and the first address is divisible by 16. The first address, when converted to a decimal number, is 3,440,387,360, which when divided by 16 results in 215,024,210. Example 19.5
  • 25. 19.25 Figure 19.3 A block of 16 addresses granted to a small organization
  • 26. 19.26 In IPv4 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. Note
  • 27. 19.27 The first address in the block can be found by setting the rightmost 32 − n bits to 0s. Note
  • 28. 19.28 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 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, we get 11001101 00010000 00100101 0010000 or 205.16.37.32. This is actually the block shown in Figure 19.3. Example 19.6
  • 29. 19.29 The last address in the block can be found by setting the rightmost 32 − n bits to 1s. Note
  • 30. 19.30 Find the last address for the block in Example 19.6. Solution 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 This is actually the block shown in Figure 19.3. Example 19.7
  • 31. 19.31 The number of addresses in the block can be found by using the formula 232−n. Note
  • 32. 19.32 Find the number of addresses in Example 19.6. Example 19.8 Solution The value of n is 28, which means that number of addresses is 2 32−28 or 16.
  • 33. 19.33 Another way to find the first address, the last address, and the number of addresses is to represent the mask as a 32-bit binary (or 8-digit hexadecimal) number. This is particularly useful when we are writing a program to find these pieces of information. In Example 19.5 the /28 can be represented as 11111111 11111111 11111111 11110000 (twenty-eight 1s and four 0s). Find a. The first address b. The last address c. The number of addresses. Example 19.9
  • 34. 19.34 Solution a. The first address can be found by ANDing the given addresses with the mask. ANDing here is done bit by bit. The result of ANDing 2 bits is 1 if both bits are 1s; the result is 0 otherwise. Example 19.9 (continued)
  • 35. 19.35 b. The last address can be found by ORing the given addresses with the complement of the mask. ORing here is done bit by bit. The result of ORing 2 bits is 0 if both bits are 0s; the result is 1 otherwise. The complement of a number is found by changing each 1 to 0 and each 0 to 1. Example 19.9 (continued)
  • 36. 19.36 c. The number of addresses can be found by complementing the mask, interpreting it as a decimal number, and adding 1 to it. Example 19.9 (continued)
  • 37. 19.37 Figure 19.4 A network configuration for the block 205.16.37.32/28
  • 38. 19.38 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. Note
  • 39. 19.39 Figure 19.5 Hierarchy in a telephone network in North America Hierarchy
  • 40. 19.40 Figure 19.6 Two levels ofhierarchy in an IPv4 address The n leftmost bits of the address x.y.z.tJn define the network (organization network); the 32 – n rightmost bits define the particular host (computer or router) to the network.
  • 41. 19.41 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. Note
  • 42. 19.42 Figure 19.8 Three-level hierarchy in an IPv4 address An organization that is granted a large block of addresses may want to create clusters of networks (called subnets) and divide the addresses between the different subnets. As an example, suppose an organization is given the block 17.12.40.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.
  • 43. 19.43 Figure 19.7 Configuration and addresses in a subnetted network 1. Suppose the mask for the first subnet is n1, then 232- n1 must be 32, which means that n1 =27. 2. Suppose the mask for the second subnet is n2, then 232- n2 must be 16, which means that n2 = 28. 3. Suppose the mask for the third subnet is n3, then 232- n3 must be 16, which means that n3 =28.
  • 44. 19.44 An ISP is granted a block of addresses starting with 190.100.0.0/16 (65,536 addresses). The ISP needs to distribute these addresses to three groups of customers as follows: a. The first group has 64 customers; each needs 256 addresses. b. The second group has 128 customers; each needs 128 addresses. c. The third group has 128 customers; each needs 64 addresses. Design the subblocks and find out how many addresses are still available after these allocations. Example 19.10
  • 45. 19.45 Solution Figure 19.9 shows the situation. Example 19.10 (continued) Group 1 For this group, each customer needs 256 addresses. This means that 8 (log2 256) bits are needed to define each host. The prefix length is then 32 − 8 = 24. The addresses are
  • 46. 19.46 Example 19.10 (continued) Group 2 For this group, each customer needs 128 addresses. This means that 7 (log2 128) bits are needed to define each host. The prefix length is then 32 − 7 = 25. The addresses are
  • 47. 19.47 Example 19.10 (continued) Group 3 For this group, each customer needs 64 addresses. This means that 6 (log264) bits are needed to each host. The prefix length is then 32 − 6 = 26. The addresses are Number of granted addresses to the ISP: 65,536 Number of allocated addresses by the ISP: 40,960 Number of available addresses: 24,576
  • 48. 19.48 Figure 19.9 An example of address allocation and distribution by an ISP
  • 49. 19.49 Network Address Translation (NAT) The number of home users and small businesses that want to use the Internet is ever increasing. many have created small networks with several hosts and need an IP address for each host. With the shortage of addresses, this is a serious problem. A network address translation (NAT) is quick solution to this problem. NAT enables a user to have a large set of addresses internally and one address, or a small set of addresses, externally.
  • 50. 19.50 Table 19.3 Addresses for private networks Everyone knows that these reserved addresses are for private networks. They are unique inside the organization, but they are not unique globally.
  • 51. 19.51 Figure 19.10 A NAT implementation The private network is transparent to the rest of the Internet; the rest of the Internet sees only the NAT router with the address 200.24.5.8.
  • 52. 19.52 Address Translation Figure 19.11 Addresses in a NAT All the outgoing packets go through the NAT router, which replaces the source address in the packet with the global NAT address.  All incoming packets also pass through the NAT router, which replaces the destination address in the packet with the appropriate private address
  • 53. 19.53 Figure 19.12 NAT address translation Translation Table How does the NAT router know the destination address for a packet coming from the Internet? There may be tens or hundreds of private IP The problem is solved if the NAT router has a translation table.
  • 54. 19.54 Table 19.4 Five-column translation table
  • 55. 19.55 Figure 19.13 An ISP and NAT
  • 56. 19.56 19-2 IPv6 ADDRESSES Despite all short-term solutions, address depletion is still a long-term problem for the Internet. This and other problems in the IP protocol itself have been the motivation for IPv6. Structure Address Space Topics discussed in this section:
  • 57. 19.57 An IPv6 address is 128 bits long. Note
  • 58. 19.58 Figure 19.14 IPv6 address in binary and hexadecimal colon notation
  • 60. 19.60 Expand the address 0:15::1:12:1213 to its original. Example 19.11 Solution We first need to align the left side of the double colon to the left of the original pattern and the right side of the double colon to the right of the original pattern to find how many 0s we need to replace the double colon. This means that the original address is.
  • 61. 19.61 Table 19.5 Type prefixes for IPv6 addresses Address Space The designers of IPv6 divided the address into several categories. A few leftmost bits, called the type prefix.
  • 62. 19.62 Table 19.5 Type prefixes for IPv6 addresses (continued)
  • 63. 19.63 Figure 19.16 Prefixes for provider-based unicast address Unicast Addresses A unicast address defines a single computer. The packet sent to a unicast address must be delivered to that specific computer.  With two type geographically based and provider-based.
  • 64. 19.64 Figure 19.16 Prefixes for provider-based unicast address Unicast Addresses Type identifier. This 3-bit field defines the address as a provider-base.d address.  Registry identifier. This 5-bit field indicates the agency that has registered the address. Currently three registry centers have been defined. Provider identifier. This variable-length field identifies the provider for Internet access (such as an ISP). 16 bit
  • 65. 19.65 Figure 19.17 Multicast address in IPv6 Multicast Addresses---Anycaste Multicast addresses are used to define a group of hosts instead of just one.
  • 66. 19.66 Figure 19.18 Reserved addresses in IPv6
  • 67. 19.67 Figure 19.19 Local addresses in IPv6 These addresses are used when an organization wants to use IPv6 protocol without being connected to the global Internet. A link local address is used in an isolated subnet; a site local address is used in an isolated site with several subnets.