Module 3
Network Layer
DR. JYOTI R MUNAVALLI
PROFESSOR, ECE,BNMIT
Network layer services
Packetizing
Routing and Forwarding
Do not provide direct Error Control (Checksum-header
due to fragmentation )and Flow control
Quality of Services (QoS) –very imp
Security -IPsec
[Link],ECE,BNMIT 2
Switching techniques
A kind of switching occurs at the network layer.
A router is a switch that creates a connection
between an input port and an output port (or a set
of output ports)
Though two types of switching are in use, network
layer uses only Packet switching
[Link],ECE,BNMIT 3
PACKET SWITCHING
Only packet switching is used at the network
layer because the unit of data at this layer is a
packet.
The packet-switched network can use two
different approaches to route the packets
The datagram approach
the virtual circuit approach.
[Link],ECE,BNMIT 4
Datagram Approach: Connectionless Service
[Link],ECE,BNMIT 5
Datagram Approach: Connectionless Service
In the datagram approach, the forwarding decision is based
on the destination address of the packet.
[Link],ECE,BNMIT 6
Virtual-Circuit Approach:
Connection-Oriented Service
packet contain the source and destination addresses + a flow label, a
virtual circuit identifier that defines the virtual path the packet should
follow.
[Link],ECE,BNMIT 7
Forwarding process in a router when used
in a virtual-circuit network
three-phase process is used:
setup Data transfer teardown
[Link],ECE,BNMIT 8
Setup Phase--Request packet
Exchange the request packet and the acknowledgment packet.
[Link],ECE,BNMIT 9
Setup Phase—Acknowledge packet
[Link],ECE,BNMIT
10
Data-Transfer Phase
[Link],ECE,BNMIT 11
Teardown Phase
In the teardown phase, source A, after sending all packets
to B, sends a special packet called a teardown packet.
Destination B responds with a confirmation packet.
All routers delete the corresponding entries from their
tables.
[Link],ECE,BNMIT 12
IPv4 ADDRESSES
Identifying the connection of each device to the
Internet is called the Internet address or IP address.
An IPv4 address is a 32-bit address that uniquely and
universally defines the connection of a host or a router
to the Internet.
The IP address is the address of the connection, not
the host or the router, because if the device is moved to
another network, the IP address may be changed.
If a device has two connections to the Internet, via two
networks, it has two IPv4 addresses.
[Link],ECE,BNMIT 13
Address Space
A protocol like IPv4 that defines addresses has an address
space.
An address space is the total number of addresses used by the
protocol.
If a protocol uses b bits to define an address, the address space
is 2b because each bit can have two different values (0 or 1).
IPv4 uses 32-bit addresses, which means that the address
space is 232 or 4,294,967,296.
If there were no restrictions, more than 4 billion devices could
be connected to the Internet.
[Link],ECE,BNMIT 14
Notation
There are three common notations to show an IPv4 address:
binary notation (base 2):
◦ an IPv4 address is displayed as 32 bits
◦ spaces are usually inserted between each octet /byte(8 bits)
dotted-decimal notation (base 256):
◦ a decimal point (dot) separates the bytes
◦ each number in the dotted-decimal notation is between 0 and 255
hexadecimal notation (base 16):
◦ Each hexadecimal digit is equivalent to four bits.
◦ 32-bit address has 8 hexadecimal digits.
◦ Used in network programming.
[Link],ECE,BNMIT 15
Hierarchy in Addressing
Example postal network, telephone number
A 32-bit IPv4 address is also hierarchical, but divided only into two
parts.
The first part of the address, called the prefix, defines the network;
the second part of the address, called the suffix, defines the node
(connection of a device to the Internet).
The prefix length is n bits and the suffix length is (32 − n) bits.
[Link],ECE,BNMIT 16
Hierarchy in Addressing
A prefix can be fixed length or variable length.
• classful addressing (F)
• classless addressing (V)
[Link],ECE,BNMIT 17
Classful Addressing
fixed-length prefixto accommodate both small
and large networks three fixed-length prefixes
were used (n = 8, n = 16, and n = 24).
The whole address space was divided into five
classes (class A, B, C, D, and E)
[Link],ECE,BNMIT 18
Classful Addressing
In class A, the network address length is 8 bits
the first bit is 0 and defines the class
we can have only seven bits as the network identifier.
i.e., 27 = 128 networks in the world that can have a class A address.
[Link],ECE,BNMIT 19
Classful Addressing
In class B, the network address length is 16 bits
the first two bits (10)2 that define the class,
only 14 bits as the network identifier.
There are 214 = 16,384 networks in the world that can have a class B
address.
[Link],ECE,BNMIT 20
Classful Addressing
All addresses that start with (110)2 belong to class C.
The network length is 24 bits
have only 21 bits as the network identifier.
There are 221 = 2,097,152 networks in the world that can have a class C
address.
[Link],ECE,BNMIT 21
Classful Addressing
Class D is not divided into prefix and suffix. It is used for multicast
addresses.
All addresses that start with 1111 in binary belong to class E. As in
Class D, Class E is not divided into prefix and suffix and is used as
reserve.
[Link],ECE,BNMIT 22
[Link],ECE,BNMIT 23
Address Depletion
class A can be assigned to only 128 organizations in the world,
but each organization needs to have a single network with
16,777,216 nodes.
Which wasted lot of addresses.
[Link],ECE,BNMIT 24
Subnetting and Supernetting
To alleviate address depletion, two strategies were proposed:
subnetting and supernetting.
In subnetting, a class A or class B block is divided into several subnets.
Each subnet has a larger prefix length than the original network.
If a network in class A is divided into four subnets, each subnet has a
prefix of nsub = 10.
At the same time, if all of the addresses in a network are not used,
subnetting allows the addresses to be divided among several
organizations.
0 0
0 1
1 2 3 4 5 6 7 8
1 0
1 1
[Link],ECE,BNMIT 25
Supernetting
Subnetting idea did not work most large organizations
not happy about dividing the block giving some of the
unused addresses smaller organizations.
Supernetting combined several class C blocks into a larger
block to be attractive to organizations that need more than
the 256 addresses available in a class C block.
This idea did not work it makes the routing of packets
more difficult.
[Link],ECE,BNMIT 26
Advantage of Classful
Addressing
classful addressing had several problems and became
obsolete.
Adv: Given an address, we can easily find the class of the
address and, since the prefix length for each class is fixed,
we can find the prefix length immediately.
In other words, the prefix length in classful addressing is
inherent in the address; no extra information is needed to
extract the prefix and the suffix.
[Link],ECE,BNMIT 27