0% found this document useful (0 votes)
32 views82 pages

UNIT-4 NW Basics

Uploaded by

pwaghralkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views82 pages

UNIT-4 NW Basics

Uploaded by

pwaghralkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 82

UNIT-4

Network Layer
The main aim of this layer is to deliver packets from source to destination across multiple links (networks).
Functions of Network 2

Layer
• It translates logical network address into physical address.
Concerned with circuit, message or packet switching.
• Routers and gateways operate in the network layer. Mechanism is
provided by Network Layer for routing the packets to final
destination.
• Connection services are provided including network layer flow
control, network layer error control and packet sequence control.
• Breaks larger packets into small packets.
Design Issues with Network
Layer
A key design issue is determining how packets are routed from source to

destination. Routes can be based on static tables that are wired into the network and
rarely changed. They can also be highly dynamic, being determined anew for each
packet, to reflect the current network load.
• If too many packets are present in the subnet at the same time, they will get into one
another's way, forming bottlenecks. The control of such congestion also belongs to
the network layer.
• Moreover, the quality of service provided(delay, transmit time, jitter, etc) is also a
network layer issue.
• When a packet has to travel from one network to another to get to its
destination, many problems can arise such as:
• The addressing used by the second network may be different from the first one.

• The second one may not accept the packet at all because it is too large.

• The protocols may differ, and so on.


Design Issues with Network
Layer
• Hosts in different subnet need a mechanism to locate each other. This
task can be done by DNS
• When a host acquires the Layer-3 Address (IP Address) of the remote
host, it forwards all its packet to its gateway. A gateway is a router
equipped with all the information which leads to route packets to the
destination host.
• Routers take help of routing tables, which has the following
information:
• Method to reach the network
• Routers upon receiving a forwarding request, forwards packet to its
next hop (adjacent router) towards the destination.
• The next router on the path follows the same thing and eventually
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
Network Addressing
• Layer 3 network addressing is one of the major tasks of Network
Layer. Network Addresses are always logical i.e. these are software
based addresses which can be changed by appropriate
configurations.
• A network address always points to host / node / server or it can
represent a whole network. Network address is always configured on
network interface card and is generally mapped by system with the
MAC address (hardware address or layer-2 address) of the machine
for Layer-2 communication.
• 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
IP addressing
• IP addressing provides mechanism to differentiate between hosts and
network. Because IP addresses are assigned in hierarchical manner, a
host always resides under a specific network. The host which needs
to communicate outside its subnet, needs to know destination
network address, where the packet/data is to be sent.
Network address can be of
one of the following:
• Unicast (destined to one host)
• Multicast (destined to group)
• Broadcast (destined to all)
• Anycast (destined to nearest one)
• A router never forwards broadcast traffic by default. Multicast traffic uses special
treatment as it is most a video stream or audio with highest priority. Anycast is just
similar to unicast, except that the packets are delivered to the nearest destination
when multiple destinations are available.
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
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.
Broadcast routing
• By default, the broadcast packets are not routed and forwarded by
the routers on any network. Routers create broadcast domains. But it
can be configured to forward broadcasts in some special cases. A
broadcast message is destined to all network devices.
Broadcast routing
• A router creates a data packet and then sends it to each host one by
one. In this case, the router creates multiple copies of single data
packet with different destination addresses. All packets are sent as
unicast but because they are sent to all, it simulates as if router is
broadcasting.
• This method consumes lots of bandwidth and router must destination
address of each node.
• Secondly, when router receives a packet that is to be broadcasted, it
simply floods those packets out of all interfaces. All routers are
configured in the same way.
Multicast Routing
• Multicast routing is special case of broadcast routing with significance
difference and challenges. In broadcast routing, packets are sent to
all nodes even if they do not want it. But in Multicast routing, the
data is sent to only nodes which wants to receive the packets.
Multicast Routing
• The router must know that there are nodes, which wish to receive
multicast packets (or stream) then only it should forward. Multicast
routing works spanning tree protocol to avoid looping.
• Multicast routing also uses reverse path Forwarding technique, to
detect and discard duplicates and loops.
Anycast Routing
• Anycast packet forwarding is a mechanism where multiple hosts can
have same logical address. When a packet destined to this logical
address is received, it is sent to the host which is nearest in routing
topology.
• Anycast routing is done with help of DNS server. Whenever an
Anycast packet is received it is enquired with DNS to where to send it.
DNS provides the IP address which is the nearest IP configured on it.
Routing Algorithms
The routing algorithms are as follows:
• Flooding
• Flooding is simplest method packet forwarding. When a packet is received, the
routers send it to all the interfaces except the one on which it was received. This
creates too much burden on the network and lots of duplicate packets wandering in
the network.
• Time to Live (TTL) can be used to avoid infinite looping of packets. There exists
another approach for flooding, which is called Selective Flooding to reduce the
overhead on the network. In this method, the router does not flood out on all the
interfaces, but selective ones.
• Shortest Path
• Routing decision in networks, are mostly taken on the basis of cost between source
and destination. Hop count plays major role here. Shortest path is a technique which
Internetworking
• In real world scenario, networks under same administration are generally
scattered geographically. There may exist requirement of connecting two
different networks of same kind as well as of different kinds. Routing between
two networks is called internetworking.
• Networks can be considered different based on various parameters such as,
Protocol, topology, Layer-2 network and addressing scheme.
• In internetworking, routers have knowledge of each other’s address and
addresses beyond them. They can be statically configured go on different
network or they can learn by using internetworking routing protocol.
• Routing protocols which are used within an organization or administration are
called Interior Gateway Protocols or IGP. RIP(Routing Information Protocol),
OSPF (Open Shortest Path First)are examples of IGP. Routing between different
organizations or administrations may have Exterior Gateway Protocol, and
there is only one EGP i.e. Border Gateway Protocol.
Internetworking
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.
Network Layer
Protocols
• Every computer in a network has an IP address by which it can be
uniquely identified and addressed. An IP address is Layer-3
(Network Layer) logical address. This address may change every
time a computer restarts. A computer can have one IP at one
instance of time and another IP at some different time.
TCP/IP Model
• A majority of the internet uses a protocol suite called the Internet Protocol
Suite also known as the TCP/IP protocol suite. This suite is a combination of
protocols which encompasses a number of different protocols for different
purpose and need. Because the two major protocols in this suites are TCP
(Transmission Control Protocol) and IP (Internet Protocol), this is commonly
termed as TCP/IP Protocol suite. This protocol suite has its own reference
model which it follows over the internet. In contrast with the OSI model, this
model of protocols contains less layers. Thus this protocol has the
Internet Protocol is responsibility of identifying hosts
one of the major based upon their logical addresses
protocols in the and to route data among them
TCP/IP protocols over the underlying network.
suite. IP provides a mechanism to
This protocol works uniquely identify hosts by an IP
at the network layer addressing scheme. IP uses best
of the OSI model and effort delivery, i.e. it does not
at the Internet layer guarantee that packets would be
of the TCP/IP model. delivered to the destined host, but
it will do its best to reach the
Internet Protocol Version 4
(IPv4)
• Internet Protocol version 4 (IPv4) is the fourth version of the
Internet Protocol (IP).
• The first version of the protocol to be widely deployed.
• Internet Protocol version 4 uses 32-bit logical address.
• IPv4 is a connectionless protocol used in packet-switched layer networks, such
as Ethernet. It provides the 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 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 multicasting, while class E
addresses are reserved for future use.
IPv4 - Packet Structure
• Internet Protocol being a layer-3 protocol (OSI) takes data Segments from
layer-4 (Transport) and divides it into packets. IP packet encapsulates data unit
received from above layer and add to its own header information.

