You are on page 1of 14

Computer Network

Unit-3
Network Layer
Point to point networks:
Point-to-point is a form of network providing a direct route from one fixed point to another.
In this type of communication, there exists a dedicated link between two nodes. In this point to
point communication, there is one transmitter and one receiver which collectively refers to this
type of communication system.
In this type of system, the smallest distance has utmost importance to reach the receiver
terminal. Here, the communication gives security and privacy to the transmitted signal because
the channel of communication is not shared.
An example is a telephone call, in which one telephone is connected to another, and only the
other can hear what is said by one caller. This is contrasted with a topology of point-to -
multipoint or communication broadcast, in which many nodes can receive information
transmitted by one node. Many examples of point-to - point communications networks include
leased wires, microwave relay links and two-way radio. Radio and television broadcasting are
examples of point to multipoint communication systems.
The Point to Point Protocol (PPP) is used to create direct communication between two nodes in
the network. It authenticates the connections, compresses them and transmits them after
encryption, thus giving privacy. PPP is designed primarily to link two networks and to carry IP
packets between the two. The connections are able to have bidirectional functions
simultaneously, transmitting data packets in a particular order. This protocol is a growing
solution for connecting various types of hosts, bridges, and routers with ease.
Note: A point-to-point link is a dedicated communication connection between two systems or
processes. Only think of a wire that links two devices directly. The devices solely use the wire
for contact. Broadcasting is the opposite of point-to - point communication, where one device
transmits to many.

Network Layer:
• Network layer is responsible for host to host delivery and for routing mechanism.
• It adds a logical address that is source and destination address as a part of IP header to the
segment coming from above Transport Layer.
Logical Addressing:
The logical addresses added by Network layer are known as IP address, it can be either IPv4 or
IPv6.
IPv4 Addresses:
An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a
device. These addresses are unique in the sense that each address defines one, and only one,
connection to the internet.
Address Space:

It defines the range of addresses used by the protocol. Each networking devices will get a
address from this address space.

Since IPv4 address is a 32 bit in size, hence the total number of address possible is: 232 =
4,294,967,296. This means theoretically 4 billion devices can be connected to internet, but
practically this number is way less because of some restrictions.

Representation of IP address: An IP address can be represented in two format:


Dotted-Decimal Notation:

In this format, an IP address is represented as 4 octet, each octet of 8 bits(1 bytes) and are
separated with a decimal point(dot).

Example:

192.168.0.1

Binary Notation:

In this IP address is represented as 32 bits.

Example:

Dotted decimal : 192. 168.0.1

Binary Notation: 1110101 10101000 00000000 00000001

Classful Addressing:
• Classful Addressing, the address space is divided into five classes: A, B, C, D and E. Each class
has has some part of the address space.
• Class A, B, C are mostly used for unicast communication where as class D is for multicast
communication and class E is reserved.
Range of each class of IP address:

Range of each class is depicted in the below diagram:


Host ID and Network ID: In classful addressing, IP address can be divided into two portion, one
is called Host ID, which identifies the host in the network and other is called network Id which
identifies the network.

Subnet Mask:

It is also 32 bit address which is used to distinguish the host part and network part of an IP
address.

In classful addressing each class has a default subnet mask:


Class A: 255.0.0.0

Class B: 255.255.0.0

Class C: 255.255.255.0

Class D: 255.255.255.255

Example1: If a class B network on the Internet has a subnet mask of 255.255.248.0, what is the
maximum number of hosts per subnet?

Solution:

255.255.248.0 = 11111111.11111111.11111000.00000000

Since 11 bit(number of 0) as a host id given, then number of IP Address are available =211

But 2 bits (first and last bit ) can not be used

Then Finally number of host per subnet = 29 =2046

Note: if it is asked about the number of subnet?

We can find

The number of subnet= 2n where n= 5( Number of 1 is subnet id)

=25 =32 subnets are possible

Basic internetworking (IP, CIDR, ARP, RARP, DHCP, ICMP):


