0% found this document useful (0 votes)
7 views

7 Routing

Wide Area Networks connect smaller networks over large geographical areas using packet switching and routing. Packet switching breaks messages into packets that are transmitted between nodes and reassembled at the destination. Each node has a routing table that determines the next hop for packets based on their destination. Routing protocols dynamically update and maintain these tables when network conditions change.

Uploaded by

Saras Pantulwar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

7 Routing

Wide Area Networks connect smaller networks over large geographical areas using packet switching and routing. Packet switching breaks messages into packets that are transmitted between nodes and reassembled at the destination. Each node has a routing table that determines the next hop for packets based on their destination. Routing protocols dynamically update and maintain these tables when network conditions change.

Uploaded by

Saras Pantulwar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Wide Area Networks (WAN): Packet

Switching and Routing Basics


Wide Area Networks (WAN)
 Refers to network spread over a large geographical area,
connecting smaller networks
 All machines in a WAN can not be directly connected to
each other due to
 large number
 geographically far apart
 All machines/nodes are not under the same
administrative control
 Transmission done by a network of switched nodes –
Switched Network
Switched Networks
 End devices or stations – devices that actually wants to
communicate (ex. a PC, phone)
 Communication network – collection of nodes and
connections
 Stations communicate using the communication network
 Data is switched from node to node until it reaches
destination station
 Intermediate nodes not concerned with content of data
Simple Switched Network

Communication Network Node


 provides switching facility (routing)

Network Station
 end node (source & destination)

Communication Network
 Used to connect geographically distributed machines and
networks into a single cohesive network

 Two key switching techniques


 Circuit switching (mostly for phone networks)
 Packet switching (used in data networks)
Circuit Switching
 Dedicated communication path between two stations
 Three phases
 Establish – signaling to set up path
 Transfer - transfer data, connection maintained
 Disconnect – signaling to tear down connection
 Must have switching capacity and channel capacity to
establish connection
 Needs to chose a path - routing
 Example – Old Public Telephone Network
Circuit Switching (contd.)
 Advantages
 once connected, transfer is fast (no forwarding decision
needed after connection)
 Disadvantages
 Inefficient
 Channel capacity dedicated for duration of connection
 If no data to be transmitted, capacity wasted
 Set up (connection) takes time
 Not done in computer networks
Packet Switching
 Data are transmitted in short messages called packets
(maximum packet size is defined)
 A dedicated connection between the two end-nodes is
not maintained
 Longer messages broken up into smaller packets
 Each packet = data + control info (header)
 Intermediate nodes buffer and then forward packets
(store and forward)
 A node-to-node link can be dynamically shared by many
packets
Use of Packets
Packet Switching (contd.)
 Datagram approach
 Each packet treated independently
 Packets may follow different paths to the destination
 May arrive out-of-order or get lost
 Intermediate nodes need to decide where to forward
packets (routing)
 Up to receiver to re-order packets and recover missing
packets
Datagram
Example
Packet Switching (contd.)
 Virtual Circuit approach
 Preplanned route established before any packets sent
 Call request and call accept packets establish connection
(handshaking) [Similar to circuit switching]
 Each packet contains a virtual circuit identifier instead of
destination address
 No routing decisions required for individual packets
 Clear request packet is used to drop circuit
 Not a dedicated path (unlike circuit switching, the links in a path
may be shared between different virtual circuits)
Virtual
Circuit
Example
Virtual Circuits vs. Datagrams
 Virtual circuits
 Network can provide sequencing and error control
 Packets are forwarded more quickly
 No forwarding decisions to make
 Less reliable
 Loss of a node loses all circuits through that node
 Datagram
 No call setup phase
 Better if few packets
 More flexible and reliable
 Routing can be used to avoid congested parts of the network,
loss of a single node does not drop all packets
Advantages of Packet Switching
 Line efficiency
 Single node to node link can be shared by many packets
over time
 Packets queued and transmitted as fast as possible
 Packets are accepted even when network is busy
 But delivery may slow down
 Priorities can be used
Effect of
Packet Size
What is the relation
between the packet
size, header size,
number of hops,
and the time to
transmit all
packets?
What would be a
good packet size?
Routing in Switched Networks
Routing in Packet Switched Networks
 The process of finding a path from a source to a
destination through intermediate nodes
 A route – a path from the source to the destination
 Router – the intermediate nodes that forward the packet
towards its destination
 Routing Table
 Kept at each node
 Contains the route to each destination node reachable
from that node
 A routing protocol fills up and maintains the routing table
at the nodes
 Updates routes if existing routes change or new better routes
