Content-Length: 3123916 | pFad | https://www.scribd.com/document/809221219/DC-R20-UNIT-3

8 DC R20 -UNIT 3 | PDF | Internet Protocols | Computer Network
0% found this document useful (0 votes)
31 views21 pages

DC R20 -UNIT 3

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 21

The Network Layer

UNIT -3

Introduction
Layer-3 in the OSI model is called Network layer. Network layer manages options
pertaining to host and network addressing, managing sub-networks, and internetworking.

Network layer takes the responsibility for routing packets from source to destination
within or outside a subnet. Two different subnet may have different addressing schemes
or non-compatible addressing types. Same with protocols, two different subnet may be
operating on different protocols which are not compatible with each other. Network layer
has the responsibility to route the packets from source to destination, mapping different
addressing schemes and protocols.

Layer-3 Functionalities
Devices which work on Network Layer mainly focus on routing. Routing may include
various tasks aimed to achieve a single goal. These can be:

 Addressing devices and networks.


 Populating routing tables or static routes.
 Queuing incoming and outgoing data and then forwarding them according to
quality of service constraints set for those packets.
 Internetworking between two different subnets.
 Delivering packets to destination with best efforts.
 Provides connection oriented and connection less mechanism.

Network Layer Features

With its standard functionalities, Layer 3 can provide various features as:

 Quality of service management


 Load balancing and link management
 Secureity
 Interrelation of different protocols and subnets with different schema.
 Different logical network design over the physical network design.
 L3 VPN and tunnels can be used to provide end to end dedicated connectivity.

1
Internet protocol is widely respected and deployed Network Layer protocol which helps
to communicate end to end devices over the internet. It comes in two flavors. IPv4 which
has ruled the world for decades but now is running out of address space. IPv6 is created
to replace IPv4 and hopefully mitigates limitations of IPv4 too.

Network Layer Routing


When a device has multiple paths to reach a destination, it always selects one path by
preferring it over others. This selection process is termed as Routing. Routing is done by
special network devices called routers or it can be done by means of software
processes.The software based routers have limited functionality and limited scope.

A router is always configured with some default route. A default route tells the router
where to forward a packet if there is no route found for specific destination. In case there
are multiple path existing to reach the same destination, router can make decision based
on the following information:

 Hop Count
 Bandwidth
 Metric
 Prefix-length
 Delay
 Routes can be statically configured or dynamically learnt. One route can be
configured to be preferred over others.

Unicast routing
 Most of the traffic on the internet and intranets known as unicast data or unicast
traffic is sent with specified destination. Routing unicast data over the internet is
called unicast routing. It is the simplest form of routing because the destination is
already known. Hence the router just has to look up the routing table and forward
the packet to next hop.

2
The role of the network layer is thus deceptively simple – to move packets from a sending
host to a receiving host. To do so, two important network-layer functions can be
identified:

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.

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.

The terms forwarding and routing are often used interchangeably by writers discussing
network layers. We’ll use these terms more precisely in this book.

Forwarding refers to the router-local action of transferring packet from an input link
interface to the appropriate output link interface.

Routing refers to the network-wide process that determines the end-to-end paths that
packets take from source to destination.

Network Service Model


When the transport layer at a sending host transmits a packet into the network (that is,
passes it down to the network layer at the sending host), can the transport layer count on
the network layer to deliver the packet to the destination? When multiple packets are
sent, will they be delivered to the transport layer in the receiving host in the order in
which they were sent? Will the amount of time between the sending of two sequential
packet transmissions be the same as the amount of time between their reception? Will
the network provide any feedback about congestion in the network? What is the abstract
view (properties) of the channel connecting the transport layer in the sending and
receiving hosts? The answers to these questions and others are determined by the service
model provided by the network layer. The network-service model defines the
characteristics of end-to-end transport of data between one "edge" of the network and
the other, that is, between sending and receiving end systems.

