0% found this document useful (0 votes)
21 views61 pages

BCA Routing

The document discusses routing in computer networks, detailing the process of selecting paths for data transmission through routers and the algorithms that facilitate this. It covers various routing techniques including unicast, broadcast, and multicast, as well as adaptive and non-adaptive algorithms. Additionally, it explains the concept of internetworking, the requirements for effective communication between different networks, and the service model of the Internet Protocol (IP).

Uploaded by

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

BCA Routing

The document discusses routing in computer networks, detailing the process of selecting paths for data transmission through routers and the algorithms that facilitate this. It covers various routing techniques including unicast, broadcast, and multicast, as well as adaptive and non-adaptive algorithms. Additionally, it explains the concept of internetworking, the requirements for effective communication between different networks, and the service model of the Internet Protocol (IP).

Uploaded by

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

Routing

Computer Networks Routing

ROUTING

Prof: Koushal Kumar


Sikh National college
Routing

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.
•A routing algorithm is that part of the network layer
responsible for deciding which output line an
incoming packet should be transmitted on.
Purpose of routing
 However, not all nodes are usually
connected to each other, as connecting all
nodes directly to each other involves lots of
wires/cables and/or high-powered
transceivers.
 Nodes in network must forward other nodes’
transmissions to correct destination.
 The process of determining where to
forward packets and actually doing so is
called routing.
Desirable properties of routing
 All packets should reach their destination
(unless prevented by other factors, e.g.
congestion).
 Data transfer should be as quick and
efficient as possible. Using the shortest or
fastest route helps achieve this.
 Routing computations should be as quick
and easy as possible.
CONTINUE….
• The algorithm should adapt to: – Topology
changes (new or removed channels). –
Changing load.
• A routing algorithm is that part of the
network layer responsible for deciding
which output line an incoming packet
should be transmitted on.
Routing

Router
A router is a device that determines the next
network point to which a packet should be
forwarded toward its destination
Allow different networks to communicate with each
other
A router creates and maintain a table of the
available routes and their conditions and uses this
information to determine the best route for a given
packet.
A packet will travel through a number of network
points with routers before arriving at its destination.
There can be multiple routes defined. The route with
a lower weight/metric will be tried first.
Continue…..
• 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
• Delay
Classification on the basis of transmission
techniques
Unicast Routing: Unicast means the
transmission from a single sender to a single
receiver. It is a point to point communication
between sender and receiver. Most of the
traffic on the internet and intranets known as
unicast data or unicast traffic is sent with
specified destination..
Continue…..