found
# Every node will have a routing table.
# the entries in table are of form:
destination, next hop, no. of hops away is the destination from this node
How is a route stored?
 Basic fields of a route
 Destination
 Route to which destination?
 Next hop
 To reach that destination, what is the next node the packet should
be forwarded to
 The next node will then use its next node field to go one more hop and so
on till the destination is reached
 Cost
 What is the cost of this route?
 Definition of cost can vary. One common metric is the number of hops
(links) to the destination
 There are usually other fields, we will see, but these three are
the most important and what you need now to understand
routing protocols
Routing vs. Forwarding
 Routing is the process of finding the routes
 Routing protocols can run even if no packets need to be sent
 Keeps the table ready to forward a packet
 There are also on-demand routing protocols in other types of
networks that finds a route only when a packet has to be sent
(we will not study)
 Forwarding is the process of using a route to send a packet
towards the destination
 Done only when a packet arrives at the node whose final
destination is not this node
 Done in real time
 Sometimes, routing is loosely used to refer to both
 “route a packet”
# temporarily it may be false for sometime
when there

Routing Protocol Goals


is disconnection in current link.

 Correctness – should find a correct route


 Optimal - compute “best” route
 Efficiency/Low overhead - should not send too many
messages to find route
 Robust - can handle failures like link failure, node
crashes # also it should be able to update the route when some route
or node has low traffic

 Routes should be automatically updated


 Rapid convergence when network conditions change
 Updated routes on network change should be found fast
Performance Metrics
 Used for selection of a route among multiple possible
routes
 Some examples
 Minimum number of hops
 Least “cost”
 cost can be based on different things like traffic carried, types
of links, available bandwidth etc. # this metric is more static
 Delay, throughput
# this is more dynamic metric
When/Where is Routing Decision
Taken?
 When?
 Periodically, per packet or per virtual circuit
establishment?
 Where?
 Distributed – all nodes decide cooperatively
 Internet routing protocols are all distributed
 Centralized – one node decides routes for everybody
 Not good for large networks
 Source – decided by source of packet, complete path to
destination put in packet (source routing)
 IP routing supports this for special applications
Routing Strategies
 Fixed/Static
# manual routing table (no routing protocol, good for small network)

 Flooding # dont build the routing table, but send a packet to all neighbours
 Random # no routing table just choose one node randomly
 Adaptive/Dynamic # build Routing table and rebuild it when links changes
Fixed/Static Routing
 Single permanent route for each source to destination
pair
 Routing table created & updated manually
 Table is fixed unless manually changed again
 No dynamic update when network conditions change
(for ex., a link goes down, or a shorter path comes up,
or some link becomes congested)
 Fine for very small networks
 Not good for large networks
 But static routing is used for fixed, small networks
# control flooding : doesnt transmit duplicate packets
# flooding disadvantage: too many messages for one packet (2E)

Flooding
 No network info required
 Packet sent by node to every neighbor
 Incoming packets retransmitted on every link except
incoming link
 Eventually a number of copies will arrive at destination
 Each packet is uniquely numbered so duplicates can be
discarded
 Nodes can remember packets already forwarded to keep
network load in bounds
 Can work around failed links/nodes
 No routing table built, routing and forwarding integrated
# flooding is not used for routing
# it can be used intially so that every node has some information.
Flooding
Example
# n-1 trasmission are required so that
everyone has
the message.
Can be done by minimum spannning tree.
Anything
got to parent is sent to its children.
Properties of Flooding
 All possible routes are tried
 Very robust
 At least one packet will have taken minimum “cost” route
(for ex., min hop count)
 Can be used to set up virtual circuit
 All nodes are visited
 Useful to distribute information
 But no routes remembered (no routing table)
 Too many copies of a packet may be sent
Random Routing
 Node selects one outgoing path for retransmission of
incoming packet
 Selection can be random or round robin
 Can select outgoing path based on probability calculation
 No network info needed
 Route followed is typically not least cost nor minimum
hop
 No routes remembered, no routing table built, routing
and forwarding integrated
Adaptive/Dynamic Routing
 Used by almost all packet switching networks
 Routing decisions change as conditions on the network
change
 Failure
 Congestion
 Requires info about network
 Decisions more complex
 Tradeoff between quality of network info and overhead
 Reacting too quickly can cause oscillation
 Reacting too slowly can make routes obsolete
 Routes saved in routing tables
 Routers communicate among themselves to update
routing tables dynamically when network conditions
change
 No manual intervention needed normally
Types of Adaptive Routing Strategies

 Distance Vector Routing


 Link State Routing
 Path Vector Routing (basic idea similar to distance vector
routing with some changes)

 All internet routing protocols are based on variations of