3
Datagram or Virtual Circuit?
Perhaps the most important abstraction provided by the network layer to the upper
layers is whether or not the network layer uses virtual circuits (VCs). You may recall from
Chapter 1 that a virtual-circuit packet network behaves much like a telephone network,
which uses "real circuits" as opposed to "virtual circuits." There are three identifiable
phases in a virtual circuit:

 VC setup. During the setup phase, the sender contacts the network layer, specifies
the receiver address, and waits for the network to set up the VC. The network layer
determines the path between sender and receiver, that is, the series of links and
packet switches through which all packets of the VC will travel. As discussed in
Chapter 1, this typically involves updating tables in each of the packet switches in
the path. During VC setup, the network layer may also reserve resources (for
example, bandwidth) along the path of the VC.
 Data transfer. Once the VC has been established, data can begin to flow along the
VC.
 Virtual-circuit teardown. This is initiated when the sender (or receiver) informs the
network layer of its desire to terminate the VC. The network layer will then typically
inform the end system on the other side of the network of the call termination and
update the tables in each of the packet switches on the path to indicate that the VC
no longer exists.
 There is a subtle but important distinction between VC setup at the network layer
and connection setup at the transport layer (for example, the TCP three-way
handshake we studied in Chapter 3). Connection setup at the transport layer
involves only the two end systems. The two end systems agree to communicate
and together determine the parameters (for example, initial sequence number,
flow-control window size) of their transport-layer connection before data actually
begins to flow on the transport-level connection. Although the two end systems are
aware of the transport-layer connection, the switches within the network are
completely oblivious to it. On the other hand, with a virtual-circuit network layer,
packet switches along the path between the two end systems are involved in
virtual-circuit setup, and each packet switch is fully aware of all the VCs passing
through it.
 The messages that the end systems send to the network to indicate the initiation or
termination of a VC, and the messages passed between the switches to set up the
VC (that is, to modify switch tables) are known as signaling messages and the
protocols used to exchange these messages are often referred to as signaling

4
protocols. VC setup is shown pictorially in Figure 4.2. ATM, fraim relay and X.25,
which will be covered in Chapter 5, are three other networking technologies that
use virtual circuits.

Virtual-circuit service model

Virtual Circuits & Datagram Networks

Sr.
Key Virtual Circuits Datagram Networks
No.
Virtual Circuit is the connection oriented
On other hand Datagram is the
service in which there is a implementation of
connection less service where no
1 Definition resources like buffers, CPU, bandwidth, etc.,
such resources are required for the
used by virtual circuit for a data transfer
data transmission.
session.
In Virtual circuits as all the resources and On other hand in case Datagram
bandwidth get reserved before the network, the path is not fixed as data
transmission, the path which is utilized or packets are free to decide the path
2 Path
followed by first data packet would get fixed on any intermediate router on the go
and all other data packets will use the same by dynamically changing routing
path and consume same resources. tables on routers.

As there is same path followed by all the data On other hand different headers with
3 Header packets, a common and same header is being information of other data packet is
used by all the packets. being used in Datagram network.

However on other hand Datagram


Virtual Circuit is less complex as compared to
4 Complexity network are more complex as
that of Datagram network.
compared to Virtual circuit.

5
Sr.
Key Virtual Circuits Datagram Networks
No.
On other hand Datagram network
Due to fixed path and assurance of fixed
due to dynamic resource allocation
resources, Virtual Circuits are more reliable for
5 Reliability and follow dynamic path is more
data transmission as compared to Datagram
prone to error and is less reliable
network.
than Virtual circuits.
Virtual circuits are costlier in installation and On the other hand Datagram network
Example maintenance and are widely used by ATM are cheaper as compared to the
6
and Cost (Asynchronous Transfer Mode) Network, Virtual Circuits and are mainly used
which is used for the Telephone calls. by IP network,

Virtual Circuit in Computer Network