Internetworking is a collection of individual networks, connected by intermediate networking
devices, that functions as a single large network.It refers to the industry, products, and
procedures that meet the challenge of creating and administering internetworks.
Internetworking is the practice of interconnecting multiple computer networks, such that any
pair of hosts in the connected networks can exchange messages irrespective of their hardware-
level networking technology.
Challenges faced by internetworking are:

• Connectivity
• Reliability
• Network Management
• Flexibility
Protocols present in Internetworking:

• IP(Internet Protocol)
The Internet Protocol (IP) is a protocol, or set of rules, for routing and addressing packets of
data so that they can travel across networks and arrive at the correct destination. Data
traversing the Internet is divided into smaller pieces, called packets. IP information is attached
to each packet, and this information helps routers to send packets to the right place. Every
device or domain that connects to the Internet is assigned an IP address, and as packets are
directed to the IP address attached to them, data arrives where it is needed.
Working of IP:
An IP address is a unique identifier assigned to a device or domain that connects to the
Internet. Each IP address is a series of characters, such as '192.168.1.1'. Via DNS resolvers,
which translate human-readable domain names into IP addresses, users are able to access
websites without memorizing this complex series of characters. Each IP packet will contain both
the IP address of the device or domain sending the packet and the IP address of the intended
recipient, much like how both the destination address and the return address are included on a
piece of mail.

• CIDR(ClassLess Inter-Domain Routing)


CIDR, which stands for Classless Inter-Domain Routing, is an IP addressing scheme that
improves the allocation of IP addresses. It replaces the old system based on classes A, B, and C.
This scheme also helped greatly extend the life of IPv4 as well as slow the growth of routing
tables.
Working of CIDR:
CIDR is based on variable-length subnet masking (VLSM). This allows it to define prefixes of
arbitrary lengths making it much more efficient than the old system. CIDR IP addresses are
composed of two sets of numbers. The network address is written as a prefix, like you would
see a normal IP address (e.g. 192.255.255.255). The second part is the suffix which indicates
how many bits are in the entire address (e.g. /12). Putting it together, a CIDR IP address would
look like the following:
192.255.255.255/12

• ARP(Address Resolution Protocol)


Address Resolution Protocol(ARP)
The purpose of Address Resolution Protocol (ARP) is to resolve an IPv4 address (32 bit Logical
Address) to the corresponding physical address (48 bit MAC Address). Network Applications at
the Application Layer use IPv4 Address to communicate with another device.
Aim:To find out the MAC address of the destination that allows us to communicate with other
devices. In this case, the ARP is actually required as it converts the IP address to a physical
address.
Working of ARP:
Arping probes hosts on the examined network link by sending Link Layer frames using the
Address Resolution Protocol (ARP) request method addressed to a host identified by its MAC
address of the network interface.

• RARP(Reverse Address Resolution Protocol)


Reverse ARP (RARP) is a networking protocol used by the client system in a local area network
(LAN) to request its IPv4 address from the ARP gateway router table. A table is created by the
network administrator in the gateway-router that is used to find out the MAC address to the
corresponding IP address.
Working of RARP:
The RARP is on the Network Access Layer and is employed to send data between two points in a
very network.The client broadcasts a RARP request with an Ethernet broadcast address and
with its own physical address. The server responds by informing the client its IP address.

• DHCP(Dynamic Host Configuration Protocol)


Dynamic Host Configuration Protocol (DHCP) is a standardized network protocol used on
Internet Protocol (IP) networks.The DHCP is controlled by a DHCP server that dynamically
distributes network configuration parameters for interfaces and services. Networks ranging in
size from small home networks to campus networks frequently use DHCP.
Working of DHCP:
A DHCP server dynamically assigns an IP address and other network configuration parameters
to each device on a network so they can communicate with other IP networks. DHCP is an
enhancement of an older protocol called BOOTP.

• ICMP(Internet Control Message Protocol)


