Lecture 4 - Lyle School of Engineering

Download Report

Transcript Lecture 4 - Lyle School of Engineering

Spring 2006
EE 5304/EETS 7304 Internet Protocols
Lecture 4
Bridges
Tom Oh
Dept of Electrical Engineering
[email protected]
TO 2-7-06 p.
1
Administrative Issues
 I have posted the download instruction for Cygwin
and Putty today. Cygwin’s download instruction is
outdated but I think that you can follow the
instruction.
 I will try to list the page numbers from our text book
relevant to each topic
 I will post the second home this week.
TO 2-7-06 p.
2
Outline
 Bridges (Pg. 164 Comer)
 Transparent learning bridges (Pg. 165 Comer)
TO 2-7-06 p.
3
Bridges to Interconnect LANs
 Work at MAC sublayer (data link layer)
 Assuming higher layers are same
 Motivation: practically, each LAN may be limited in
number of stations, size, and total bandwidth
TO 2-7-06 p.
4
Advantages of Bridges
 Overcome physical constraints: users on distant
LANs can communicate, total number of stations
can increase by adding LAN segments
 Allows different user communities to have separate
LANs but stay interconnected

In this case, intra-LAN traffic is much more than inter-LAN
 Bridges can monitor and manage each LAN
segment
TO 2-7-06 p.
5
Advantages (cont)
 More reliable and serviceable

Fault in a LAN segment can be isolated from other
segments
 More security is possible
 Main disadvantage is performance

TO 2-7-06 p.
6
Frames going through bridges may be delayed, lost,
misordered, or errored
Transparent Learning Bridges (IEEE 802.1)
 Function is to make interconnected LANs look like
one LAN to all stations, by store-and-forwarding



TO 2-7-06 p.
7
Bridge reads all frames on LAN A and stores those
addressed to LAN B
Waits for free channel, retransmits buffered frames onto B
using its MAC protocol
Does same thing from LAN B to LAN A
Transparent Learning Bridges (cont)
 Advantages


No extra work or modification is required by stations
(bridge is "transparent")
Both LANs can be transmitting simultaneously without
collision
 Filtering is necessary: if bridge repeats all traffic,
then both LANs will see combined traffic, causing
bad performance (like a large LAN)

TO 2-7-06 p.
8
Performance depends on most traffic staying intra-LAN
Transparent Learning Bridges (cont)
 Bridge functions:

Stores frames from LAN and forwards as necessary

Learns station addresses when stations transmit a frame

Resolves possible loops in topology through a spanning
tree algorithm
•
TO 2-7-06 p.
9
Spanning tree is used to broadcast frames when destination
station has unknown location
Transparent Learning Bridges (cont)
 Contains routing table (or forwarding database)
TO 2-7-06 p.
10
Transparent Learning Bridges (cont)
 Associates an outgoing port for each known
destination station
 When frame is received, the dest. address is looked
up in database



TO 2-7-06 p.
11
If frame arrives on same port as in database, frame is
discarded means already on correct LAN
If frame arrives on different port, frame is forwarded to
specified port
If address is not found, frame is transmitted on ports
determined by spanning tree algorithm except the port
where it was received
Transparent Learning Bridges (cont)
 Learning algorithm to update routing directory:


For every received frame, bridge records incoming port #
and source address
Finds source address in database
•
•
•

In all cases, start a timer
•
TO 2-7-06 p.
12
If not there, it is added with incoming port #
If there with different port #, then port # is updated
If there with same port #, no change
When time-out, then entry is assumed out-of-date and
removed
Transparent Learning Bridges (cont)
 Spanning tree algorithm to resolve loops (if loops
are possible)

TO 2-7-06 p.
13
Loops can cause problem in learning algorithm
Transparent Learning Bridges (cont)
 Station Y sends a frame to station X through two
bridges at time T0
 Bridge A forwards frame to LAN 1, then bridge B
forwards its frame later
 Station X gets two copies of frame
 When bridge A forwards frame to LAN 1, bridge B
will think station Y is on LAN 1 (frame contains
source and dest. addresses)
 Later, bridge A will think the same when bridge B
forwards frame
TO 2-7-06 p.
14
Transparent Learning Bridges (cont)
 By spanning tree algorithm, bridges decide on a