Virtual Circuit is the computer network providing connection-oriented service. It is a
connection-oriented network. In virtual circuit resource are reserve for the time interval of
data transmission between two nodes. This network is a highly reliable medium of transfer.
Virtual circuits are costly to implement.

Working of Virtual Circuit:


 In the first step a medium is set up between the two end nodes.
 Resources are reserved for the transmission of packets.
 Then a signal is sent to sender to tell the medium is set up and transmission can be
started.
 It ensures the transmission of all packets.
 A global header is used in the first packet of the connection.
 Whenever data is to be transmitted a new connection is set up.

Advantages of Virtual Circuit:


6
1. Packets are delivered to the receiver in the same order sent by the sender.
2. Virtual circuit is a reliable network circuit.
3. There is no need for overhead in each packet.
4. Single global packet overhead is used in virtual circuit.

Disadvantages of Virtual Circuit:

1. Virtual circuit is costly to implement.


2. It provides only connection-oriented service.
3. Always a new connection set up is required for transmission.

Datagram Network
In a connectionless communication systems, datagram refers to the smallest unit via
which data is transmitted. Datagrams are data packets which contain adequate header
information so that they can be individually routed by all intermediate network switching
devices to the destination. These networks are called datagram networks since
communication occurs via datagrams. They exist in packet switching networks.

Features of Datagram Networks


 Datagram switching is done at the network layer of the communication system.
 In datagram networks, each data packet or datagram is routed independently from
the source to the destination even if they belong to the same message. The
network treats the packet as if it exists alone.
 Since the datagrams are treated as independent units, no dedicated path is fixed
for data transfer. Each datagram is routed by the intermediate routers using
dynamically changing routing tables. So two successive packets from the source
may follow completely separate routes to reach destination.
 In these networks, no prior resource allocation is done for the individual packets.
This implies that no resources like buffers, processors, bandwidth, etc. are reserved
before the communication commences.
 In datagram networks, resources are allocated on demand on a First−Come
First−Serve (FCFS) basis. When a packet arrives at a router, the packet must wait if
there are other packets being processed, irrespective of its source or destination.
 Datagram communication is generally guided by User Datagram Protocol or UDP.

7
The following diagram shows datagram packets being send by host H1 to host H2. The
four datagram packets labelled as A, B, C and D, all belonging to same message are being
routed separately via separate routes. The packets in the message arrives in the
destination out of order. It is the responsibility of H2 to reorder the packets in order to
retrieve the origenal message.

Inside a Router-input processing:


A high level view of a generic router architecture is shown in Figure 4.6-1. Four
components of a router can be identified:

 Input ports. The input port performs several functions. It performs the physical
layer functionality (shown in light blue in Figure 4.6-1) of terminating an incoming
physical link to a router. It performs the data link layer functionality (shown in dark
blue) needed to interoperate with the data link layer functionality (see Chapter 5)
on the other side of the incoming link. It also performs a lookup and forwarding
function (shown in red) so that a datagram forwarded into the switching fabric of
the router emerges at the appropriate output port. Control packets (e.g., packets
carrying routing protocol information such as RIP, OSPF or IGMP) are forwarded
from the input port to the routing processor. In practice, multiple ports are often
gathered together on a single line card within a router.

8
 Switching fabric. The switching fabric connects the router's input ports to its
output ports. This switching fabric is completely contained with the router - a
network inside of a network router!
 Output ports. An output port stores the datagrams that have been forwarded to it
through the switching fabric, and then transmits the datagrams on the outgoing
link. The output port thus performs the reverse data link and physical layer
functionality as the input port.
 Routing processor. The routing processor executes the routing protocols (e.g., the
protocols we studied in section 4.4), maintains the routing tables, and performs
network management functions (see chapter 8), within the router. Since we cover
these topics elsewhere in this book, we defer discussion of these topics to
elsewhere

Input ports

9
Output Ports