The Internet Control Message Protocol (ICMP) is a protocol that devices within a network use
to communicate problems with data transmission. In this ICMP definition, one of the primary
ways in which ICMP is used is to determine if data is getting to its destination and at the right
time. This makes ICMP an important aspect of the error reporting process and testing to see
how well a network is transmitting data.
Working of ICMP:
ICMP will take source IP from the discarded packet and inform the source by sending a source
quench message.
Then the source will reduce the speed of transmission so that the router will free itself from
congestion.
Routing:
o A Router 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.
o A Router works at the network layer in the OSI model and internet layer in TCP/IP model
o A router is a networking device that forwards the packet based on the information
available in the packet header and forwarding table.
o 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.
o 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.
o The routing algorithm initializes and maintains the routing table for the process of path
determination.

Routing Metrics and Costs:

Routing metrics and costs are used for determining the best route to the destination. The factors
used by the protocols to determine the shortest path, these factors are known as a metric.

Metrics are the network variables used to determine the best route to the destination. For some
protocols use the static metrics means that their value cannot be changed and for some other
routing protocols use the dynamic metrics means that their value can be assigned by the system
administrator.
The most common metric values are given below:

o Hop count: Hop count is defined as a metric that specifies the number of passes through
internetworking devices such as a router, a packet must travel in a route to move from
source to the destination. If the routing protocol considers the hop as a primary metric
value, then the path with the least hop count will be considered as the best path to move
from source to the destination.
o Delay: It is a time taken by the router to process, queue and transmit a datagram to an
interface. The protocols use this metric to determine the delay values for all the links
along the path end-to-end. The path having the lowest delay value will be considered as
the best path.
o Bandwidth: The capacity of the link is known as a bandwidth of the link. The bandwidth
is measured in terms of bits per second. The link that has a higher transfer rate like gigabit
is preferred over the link that has the lower capacity like 56 kb. The protocol will
determine the bandwidth capacity for all the links along the path, and the overall higher
bandwidth will be considered as the best route.
o Load: Load refers to the degree to which the network resource such as a router or
network link is busy. A Load can be calculated in a variety of ways such as CPU utilization,
packets processed per second. If the traffic increases, then the load value will also be
increased. The load value changes with respect to the change in the traffic.
o Reliability: Reliability is a metric factor may be composed of a fixed value. It depends on
the network links, and its value is measured dynamically. Some networks go down more
often than others. After network failure, some network links repaired more easily than
other network links. Any reliability factor can be considered for the assignment of
reliability ratings, which are generally numeric values assigned by the system
administrator.

Types of Routing
Routing can be classified into three categories:

o Static Routing
o Default Routing
o Dynamic Routing
Static Routing
o Static Routing is also known as Non adaptive Routing.
o It is a technique in which the administrator manually adds the routes in a routing table.
o A Router can send the packets for the destination along the route defined by the
administrator.
o In this technique, routing decisions are not made based on the condition or topology of
the networks
Advantages of Static Routing
Following are the advantages of Static Routing:
o No Overhead: It has ho overhead on the CPU usage of the router. Therefore, the cheaper
router can be used to obtain static routing.
o Bandwidth: It has not bandwidth usage between the routers.
o Security: It provides security as the system administrator is allowed only to have control
over the routing to a particular network.
Disadvantages of Static Routing:
Following are the disadvantages of Static Routing:
o For a large network, it becomes a very difficult task to add each route manually to the
routing table.
o The system administrator should have a good knowledge of a topology as he has to add
each route manually.
Default Routing
o Default Routing is a technique in which a router is configured to send all the packets to
the same hop device, and it doesn't matter whether it belongs to a particular network or
not. A Packet is transmitted to the device for which it is configured in default routing.
o Default Routing is used when networks deal with the single exit point.
o It is also useful when the bulk of transmission networks have to transmit the data to the
same hp device.
o When a specific route is mentioned in the routing table, the router will choose the specific
route rather than the default route. The default route is chosen only when a specific route
is not mentioned in the routing table.
Dynamic Routing
o It is also known as Adaptive Routing.
o It is a technique in which a router adds a new route in the routing table for each packet
in response to the changes in the condition or topology of the network.
o Dynamic protocols are used to discover the new routes to reach the destination.
o In Dynamic Routing, RIP and OSPF are the protocols used to discover the new routes.
o If any route goes down, then the automatic adjustment will be made to reach the
destination.
The Dynamic protocol should have the following features:
o All the routers must have the same dynamic routing protocol in order to exchange the
routes.
o If the router discovers any change in the condition or topology, then router broadcast this
information to all other routers.
Advantages of Dynamic Routing:
o It is easier to configure.
o It is more effective in selecting the best route in response to the changes in the condition
or topology.
Disadvantages of Dynamic Routing:
o It is more expensive in terms of CPU and bandwidth usage.
o It is less secure as compared to default and static routing.