• The encapsulated data is referred to as IP Payload. IP header contains all the


necessary information to deliver the packet at the other end.
IPv4 - Packet Structure

• IP header includes many relevant information including Version Number, which, in this
context, is 4. Other details are as follows:
• Version: Version no. of Internet Protocol used (e.g. IPv4).
• IHL: Internet Header Length; Length of entire IP header.
IPv4 - Packet Structure
• DSCP: Differentiated Services Code Point; this is Type of Service. (The default
codepoint has the value 0 and denotes a best effort service.)
• ECN: Explicit Congestion Notification; It carries information about the
congestion seen in the route.
• Total Length: Length of entire IP Packet (including IP header and IP Payload).
• Identification: If IP packet is fragmented during the transmission, all the
fragments contain same identification number. to identify original IP packet
they belong to.
• Flags: As required by the network resources, if IP Packet is too large to
handle, these ‘flags’ tells if they can be fragmented or not. In this 3-bit flag,
the MSB is always set to ‘0’.
• Fragment Offset: This offset tells the exact position of the fragment in the
original IP Packet.
IPv4 - Packet Structure
• Time to Live: To avoid looping in the network, every packet is sent with some
TTL value set, which tells the network how many routers (hops) this packet can
cross. At each hop, its value is decremented by one and when the value
reaches zero, the packet is discarded.
• Protocol: Tells the Network layer at the destination host, to which Protocol
this packet belongs to, i.e. the next level Protocol. For example protocol
number of ICMP is 1, TCP is 6 and UDP is 17.
• Header Checksum: This field is used to keep checksum value of entire
header which is then used to check if the packet is received error-free.
• Source Address: 32-bit address of the Sender (or source) of the packet.
• Destination Address: 32-bit address of the Receiver (or destination) of the
packet.
• Options: This is optional field, which is used if the value of IHL is greater than
5. These options may contain values for options such as Security, Record
Hierarchical Addressing
Scheme
• IPv4 uses hierarchical addressing scheme. An IP address, which is 32-bits in
length, is divided into two or three parts as depicted:

• A single IP address can contain information about the network and its sub-
network and ultimately the host. This scheme enables the IP Address to be
hierarchical where a network can have many sub-networks which in turn can
have many hosts.
Subnet Mask
• The 32-bit IP address contains information about the host and its network. It is
very necessary to distinguish both. For this, routers use Subnet Mask, which is
as long as the size of the network address in the IP address. Subnet Mask is
also 32 bits long. If the IP address in binary is ANDed with its Subnet Mask, the
result yields the Network address. For example, say the IP Address is
192.168.1.152 and the Subnet Mask is 255.255.255.0 then:

• This way the Subnet Mask helps extract the Network ID and the Host from an
IP Address. It can be identified now that 192.168.1.0 is the Network number
and 192.168.1.152 is the host on that network.
Binary Representation
• The positional value method is the simplest form of converting binary from
decimal value. IP address is 32 bit value which is divided into 4 octets. A
binary octet contains 8 bits and the value of each bit can be determined by
the position of bit value '1' in the octet.

• Positional value of bits is determined by 2 raised to power (position – 1), that is


the value of a bit 1 at position 6 is 2^(6-1) that is 2^5 that is 32. The total
value of the octet is determined by adding up the positional value of bits. The
value of 11000000 is 128+64 = 192. Some examples are shown in the table
below:
IPv4 - Address Classes
• Internet Protocol hierarchy contains several classes of IP Addresses to be used
efficiently in various situations as per the requirement of hosts per network.
Broadly, the IPv4 Addressing system is divided into five classes of IP
Addresses. All the five classes are identified by the first octet of IP Address.
• Internet Corporation for Assigned Names and Numbers is responsible for
assigning IP addresses.
• The first octet referred here is the left most of all. The octets numbered as
follows depicting dotted decimal notation of IP Address:
IPv4 - Address Classes
• The number of networks and the number of hosts per class can be derived by
this formula:

• When calculating hosts' IP addresses, 2 IP addresses are decreased because


they cannot be assigned to hosts, i.e. the first IP of a network is network
number and the last IP is reserved for Broadcast IP.
Class A Address
• The first bit of the first octet is always set to 0 (zero). Thus the first octet
ranges from 1 – 127, i.e.

• Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP
range 127.x.x.x is reserved for loopback IP addresses.
• The default subnet mask for Class A IP address is 255.0.0.0 which implies that
Class A addressing can have 126 networks (27-2) and 16777214 hosts (224-2).
• Class A IP address format is thus:

0NNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH
Class B Address
• An IP address which belongs to class B has the first two bits in the first octet
set to 10, i.e.

• Class B IP Addresses range from 128.0.x.x to 191.255.x.x. The default subnet


mask for Class B is 255.255.x.x.
• Class B has 16384 (214) Network addresses and 65534 (216-2) Host addresses.
• Class B IP address format is:

10NNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH
Class C Address
• The first octet of Class C IP address has its first 3 bits set to 110, that is:

• Class C IP addresses range from 192.0.0.x to 223.255.255.x. The default


subnet mask for Class C is 255.255.255.x.
• Class C gives 2097152 (221) Network addresses and 254 (28-2) Host
addresses.
• Class C IP address format is:

110NNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH
Class D Address
• Very first four bits of the first octet in Class D IP addresses are set to 1110,
giving a range of:

• Class D has IP address rage from 224.0.0.0 to 239.255.255.255. Class D is