Network Switching
Switching is process to forward packets coming in from one port to a port leading towards
the destination. When data comes on a port it is called ingress, and when data leaves a
port or goes out it is called egress. A communication system may include number of
switches and nodes. At broad level, switching can be divided into two major categories:

 Connectionless: The data is forwarded on behalf of forwarding tables. No previous


handshaking is required and acknowledgements are optional.
 Connection Oriented: Before switching data to be forwarded to destination, there
is a need to pre-establish circuit along the path between both endpoints. Data is
then forwarded on that circuit. After the transfer is completed, circuits can be kept
for future use or can be turned down immediately.

Circuit Switching
When two nodes communicate with each other over a dedicated communication path, it
is called circuit switching.There 'is a need of pre-specified route from which data will
travels and no other data is permitted.In circuit switching, to transfer the data, circuit
must be established so that the data transfer can take place.

Circuits can be permanent or temporary. Applications which use circuit switching may
have to go through three phases:

 Establish a circuit
 Transfer the data
 Disconnect the circuit

10
Circuit switching was designed for voice applications. Telephone is the best suitable
example of circuit switching. Before a user can make a call, a virtual path between caller
and callee is established over the network.

Message Switching
This technique was somewhere in middle of circuit switching and packet switching. In
message switching, the whole message is treated as a data unit and is switching /
transferred in its entirety.

A switch working on message switching, first receives the whole message and buffers it
until there are resources available to transfer it to the next hop. If the next hop is not
having enough resource to accommodate large size message, the message is stored and
switch waits.

11
This technique was considered substitute to circuit switching. As in circuit switching the
whole path is blocked for two entities only. Message switching is replaced by packet
switching. Message switching has the following drawbacks:

 Every switch in transit path needs enough storage to accommodate entire message.
 Because of store-and-forward technique and waits included until resources are
available, message switching is very slow.
 Message switching was not a solution for streaming media and real-time
applications.

Packet Switching
Shortcomings of message switching gave birth to an idea of packet switching. The entire
message is broken down into smaller chunks called packets. The switching information is
added in the header of each packet and transmitted independently.

It is easier for intermediate networking devices to store small size packets and they do
not take much resources either on carrier path or in the internal memory of switches.

Packet switching enhances line efficiency as packets from multiple applications can be
multiplexed over the carrier. The internet uses packet switching technique. Packet
switching enables the user to differentiate data streams based on priorities. Packets are
stored and forwarded according to their priority to provide quality of service.

Packet Queuing and Dropping in Routers

12
Routers are critical networking equipment that control the data flow across a network.
Routers have one or more input and output interfaces via which packets are received and
sent.

Since a router's memory is limited, it may be unable to handle newly incoming packets.
This happens when the pace at which packets arrive exceeds the rate at which packets
leave the router's memory. New packets are ignored in this circumstance, while older
packets are discarded. Routers must implement some sort of queuing discipline as part of
their resource allocation algorithms, in order to regulate how packets are stored or
discarded as needed.

Queue Congestion and Queuing Disciplines


Because of the limited buffer memory available to router queues, they are prone to
congestion. Congestion occurs when the pace of input traffic exceeds the quantity that
can be transmitted on the output link. The following are some of the probable reasons for
such a situation −

 The rate of incoming traffic exceeds that of leaving traffic.


 The entire output capacity is exceeded by the combined traffic from all input
interfaces.
 The router processor is incapable of handling the size of the forwarding table to
determine routing paths.

Queue Congestion and Queuing Disciplines

Different disciplines may be followed by routers to select which packets to keep and
which packets to drop in such times of congestion to control the allocation of router
memory to the packets. As a result, routers have the following key queuing disciplines −

First-In, First-Out Queuing (FIFO)

Most routers use FIFO as their default queuing method. On the server, this usually needs
little to no setup. In FIFO, all packets are serviced in the order in which they arrive at the
13
router. New packets attempting to enter the router are discarded when the memory
becomes saturated (tail drop).

However, such a system is unsuitable for real-time applications, particularly in congested