Forwarding:
When a packet arrives at a router’s input link, the router must move the packet to the
appropriate output link. For example, a packet arriving from Host H1 to Router R1 must be
forwarded to the next router on a path to H2. Forwarding refers to the router-local action of
transferring packet from an input link interface to the appropriate output link interface.
Routing
The network layer must determine the route or path taken by packets as they flow from a
sender to a receiver. The algorithms that calculate these paths are referred to as routing
algorithms. A routing algorithm would determine, for example, the path along which packets
flow from H1 to H2. Routing refers to the network-wide process that determines the end-to-
end paths that packets take from source to destination.
Every router has a forwarding table. A router forward a packet by examining the value of a field
in the arriving packet’s header, and then using this header value to index into the router’s
forwarding table. The value stored in the forwarding table entry for that header indicates the
router’s outgoing link interface to which the packet is to be forwarded.
Depending on the network layer protocol, the header value could be the destination address of
the packet or an indication of the connection to which the packet belongs.
Figure below provides an example.
In the above figure, a packet with a header field value of 0111 arrives to a router. The router
indexes into its forwarding table and determines that the output link interface for this packet is
interface 2. The router then internally forwards the packet to interface 2.

You might be wondering how the forwarding tables in the routers are configured. This is a
critical issue, one that exposes the important interplay between routing and forwarding.
As shown in the figure above, the routing algorithm determines the values that are inserted
into the routers’ forwarding tables. The routing algorithm may be centralized (e.g. with an
algorithm executing on a central site and downloading routing information to each of the
routers) or decentralized (i.e. with a piece of the distributed routing algorithm running in each
router). In either case, a router receives routing protocol messages, which are used to configure
its forwarding table. The distinct and different purposes of the forwarding and routing functions
can be further illustrated by considering the hypothetical (and unrealistic, but technically
feasible) case of a network in which all forwarding tables are configures directly by human
operators physically present at the routers. In this case, no routing protocols would be
required! Of course, the human operators would need to interact with each other to ensure
that the forwarding tables were configured in such a way that packets reached their intended
destinations. It’s also likely that human configuration would be more error-prone and much
slower to respond to changes in the network topology than a routing protocol. We’re thus
fortunate that all networks have both a forwarding and a routing function!
Routing Algorithm:
A routing algorithm is a procedure that lays down the route or path to transfer data packets
from source to the destination. They help in directing Internet traffic efficiently. After a data
packet leaves its source, it can choose among the many different paths to reach its destination.
Routing algorithm mathematically computes the best path, i.e. “least – cost path” that the
packet can be routed through.
Types of Routing Algorithms
Routing algorithms can be broadly categorized into two types, adaptive and non adaptive
routing algorithms. They can be further categorized as shown in the following diagram –
Adaptive Routing Algorithms:
Adaptive routing algorithms, also known as dynamic routing algorithms, makes routing decisions
dynamically depending on the network conditions. It constructs the routing table depending
upon the network traffic and topology. They try to compute the optimized route depending upon
the hop count, transit time and distance.
The three popular types of adaptive routing algorithms are −
• Centralized algorithm − It finds the least-cost path between source and destination nodes
by using global knowledge about the network. So, it is also known as global routing
algorithm.
• Isolated algorithm − This algorithm procures the routing information by using local
information instead of gathering information from other nodes.
• Distributed algorithm − This is a decentralized algorithm that computes the least-cost path
between source and destination iteratively in a distributed manner.