reserved for Multicasting. In multicasting data is not destined for a particular
host, that is why there is no need to extract host address from the IP address,
and Class D does not have any subnet mask.
Multicast
• To transmit a single message to a select group of recipients. A simple
example of multicasting is sending an e-mail message to a mailing list.
Teleconferencing and videoconferencing also use multicasting, but require
more robust protocols and networks. Standards are being developed to
support multicasting over a TCP/IP network such as the Internet.
• Note that multicasting refers to sending a message to a select group
whereas broadcasting refers to sending a message to everyone connected
to a network.
• The terms multicast and narrowcast are often used interchangeably,
although narrowcast usually refers to the business model whereas
multicast refers to the actual technology used to transmit the data.
Class E Address
• This IP Class is reserved for experimental purposes only for R&D or Study. IP
addresses in this class ranges from 240.0.0.0 to 255.255.255.254. Like Class
D, this class too is not equipped with any subnet mask.
• Class E was set aside for "experimental" use. In fact, that chunk of of about 268 million
IPv4 addresses is still designated by IANA for "future use" today.
• The Internet Assigned Numbers Authority (IANA) is a function of ICANN, a
nonprofit private American corporation that oversees global IP address
allocation, autonomous system number allocation, root zone management in
the Domain Name System (DNS), media types, and other Internet Protocol-
related symbols and Internet numbers
• Before ICANN was established primarily for this purpose in 1998, IANA was
administered principally by Jon Postel at the Information Sciences Institute (ISI)
of the University of Southern California (USC) situated at Marina Del Rey (Los
Angeles), under a contract USC/ISI had with the
United States Department of Defense,
• IANA is broadly responsible for the allocation of globally unique names and
numbers that are used in Internet protocols that are published as
Request for Comments documents. These documents describe methods,
behaviors, research, or innovations applicable to the working of the Internet
and Internet-connected systems.[4] IANA maintains a close liaison with the
Internet Engineering Task Force (IETF) and RFC Editorial team in fulfilling this
IPv4 - Subnetting

• Each IP class is equipped with its own default subnet mask which
bounds that IP class to have prefixed number of Networks and
prefixed number of Hosts per network. Classful IP addressing
does not provide any flexibility of having less number of Hosts
per Network or more Networks per IP Class.
• CIDR or Classless Inter Domain Routing provides the flexibility
of borrowing bits of Host part of the IP address and using them as
Network in Network, called Subnet. By using subnetting, one
single Class A IP address can be used to have smaller sub-
networks which provides better network management
capabilities.
Class A Subnets

• In Class A, only the first octet is used as Network identifier and rest of three
octets are used to be assigned to Hosts (i.e. 16777214 Hosts per Network). To
make more subnet in Class A, bits from Host part are borrowed and the
subnet mask is changed accordingly.
• For example, if one MSB (Most Significant Bit) is borrowed from host bits of
second octet and added to Network address, it creates two Subnets (21=2)
with (223-2) 8388606 Hosts per Subnet.
• The Subnet mask is changed accordingly to reflect subnetting. Given below is
a list of all possible combination of Class A subnets:
In case of subnetting too, the
very first and last IP address of
every subnet is used for Subnet
Number and Subnet Broadcast
IP address respectively. Because
these two IP addresses cannot
be assigned to hosts, sub-
netting cannot be implemented
by using more than 30 bits as
Network Bits.
Class B Subnets
• By default, using Classful
Networking, 14 bits are used
as Network bits providing
(214) 16384 Networks and
(216-2) 65534 Hosts. Class B IP
Addresses can be subnetted
the same way as Class A
addresses, by borrowing bits
from Host bits. Below is given
all possible combination of
Class B subnetting:
Class C Subnets
• Class C IP addresses are normally assigned to a very small size network
because it can only have 254 hosts in a network. Given below is a list of all
possible combination of subnetted Class B IP address:
IPv4 - Reserved
Addresses
• There are a few reserved IPv4 address spaces
which cannot be used on the internet. These
addresses serve special purpose and cannot be
routed outside the Local Area Network.
Private IP Addresses
• Every class of IP, (A, B & C) has some addresses reserved as Private IP
addresses. These IPs can be used within a network, campus, company and are
private to it. These addresses cannot be routed on the Internet, so packets
containing these private addresses are dropped by the Routers.
• In order to communicate with the outside world, these IP addresses must have
to be translated to some public IP addresses using NAT process, or Web Proxy
server can be used.
• The sole purpose to create a separate range of private addresses is to control
assignment of already-limited IPv4 address pool. By using a private address
range within LAN, the requirement of IPv4 addresses has globally decreased
significantly. It has also helped delaying the IPv4 address exhaustion.
• IP class, while using private address range, can be chosen as per the size and
requirement of the organization. Larger organizations may choose class A
private IP address range where smaller organizations may opt for class C.
These IP addresses can be further sub-netted and assigned to departments
Loopback IP Addresses
• The IP address range 127.0.0.0 – 127.255.255.255 is reserved for
loopback, i.e. a Host’s self-address, also known as localhost address. This
loopback IP address is managed entirely by and within the operating
system. Loopback addresses, enable the Server and Client processes on a
single system to communicate with each other. When a process creates a
packet with destination address as loopback address, the operating
system loops it back to itself without having any interference of NIC.
• Data sent on loopback is forwarded by the operating system to a virtual
network interface within operating system. This address is mostly used for
testing purposes like client-server architecture on a single machine. Other
than that, if a host machine can successfully ping 127.0.0.1 or any IP from
loopback range, implies that the TCP/IP software stack on the machine is
successfully loaded and working.
Link-local Addresses
• The link-local address is always assigned to a device by itself. In more detail,
the device chooses an IP address (from a specified range) and sends this IP
address to other devices in the network. If this IP address is not occupied by
other devices
• In case a host is not able to acquire an IP address from the DHCP server and it
has not been assigned any IP address manually, the host can assign itself an IP
address from a range of reserved Link-local addresses. Link local address
ranges from 169.254.0.0 -- 169.254.255.255.
• Assume a network segment where all systems are configured to acquire IP
addresses from a DHCP server connected to the same network segment. If the
DHCP server is not available, no host on the segment will be able to
communicate to any other. Windows (98 or later), and Mac OS (8.0 or later)
supports this functionality of self-configuration of Link-local IP address. In
absence of DHCP server, every host machine randomly chooses an IP address
from the above mentioned range and then checks to ascertain by means of
ARP, if some other host also has not configured itself with the same IP address.
Address Resolution
Protocol(ARP)
• While communicating, a host needs Layer-2 (MAC) address of the destination
machine which belongs to the same broadcast domain or network. A MAC
address is physically burnt into the Network Interface Card (NIC) of a machine
and it never changes.
• On the other hand, IP address on the public domain is rarely changed. If the
NIC is changed in case of some fault, the MAC address also changes. This way,
for Layer-2 communication to take place, a mapping between the two is
required.
Address Resolution Protocol(ARP)
• To know the MAC address of remote host on a broadcast domain, a
computer wishing to initiate communication sends out an ARP broadcast
message asking, “Who has this IP address?” Because it is a broadcast, all
hosts on the network segment (broadcast domain) receive this packet and
process it. ARP packet contains the IP address of destination host, the
sending host wishes to talk to. When a host receives an ARP packet
destined to it, it replies back with its own MAC address.
• Once the host gets destination MAC address, it can communicate with
remote host using Layer-2 link protocol. This MAC to IP mapping is saved
into ARP cache of both sending and receiving hosts. Next time, if they
require to communicate, they can directly refer to their respective ARP
cache.
• Reverse ARP is a mechanism where host knows the MAC address of
remote host but requires to know IP address to communicate.
Internet Control Message Protocol
(ICMP)