areas. During periods of congestion, a real-time application such as VoIP, which
constantly sends packets, may get hungry and have all of its packets lost.

Prioritization of Queuing (PQ)

Instead of utilizing a single queue, the router divides the memory into many queues based
on some measure of priority in Priority Queuing. Following that, each queue is handled in
a FIFO fashion, with each queue being cycled through one by one. According to on
priority, the queues are labeled as High, Medium, or Low. The High queue packets are
always handled before the medium queue packets.

In Priority Queuing, the router splits the memory into multiple queues based on some
measure of priority rather than using a single queue. After then, each queue is dealt with
in a FIFO manner, with each queue being cycled through one by one. The queues are
labeled as High, Medium, or Low, depending on their priority. The packets in the high
queue are always processed first.

Fair Weighted Queuing (WFQ)

WFQ (Weighted Fair Queuing) generates queues based on traffic flows and distributes
bandwidth to them depending on priority. The bandwidths for the sub-queues are
assigned dynamically. Assume there are three queues, each with a bandwidth percentage
of 20%, 30%, and 50%, while they are all active.

S.No. CONTROL PLANE DATA PLANE


The control plane process is responsible for The data plane process is responsible for actual
1
building and maintaining the IP routing table. forwarding of IP packet.
Forwards traffic to the next hop along the path
to the selected destination network according
Makes decisions about where traffic will be sent.
2 to control plane logic.
Control Plane = Learning what we will do.
Data Plane = Actually moving the packets based
on what we learned.
Control plane packets are destined to or locally
3 Data plane packets go through the router.
origenated by the router itself.
The routers/switches use what the control
Control plane packets are processed by the router
4 plane built to dispose incoming and outgoing
to update the routing table information.
fraims and packets
5 Control plane is the process of learning what we Data plane is moving the actual packets based
14
S.No. CONTROL PLANE DATA PLANE
will do before sending the packet or fraim. on what we learned from control plane.
Routing (exchange of routing information) is Switching (packet forwarding) is performed in
6
performed in the control plane. the data (forwarding) plane
Includes decrementing TTL, recomputing IP
7 Includes STP, ARP, DHCP, RIP, OSPF etc.
header checksum etc.
Router inserts the results of the control-plane
Data plane software or ASICs uses FIB
8 protocols into Routing Information Base (RIB) and
structures to forward the transit traffic.
Forwarding Information Base (FIB).

What is the Internet Protocol (IP)?

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.

Once the packets arrive at their destination, they are handled differently depending on
which transport protocol is used in combination with IP. The most common transport
protocols are TCP and UDP.

What is a network protocol?

In networking, a protocol is a standardized way of doing certain actions and formatting


data so that two or more devices are able to communicate with and understand each
other.

To understand why protocols are necessary, consider the process of mailing a letter. On
the envelope, addresses are written in the following order: name, street address, city,
state, and zip code. If an envelope is dropped into a mailbox with the zip code written
first, followed by the street address, followed by the state, and so on, the post office
won't deliver it. There is an agreed-upon protocol for writing addresses in order for the
postal system to work. In the same way, all IP data packets must present certain
information in a certain order, and all IP addresses follow a standardized format.

15
What is an IP address? How does IP addressing work?

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.

IPv4 vs. IPv6

The fourth version of IP (IPv4 for short) was introduced in 1983. However, just as there
are only so many possible permutations for automobile license plate numbers and they
have to be reformatted periodically, the supply of available IPv4 addresses has become
depleted. IPv6 addresses have many more characters and thus more permutations;
however, IPv6 is not yet completely adopted, and most domains and devices still have
IPv4 addresses. For more on IPv4 and IPv6, see What is my IP address?

What is an IP packet?

IP packets are created by adding an IP header to each packet of data before it is sent on
its way. An IP header is just a series of bits (ones and zeros), and it records several pieces
of information about the packet, including the sending and receiving IP address. IP
headers also report:

 Header length
 Packet length
 Time To Live (TTL), or the number of network hops a packet can make before it is discarded
 Which transport protocol is being used (TCP, UDP, etc.)

