Mod3 1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 112

MODULE 3

Network Layer:
• MODULE 3 8 Hrs

• Network Layer Design issues, Routing Protocol Basics, Routing Algorithm


(Distance Vector
• Routing, Link State Routing and Hierarchical Routing). IP addressing, IP
Packet format IPV4,
• IPV6 and IP Tunneling. Congestion control algorithms, QoS (Traffic Shaping,
Packet Scheduling).
DAYANANDA SAGAR UNIVERSITY , DEPARTMENT OF CSE

Design issues in Network Layer


DAYANANDA SAGAR UNIVERSITY , DEPARTMENT OF CSE
Introduction
• The Network Layer is responsible for getting packets from the source to the
destination.
• To do so, the network layer must know about the topology of the network.
• It also chooses the appropriate path in networks.
• It must also take consider the situation of overloading or underloading the
communication lines while choosing the routes across the networks.

COMPUTER NETWORKS - 19CS3602


DAYANANDA SAGAR UNIVERSITY , DEPARTMENT OF CSE

Routing Protocol Basics

COMPUTER NETWORKS - 19CS3602


Introduction

 A Router is a process of selecting path along which the data can


be transferred from source to the destination.

 A Router works at the network layer in the OSI model and


internet layer in TCP/IP model.

 It forwards the packet based on the information available in the


packet header and forwarding table.

 The routing protocols use the metric to determine the best path
for the packet delivery.

 The routing algorithm initializes and maintains the routing table


for the process of path determination
Router Function

 A router has multiple interfaces and receives data packets


through them. It evaluates the network addresses of the incoming
packets and decides which interface to forward the packet.

 It uses its local routing table for decision-making. This can be


statically configured or calculated via dynamic routing protocols
such as OSPF or BGP.

 OSPF: Open Shortest Path First


 BSF: Border Gateway Protocol
Routing Algorithms

• The main function of NL (Network Layer) is routing packets


from the source machine to the destination machine.
• The algorithms that choose the routes and the data structures
that they use are a major area of network layer design.
• The routing algorithm is that part of the NL software
responsible for deciding which output line an incoming
packet should be transmitted on.
Routing Algorithms

• There are two processes inside router:


a) One of them handles each packet as it arrives, looking up the
outgoing line to use for it in the routing table. This process
is forwarding.
b) The other process is responsible for filling in and updating the
routing tables. That is where the routing algorithm comes into
play. This process is routing.
Routing Algorithms
• Regardless of whether routes are chosen independently for
each packet or only when new connections are established,
certain properties are desirable in a routing algorithm:
• correctness, simplicity,
• robustness, stability,
• fairness, and optimality.
Routing Algorithms
• Correctness and simplicity hardly require coment.
• Robustness: the routing algorith should be able to cope with
changes in topology and traffic without requiring all jobs in
all hosts to be aborted and the network to be rebooted every
time some router crashes.
Routing Algorithms
• Stability is also an important goal for the routing algorithm.
A stable algorithm reaches equilibrium and stays there.
• Fairness and optimality may sound obvious – surely no
reasonable person would oppose them – but as it turn out,
they are often contradictory goals.
Routing Algorithms

Conflict between fairness and optimality.


Routing Algorithms

• Routing algorithms can be grouped into two major classes:


nonadaptive and adaptive.
• Nonadaptive algorithm do not base their routing decisions on
measurements or estimates of the current traffic and topology.
Instead, the choice of the route to use to get from I to J is
computed in advance, off line, and downloaded to the routers
when the network is booted. This procedure is sometimes
called static routing.
Distance Vector Routing

 Each router is required to inform the topology changes to its


neighboring routers periodically. Historically it is known as the
old ARPNET routing algorithm or Bellman-Ford algorithm.

 How it works:
 In DVR, each router maintains a routing table. It contains only one entry for each
router. It contains two parts − a preferred outgoing line to use for that destination and
an estimate of time (delay). Tables are updated by exchanging the information with the
neighbor’s nodes.
 Each router knows the delay in reaching its neighbors (Ex − send echo request).
 Routers periodically exchange routing tables with each of their neighbors.
 It compares the delay in its local table with the delay in the neighbor’s table and the
cost of reaching that neighbor.
 If the path via the neighbor has a lower cost, then the router updates its local table to
forward packets to the neighbor.
• Distance Vector Routing (Bellman-Ford routing algorithm)

• Dynamic routing algorithm

• Operation:
– Each router maintain a table (i.e., a vector) giving the best known distance to each
destination and which link to use to get there.
– In distance vector routing, each router periodically shares its knowledge
about the entire network with its neighbors.