• ICMP is network diagnostic and error reporting protocol. ICMP belongs to IP


protocol suite and uses IP as carrier protocol. After constructing ICMP
packet, it is encapsulated in IP packet. Because IP itself is a best-effort
non-reliable protocol, so is ICMP.
• Any feedback about network is sent back to the originating host. If some
error in the network occurs, it is reported by means of ICMP. ICMP contains
dozens of diagnostic and error reporting messages.
• ICMP-echo and ICMP-echo-reply are the most commonly used ICMP
messages to check the reachability of end-to-end hosts. When a host
receives an ICMP-echo request, it is bound to send back an ICMP-echo-
reply. If there is any problem in the transit network, the ICMP will report
that problem.
RIP
• The Routing Information Protocol (RIP) is one of a family of IP Routing
protocols, and is an Interior Gateway Protocol (IGP) designed to
distribute routing information within an Autonomous System (AS).
• Within the Internet, an autonomous system (AS) is a collection of
connected Internet Protocol (IP) routing prefixes under the control of
one or more network operators on behalf of a single administrative
entity or domain that presents a common, clearly defined routing
policy to the Internet.
• RIP is a simple vector routing protocol with many existing
implementations in the field. In a vector routing protocol, the routers
exchange network reachability information with their nearest
neighbors. In other words, the routers communicate to each other the
sets of destinations ("address prefixes") that they can reach, and the
next hop address to which data should be sent in order to reach those
In brief the RIP protocol works as
follows.
• Each router initializes its routing table with a list of locally connected networks.
• Periodically, each router advertises the entire contents of its routing table over all
of its RIP-enabled interfaces.
• Whenever a RIP router receives such an advertisement, it puts all of the appropriate
routes into its routing table and begins using it to forward packets. This process ensures
that every network connected to every router eventually becomes known to all routers.

• If a router does not continue to receive advertisements for a remote route, it eventually
times out that route and stops forwarding packets over it.

• Every route has a property called a metric, which indicates the "distance" to the
route's destination.
• Every time a router receives a route advertisement, it increments the metric.
• Routers prefer shorter routes to longer routes when deciding which of two versions of a
route to program in the routing table.
• The maximum metric permitted by RIP is 16, which means that a route is unreachable.
This means that the protocol cannot scale to networks where there may be more than
15 hops to a given destination.
OSPF
• The OSPF (Open Shortest Path First) protocol is one of a family of IP
Routing protocols, and is an Interior Gateway Protocol (IGP) for the
Internet, used to distribute IP routing information throughout a single
Autonomous System (AS) in an IP network.
• The OSPF protocol is a link-state routing protocol, which means that the
routers exchange topology information with their nearest neighbors. The
topology information is flooded throughout the AS, so that every router
within the AS has a complete picture of the topology of the AS. This
picture is then used to calculate end-to-end paths through the AS, normally using a variant of the Dijkstra algorithm.