spanning tree to prevent loops
TO 2-7-06 p.
15
Wrap Up
 Bridges allow transparent interconnection of LAN
segments

Work at MAC layer
 Transparent learning bridges automatically build
routing tables by learning locations of stations
when they transmit

TO 2-7-06 p.
16
Spanning tree is used to broadcast frames to stations with
unknown locations
Spring 2006
EE 5304/EETS 7304 Internet Protocols
Lecture 4
Network layer, routing considerations
Tom Oh
Dept of Electrical Engineering
[email protected]
TO 2-7-06 p.
17
Outline
 Network layer
 Routing considerations
TO 2-7-06 p.
18
Network Layer (OSI Layer 3)
Layer 4
Transport
- hides details of network from applications
- end to end reliability, flow control
Layer 3
Network
- routing, congestion control, connection
control
Layer 2
Data link
- hides details of physical layer from network
- adds reliability, synchronization, flow control
Layer 1
Physical
- unguaranteed, unstructured bitstream
transmission
TO 2-7-06 p.
19
Network Layer (cont)
 Network layer uses services of data link layer
(reliable point-to-point transmission between
nodes) and adds packet switching for end-to-end
connectivity
 Provides end-to-end delivery of packets as service
to higher transport layer


TO 2-7-06 p.
20
Can offer connectionless or connection-oriented service
Establishes and manages connections through subnet (if
connection-oriented)
Network Layer (cont)
 Determines routes for packets from sender to
destination
 Exercises congestion control to maintain network
efficiency during heavy traffic loads
 Allows transport layer to send data from host to
host without need to know network details
 Unlike other layers, nodes need to share
information among themselves to make decisions

TO 2-7-06 p.
21
Routing protocol adds complexity
Network Layer - Issues
 Routing: how to select the best route through the
network
 Congestion control: global problem of too much
traffic for limited resources (vs flow control)
 Addressing: how to identify hosts and nodes
 Internetworking: how to deliver packets across
‘network of different networks’
TO 2-7-06 p.
22
Routing Considerations
 Routing determines a path through the network
when more than one path is possible

Sometimes no choice, e.g., no routing in hierarchical
topologies (eg, trees)
 1. Connection-oriented or connectionless?

Connection-oriented:
•
•
TO 2-7-06 p.
23
Requires computation and set-up of path (virtual circuit)
before any packets are sent
”Virtual" because circuit is not reserved: packets from different
virtual circuits can share same path and same physical links
Routing (cont)
 During set-up, hosts can specify requirements, eg,
bandwidth, max. delay
 Network has chance to reject (block) connection or
reserve resources for connection
 Each node along route knows next node to forward
packets
 Packets of same virtual circuit maintain their
sequential order
 Vulnerable to node/link failures
TO 2-7-06 p.
24
Routing (cont)
 Connectionless:






TO 2-7-06 p.
25
Path for each packet (datagram) is computed
independently
No set-up or disconnect phases
No reservations, so usually "best-effort" type of network
service
More processing: nodes make a routing decision for each
datagram
Datagrams may arrive at destination node out of original
sequence
More reliable and adaptive to failures
Routing (cont)
 2. Routing algorithm: to select ‘best’ route
according to some criteria



TO 2-7-06 p.
26
Requires information from other nodes that's exchanged
cooperatively
Complicated by failures and congestion
Examples of routing algorithms: flooding, deflection
routing, random routing, source routing, least cost
(shortest distance) routing
Routing (cont)
 3. Issues:



TO 2-7-06 p.
27
Where are decisions made? each node (hop-by-hop
routing), central node (centralized routing), or source node
(source routing)
Is decision made per packet (datagram) or per session
(virtual circuit)?
Static (routing info. is changed only for topology changes)
or adaptive (routing info. is changed continuously or
periodically) or random?
Routing (cont)
 Issues (cont)


TO 2-7-06 p.
28
How much information is available? none, local (each
node uses own info.), adjacent nodes, or all nodes
(centralized)
What are performance criteria (routing metric)? number of
hops, cost per link, delay, throughput,...
Routing (cont)
 3. Routing tables