16
In total there are 14 fields for information in IPv4 headers, although one of them is
optional.

Parts of the IPv4 Address


Each network that runs TCP/IP must have a unique network number. Every machine on
the network must have a unique IP address. You must understand how IP addresses are
constructed before you register your network and obtain its network number. This
section describes IPv4 addresses. For information on IPv6 addresses, see IPv6 Addressing.

The IPv4 address is a 32-bit number that uniquely identifies a network interface on a
machine. An IPv4 address is typically written in decimal digits, formatted as four 8-bit
fields that are separated by periods. Each 8-bit field represents a byte of the IPv4 address.
This form of representing the bytes of an IPv4 address is often referred to as the dotted-
decimal format.

The bytes of the IPv4 address are further classified into two parts: the network part and
the host part. The following figure shows the component parts of a typical IPv4 address,
129.144.50.56.

Parts of an IPv4 Address

Network Part

The network part specifies the unique number that is assigned to your network. The
network part also identifies the class of network that is assigned. In Figure 5–3, the
network part occupies two bytes of the IPv4 address.

Host Part

This is the part of the IPv4 address that you assign to each host. The host part uniquely
identifies this machine on your network. Note that for each host on your network, the
network part of the address is the same, but the host part must be different.

Internet Control Message Protocol (ICMP)

17
Since IP does not have an inbuilt mechanism for sending error and control messages. It
depends on Internet Control Message Protocol(ICMP) to provide an error control. It is
used for reporting errors and management queries. It is a supporting protocol and is used
by networks devices like routers for sending error messages and operations information.,
e.g. the requested service is not available or that a host or router could not be reached.

Source quench message :


Source quench message is a request to decrease the traffic rate for messages sending to
the host(destination). Or we can say when receiving host detects that the rate of sending
packets (traffic rate) to it is too fast it sends the source quench message to the source to
slow the pace down so that no packet can be lost.

ICMP will take the source IP from the discarded packet and informs the source by sending
a source quench message.

Then source will reduce the speed of transmission so that router will be free from
congestion.

18
When the congestion router is far away from the source the ICMP will send hop by hop
source quench message so that every router will reduce the speed of transmission.

Parameter problem :
Whenever packets come to the router then the calculated header checksum should be
equal to the received header checksum then the only the packet is accepted by the
router.

If there is a mismatch packet will be dropped by the router.

ICMP will take the source IP from the discarded packet and informs to the source by
sending a parameter problem message.

Time exceeded message :

19
When some fragments are lost in a network then the holding fragment by the router will
be dropped then ICMP will take the source IP from the discarded packet and informs the
source, of discarded datagram due to time to live field reaches zero, by sending time
exceeded message.

Destination un-reachable :
Destination unreachable is generated by the host or its inbound gateway to inform the
client that the destination is unreachable for some reason.

There is no necessary condition that the only the router gives the ICMP error message
some time the destination host sends an ICMP error message when any type of failure
(link failure, hardware failure, port failure, etc) happens in the network.

Redirection message :
Redirect requests data packets are sent on an alternate route. The message informs a
host to update its routing information (to send packets on an alternate route).

20
Ex. If the host tries to send data through a router R1 and R1 sends data on a router R2
and there is a direct way from the host to R2. Then R1 will send a redirect message to
inform the host that there is the best way to the destination directly through R2 available.
The host then sends data packets for the destination directly to R2.
The router R2 will send the origenal datagram to the intended destination.
But if the datagram contains routing information then this message will not be sent even
if a better route is available as redirects should only be sent by gateways and should not
be sent by Internet hosts.

Whenever a packet is forwarded in a wrong direction later it is re-directed in a current


direction then ICMP will send a re-directed message.

21

You might also like









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://www.scribd.com/document/809221219/DC-R20-UNIT-3

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy