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

Network Layer-Logical Addressing

The document summarizes network layer logical addressing concepts in IP networking. It describes IPv4 and IPv6 addresses, including IPv4 address notation and classes. IPv4 addresses are divided into network and host identifiers based on address class. Subnetting and classless addressing allow for more flexible allocation of address blocks. Network masks are used to extract the network or subnetwork portion of an IP address.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
148 views

Network Layer-Logical Addressing

The document summarizes network layer logical addressing concepts in IP networking. It describes IPv4 and IPv6 addresses, including IPv4 address notation and classes. IPv4 addresses are divided into network and host identifiers based on address class. Subnetting and classless addressing allow for more flexible allocation of address blocks. Network masks are used to extract the network or subnetwork portion of an IP address.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

CHAPTER 9 – NETWORK LAYER:

LOGICAL ADDRESSING

9.1 Introduction
9.2 IPv4 Addresses
9.3 IPv6 Addresses

8/2/2017 COSC 31014 1


9.1 Introduction

• Network layer  host-to-host delivery


• Computers located in different areas around the world
communicate with each other through the Internet.
• The packet transmitted by the sending computer may
pass through several LANs or WANs before reaching
the destination computer.

Required

Logical Address (IP Address)


The identifier used in the network layer of the Internet
model to identify each device connected to the Internet.
8/2/2017 COSC 31014 2
9.1 Introduction Contd..

IPv4 (IP version 4) addresses

• 32 bits in length.
• Gives a maximum of 232 addresses.

IPv6 (IP version 6) addresses

• Uses 128-bit addresses.


• It gives much greater flexibility in address allocation.

8/2/2017 COSC 31014 3


9.2 IPv4 Addresses Contd..

• These addresses are unique and universal.


• 32 bits long.

9.2.1 Address Space


• The total number of addresses used by the protocol.
• If a protocol uses N bits to define an address, the
address space is 2N because each bit can have two
different values (0 or 1) and N bits can have 2N values
• The address space is 232 or 4,294,967,296.
• This means that, theoretically, if there were no
restrictions, more than 4 billion devices could be
connected to the Internet.
8/2/2017 COSC 31014 4
9.2 IPv4 Addresses Contd..

9.2.2 Notations
Binary Notation

Dotted-Decimal Notation

8/2/2017 COSC 31014 5


9.2 IPv4 Addresses Contd..

Example 1:

Change the following IPv4 addresses from binary notation


to dotted-decimal notation.

a) 10000001 00001011 00001011 11101111


b) 11000001 10000011 00011011 11111111

8/2/2017 COSC 31014 6


9.2 IPv4 Addresses Contd..

Example 2:

Change the following IPv4 addresses from dotted-decimal


notation to binary notation.

a) 129.11.11.239
b) 193.131.27.255

8/2/2017 COSC 31014 7


9.2 IPv4 Addresses Contd..

Example 3:

Find the error, if any, in the following IPv4 addresses.

a) 111.56.045.78
b) 221.34.7.8.20
c) 75.45.301.14
d) 11100010.23.14.67

8/2/2017 COSC 31014 8


9.2 IPv4 Addresses Contd..

9.2.3 Classful Addressing

• The architecture, that using the concept of classes at its


inception, knows as Classful Addressing.
• Address space is divided into five classes (A, B, C, D
and E)
• Each class occupies some part of the address space.

8/2/2017 COSC 31014 9


9.2 IPv4 Addresses Contd..

9.2.3 Classful Addressing Contd..

8/2/2017 COSC 31014 10


9.2 IPv4 Addresses Contd..

Example 4:

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

8/2/2017 COSC 31014 11


9.2 IPv4 Addresses Contd..

9.2.4 Netid and Hostid

• IP address in class A, B or C is divided into netid and


hostid.
• These parts are of varying length, depending on the
class of the address.

Netid – Network Hostid – Host Identification


Identification
8/2/2017 COSC 31014 12
9.2 IPv4 Addresses Contd..

9.2.4 Netid and Hostid Contd..

• The mask helps to find the netid and the hosted.


• The mask for a class A address has eight 1s, which
means the first 8 bits of any address in class A define
the netid; the next 24 bits define the hostid.
• Classless Inter-Domain Routing (CLDR) notaion, also
called as slash notation is used in classless addressing.

8/2/2017 COSC 31014 13


9.2 IPv4 Addresses Contd..

9.2.5 Classes and Blocks

In classful addressing, a large part of the available


addresses were wasted

8/2/2017 COSC 31014 14


9.2 IPv4 Addresses Contd..

9.2.5 Classes and Blocks Contd..

Class A
• Divided into 128 blocks; each block has different netid.
• 1st block  0.0.0.0 to 0.255.255.255 (netid - 0)
2nd block  1.0.0.0 to 1.255.255.255 (netid - 1)
last block  127.0.0.0 to 127.255.255.255 (netid-127)
• For each block of addresses the first byte (netid) is the same, but
the other 3 bytes (hostid) can take any value in the given range.
• 1st address in the block is used to identify the organization to the
rest of the internet. (Network address – defines the network of
the organization, not individual hosts)
• Last address is reserved for a special purpose.

8/2/2017 COSC 31014 15


9.2 IPv4 Addresses Contd..

9.2.5 Classes and Blocks Contd..

Class B
• Divided into 16,384 blocks; each block has different netid.
• 16 blocks are reserved for private addresses, leaving 16,368
blocks for assignment to organizations.
• 1st block  128.0.0.0 to 128.0.255.255 (netid – 128.0)
last block  191.255.0.0 to 191.255.255.255 (netid 191.255)
• First 2 bytes (netid) are same for each block, other 2 bytes
(hostid) can take any value in the given range.

8/2/2017 COSC 31014 16


9.2 IPv4 Addresses Contd..

9.2.5 Classes and Blocks Contd..

Class C
• Divided into 2,097,152 blocks; each block has different netid.
• 256 blocks are reserved for private addresses, leaving 2,096,896
blocks for assignment to organizations.
• 1st block  192.0.0.0 to 192.0.0.255 (netid – 192.0.0)
Last block  223.255.255.0 to 223.255.255.255 (netid –
223.255.255)
• First 3 bytes (netid) for each block is the same, but the remaining
byte (hostid) can take any value in the given range.

8/2/2017 COSC 31014 17


9.2 IPv4 Addresses Contd..

9.2.5 Classes and Blocks Contd..

Class D
• There is just one block of class D addresses.
• It is designed for multicasting.

Class E
• There is just one block of class E addresses.
• It was designed for use as reserved addresses.

In the network address, all hostid bytes are 0s.

8/2/2017 COSC 31014 18


9.2 IPv4 Addresses Contd..

Example 5:

Find the netid, hostid and the network address.


a) 4.23.145.90
b) 227.34.78.7
c) 246.7.3.8
d) 129.6.8.4
e) 198.76.9.23

8/2/2017 COSC 31014 19


9.2 IPv4 Addresses Contd..

9.2.6 Classless Addressing

• Classful addressing, which is almost obsolete, is


replaced with classless addressing.
• There are no classes, but the addresses are still granted
in blocks.
• The size of the block (number of addresses) varies
based on the nature and size of the entity.

8/2/2017 COSC 31014 20


9.2 IPv4 Addresses Contd..

9.2.7 Subnetting

• 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 (subnets).
• Such a division of a network into subnetworks is called
subnetting.
• Each subnetwork is assigned a subnet number.
• The Hostid portion of the Internet address is partitioned
into a subnet number (Subnetid) and a host number
(Hostid).
8/2/2017 COSC 31014 21
9.2 IPv4 Addresses Contd..

9.2.8 Masking

• Masking is a process that extracts the address of the


physical network from an IP address.
• Masking can be done whether we have subnetting or
not.
• If we have not subnetted the network, masking extracts
the network address from an IP address.
• If we have subnetted, masking extracts the subnetwork
address from an IP address.

8/2/2017 COSC 31014 22


9.2 IPv4 Addresses Contd..

9.2.8.1 Masks without subnetting

• To be compatible, router use a mask even if there is no


subnetting.
Class Mask Address (Ex:) Network Address
(Ex:)
A 255.0.0.0 15.32.56.7 15.0.0.0
B 255.255.0.0 135.67.13.9 135.67.0.0
C 255.255.255.0 201.34.12.72 201.34.12.0
D N/A N/A N/A
E N/A N/A N/A

8/2/2017 COSC 31014 23


9.2 IPv4 Addresses Contd..

9.2.8.2 Masks with subnetting

• When there’s subnetting, the mask can vary.

Class Mask Address (Ex:) Subnetwork


Address (Ex:)
A 255.0.0.0 15.32.56.7 15.0.0.0
B 255.255.0.0 135.67.13.9 135.67.0.0
C 255.255.255.192 201.34.12.72 201.34.12.64
D N/A N/A N/A
E N/A N/A N/A

8/2/2017 COSC 31014 24


9.2 IPv4 Addresses Contd..

9.2.9 Finding the Subnetwork Address

• To find the subnetwork address, apply the mask to the


IP address.

9.2.9.1 Boundary-Level Masking


• If the masking is at the boundary level (mask numbers
are either 255 or 0), follow the 2 rules:
1. The bytes in the IP address that correspond to 255
in the mask will be repeated in the subnetwork
address.

8/2/2017 COSC 31014 25


9.2 IPv4 Addresses Contd..

9.2.9.1 Boundary-Level Masking Contd..


2. The bytes in the IP address that correspond to 0
in the mask will change to 0 in the subnetwork
address.

Example 6:
IP address 45 23 21 8
Mask 255 255 0 0

Subnetwork 45 23 0 0
address

8/2/2017 COSC 31014 26


9.2 IPv4 Addresses Contd..

Example 7:

Find the subnetwork address from the IP address


173.23.21.8. Mask is 255.255.255.0

8/2/2017 COSC 31014 27


9.2 IPv4 Addresses Contd..

9.2.9.2 Nonboundary-Level Masking


• If the masking is not at the boundary level, finding the
subnetwork address involves using the bit-wise AND
operator and follow the following rules.
1. The bytes in the IP address that correspond to 255
in the mask will be repeated in the subnetwork
address.
2. The bytes in the IP address that correspond to 0 in
the mask will change to 0 in the subnetwork
address.
3. For other bytes, use the bit-wise AND operator.

8/2/2017 COSC 31014 28


9.2 IPv4 Addresses Contd..

Example 8:

IP address 45 123 21 8

Mask 255 192 0 0

Subnetwork 45 64 0 0
address

8/2/2017 COSC 31014 29


9.2 IPv4 Addresses Contd..

Example 9:

Find the subnetwork address from the IP address


213.23.47.37. Mask is 255.255.255.240.

Note: y bits

Netid Subnetid Hostid


x bits z bits (y-z) bits

Number of subnetworks = 2z
Number of hosts in a subnetwork = 2(y-z) - 2
8/2/2017 COSC 31014 30
9.2 IPv4 Addresses Contd..

9.2.10 Local, Global and Private Addresses

• An IP address must be assigned to each end system or


inter-connection equipment that uses the TCP/IP
protocols.
• 3 types of addresses are used for hosts:
1. Local
2. Global
3. Private

8/2/2017 COSC 31014 31


9.2 IPv4 Addresses Contd..

9.2.10.1 Local Addresses

• Within an isolated network (no connections to the


Internet), can assign IP address at random as long as
each one is unique.
• These addresses are called as Local Addresses and are
defined by the user.
• Can freely choose one of the classes (A, B or C)
according to the number of end systems(hosts).

8/2/2017 COSC 31014 32


9.2 IPv4 Addresses Contd..

9.2.10.2 Global Addresses

• When connecting a private network to the Internet


requires using registered IP addresses, called Internet
addresses, to avoid duplicates.
• Can be obtained from the local Internet Service
Provider (ISP) (Ex: SLT)
• Currently only class C addresses are available for this
purpose.

8/2/2017 COSC 31014 33


9.2 IPv4 Addresses Contd..

9.2.10.3 Private Addresses

• Network Address Translation (NAT), an internet


standard that enables a LAN to use one set of IP
addresses for internal traffic and one address or a small
second set of addresses for external traffic.
• The IP addresses used for internal traffic are called
Private Address.
• They are unique inside the organization, but they are
not unique globally.
• No router will forward a packet that has one of these
addresses as the destination address.
8/2/2017 COSC 31014 34
9.2 IPv4 Addresses Contd..

9.2.10.3 Private Addresses Contd..

Addresses for Private Networks

8/2/2017 COSC 31014 35


9.3 IPv6 Addresses

Advantages of IPv6 over IPv4

• Larger address space: AN IPv6 is 128 bits long.


Compared with the 32-bit address of IPv4, this is a
four-fold increase in the address space.
• Better header format: IPv6 uses a new header format in
which options are separated from the base header and
inserted, when needed, between the base header and the
upper-layer data. This simplifies and speeds up the
routing process because most of the options do not
need to be checked by routers.

8/2/2017 COSC 31014 36


9.3 IPv6 Addresses

Advantages of IPv6 over IPv4 Contd..

• New options: IPv6 has new options to allow for


additional functionalities.
• Allowance for extension: IPv6 is designed to allow the
extension of the protocol if required by the new
technologies or applications.
• Support for resource allocation: In IPv6, the type-of-
service field has been removed, but a mechanism
(called flow label) has been added to enable the source
to request special handling of the packet.

8/2/2017 COSC 31014 37


9.3 IPv6 Addresses

Advantages of IPv6 over IPv4 Contd..

• Support for more security: The encryption and


authentication options in IPv6 provide confidentiality
and integrity of the packet.

8/2/2017 COSC 31014 38


9.3 IPv6 Addresses

Abbreviated Addresses

8/2/2017 COSC 31014 39

You might also like