Therefore, in a link-state routing protocol, the next hop address to which


data is forwarded is determined by choosing the best end-to-end path to
the eventual destination.
• The main advantage of a link state routing protocol like OSPF is that the
complete knowledge of topology allows routers to calculate routes that satisfy
particular criteria. This can be useful for traffic engineering purposes, where
routes can be constrained to meet particular quality of service requirements. The
main disadvantage of a link state routing protocol is that it does not scale well as
more routers are added to the routing domain. Increasing the number of routers
increases the size and frequency of the topology updates, and also the length of
time it takes to calculate end-to-end routes. This lack of scalability means that a
link state routing protocol is unsuitable for routing across the Internet at large,
which is the reason why IGPs only route traffic within a single AS.
• Each OSPF router distributes information about its local state (usable interfaces
and reachable neighbors, and the cost of using each interface) to other routers
using a Link State Advertisement (LSA) message. Each router uses the received
messages to build up an identical database that describes the topology of the
AS.
• From this database, each router calculates its own routing table using a Shortest
Path First (SPF) . This routing table contains all the destinations the routing
or Dijkstra algorithm
BGP (Border Gateway
Protocol)
• BGP (Border Gateway Protocol) is protocol that manages how packets are
routed across the internet through the exchange of routing and
reachability information between edge routers. BGP directs packets
between autonomous systems (AS) -- networks managed by a single
enterprise or service provider. Traffic that is routed within a single network
AS is referred to as internal BGP, or iBGP. More often, BGP is used to
connect one AS to other autonomous systems, and it is then referred to as
an external BGP, or eBGP.
• BGP offers network stability that guarantees routers can quickly adapt to
send packets through another reconnection if one internet path goes
down. BGP makes routing decisions based on paths, rules or network
policies configured by a network administrator. Each BGP router maintains
a standard routing table used to direct packets in transit. This table is
used in conjunction with a separate routing table, known as the routing
information base (RIB), which is a data table stored on a server on the
BGP routing basics

What is Border
Gateway Protocol
(BGP)?
The Border Gateway
Protocol (BGP) is one
of a family of IP
Routing protocols, and
is an Exterior Gateway
Protocol (EGP)
designed to distribute
routing information
between ASs.
Congestion Control
• Congestion is an important issue that can arise in packet switched
network. Congestion is a situation in Communication Networks in which
too many packets are present in a part of the subnet, performance
degrades. Congestion in a network may occur when the load on the
network (i.e. the number of packets sent to the network) is greater than
the capacity of the network (i.e. the number of packets a network can
handle.)
• In other words when too much traffic is offered, congestion sets in and
performance degrades sharply
Causing of
•Congestion:
The various causes of congestion in a subnet are:
• The input traffic rate exceeds the capacity of the output lines. If suddenly, a
stream of packet start arriving on three or four input lines and all need the
same output line. In this case, a queue will be built up.
• The routers are too slow to perform bookkeeping tasks (queuing buffers,
updating tables, etc.)
• The routers' buffer is too limited.
• Congestion in a subnet can occur if the processors are slow. Slow speed CPU at
routers will perform the routine tasks such as queuing buffers, updating table
etc slowly. As a result of this, queues are built up even though there is excess
line capacity.
• Congestion is also caused by slow links.
How to correct the Congestion
Problem:
• Congestion Control refers to techniques and mechanisms that can either
prevent congestion, before it happens, or remove congestion, after it has
happened. Congestion control mechanisms are divided into two
categories, one category prevents the congestion from happening and the
other category removes congestion after it has taken place.
These two categories are: Open
Loop & Closed Loop

• Open Loop Congestion Control