Virtual circuit (connection-oriented):
•
•
•
•
•
•
TO 2-7-06 p.
29
Routing table is updated during connection set-up phase
All packets of same virtual circuit follow same route
Routing table: incoming link and virtual circuit ID, outgoing link
and virtual circuit ID
Why translate virtual circuit ID? global IDs will limit number of
connections, and time consuming to find unused ID
Advantages: no routing decision per packet; packets maintain
sequential order
Disadvantages: link or node failure can bring down virtual
circuit
Routing (cont)
 Example:
IN
link #
in-link1
in-link2
TO 2-7-06 p.
30
OUT
VC #
X1
X2
:
W1
W2
:
link #
out-link5
out-link2
:
out-link4
out-link8
:
VC #
Y1
Y2
:
Z1
Z2
:
Routing (cont)
 Datagrams (connectionless):

Route of each packet is decided independently

Routing table: destination, outgoing link or next node, cost



TO 2-7-06 p.
31
For given destination, choose outgoing link based on
some cost measure, eg, distance
Advantages: adaptability to changing network conditions
(e.g., link or node failures, congestion)
Disadvantages: more processing per packet; sequential
order of packets is not maintained
Routing (cont)
 Example:
Dest.
A
B
TO 2-7-06 p.
32
Outgoing link
outlink1
outlink2
:
outlink1
outlink2
:
Cost
X1
X2
:
Y1
Y2
:
Routing (cont)
 4. Routing protocol (or update algorithm): protocol
to share information to update tables



TO 2-7-06 p.
33
Is routing static or dynamic?
Update time: more frequent is more accurate, but more
overhead
Consistency: keep accurate and same information at all
nodes
Routing (cont)
 5. Levels of routing


In large networks (internets), packets may travel within
subnets and between multiple subnets
Autonomous system (TCP/IP terms) or routing domains
(OSI terms) = subnetwork or group of subnetworks under
single administration
•
•
TO 2-7-06 p.
34
Nodes in same routing domain are interior routers or
gateways (TCP/IP) or intradomain intermediate systems - ISs
(OSI)
Each has own interior gateway protocol (TCP/IP) or
intradomain IS-IS protocol (OSI)
Routing (cont)
 Nodes exchange routing information and make
routing decisions-- protocol is determined by
administration
 RIP (routing information protocol) earlier and OSPF
(open shortest path first) are widely used
 Autonomous systems are connected through
exterior routers or gateways (TCP/IP terms) or
interdomain ISs (OSI terms)

TO 2-7-06 p.
35
Must conform to a standard protocol for interconnectivity,
eg, BGP (border gateway protocol)
Layered Routing
Inter-AS
routing
Autonomous
systems
Intra-AS
routing
TO 2-7-06 p.
36
Spring 2006
EE 5304/EETS 7304 Internet Protocols
Routing algorithms
Tom Oh
Dept of Electrical Engineering
[email protected]
TO 2-7-06 p.
37
Outline
 Static routing (Comer: Pg211, 399 and 400)
 Source routing
 Flooding (Comer: Pg. 14)
 Dijkstra’s algorithm
 Bellman-Ford algorithm
TO 2-7-06 p.
38
Static Routing
 Routes are computed once and programmed into
switches’ routing tables
 Routes do not change
 Suitable if network topology and traffic patterns do
not change much
TO 2-7-06 p.
39
Source Routing
 Sender decides on route for each packet
 Route is specified within packet header

Switches read packet header and forward packet along
route
 Suitable when sender wants a certain route (e.g.,
for testing) or avoid other routes (e.g., competitors’
networks)
 Costs:
TO 2-7-06 p.
40

Extra fields in packet header

Processing burden on sender to discover routes
Flooding
 Flooding is used to broadcast topology changes to
all nodes or when exact location of destination is
unknown
 Advantages:
TO 2-7-06 p.
41

Simple

Needs no network information or routing tables

Robust for failure-prone networks

Shortest path is always found
Flooding (cont)
 Source node broadcasts packets to all neighbors,
these broadcast to their neighbors, etc.
 Various methods to prevent infinite number of
packets


Node does not broadcast packet back on incoming link
Packet has unique ID (eg, source node number, sequence
number)
•

Packet keeps hop count
•
TO 2-7-06 p.
42
If a node receives a duplicate copy, it discards the packet
Discarded when hop count reaches a limit
Flooding (cont)
 Alternatively, broadcast only along spanning tree