these
Distance Vector Routing
 Based on Bellman-Ford Shortest Path algorithm to find the least cost
route between nodes
 Each node x has a routing table with entries of the form <p, q, c>,
which says that x has a path to node p that goes through its neighbor node
q (the next hop) and the cost of the path is c
 Each node periodically sends its routing table to all its neighbors
 If a node does not receive a routing table from one of its neighbors y for
some predefined time, the link (x,y) is assumed to be down
 On receipt of a routing table at x from y, update the information for any
node p at y if
 the path through y is of lower cost than the path x knows currently, OR
 y is the next hop on the current path to p from x
 When a route is found to not exist, the cost of the route is set to infinity
 Route is deleted from table after a fixed time after setting the cost to infinity
The update rule
Let d be the cost of the link (x, y)
Node x, on receive of a routing table from y, does the
following:
For each entry <p, q, c> in the routing table of y
if there is no entry for p in routing table of x
add < p, y, c+d> to the table of x
else
let the current entry be <p, r, c’>
# always trust the next hop
if (c+d) < c’ or if y = r
remove <p, r, c’> from table of x
add <p, y, c+d> to table of x
# the path that i know currently already goes through Y so I update whatever
Y is saying. (from y to dest there may be decrease or increase in cost due to
down links or new path but x doesnt care about that)
Counting to
Infinity
Problem
 Possible solutions
 Triggered Update: When a link failure is detected, propagate
that information immediately (without waiting for the next
update time)
 Ensures that the infinity value is propagated before it can be
overwritten in most cases
 Split Horizon: do not advertise a route to a node from which
the route is learnt in the first place (the next hop)
 Breaks all 2-node loops
 Verify that 3-node loops can still occur
 Poisoned Reverse: if y is the next hop for z to get to destination
x, then z will advertise to y that its distance to x is infinity
 Avoids y trying to reach x via z
 None of these (or combinations) solve the counting to
infinity problem fully, just reduces the chance
 Verify this claim by forming counterexamples
 Advantages of distance vector routing
 Simple to implement
 Low memory requirement at each node
 Disadvantages
 Slow convergence
 If a network becomes inaccessible or a link cost changes, it may
take a long time for all other routing tables to know this
 Proportional to diameter of the network
 High overhead – updates sent even if no change in routing table
 Not sending it will be interpreted as link failure
 Can optimize by sending full routing table only periodically and
sending only incremental changes every period
 Routing loops may take a long time to be detected (counting to
infinity problem)
 Needs to fix a value of “infinity” (a route cost that cannot occur
normally)
 Limits the size of the network in which it can run
Link State Routing
 Each node floods information about only its neighbors
(who and cost) to all nodes in the network
 Link State Advertisement (LSA) packets
 All nodes receive and store complete information about
the network, then run some least cost algorithm (ex.
Dijkstra’s) to compute least cost route to all other nodes
and stores in routing table
 When are LSA packets sent?
 At the beginning, and periodically with full information
 On any local topology change detected by a node
(link/neighbor down, link cost change)
 Some issues that protocols need to handle:
 What if an LSA packet is lost?
 A change information may be lost until the next periodic
update
 What if an LSA packet arrives out of order?
 Link (x, y) goes down, node x sends LSA with this
information. This reaches all nodes, but is delayed to some
node z
 Link (x. y) comes up again, node x sends LSA with this
information. Reaches all nodes, including z
 Now the LSA packet with the link down information arrives
at z
 Node z thinks (wrongly) link (x.y) is down, while others
think (rightly) it is up
 How can you solve it?
 Use sequence numbers in LSA packets to distinguish old, stale LSA
packets
 Advantages
 Faster convergence
 No counting to infinity problem
 But can routing loops still occur at all?
 Less overhead than distance vector
 Periodic sends can be much less frequent. Mostly incremental
changes flooded
 Disadvantages
 More information needs to be stored and processed at each
node
Path Vector Routing
 Same concept as distance vector routing
 Difference:
 Full routes (complete path) stored for each destination
 Full path information sent with each update
 Advantage: easy to detect routing loops, so no counting
to infinity problem
 Disadvantage: Larger tables, larger update messages
Metrics Used
 What is a good cost metric to use for each link?
 Static metrics
 Number of hops
 Link bandwidth
 Dynamic metrics
 Delay on a link
 Load (traffic) on a link
 Dynamic metrics seem better, bur are harder to implement,
also can cause oscillations
 Think when all traffic goes to a low delay path for example
because it is low cost
 Static metrics are mostly used
 We will look at some actual routing protocols later

You might also like