Title: Avoid Routing Loops
1Avoid Routing Loops
- The network must be made into an acyclic tree.
- The root of the tree must be decided.
- The shortest path to the route are the only
routes used. - The algorithm must adapt to changes in the
network (e.g., when nodes are added, links cut,
or nodes break).
2Spanning Tree Algorithm 1
- When manufactured, each bridge is given a unique
ID. The root is the node with the smallest ID. - If a LAN has more than one bridge, all the
bridges on that LAN must decide which bridge can
route frames to and from the LAN. - The one selected is the one that is closer to the
root. - If there is a tie, then the one with smaller ID
is selected.
3Spanning Tree Algorithm 2
- Bridges exchange messages with the following
information - 1. The ID of the bridge that is sending the
message. - 2. The ID for what the sending bridge believes to
be the root bridge. - 3. The distance (hops) from the sending bridge to
the root bridge.
4Spanning Tree Algorithm 3
- Each bridge that receives the message checks if
it is better than the current information,
where better means - 1. The identified root has a smaller ID or
- 2. The root is the same, but the distance is less
or - 3. The root and distance is the same, but the
sending bridge has a smaller ID. - In this way all the bridges get the correct
information.
5Spanning Tree Algorithm 3
- Bridges continue to send messages even after the
routing has stabilized. - If information is not refreshed, then it is
disregarded. - In this way, if the topology changes, a new tree
will be quickly made.
6Spanning Tree Example
LAN 2
LAN 2
10
5
10
5
10
10
B3
B4
B3
B4
B1
B1
10
5
10
5
10
10
LAN 5
LAN 5
5
5
B5
B5
5
5
LAN 1
LAN 1
10
10
5
5
5
5
B2
B2
LAN 3
LAN 4
LAN 3
LAN 4
7Spanning Tree Example
B1
. Only designated bridges on each LAN allowed
to forward frames. . Bridges continue
exchanging info to react to topology changes.
LAN 2
LAN 1
B4
B3
B5
LAN 5
B2
LAN 3
LAN 4
8The Network Layer
- Stallings chapters 8, 9, 15, 16 and Tanenbaum
chapter 5.
9Goals
- Get data from source to destination.
- May require traversing many hops and involving
intermediate routers and different types of
links.
10Store and Forward Packet Switching
H2
H1
Router
End system
Router
Router
Router
Subnet
Idea H1 sends a packet to the router. The router
receives the packet, checks the CRC, reads the
destination address and then decides which
outgoing link to use and sends the packet to its
next hop. The network accepts packets and
delivers packets and thats about it. Two types
of networks connectionless and
connection-oriented.
11Network Layer Design
- Connection-oriented versus connection-less
infrastructure. - Connection-oriented virtual circuit
- Connection-less datagrams.
12Connectionless
- A packet (datagram) is injected to the network
with no advanced setup. - When a router receives a packet it treats it as
an individual packet, there is no concept of
flow. - It is possible that packets from the same source
and to the same destination will not use the same
path. - Each packet must have a global destination
address. This large address must be processed at
every router.
13Connection-less service
- Internet.
- E2E argument.
- Push functionality closer to users.
- Error and flow control at higher layers.
- No delivery or ordering guarantees.
- Every packet must carry full destination address
(each packet independent of the other).
14Connection-oriented
- Telephone and ATM networks.
- Network-layer connection
- Logical connection between network-layer
processes at sender and receiver. - Connection ID used to identify PDUs.
- Connection set up (QoS, cost negotiation) and
tear down. - Full duplex communication.
- Reliable and ordered delivery.
15Virtual Circuit
- Analogy to physical circuits used by telephone
networks. - At connection establishment time, path from
source to destination is selected and used
throughout connection lifetime. - When connection is over, virtual circuit
terminated.
16Connection-Oriented
- Virtual-circuit like circuit switching
- Circuit switching
- Each call gets its own wire or its own part of
the spectrum of a wire. - The wire must be setup at the beginning of the
call. - The wire stays setup for the length of the call.
- Can be inefficient.
- Provides reliable service.
17Connection-Oriented
- Virtual-circuit
- Each call is setup.
- During setup a path is found.
- Each router along the path makes sure that there
is enough bandwidth that the call can be handled.
If not, then another path is found, or the call
is rejected. - Because of buffers and careful planning (queuing
theory), virtual-circuit is much more efficient
than circuit switching. - The quality can easily be controlled.
- Billing is possible.
18Connection-Oriented
- Label switching
- A scheme to reduce the size of the address and
aggregate traffic.
H2
H1
Router D
Router A
End system
Router C
H3
H4
Router B
Suppose H1 -gt H4. Then H1 tells router A that it
will send a flow labeled 1 with destination
H4. If its OK, router A tells router B that it
will send a flow labeled 1 with destination
H4.. Now H3 tells router B that it will send a
flow labeled 1 with destination H2. Router B says
ok, but since there is already a flow going from
B-gtC with label 1, it will re-label this flow 2.
And router B tells router C that a flow with
label 2 with destination H2.. While setup might
be slow, the switching is very fast.
19Connection vs. connectionless
issue Packet switching Virtual-circuit
Setup Not needed needed
addressing Each packet has full address Just VC number (label)
State information Nothing about the flow is needed Each VC requires a some information
Routing Each packet routing independently Route is chosen at setup.
Effect of router failure Perhaps little, a few packets lost until a new route is found. All VC that pass through router have to be re-setup
Quality of Service Difficult Easy to implement, but hard to plan efficiently.
Congestion control Difficult Easy to implement, but difficult to plan efficiently.
20- We mostly look at connectionless routing.
- But connection-oriented is becoming more and more
important (maybe).
21Routing and Internetworking
- Based on knowledge of network topology, choose
appropriate paths from source to destination. - Goals
- Correctness
- Simplicity (funny, arent we smart enough to make
complicated things?) - Robustness when a router or link goes down, the
network must remain up. - Stability some routing algorithms never
converge or take a very long time to converge
after a small change. A small change in one part
of the network should not lead to a large change.
Currently the routing does not meet this
criteria. - Fairness
- Optimality
22Fairness and optimality
3
5
1
8
7
4
2
6
Total flow is maximized by just sending from
1-gt2, 3-gt4 and 5-gt6, but not so fair to 7-gt8
23Adaptive and Non-adaptive Routing
- Non-adaptive routing
- Fixed routing, static routing.
- Do not take current state of the network (e.g.,
load, topology). - Routes are computed in advance, off-line, and
downloaded to routers when booted. - Adaptive routing
- Routes change dynamically as function of current
state of network. - Algorithms vary on how they get routing
information, metrics used, and when they change
routes.
24Hot potato routing
- Just send the packet somewhere.
25Flooding
- Every packet is sent to every neighboring router
except the one it came on. - In order to stop the packet from traveling
forever, a counter of the number of hops is
decremented at every hop. Once the counter hits
zero, the packet is dropped. - Use sequence numbers so that if a router sees a
packet twice, it will drop it. But then each
router need to keep a list of packets it has seen
so far. - Each packet could contain a list to routers
visited so far. Then - Selective flooding
- Flood to those neighbors that are in the general
right direction. -
26Shortest Path Routing
- Shortest with respect to some metric
- Example
- Number of hops.
- Delay.
- Bandwidth.
- Cost.
27Bellman Optimality Principle
- General statement about optimal routes (topology,
routing algorithm independent). - If router J is on optimal path between I and K,
then the optimal path from J to K also falls
along the same route. - Proof by contradiction.
- Corollary
- Set of optimal routes from all sources to
destination form a tree rooted at destination. - Sink tree.