TO 2-7-06 p.
43
Spanning tree is subset of connectivity graph that
connects all nodes with no cycles
Spanning tree must be maintained and updated somehow
Flooding (cont)
2
1
2
2
A
3
2
1
44
3
2
3
A
TO 2-7-06 p.
1
3
3
3
3
1
2
2
Flooding by broadcasting
Flooding along spanning tree
Random routing
 Outgoing link for a packet is chosen randomly
according to set of probabilities
 Probabilities could be based on link rate or other
fixed link info. to distribute traffic uniformly
 Simple and requires no network information, but
routes are sub-optimal and looping must be
prevented
TO 2-7-06 p.
45
Deflection (Hot Potato) Routing
 Objective is get rid of packets as quickly as
possible, based on only local information

Put outgoing packet on shortest output queue
 Minimizes chance of buffer overflow, but packet
may not get closer to destination node
 Can be combined with static routing


TO 2-7-06 p.
46
Each packet has assigned link (according to table lookup)
If more than one packet are contending for same link, one
succeeds, others are deflected
Least Cost (or Shortest Distance) Routing
 Assume knowledge of entire network
 Network is represented by graph of nodes and links

Each link has assigned length or more generally "cost"
(eg, function of distance, capacity, load, delays, etc.)
 Objective is find route between source-destination
nodes with smallest total length or least cost
 2 widely used algorithms:
TO 2-7-06 p.
47

Dijkstra (link-state routing protocols)

Bellman-Ford (vector-distance routing protocols)
Least Cost Routing (cont)
2
4
2
4
3
6
3
A
A
1
2
4
3
Network graph
TO 2-7-06 p.
48
1
1
2
1
3
Spanning tree representing least-cost
routes from node A to all other nodes
Dijkstra’s Algorithm
 Each node has label (X,Y) where X is previous node
and Y is distance from source node along best
known path (up to that time)
 Label is either tentative or permanent

Becomes permanent when it represents the shortest
possible path from source node
 Algorithm proceeds to find shortest paths from
source node to all other nodes, in increasing order
of distance
TO 2-7-06 p.
49
Dijkstra’s Algorithm (cont)
 Proceeds in stages





TO 2-7-06 p.
50
By stage k, will have found k shortest paths from source
node
These nodes are included in set M
At next stage, shortest path is found to a node not in M,
this node is added to M
Ends when M includes all nodes
Result is shortest path spanning tree with root at source
node
Dijkstra’s Algorithm (cont)
 Notation

1 = source node

cij = distance (cost) between nodes i and j

M = set of permanent nodes found so far