• 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.
• There are various unicast protocols such
as TCP, HTTP, etc.
continue….
• TCP is the most commonly used unicast
protocol. It is a connection oriented protocol
that relay on acknowledgement from the
receiver side.
• HTTP stands for Hyper Text Transfer
Protocol. It is an object oriented protocol for
communication.
Continue…
Broadcast routing
• Deliver packets from a source to all other
nodes even if they do not want it. 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.
Continue…
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.
Continue…
Adaptive vs. Non-Adaptive Algorithms
• Non-Adaptive Algorithms: These algorithms
do not base their routing decisions on
measurements and estimates of the current
traffic and topology. Instead the route to be
taken in going from one node to the other is
computed in advance, off-line, and
downloaded to the routers when the network is
booted. This is also known as static routing.
Adaptive Algorithms
• These algorithms change their routing
decisions to reflect changes in the
topology and in traffic as well. These get
their routing information from adjacent
routers or from all routers. The
optimization parameters are the distance,
number of hops and estimated transit
time.
Desirable properties of Routing
algorithms
• Correctness: The routing should be
done properly and correctly so that the
packets may reach their proper
destination.
• Simplicity: The routing should be done
in a simple manner so that the overhead
is as low as possible. With increasing
complexity of the routing algorithms the
overhead also increases.
Network layer -- May 18
2004
Continue…..
• Robustness: Once a major network
becomes operative, it may be expected to
run continuously for years without any
failures. The algorithms designed for
routing should be robust enough to handle
hardware and software failures and should
be able to cope with changes in the
topology and traffic without requiring all
jobs in all hosts to be aborted and the
network rebooted every time some router
goes down.
Continue….
• Stability: The routing algorithms should be
stable under all possible circumstances.
• Fairness: Every node connected to the
network should get a fair chance of
transmitting their packets. This is generally
done on a first come first serve basis.
• Optimality: The routing algorithms should be
optimal in terms of throughput and minimizing
mean packet delays. Here there is a trade-off
and one has to choose depending on his
suitability.
Optimality principle
• The optimality principle states that if router
J is on the optimal path from router I to
router K, then the optimal path from J to K
also falls along the same route.
• As a consequence of that principle, we
can see that the set of optimal routes from
all sources to a given destination form a
tree rooted at the destination. Such tree is
called a sink tree.
Sink Trees
• The set of optimal
routes to a particular
node forms a sink
tree.
• Sink trees are not
necessarily unique
• Goal of all routing
algorithms
– Discover sink trees for
all destinations
Routing algorithms
Optimal path from I to K over J
• Optimality principle
I d1 distance  K
d2
d1 + d2 is minimal
J  d3
Other path from J to K
d3 > d 2
Set of all optimal routes as
• from all sources d1 + d 3 > d 1 + d 2
• to a given destination
is a tree: sink tree
Network layer -- May 23
2004
Shortest path Algorithm
• Build a graph of network
• Each node represent a router
• Each arc represent a link
• Find shortest path between the two nodes
Each arc is labeled with a weight
• number of hops
• geographic distance
• mean queuing/transmission delay
• bandwidth
• cost
Shortest Path Routing
(a nonadaptive routing algorithm)
• It is really the least-cost path routing, based on
dynamic programming for optimization.
• Given a network topology and a set of weights
describing the cost to send data across each
link in the network
• Find the shortest path from a specified source
to all other destinations in the network.
• Shortest path algorithm first developed by E.
W. Dijkstra.
Continue….
• Basic idea: At each step, select a newly
reachable node at the lowest cost, and
add an edge to that node, so to connect
it to the tree built up so far.
• Consider network configuration, where
nodes labeled as A to H are routers,
and each link has a cost associated with
it.
Example of shortest path
Explanation
Least-cost path for A → D
Step1: B is lowest-cost node reachable from
A, adds edge A−B.
Step2: E is lowest-cost node reachable from
the tree with A and B, adds lowest-cost
edge B − E.
Step3: G is lowest-cost node reachable from
the tree with A, B and E, adds lowest-cost
edge E − G.
Continue….
Step4: F is the one with lowest-cost edge
E−F.
Step5: H is the one with lowest-cost edge
F − H.
Step6: Adding lowest-cost edge H − D
gives “shortest” path from A to D: A − B
−E−F−H−D
Dijkstra’s Algorithm
• Finds shortest paths from given source
node s to all other nodes.
• Develops paths in order of increasing
path length.
• Runs in stages, each time adding node
with next shortest path.
• algorithm terminates when all nodes
processed by algorithm
Example
Continue…
Continue….
Continue….
Continue…
Continue….
Continue….
Continue…
Continue…
Continue….
Flooding
• That is another static algorithm, in which
every incoming packet is sent out on
every outgoing line except the one it
arrived on.
• Flooding generates infinite number of
duplicate packets unless some
measures are taken to damp the
process.
• Several measures are takes to stop the
duplication of packets.
Continue….
• One solution is to include a hop counter in
the header of each packet. This counter is
decremented at each hop along the path.
When this counter reaches zero the packet
is discarded.
• Ideally, the hop counter should become zero
at the destination hop, indicating that there
are no more intermediate hops and
destination is reached. This requires the
knowledge of exact number of hops from a
source to destination.
Continue…
• Another technique is to keep the track of the
packed that have been flooded, to avoid
sending them a second time. For this, the
source router put a sequence number in
each packet it receives from its hosts.
• Each router then needs a list per source
router telling which sequence numbers
originating at that source have already been
seen. If an incoming packet is on the list, it
is not flooded.
Flooding
Internetworks
• When we speak of a network we will
be speaking about a single technology
network (Ethernet, Token Ring, ATM,
Point to Point, WaveLan, etc.)
• An internetwork is an interconnected
collection of such networks.
• An internetwork is a collection of
individual networks, connected by
intermediate networking devices, that
functions as a single large network
• The Internet Protocol (IP) is the key
toll used today to build scalable,
heterogeneous internetworks.
Conceptual layering of protocol
software
Message sent Message received

Layer n

Layer 2
Layer 1
Sender Communication Recipient
medium

OCT 46
What is internetworking?
• Connect multiple networks of one or more
organizations into a large, uniform
communication system.
• The resulting system is called an
internetwork or internet.
• Each intermediate network must agree to
handle transit in exchange for the right to
send traffic throughout the internet.
A simple internetwork where H represents hosts and R
represents routers
Network 1 (Ethernet)