– The preferred outgoing line to use for that destination and an estimate of the distance to that
destination. Eventually, every router knows the best link to reach each destination.
COMPUTER NETWORKS - 19CS3602
What is The Count to Infinity problem 
• The Count to Infinity problem arises from the routing
loop in this Distance Vector Routing(DVR) network.
Such Routing Loops usually occurs when 2 routers send
an update together at the same time or when an
interface goes down
Count to Infinity Problem

• It is an issue in Distance Vector Routing

• Counting to infinity is just another name for a


routing loop

• A problem with distance-vector routing is that


any decrease in cost (good news) propagates
quickly, but any increase in cost (bad news)
will propagate slowly.
LINK STATE ROUTING
Hierarchical Routing
The prefix size is the number of
addresses available for use. Public IP
address prefixes consist of IPv4 or IPv6
addresses
• When routing is done hierarchically then there will be only 7 entries as
shown below
• Ration of no of regions to the number of routers per region grows, saving in
table space increases.
Explanation

• Step 1 − For example, the best path from 1A


to 5C is via region 2, but hierarchical routing
of all traffic to region 5 goes via region 3 as it
is better for most of the other destinations of
region 5.
IP Addresses: Classful Addressing

• IP address is an address having information about how to


reach a specific host, especially outside the LAN. An IP
address is a 32 bit unique address having an address space
of 232.
Generally, there are two notations in which IP address is
written, dotted decimal notation and hexadecimal notation.
• Dotted Decimal Notation:
CLASSFUL ADDRESSING

IP addresses, when started a few decades ago, used the concept of classes.
This architecture is called classful addressing. In the mid-1990s, a new
architecture, called classless addressing, was introduced and will
eventually supersede the original architecture. However, part of the
Internet is still using classful addressing, but the migration is very fast.
Some points to be noted about dotted decimal notation:
1.The value of any segment (byte) is between 0 and 255 (both included).
2.There are no zeroes preceding the value in any segment (054 is wrong, 54 is
correct).

Classful Addressing
The 32-bit IP address is divided into five sub-classes. These
are:
•Class A
•Class B
•Class C
•Class D
Each of these classes has a valid range of IP addresses. Classes D and E are
reserved for multicast and experimental purposes respectively. The order of
bits in the first octet determine the classes of IP address.
IPv4 address is divided into two parts:

•Network ID
•Host ID

The class of IP address is used to determine the bits used for network ID and
host ID and the number of total networks and hosts possible in that particular
class.

Each ISP or network administrator assigns IP address to each device that is


connected to its network.
Class A:

IP address belonging to class A are assigned to the networks that contain a large
number of hosts.
•The network ID is 8 bits long.
•The host ID is 24 bits long.
The higher order bit of the first octet in class A is always set to 0. The remaining
7 bits in first octet are used to determine network ID. The 24 bits of host ID are
used to determine the host in any network.
The default subnet mask for class A is 255.x.x.x. Therefore, class A has a total
of:
•2^7-2= 126 network ID(Here 2 address is subtracted because 0.0.0.0 and
127.x.y.z are special address. )
•2^24 – 2 = 16,777,214 host ID
IP addresses belonging to class A ranges from 1.x.x.x – 126.x.x.x
Class B:

IP address belonging to class B are assigned to the networks that ranges from
medium-sized to large-sized networks.
•The network ID is 16 bits long.
•The host ID is 16 bits long.
The higher order bits of the first octet of IP addresses of class B are always set to
10. The remaining 14 bits are used to determine network ID. The 16 bits of host ID
is used to determine the host in any network. The default sub-net mask for class B
is 255.255.x.x. Class B has a total of:
•2^14 = 16384 network address
•2^16 – 2 = 65534 host address
•IP addresses belonging to class B ranges from 128.0.x.x – 191.255.x.x.
Class C:
IP addresses belonging to class C are assigned to small-sized networks.
• The network ID is 24 bits long.
• The host ID is 8 bits long.
The higher order bits of the first octet of IP addresses of class C are always set to
110. The remaining 21 bits are used to determine network ID. The 8 bits of host
ID is used to determine the host in any network. The default sub-net mask for
class C is 255.255.255.x. Class C has a total of:
• 2^21 = 2097152 network address
• 2^8 – 2 = 254 host address
IP addresses belonging to class C ranges from 192.0.0.x – 223.255.255.x.
Class D:

IP address belonging to class D are reserved for multi-casting.


The higher order bits of the first octet of IP addresses belonging to class D are
always set to 1110.
The remaining bits are for the address that interested hosts recognize.
Class D does not posses any sub-net mask. IP addresses belonging to class D
ranges from 224.0.0.0 – 239.255.255.255.
DETAILS OF IP PACKET

 An IP packet is the smallest message entity exchanged via the Internet


Protocol across an IP network.
 IP packets consist of a header for addressing and routing, and a
