#Network Layer
#Network Layer
addressing scheme.
Tunneling
If they are two geographically separate networks, which want to communicate with
each other, they may deploy a dedicated line between or they have to pass their
data through intermediate networks.
Tunneling is a mechanism by which two or more same networks communicate with
each other, by passing intermediate networking complexities. Tunneling is
configured at both ends.
When the data enters from one end of Tunnel, it is tagged. This tagged data is then
routed inside the intermediate or transit network to reach the other end of Tunnel.
When data exists the Tunnel its tag is removed and delivered to the other part of the
network.
Both ends seem as if they are directly connected and tagging makes data travel
through transit network without any modifications.
Packet Fragmentation
A data packet can have more or less packet length depending upon
the application. Devices in the transit path also have their hardware
and software capabilities which tell what amount of data that device
can handle and what size of packet it can process.
If the packet is larger, it is broken into smaller pieces and then
forwarded. This is called packet fragmentation. Each fragment
contains the same destination and source address and routed through
transit path easily. At the receiving end it is assembled again.
If a packet with DF (don’t fragment) bit set to 1 comes to a router
which can not handle the packet because of its length, the packet is
dropped.
When a packet is received by a router has its MF (more fragments)
bit set to 1, the router then knows that it is a fragmented packet and
parts of the original packet is on the way.
Network Addressing
Network Addressing is one of the major responsibilities of the network layer.
A host is also known as end system that has one link to the network. The
boundary between the host and link is known as an interface. Therefore, the
host can have only one interface.
A router is different from the host in that it has two or more links that connect
to it. When a router forwards the datagram, then it forwards the packet to one
of the links.
The boundary between the router and link is known as an interface, and the
router can have multiple interfaces, one for each of its links. Each interface is
capable of sending and receiving the IP packets, so IP requires each interface
to have an address.
Each IP address is 32 bits long, and they are represented in the form of
"dot-decimal notation" where each byte is written in the decimal form, and
they are separated by the period.
In the above figure, a router has three interfaces labeled as 1, 2 & 3 and
each router interface contains its own IP address.
Each host contains its own interface and IP address.
All the interfaces attached to the LAN 1 is having an IP address in the form
of 223.1.1.xxx, and the interfaces attached to the LAN 2 and LAN 3 have
an IP address in the form of 223.1.2.xxx and 223.1.3.xxx respectively.
Class-full Addressing
An IP address is divided into sub-classes:
Class A
Class B
Class C
Class D
Class E
Rules for assigning Host ID
The Host ID is used to determine the host within any
network. The Host ID is assigned based on the following
rules:
The Host ID must be unique within any network.
The Network ID in which all the bits are set to 0 cannot be assigned as
it is used to specify a particular host on the local network.
The Network ID in which all the bits are set to 1 cannot be assigned as
it is reserved for the multicast address.
An IP address is divided into two parts:
Network ID: It represents the number of networks.
Host ID: It represents the number of hosts.
the first bit in higher order bits of the first octet is always set
to 0 and the remaining 7 bits determine the network ID. The
24 bits determine the host ID in any network.
Class B
In Class B, an IP address is assigned to those networks that
range from small sized to large-sized networks.
The Network ID is 16 bits long.
The Host ID is 16 bits long.
In Class B, the higher order bits of the first octet is always set
to 01, and the remaining14 bits determine the network ID. The
other 16 bits determine the Host ID.
Class C
In Class C, an IP address is assigned to only small-sized
networks.
The Network ID is 24 bits long.
The host ID is 8 bits long.
In Class C, the higher order bits of the first octet is always set
to 110, and the remaining 21 bits determine the network ID.
The 8 bits of the host ID determine the host in a network.
What is Sub netting?
the practice of dividing a network into two or smaller
networks. It increases routing efficiency, which helps to
enhance the security of the network and reduces the size of the
broadcast domain.
IP Subnetting designates high-order bits from the host as part
of the network prefix. This method divides a network into
smaller subnets.
It also helps you to reduce the size of the routing tables, which
is stored in routers. This method also helps you to extend the
existing IP address base & restructures the IP address.
Why Use Sub netting?
Here are important reasons for using Sub netting:
IPV4 Sub netting reduces network traffic by eliminating
collision and broadcast traffic and thus improves overall
performance.
Optimized IP network performance & Facilitates spanning
of large geographical distances.
Sub netting process helps to allocate IP addresses that
prevent large numbers of IP network addresses from
remaining unused.
What is Subnet Mask?
A subnet mask is a 32 bits address used to distinguish between
a network address and a host address in IP address.
A subnet mask identifies which part of an IP address is the
network address and the host address.
They are not shown inside the data packets traversing the
Internet. They carry the destination IP address, which a router
will match with a subnet
What is IP?
IP address as a numeric address assigned to each device on a
network.
An IP address is assigned to each device connected to a
network. Each device uses an IP address for communication.
An IP address is assigned to each device so that the device on a
network can be identified uniquely.
To facilitate the routing of packets, TCP/IP protocol uses a 32-
bit logical address known as IPv4 (Internet Protocol version 4).
There are two types of IP addresses
IPv4
IPv6
What is IPv4?
It is a current version and the most commonly used IP address.
It is a 32-bit address written in four numbers separated by
'dot', i.e., periods. This address is unique for each device.
In today's computer network world, computers do not
understand the IP addresses in the standard numeric format as
the computers understand the numbers in binary form only.
The binary number can be either 1 or 0. The IPv4 consists of
four sets, and these sets represent the octet. The bits in each
octet represent a number.
If the bit the 1, then the number it represents will count, and if
the bit is 0, then the number it represents does not count.
Network Layer Protocols in TCP/IP
Routing
A Routing is a process of selecting path along which the data can be
transferred from source to the destination. Routing is performed by a
special device known as a router
A router is a networking device that forwards the packet based on
the information available in the packet header and forwarding table.
The routing algorithms are used for routing the packets. The routing
algorithm is nothing but a software responsible for deciding the
optimal path through which packet can be transmitted.
The routing protocols use the metric to determine the best path for
the packet delivery. The metric is the standard of measurement such
as hop count, bandwidth, delay, current load on the path, etc. used
by the routing algorithm to determine the optimal path to the
destination.
Types of Routing
Routing can be classified into three categories:
Static Routing
Default Routing
Dynamic Routing
Static Routing
Static Routing is also known as Non adaptive Routing.
It is a technique in which the administrator manually adds the
routes in a routing table.
A Router can send the packets for the destination along the
route defined by the administrator.
In this technique, routing decisions are not made based on the
condition or topology of the networks
Advantages Of Static Routing
No Overhead: It has ho overhead on the CPU usage of the
router. Therefore, the cheaper router can be used to obtain
static routing.
Bandwidth: It has not bandwidth usage between the routers.
Security: It provides security as the system administrator is
allowed only to have control over the routing to a particular
network.