H7 R3 H8
H1 H2 H3

Network 4
Network 2 (Ethernet) (point-to-point)
R1

R2

H4
Network 3 (FDDI)

H5 H6
Continue….
• An internetwork is a network of networks
– in the figure, we see Ethernets, an FDDI ring,
and a point-to-point link
– each of these is a single-technology network
– the nodes that interconnect the networks are
called routers (sometimes called gateways).
– The following figure shows how H1 and H8
are logically connected by the internet,
including the protocol graph running on each
node
• A simple internetwork of protocol stack

H1 H8

TCP R1 R2 R3 TCP

IP IP IP IP IP

ETH ETH FDDI FDDI PPP PPP ETH ETH

Protocol layers used to connect H1 to H8.


ETH: the protocol that runs over Ethernet.

50
Requirements for Internetworking
The overall requirements for an internetworking
facility are:
1.Provide a link between networks. At minimum,
a physical and link control connection is
needed.
2.Provide for the routing and delivery of data
between processes on different networks.
3. Provide an accounting service that keeps track of
the use of the various networks and routers and
maintains status information.
Continue…..
Provide the services just listed without
requiring modifications to the networking
architecture of constituent networks. This
means accommodating the following
differences:
 Different addressing schemes: e.g., naming
(DNS), DHCP.
 Different maximum packet size: e.g.,
segmentation, ATM cells.
 Different network access mechanisms: e.g.,
Ethernet, FDDI, ATM.
Continue…
 Different error recovery services: some
networks will have it, others won’t.
Internetwork error recovery should be
independent of individual networks.
 Different status reporting: how and
whether this information can be
shared.
 Different routing techniques: may
depend on fault detection and
congestion control techniques.
Coordination is needed.
 Connection-oriented vs. connectionless
4.1.2 Service Model
• A good place to start when you build an internetwork
is to define its service model
• A service model is the host-to-host services you
want to provide
• Service model for an internetwork
– a host-to-host service only if this service can
somehow be provided over each of the
underlying physical networks

54
4.1.2 Service Model
• IP service model has two parts
– addressing scheme
• provides a way to identify all hosts in the internetwork
– datagram (conectionless) model of data delivery
• This service model is sometimes called best effort
– although IP makes every effort to deliver datagrams, it
makes no guarantees

55
Continue….
• Datagram
– a type of packet sent in a connectionless
manner over a network
– every datagram carry enough information
to let the network forward the packet to its
correct destination
– no need for any advance setup mechanism
to tell the network what to do when the
packet arrives

56
• Best-effort delivery (unreliable service)
– if something goes wrong and has the
following situations
• packets are lost
• packets are delivered out of order
• duplicate copies of a packet are delivered
• packets can be delayed for a long time
– the network does not make any attempt to
recover from the failure

57
• Best-effort, connectionless service is
about the simplest service you could ask
for from an internetwork
• If you provide best-effort service over a
network that provides a reliable service,
then that’s fine

58
IPv4 header format
• Datagram format
0 4 8 16 19 31
Version HLen TOS Length

Ident Flags Offset

TTL Protocol Checksum

SourceAddr

DestinationAddr

Options (variable) Pad


(variable)
Data

59
Continue….
• Devices that connect networks are called
Internetworking devices. Internetworking
devices are divided into categories based on
the OSI layer at which they operate.
• Repeaters operate at the physical layer.
• Bridges operate at the Data Link layer.
• Routers operate at the Network layer.
• Gateways operate at any layer higher than the
Network layer.
Internetworking Devices

Internetworking Devices
Device Description
Hub Hubs are used to connect multiple users to a single physical device,
which connects to the network. Hubs and concentrators act as
repeaters by regenerating the signal as it passes through them.
Bridge Bridges are used to logically separate network segments within the
same network. They operate at the OSI data link layer (Layer 2) and
are independent of higher-layer protocols.
Switch Switches are similar to bridges but usually have more ports.
Switches provide a unique network segment on each port, thereby
separating collision domains. Today, network designers are
replacing hubs in their wiring closets with switches to increase their
network performance and bandwidth while protecting their existing
wiring investments.
Router Routers separate broadcast domains and are used to connect
different networks. Routers direct network traffic based on the
destination network layer address (Layer 3) rather than the
workstation data link layer or MAC address.

You might also like