payload for user data.
 The header contains information about IP version, source IP address,
destination IP address, time-to-live, etc.
IPv4:
 IPv4 is a connectionless protocol used for packet-switched networks.
 It operates on a best effort delivery model, in which neither delivery is guaranteed,
nor proper sequencing or avoidance of duplicate delivery is assured.
 Internet Protocol Version 4 (IPv4) is the fourth revision of the Internet Protocol and a
widely used protocol in data communication over different kinds of networks.
 IPv4 is a connectionless protocol used in packet-switched layer networks, such as
Ethernet.
 It provides a logical connection between network devices by providing identification
for each device.
 There are many ways to configure IPv4 with all kinds of devices – including manual
and automatic configurations – depending on the network type.
 IPv4 is defined and specified in IETF publication RFC 791.
 IPv4 uses 32-bit addresses for Ethernet communication in five classes: A, B, C,
D and E.
 Classes A, B and C have a different bit length for addressing the network host.
 Class D addresses are reserved for military purposes, while class E addresses
are reserved for future use.
 IPv4 uses 32-bit (4 byte) addressing, which gives 232 addresses.
 IPv4 addresses are written in the dot-decimal notation, which comprises of four
octets of the address expressed individually in decimal and separated by
periods, for instance, 192.168.1.5.
IPV6
Internet Protocol version 6 (IPV 6) is the replacement for version 4 (IPV 4). The
phenomenal development of the Internet has begun to push IP to its limits. It
provides a large address space, and it contains a simple header as compared to
IPv4.
Features of IPV6
There are various features of IPV6, which are as follows−
Larger address space: An IPV6 address is 128 bits long. It is compared with the 32-bit
address of IPV4. It will allow for unique IP-addresses up to 3.4 x 1038 whereas IPV4
allows up to 4.3 x 108 unique address.
Better Header format: New header form has been designed to reduce overhead. It is
done by moving both non-essential fields and optional fields to extension field header
that are placed after the IPV6 header.
More Functionality: It is designed with more options like priority of packet for control
of congestion, Authentication etc.
Allowance for Extension: It is designed to allow the extension of the protocol if
required by new technologies.
Support of resource allocation: In IPV6, the type of service fields has been removed,
but a new mechanism has been added to support traffic control or flow labels like
real-time audio and video.
IPV6
IPV6 Packet Format
It is a compulsory base header followed by the payload. The payload includes two
parts (1) optional extension headers and data called payload from the upper layer.
IPV6
Base Header has 8 fields which are as follows−

Version: It is a four-bit field that defines the version number of the IP. IP6 version is 6,
IP4 version is 4.
Priority: It is a 4-bit priority field that defines the priority of the packet with respect to
traffic congestion that a packet is to reject or not.
Flow Label: It is three bytes or 24-bit field designed to provide special handling for a
particular flow of data to speed flow on an already flowing packet path.
Payload Length: It is a two-byte payload length field that defines the total length of
the IP datagram, excluding the base header.
Next Header: It is an 8-bit field that defines the header that follows the base header
in the datagram.
Source Address: This field is 16-byte which specifies the original source of the
datagram destination address. This is a 16-byte internet address that usually identifies
the final destination of the datagram.
Priority: IPV6 divides traffic into two broad categories, which are as follows:
IPV6
Congestion Control Traffic: If a source adopts itself to traffic showdown when there is
congestion. In TCP protocol, congestion-control data is assigned priority 0 to 7, such
as 0 for lowest and 7 for highest in congestion.

Priority Meaning
0 There is no specific traffic
1 Background data
2 Unattended data traffic
3 Reserved
4 Attended Bulk data traffic
5 Reserved
6 Interactive Traffic
7 Control Traffic
IP Tunneling
IP tunnels provide a virtual link between two nodes that are reachable by using IP.
The link can thus be used to transport IPv6 packets over the IPv4 networks to enable
IPv6 communication between the two IPv6 sites.

VPN Tunneling: A VPN is a secure, encrypted connection over a publicly shared


network. Tunneling is the process by which VPN packets reach their intended
destination, which is typically a private network.

Split Tunneling: Split tunneling allows some traffic to go outside of the VPN tunnel. In
essence, split tunneling lets user devices connect to two networks simultaneously:
one public and one private.

GRE Tunneling: Generic Routing Encapsulation (GRE) is one of several tunneling


protocols. GRE encapsulates data packets that use one routing protocol inside the
packets of another protocol
SSH Tunneling: The Secure Shell (SSH) protocol sets up encrypted connections
between client and server, and can also be used to set up a secure tunnel. SSH
operates at layer 7 of the OSI model, the application layer.
Congestion Control Algorithms
When too much traffic is offered, congestion sets in and performance degrades sharply.

