19.1
Chapter 19
Network Layer:
Logical Addressing
Communication at the network layer is host-to-host (computer-to-computer)
Computer somewhere in the world needs to communicate with another computer somewhere else in the world.
Usually, computers communicate through the
Internet. 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 called logical addressing.
Today, we use the term IP address to mean a logical address in the network layer of the TCP/IP protocol suite.
IP Address
An IP address, short for Internet Protocol address,
is an identifying number for a piece of network hardware.
An IP address is a logical address that is assigned
by software residing in a server or router .
Having an IP address allows a device to
communicate with other devices over an IP-based network like the internet.
In order to locate a device in the network,
the logical IP address is converted to a physical address by a function within the TCP/IP protocol software (see ARP).
19.4
19-1 IPv4 ADDRESSES
19-1 IPv4 ADDRESSES
• An IPv4 addressAn IPv4 address is a 32-bit is a 32-bit address that uniquely address that uniquely and universally defines the connection of a device
and universally defines the connection of a device
(for example, a computer or a router) to the
(for example, a computer or a router) to the
Internet.
Internet.
• IPv4 addresses are unique i.e. two devices on the Internet can never have the same address at the same time.
19.5
19.6
The IPv4 addresses are unique and universal.
Address Space
An address space is 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.
19.8
The address space of IPv4 is
232 or 4,294,967,296 (more than 4 billion)..
Notations
There are three notations to show an
IPv4 address:
Binary Notation
Dotted-Decimal Notation
Hexadecimal Notation
Binary Notation
In binary notation, the IPv4 address is
displayed as 32 bits.
Each octet is often referred to as a byte.
IPv4 address is referred as a 32-bit address
or a 4-byte address.
Dotted-Decimal Notation
An IP address is written in "dotted decimal" notation,
which is 4 sets of numbers separated by period (dot) each set representing 8-bit number ranging from (0-255).
19.12
Figure 19.1 Dotted-decimal notation and binary notation for an IPv4 address
Hexadecimal Notation
IPV4 address can be represented in
hexadecimal form also.
A 32 bit address has 8 hexadecimal
digits.
This notation is often used in network
programming
19.14
Change the following IPv4 addresses from binary notation to dotted-decimal notation.
19.15
Solution 19.1
19.16
Change the following IPv4 addresses from dotted-decimal notation to binary notation.
19.17
Solution 19.2
19.18
Find the error, if any, in the following IPv4 addresses.
19.19
Solution 19.3
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.
Classful Addressing
A classful network is a network addressing architecture
used in the Internet from 1981 until the introduction of Classless Inter-Domain Routing in 1993.
The method divides the IP address space for Internet
Protocol version 4 (IPv4) into five address classes.
Classes A, B, and C provide unicast addresses for networks
of three different network sizes. Class D is for multicast networking and the class E address range is reserved for future or experimental purposes.
19.21
In classful addressing, the address space is divided into five classes:
19.22
19.23
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
19.24
Solution 19.4
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.
19.26
IP Address Components:
In classful addressing, an 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.
The IP address is divided into two main parts:
Network Number (Netid) and
Host Number (Hostid)
19.28
• The network number identifies the network and must be assigned
by the Internet Network Information Center (InterNIC) if the network is to be part of the Internet.
• The host number identifies a host in the network and is assigned
19.29
Classful Network Masks:
Each of the commercial address classes has a
set classful network mask.
The network mask defines which bits out of the
32 bit of the address are defined as the network portion and which are the host portion.
The network mask is calculated by setting all bits
to a value of 1 in the octets designated for the network portion and all bits to a value of 0 in the octets designated for the host portion.
19.31
A Class A address has the first octet as the network portion and the remaining
3 octets as the host portion. Therefore, a Class A network mask is defined as
255.0.0.0.
A Class B address has the first and second octets as the network portion and
the third and fourth octets as the host portion. A Class B network mask is
shown as 255.255.0.0.
A Class C address has the first, second, and third octet as the network portion
and the last octet as the host portion. A Class C network mask is shown as
19.32
Examples of Subnet Mask
Let's say a host has the IP address 10.25.65.32.
Using the default subnet mask, the network address would
be 10.0.0.0. The host component of the address would be 25.65.32.
If a host has the IP address 172.20.33.33,
The network portion of the address would be 172.20.0.0. The
host component would be 33.33.
If a host has the IP address 192.168.2.3
the network portion of the address would be 192.168.2.0.
The host component would be 3.
Note 4:
Note 5:
Only those devices which have the network
layer will have IP Address.
So, switches, hubs and repeaters does not
have any IP Address.
Casting in
Networking- Transmitting data (stream of packets) over
the network is termed as casting.
Types of Casting
NOTE
Limited Broadcast Address for any network
= All 32 bits set to 1
= 11111111.11111111.11111111.11111111
= 255.255.255.255
NOTE
Direct Broadcast Address for any network is the IP Address
where-Network ID is the IP Address of the network
where all the destination hosts are present.
Host ID bits are all set to 1.
Examples-
Sending a message to a particular group of people on whatsapp
Sending an email to a particular group of people
Video conference or teleconference
19.52
Classful addressing, which is almost obsolete, is replaced with classless
Subnetting in Networking
In networking,
The process of dividing a single network
into multiple sub networks is called as subnetting.
The sub networks so created are called
as subnets.
Subnet ID
Each subnet has its unique network
address known as its Subnet ID.
The subnet ID is created by borrowing
some bits from the Host ID part of the IP Address.
The number of bits borrowed depends
on the number of subnets created.
Fixed Length Subnetting
Fixed length subnetting also called as classful subnetting divides the network into subnets
where-All the subnets are of same size.
All the subnets have equal number of hosts.
All the subnets have same subnet mask.
Variable Length
Subnetting-Variable length subnetting also called as classless subnetting divides the network into subnets
where-All the subnets are not of same size.
All the subnets do not have equal number of
hosts.
All the subnets do not have same subnet mask.