• In this method, policies are used to prevent the congestion before it
happens.
• Congestion control is handled either by the source or by the
destination.
• The various methods used for open loop congestion control are:
• Retransmission Policy
• • The sender retransmits a packet, if it feels that the packet it has sent is
lost or corrupted.
• • However retransmission in general may increase the congestion in the
network. But we need to implement good retransmission policy to prevent
congestion.
• • The retransmission policy and the retransmission timers need to be
designed to optimize efficiency and at the same time prevent the
congestion.
• Window Policy
• • To implement window policy, selective reject window method is used for
congestion control.
• • Selective Reject method is preferred over Go-back-n window as in Go-
back-n method, when timer for a packet times out, several packets are
resent, although some may have arrived safely at the receiver. Thus, this
duplication may make congestion worse.
• Acknowledgement Policy
• • The acknowledgement policy imposed by the receiver may also affect
congestion.
• • If the receiver does not acknowledge every packet it receives it may slow
down the sender and help prevent congestion.
• • Acknowledgments also add to the traffic load on the network. Thus, by
sending fewer acknowledgements we can reduce load on the network.
• • To implement it, several approaches can be used:
• 1. A receiver may send an acknowledgement only if it has a packet to be
sent.
• 2. A receiver may send an acknowledgement when a timer expires.
• 3. A receiver may also decide to acknowledge only N packets at a time.
• Discarding Policy
• • A router may discard less sensitive packets when congestion is likely to
happen.
• Admission Policy
• • An admission policy, which is a quality-of-service
mechanism, can also prevent congestion in virtual circuit
networks.
• • Switches in a flow first check the resource requirement of a
flow before admitting it to the network.
• • A router can deny establishing a virtual circuit connection if
there is congestion in the "network or if there is a possibility of
future congestion.
• Closed Loop Congestion Control

• • Closed loop congestion control mechanisms try to remove the congestion


after it happens.

• • The various methods used for closed loop congestion control are:
• Backpressure
• • Backpressure is a node-to-node congestion control that starts with a
node and propagates, in the opposite direction of data flow.
• • The backpressure technique can be applied only to virtual circuit
networks. In such virtual circuit each node knows the upstream node from
which a data flow is coming.
• • In this method of congestion control, the congested node stops receiving
data from the immediate upstream node or nodes.
• • This may cause the upstream node on nodes to become congested, and
they, in turn, reject data from their upstream node or nodes.
• As shown in fig node 3 is congested and it stops receiving packets and informs its
upstream node 2 to slow down. Node 2 in turns may be congested and informs node 1
to slow down. Now node 1 may create congestion and informs the source node to slow
down. In this way the congestion is alleviated. Thus, the pressure on node 3 is moved
backward to the source to remove the congestion.
• Choke Packet
• • In this method of congestion control, congested router or node sends a
special type of packet called choke packet to the source to inform it about
the congestion.
• • Here, congested node does not inform its upstream node about the
congestion as in backpressure method.
• • In choke packet method, congested node sends a warning directly to the
source station i.e. the intermediate nodes through which the packet has
traveled are not warned.
• Implicit Signaling
• • In implicit signaling, there is no communication between the congested node or nodes and the
source.
• • The source guesses that there is congestion somewhere in the network when it does not receive
any acknowledgment. Therefore the delay in receiving an acknowledgment is interpreted as
congestion in the network.
• • On sensing this congestion, the source slows down.
• • This type of congestion control policy is used by TCP.
• Explicit Signaling
• • In this method, the congested nodes explicitly send a signal to the source or destination to inform
about the congestion.
• • Explicit signaling is different from the choke packet method. In choke packed method, a separate
packet is used for this purpose whereas in explicit signaling method, the signal is included in the
packets that carry data .
• • Explicit signaling can occur in either the forward direction or the backward direction .
• • In backward signaling, a bit is set in a packet moving in the direction opposite to the congestion.
This bit warns the source about the congestion and informs the source to slow down.
• • In forward signaling, a bit is set in a packet moving in the direction of congestion. This bit warns
the destination about the congestion. The receiver in this case uses policies such as slowing down
the acknowledgements to remove the congestion.
Congestion control
algorithms
• Leaky Bucket Algorithm

• It is a traffic shaping mechanism that controls the amount


and the rate of the traffic sent to the network.
• A leaky bucket algorithm shapes bursty traffic into fixed rate
traffic by averaging the data rate.
• Imagine a bucket with a small hole at the bottom.
• The rate at which the water is poured into the bucket is not
fixed and can vary but it leaks from the bucket at a constant
rate. Thus (as long as water is present in bucket), the rate at
which the water leaks does not depend on the rate at which
the water is input to the bucket.
• Also, when the bucket is full, any additional water that enters into the bucket spills over the sides
and is lost.

• • The same concept can be applied to packets in the network. Consider that data is coming from the
source at variable speeds. Suppose that a source sends data at 12 Mbps for 4 seconds. Then there is
no data for 3 seconds. The source again transmits data at a rate of 10 Mbps for 2 seconds. Thus, in a
time span of 9 seconds, 68 Mb data has been transmitted.