54
Traffic Shaping
Congestion control in data-gram and sub-nets :
• A special bit (warning bit) in the packet header is set by
the router to warn the source when congestion is
detected.

• The bit is copied and piggy-backed on the ACK and sent to


the sender.

• The sender monitors the number of ACK packets it receives


with the warning bit set and adjusts its transmission rate
accordingly.

• The usual purpose of piggybacking is simply to gain free network access rather than any malicious intent, but it can slow down data transfer for legitimate users of the
network. Piggybacking is sometimes referred to as "Wi-Fi squatting
A choke packet
A choke packet is used in network
maintenance and quality management to
inform a specific node or transmitter that
its transmitted traffic is creating
congestion over the network.
This forces the node or transmitter to reduce
its output rate.
Choke packets are used for congestion and
flow control over a network
Hop-by-Hop
Choke Packets

(a) A choke packet that affects


only the source.

(b) A choke packet that affects


each hop it passes through.

94
Jitter Control

(a) High jitter. (b) Low jitter.

10
2
Congestion control algorithms
Leaky Bucket Algorithm:
• In the figure, we assume that the network has committed a bandwidth of 3 Mbps for a host.
• The use of the leaky bucket shapes the input traffic to make it conform to this commitment.
• In Figure the host sends a burst of data at a rate of 12 Mbps for 2 s, for a total of 24 Mbits of
data.
• The host is silent for 5 s and then sends data at a rate of 2 Mbps for 3 s, for a total of 6 Mbits
of data.
• In all, the host has sent 30 Mbits of data in 10 s.
• The leaky bucket smooths the traffic by sending out data at a rate of 3 Mbps during the same
10 s. 

Without the leaky bucket, the beginning burst may have hurt the network by consuming more
bandwidth than is set aside for this host. We can also see that the leaky bucket may prevent
congestion.
• A simple leaky bucket algorithm can be implemented using FIFO queue.
• A FIFO queue holds the packets.
• If the traffic consists of fixed-size packets (e.g., cells in ATM networks), the
process removes a fixed number of packets from the queue at each tick of the
clock.
• If the traffic consists of variable-length packets, the fixed output rate must be
based on the number of bytes or bits.

The following is an algorithm for variable-length packets: 


 
1.Initialize a counter to n at the tick of the clock.
2.If n is greater than the size of the packet, send the packet and decrement the
counter by the packet size. Repeat this step until n is smaller than the packet size.
3.Reset the counter and go to step 1.
• Example – Let n=1000 
Packet=
Since n> front of Queue i.e. n>200 
Therefore, n=1000-200=800 
Packet size of 200 is sent to the network. 
 

Now Again n>front of the queue i.e. n > 400 


Therefore, n=800-400=400 
Packet size of 400 is sent to the network. 

Since n< front of queue 


Therefore, the procedure is stop. 
Initialize n=1000 on another tick of clock. 
This procedure is repeated until all the packets are sent to the
network.
• Token bucket Algorithm :
• Token bucket Algorithm :
1. In regular intervals tokens are thrown into the bucket. f
2. The bucket has a maximum capacity. ƒ
3. If there is a ready packet, a token is removed from the
bucket, and the packet is sent.
4. If there is no token in the bucket, the packet cannot be
sent.
QoS
• Traffic Shaping: Traffic shaping is a computer network bandwidth
management technique that delays some or all datagrams in line with a
traffic profile to improve latency, optimize performance, or increase usable
bandwidth for certain types of packets by delaying other types

• Packet Scheduling: Packet scheduling is the means by which


data (packet) transmission governing a key function of quality of service is
achieved.
Traffic Shaping
• This technique uses three parameters to shape the flow of network traffic

• Burst size
• Average bandwidth
• Peak bandwidth
Contd.

Burst Size: When the workload is greater than average bandwidth it is known
as burst. Maximum amount of bytes that are permitted to move in a burst are
defined by burst size. Burst Size = Time*Bandwidth

Average Bandwidth: It is configured to set permitted bits per second across a


port group level or a virtual/distributed virtual switch, over time. The rate of
data transfer is permitted over time.

Peak Bandwidth: It decides maximum number of bits per second permitted


across a port group level or a virtual/distributed virtual switch without
discarding or queuing the frames.
Packet Scheduling

The packet scheduler considers the classification provided by the Generic


Packet Classifier (GPC), and provides preferential treatment to higher-priority
traffic. Consequently, the packet scheduler is the first step (in a sequential
view) to ensuring that the prioritized network transmission of packets begins
with data that has been deemed most important.

Part of the packet scheduler's responsibility is shaping the way packets are
transmitted from a network device, a capability often referred to as packet
shaping. Though often referenced by its own name, the packet shaper is
simply a part of overall packet scheduler functionality.

You might also like