Non – Adaptive Routing Algorithms


Non-adaptive Routing algorithms, also known as static routing algorithms, construct a static
routing table to determine the path through which packets are to be sent. The static routing
table is constructed based upon the routing information stored in the routers when the network
is booted up.
The two types of non – adaptive routing algorithms are −
• Flooding − In flooding, when a data packet arrives at a router, it is sent to all the outgoing
links except the one it has arrived on. Flooding may be uncontrolled, controlled or selective
flooding.
• Random walks − This is a probabilistic algorithm where a data packet is sent by the router
to any one of its neighbors randomly.
Congestion control:
Congestion is a state occurring in network layer when the message traffic is so heavy that it
slows down network response time.
Effects of Congestion
1) As delay increases, performance decreases.
2) If delay increases, retransmission occurs, making situation worse.
Congestion control algorithms
• Congestion Control is a mechanism that controls the entry of data packets into the
network, enabling a better use of a shared network infrastructure and avoiding
congestive collapse.
• Congestive-Avoidance Algorithms (CAA) are implemented at the TCP layer as the
mechanism to avoid congestive collapse in a network.
There are two congestion control algorithm which are as follows:
Leaky Bucket Algorithm
• The leaky bucket algorithm discovers its use in the context of network traffic shaping or
rate-limiting.
• A leaky bucket execution and a token bucket execution are predominantly used for
traffic shaping algorithms.
• This algorithm is used to control the rate at which traffic is sent to the network and
shape the burst traffic to a steady traffic stream.
• The disadvantages compared with the leaky-bucket algorithm are the inefficient use of
available network resources.
• The large area of network resources such as bandwidth is not being used effectively.

Let us consider an example to understand

Imagine a bucket with a small hole in the bottom.No matter at what rate water enters the
bucket, the outflow is at constant rate.When the bucket is full with water additional water
entering spills over the sides and is lost.

Similarly, each network interface contains a leaky bucket and the following steps are involved
in leaky bucket algorithm:
1) When host wants to send packet, packet is thrown into the bucket.
2) The bucket leaks at a constant rate, meaning the network interface transmits
packets at a constant rate.
3) Bursty traffic is converted to a uniform traffic by the leaky bucket.
4) In practice the bucket is a finite queue that outputs at a finite rate.
Token bucket Algorithm:
• The leaky bucket algorithm has a rigid output design at an average rate independent
of the bursty traffic.
• In some applications, when large bursts arrive, the output is allowed to speed up. This
calls for a more flexible algorithm, preferably one that never loses information.
• Therefore, a token bucket algorithm finds its uses in network traffic shaping or rate-
limiting.
• It is a control algorithm that indicates when traffic should be sent. This order comes
based on the display of tokens in the bucket.
• The bucket contains tokens. Each of the tokens defines a packet of predetermined
size. Tokens in the bucket are deleted for the ability to share a packet.
• When tokens are shown, a flow to transmit traffic appears in the display of tokens.
• No token means no flow sends its packets. Hence, a flow transfers traffic up to its
peak burst rate in good tokens in the bucket.

IPv6 (Internet Protocol Version 6)


IP address determines who and where you are in the network of billions of digital devices that
are connected to the Internet.
IPv6 (Internet Protocol Version 6) is a network layer protocol that allows communication to take
place over the network. IPv6 was designed by Internet Engineering Task Force (IETF) in December 1998
with the purpose of superseding the IPv4 due to the global exponentially growing internet users. An Ipv6
address uses 128 bits as opposed to 32 bits in IPv4.IPv6 addresses are written using hexadecimal, as
opposed to dotted decimal in IPv4.

You might also like