• If a leaky bucket algorithm is used, the data flow will be 8 Mbps for 9 seconds. Thus constant flow is
maintained.
Token bucket
Algorithm
• The leaky bucket algorithm allows only an average (constant) rate of
data flow. Its major problem is that it cannot deal with bursty data.
• A leaky bucket algorithm does not consider the idle time of the host.
For example, if the host was idle for 10 seconds and now it is willing
to sent data at a very high speed for another 10 seconds, the total
data transmission will be divided into 20 seconds and average data
rate will be maintained. The host is having no advantage of sitting
idle for 10 seconds.
• To overcome this problem, a token bucket algorithm is used. A token
bucket algorithm allows bursty data transfers.
• A token bucket algorithm is a modification of leaky bucket in which
leaky bucket contains tokens.
• In this algorithm, a token(s) are
generated at every clock tick. For a
packet to be transmitted, system must
remove token(s) from the bucket.
• Thus, a token bucket algorithm allows
idle hosts to accumulate credit for the
future in form of tokens.
• For example, if a system generates
100 tokens in one clock tick and the
host is idle for 100 ticks. The bucket
will contain 10,000 tokens.
• Now, if the host wants to send bursty
data, it can consume all 10,000 tokens
at once for sending 10,000 cells or
bytes.
• Thus a host can send bursty data as
long as bucket is not empty.
Network Address Translation
(NAT)
• A NAT (Network Address Translation or Network Address Translator) is the
virtualization of Internet Protocol (IP) addresses. NAT helps improve
security and decrease the number of IP addresses an organization needs.
• Network Address Translation (NAT) is designed for IP address conservation.
It enables private IP networks that use unregistered IP addresses to
connect to the Internet. NAT operates on a router, usually connecting two
networks together, and translates the private (not globally unique)
addresses in the internal network into legal addresses, before packets are
forwarded to another network.
• As part of this capability, NAT can be configured to advertise only one
address for the entire network to the outside world. This provides
additional security by effectively hiding the entire internal network behind
that address. NAT offers the dual functions of security and address
conservation and is typically implemented in remote-access environments.
Network Address Translation
(NAT)
• Basically, NAT allows a single device, such as a router, to act as an
agent between the Internet (or public network) and a local network (or
private network), which means that only a single unique IP address is
required to represent an entire group of computers to anything
outside their network.
• In order to configure traditional NAT, you need to make at least one
interface on a router (NAT outside) and another interface on the router
(NAT inside)
Quality of service (QoS)
• Quality of service (QoS) refers to a network’s ability to achieve
maximum bandwidth and deal with other network performance
elements like latency, error rate and uptime. Quality of service also
involves controlling and managing network resources by setting
priorities for specific types of data (video, audio, files) on the
network. QoS is exclusively applied to network traffic generated for
video on demand, IPTV, VoIP, streaming media, videoconferencing
and online gaming.
• As the number of Internet users continues to grow, network
performance requirements must increase right along with them. In
addition, many of the latest online services require high amounts of
bandwidth and network performance. Network performance is an
element of concern both for the user and the service provider.
Internet service providers need to apply techniques and technologies
• The primary goal of quality of service is to provide priority to
networks, including dedicated bandwidth, controlled jitter, low
latency and improved loss characteristics. Its technologies
supply the elemental building blocks that will be used for
future business applications in campus, wide area networks
and service provider networks.
• There are three fundamental components for basic QoS
implementation:
• Identification and marking techniques for coordinating QoS from end
to end between network elements
• QoS within a single network element
• QoS policy, management, and accounting functions to control and
MPLS
• MPLS is a new forwarding mechanism called “label switching” in which packets
are forwarded based on labels. However, hosts are unaware about labeled
packets so routers will need to add a label when entering “MPLS area” and
remove that label after leaving there.
• The idea of label switching is to have only the first router do an IP lookup and
assign a label, then all future routes in the network can “cheat” by doing exact
match “switching” based on a label. This would reduce load on the core
routers, where high-performance was the most difficult to achieve, and
distribute the routing lookups across lower speed edge routers.
• In a traditional IP network:
* Each router performs an IP lookup (“routing”), determines a next-hop based
on its routing table, and forwards the packet to that next-hop.
* Rinse and repeat for every router, each making its own independent routing
decisions, until the final destination is reached.
MPLS
• MPLS does “label switching” instead:
* The first device does a routing lookup, just like before.
* But instead of finding a next-hop, it finds the final destination router.
* And it finds a pre-determined path from “here” to that final router.
* The router applies a “label” (or “shim”) based on this information.
* Future routers use the label to route the traffic without needing to perform
any additional IP lookups.
* At the final destination router, the label is removed and the packet is
delivered via normal IP routing.
• Therefore in an MPLS network, data packets are assigned labels.
Packet-forwarding decisions are made solely on the contents of this
label, without the need to examine the packet itself.

You might also like