(X,Y) = node label
•
•
TO 2-7-06 p.
51
X = previous node
Y = distance from source node to this node
Initialize all node labels to (-,∞).
Add node 1 to set M; M={1}
From last node added to M, update
the labels at neighboring nodes:
if shorter distance can be found,
change node label to shortest route.
Among the nodes not currently in
M, choose node with smallest
distance in its label. Make this
node permanent and add to M.
TO 2-7-06 p.
52
Until M
includes
all nodes
Dijkstra’s Algorithm - Example Graph
5
2
3
3
5
2
1
2
3
1
6
2
1
4
TO 2-7-06 p.
53
1
5
Initialize node labels. Add node 1 to set M; M={1}.
(-,∞)
5
2
(-,∞)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(-,∞)
TO 2-7-06 p.
54
(-,∞)
1
5
(-,∞)
54
Update labels at neighboring nodes from node 1.
(1,2)
5
2
(1,5)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
55
1
5
(-,∞)
(-,∞)
Choose node 4 to add to M; M={1,4}. Make 4 permanent.
(1,2)
5
2
(1,5)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
56
1
5
(-,∞)
(-,∞)
Update labels at neighboring nodes from node 4.
(1,2)
5
2
(4,4)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
57
1
5
(4,2)
(-,∞)
Choose 2 (or 4) to add to M; M={1,4,2}. Make 2 permanent.
(1,2)
5
2
(4,4)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
58
1
5
(4,2)
(-,∞)
From 2, update labels at neighboring nodes.
(1,2)
5
2
(4,4)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
59
(-,∞)
1
5
(4,2)
59
Choose 5 to add to M; M={1,4,2,5}. Make 5 permanent.
(1,2)
5
2
(4,4)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
60
1
5
(4,2)
(-,∞)
From 5, update labels at neighboring nodes.
(1,2)
5
2
(5,3)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
61
1
5
(4,2)
(5,4)
Choose 3 to add to M; M={1,4,2,5,3}. Make 3 permanent.
(1,2)
5
2
(5,3)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
62
1
5
(4,2)
(5,4)
From 3, update label at node 6.
(1,2)
5
2
(5,3)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
63
1
5
(4,2)
(5,4)
Add 6 to M; M={1,4,2,5,3,6}. Make 6 permanent.
(1,2)
5
2
(5,3)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
64
1
5
(4,2)
(5,4)
Spanning tree representing least cost routes
(1,2)
2
(-,0)
6
(1,1)
65
3
1
4
TO 2-7-06 p.
(5,3)
5
(4,2)
(5,4)
Dijkstra’s Algorithm - Table Form
TO 2-7-06 p.
66
M
Node 2
Node 3
Node 4
Node 5
Node 6
{1}
(1,2)
(1,5)
(1,1)
(-,∞)
(-,∞)
{1,4}
(1,2)
(4,4)
(1,1)
(4,2)
(-,∞)
{1,4,2}
(1,2)
(4,4)
(1,1)
(4,2)
(-,∞)
{1,4,2,5}
(1,2)
(5,3)
(1,1)
(4,2)
(5,4)
{1,4,2,5,3}
(1,2)
(5,3)
(1,1)
(4,2)
(5,4)
{1,4,2,5,3,6}
(1,2)
(5,3)
(1,1)
(4,2)
(5,4)
Bellman-Ford Algorithm
 Bellman's optimality principle: if path is optimal,
any segment (between any two nodes) along this
path must be optimal between those two nodes
 Algorithm proceeds to find shortest paths from
source node to all nodes, in increasing order of
number of hops


TO 2-7-06 p.
67
Find shortest path of 1 hop (max.), then shortest path of 2
hops (max.), etc.
Stop when next iteration does not change anything
Bellman-Ford Algorithm (cont)
 Proceeds in iterations


Node looks at routes through all of its neighbors

Chooses neighbor with shortest route

Ends when no more changes

TO 2-7-06 p.
68
Each node is responsible for updating its own label in each
iteration
Result is shortest path spanning tree with root at source
node
Initialize all node labels to (-,∞)
except source node label is (-,0)
Each node calculates routes
through all neighbors.
Choose shortest route and update
label if necessary.
TO 2-7-06 p.
69
Iterate until
no more
changes
Example: Initialize node labels.
(-,∞)
5
2
(-,∞)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(-,∞)
TO 2-7-06 p.
70
1
5
(-,∞)
(-,∞)
Iteration 1: each node calculates routes through all neighbors, chooses
shortest route, updates labels if necessary.
(1,2)
5
2
(1,5)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
71
1
5
(-,∞)
(-,∞)
Iteration 2
(1,2)
5
2
(4,4)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
72
1
5
(4,2)
(3,10)
Iteration 3
(1,2)
5
2
(5,3)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
73
1
5
(4,2)
(5,4)
Iteration 4: no change → stop
(1,2)
5
2
(5,3)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
74
1
5
(4,2)
(5,4)
Node labels define shortest path spanning tree (same as before)
(1,2)
5
2
(5,3)
3
3
5
2
(-,0)
1
2
3
1
6
2
1
4
(1,1)
TO 2-7-06 p.
75
1
5
(4,2)
(5,4)
Bellman-Ford Algorithm - Table Form
TO 2-7-06 p.
76
iteration
Node 2
Node 3
Node 4
Node 5
Node 6
0
(-,∞)
(-,∞)
(-,∞)
(-,∞)
(-,∞)
1
(1,2)
(1,5)
(1,1)
(-,∞)
(-,∞)
2
(1,2)
(4,4)
(1,1)
(4,2)
(3,10)
3
(1,2)
(5,3)
(1,1)
(4,2)
(5,4)
4
(1,2)
(5,3)
(1,1)
(4,2)
(5,4)