linklayerrouting.ppt

46
University of Delaware CPEG 419 1 Plan for next month or so Networking Networking at the link layer (LAN networking) Tanenbaum p 318-329 Networking at the Network layer Intro Stallings pp 530-540 Routing Tanenbaum pp 350-384 Global Internet Tanenbaum pp 431-473 QoS Tanenbaum pp 397 – 418

Upload: networksguy

Post on 21-Nov-2014

428 views

Category:

Documents


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: LinkLayerRouting.ppt

University of Delaware CPEG 419 1

Plan for next month or so

Networking  Networking at the link layer (LAN networking) Tanenbaum p 318-329  Networking at the Network layer Intro Stallings pp 530-540 Routing Tanenbaum pp 350-384 Global Internet Tanenbaum pp 431-473 QoS Tanenbaum pp 397 – 418

Page 2: LinkLayerRouting.ppt

University of Delaware CPEG 419 2

Today

Networking at the link layer

Page 3: LinkLayerRouting.ppt

University of Delaware CPEG 419 3

Building Bigger LANs from Smaller LANs

LANs are interconnected with•Repeaters•Hubs•Switches•Bridges

•LANs connect to much larger networks through routers.

•LANs are subdivided using VLAN

increasing intelligence

These should all be transparent.

Page 4: LinkLayerRouting.ppt

University of Delaware CPEG 419 4

Interconnection Schemes

Hubs or repeaters: physical-level interconnection. Devices repeat/amplify signal. No buffering/routing capability.

Bridges: link-layer interconnection. Store-and-forward frames to destination LAN. Need to speak protocols of LANs it interconnect.

Routers: network-layer interconnection. Interconnect different types of networks.

Page 5: LinkLayerRouting.ppt

University of Delaware CPEG 419 5

Repeater

These connect two wires and make them seems like a longer wire.

They capture the signal on the input, amplify and transmit on the output.

They perform no local functions.

With repeaters, 10Mbps Ethernet can cover 2500m.

Page 6: LinkLayerRouting.ppt

University of Delaware CPEG 419 6

Hub

Hubs are like multi-port repeaters.

Frames that simultaneously arrive at a hub collide even through they don’t arrive on the same wire.

Hubs do not amplify.

Hubs perform no logical function.

Page 7: LinkLayerRouting.ppt

University of Delaware CPEG 419 7

Switch

If there are many hosts on a single LAN, the network might saturate.A switch can alleviate this problem.

When a frame arrives at the switch, it is placed in a buffer. The frame destination address of the frame is analyzed and the frame is placed on the port that leads to the correct destination. (Store and forward).

Typically, only one host is attached to one switch port. So collisions never occur. However, the switch has an internal LAN that must support collision avoidance.

Very good for security!

Page 8: LinkLayerRouting.ppt

University of Delaware CPEG 419 8

BridgesBridges connect different LANS at the link layer (routers do a similar thing at the network layer).

Bridges are like switches, but with a bit more intelligence.

Interconnect LANs of the same type, or LANs that speak different MAC protocols. So they may have to convert header. But this is limited.

Bridge1 4

5 8

LAN A

LAN B

Extended LAN

Page 9: LinkLayerRouting.ppt

University of Delaware CPEG 419 9

Bridges

Why bridges:•A bridge breaks a large LAN into smaller, more manageable ones. •Extend the size (e.g., a 10Mbps Ethernet can’t go more than 2500m.)•Connect LANS of different types.•If one breaks, the others still function. If one is hacked into, the damage is limited.•Traffic load can be managed with hierarchical networks.

High speed LAN (between buildings)

lower speedLAN

(in a building)

bridges lower speedLAN

(in a building)

lower speedLAN

(in a building)

Page 10: LinkLayerRouting.ppt

University of Delaware CPEG 419 10

Bridge Protocol Architecture

IEEE 802.1D specification for MAC bridges.

PHYMACLLC

Station

LAN LANBridge Station

MAC

PHYPHYMAC

LLC

PHY

Page 11: LinkLayerRouting.ppt

University of Delaware CPEG 419 11

Bridges 4

No additional encapsulation. Operate at the data link layer.

Only examine DLL header information. Do not look at the network layer header.

But they may have to do header conversion if interconnecting different LANs (e.g., 802.3 to 802.4 frame).

May interconnect more than 2 LANs. LANs may be interconnected by more than 1

bridge.

Page 12: LinkLayerRouting.ppt

University of Delaware CPEG 419 12

How bridges work

Bridges accept every frame on the LAN to which it is attached.

It stores the frame, decides where it should go, and then forwards it. This is called store and forward (compare to a hub or repeaters).

The difficult task is to decide if and where the frame be forwarded.

Page 13: LinkLayerRouting.ppt

University of Delaware CPEG 419 13

Flooding

Flooding: The bridge transmits every frame it sees onto every link, but the one it came in on.

•Mostly always works.•Does not need any user intervention and simple to program.•Not efficient, we lose the capacity increase associated with hierarchical networks.

•All broadcast frame must be flooded.

Page 14: LinkLayerRouting.ppt

University of Delaware CPEG 419 14

Routing with Bridges

Bridge decides to relay frame based on destination MAC address.

If only 2 LANs, decision is simple.If more complex topologies, routing

is needed, i.e., frame may traverse more than 1 bridge.

Page 15: LinkLayerRouting.ppt

University of Delaware CPEG 419 15

Forwarding Tables

The bridge has a table that maps destinations to out-going links.

Bridge1 4

5 8

LAN A

LAN BExtended LAN

•The bridge accepts all packets from LAN A. •The bridge checks if the destination of the frame is on LAN A or B. •If it is on LAN B, the frame is transmitted onto LAN B. •Otherwise, it drops the frame.

Traffic from B to A is handled similarly.

Page 16: LinkLayerRouting.ppt

University of Delaware CPEG 419 16

Routing

Determining where to send frame so that it reaches the destination.

Routing by learning: adaptive or backward learning.

Page 17: LinkLayerRouting.ppt

University of Delaware CPEG 419 17

Routing with Bridges

3 algorithms: Fixed routing. Spanning tree. Source routing.

Page 18: LinkLayerRouting.ppt

University of Delaware CPEG 419 18

Fixed Routing

Fixed route for every source-destination pair of LANs.

Does not automatically respond to changes in load/topology.

Statically configured routing matrix (pre-loaded into bridge).

If alternate routes, pick “shortest” one.Rij: first bridge on the route from i to j.

Page 19: LinkLayerRouting.ppt

University of Delaware CPEG 419 19

Fixed Routing: Example

LAN A

LAN B LAN C

LAN D E F G

1 2 3

4 5 6 7

101

107

102

103104

105 106

Source LAN

101 102 103 107 105 106

A B C D E F G

A

B 101 102 103 104 105 106

102 101 103 107 105 106

101 103 102 104 105 106

107

102

102

104

101

101

102

105

106

103

103

103

107

107

105

105

106

106

Ex: E-> F: 107; 102; 105.

C

D

E

F

G

Page 20: LinkLayerRouting.ppt

University of Delaware CPEG 419 20

Fixed Routing

Each bridge keeps column for each LAN it attaches.

Table “From X” derived from column “x”.

Every entry that has the number of the bridge results in entry.

101 From A From B

Dest Next hop

B BC

E

FG

A AC AD -E -F AG A

D B

Dest Next hop

Page 21: LinkLayerRouting.ppt

University of Delaware CPEG 419 21

Fixed Routing

Simple and minimal processing.Too limited for internets with

dynamically changing topology.

Page 22: LinkLayerRouting.ppt

University of Delaware CPEG 419 22

Dynamic Routing

•Determine routing tables without any user intervention.•Must learn the network (backward learning).•Must adapt to changes in the network (tables expire and are relearned).

Page 23: LinkLayerRouting.ppt

University of Delaware CPEG 419 23

Address Learning 1

Problem: determine where destinations are.

Bridges operate in promiscuous mode, i.e., accept all frames.

Basic idea: look at source address of received frame to learn where that station is (which direction frame came from).

Build routing table so that if frame comes from A on interface N, save [A, N].

Page 24: LinkLayerRouting.ppt

University of Delaware CPEG 419 24

Address Learning 2

When bridges first start, all tables are empty.

So they flood: every frame for unknown destination, is forwarded on all interfaces except the one it came from.

With time, bridges learn where destinations are, and no longer need to flood for known destinations.

Page 25: LinkLayerRouting.ppt

University of Delaware CPEG 419 25

Backward Learning

Bridges look at frame’s (MAC) source address to find which machine is accessible on which LAN.

LAN 1

LAN 2

LAN 3

LAN 4

B1

B2

If B1 sees frame from C on LAN 2, RT entry (C, LAN2).Any frame to C on LAN1 will be forwarded.But, frame to C on LAN2 will not be forwarded.

CA B

Page 26: LinkLayerRouting.ppt

University of Delaware CPEG 419 26

Address Learning 3RT entries have a time-to-live (TTL). RT entries refreshed when frames

from source already in the table arrive.

Periodically, process running on bridge scans RT and purges stale entries, i.e., entries older than TTL.

Forwarding to unknown destinations reverts to flooding.

Page 27: LinkLayerRouting.ppt

University of Delaware CPEG 419 27

Frame Forwarding

Depends on source and destination LANs. If destination LAN (where frame is going to) =

source LAN (where frame is coming from), discard frame.

If destination LAN != source LAN, forward frame.

If destination LAN unknown, flood frame.

Special purpose hardware used to perform RT lookup and update in few microseconds.

Page 28: LinkLayerRouting.ppt

University of Delaware CPEG 419 28

Loops

Alternate routes: loops.Example:

LAN A, bridge 101, LAN B, bridge 104, LAN E, bridge 107, LAN A.

LAN A

LAN B

E

2

4 5

101

103104

1

107

Page 29: LinkLayerRouting.ppt

University of Delaware CPEG 419 29

Loop: Problems

A

B

LAN 1

LAN 2

B1 B2

1. Station A sends frame to B; bridges B1 and B2 don’t know B.2. B1 copies frame onto LAN1; B2 does the same.3. B2 sees B1’s frame to unknown destination and copies it onto LAN 2.4. B1 sees B2’s frame and does the same.5. This can go on forever.

Page 30: LinkLayerRouting.ppt

University of Delaware CPEG 419 30

Loop Resolution

Goal: remove “extra” paths by removing “extra” bridges.

Spanning tree: Given graph G(V,E), there exists a tree

that spans all nodes where there is only one path between any pair of nodes, i.e., NO loops.

LANs are represented by nodes and bridges by edges.

Page 31: LinkLayerRouting.ppt

University of Delaware CPEG 419 31

Spanning Tree Routing

Aka transparent bridges.Bridge routing table is automatically

maintained (set up and updated as topology changes).

3 mechanisms: Address learning. Frame forwarding. Loop resolution.

Page 32: LinkLayerRouting.ppt

University of Delaware CPEG 419 32

Definitions 1

Bridge ID: unique number (e.g., MAC address + integer) assigned to each bridge.

Root: bridge with smallest ID.Cost: associated with each interface;

specifies cost of transmitting frame through that interface.

Root port: interface to minimum-cost path to root.

Page 33: LinkLayerRouting.ppt

University of Delaware CPEG 419 33

Definitions 2

Root path cost: cost of path to root bridge.

Designated bridge: on any LAN, bridge closest to root, i.e., the one with minimum root path cost.

Page 34: LinkLayerRouting.ppt

University of Delaware CPEG 419 34

Spanning Tree Algorithm 1

1. Determine root bridge.2. Determine root port on all bridges.3. Determine designated bridges.

Page 35: LinkLayerRouting.ppt

University of Delaware CPEG 419 35

Spanning Tree Algorithm 2

Initially all bridges assume they are the root and broadcast message with its ID, root path cost.

Eventually, lowest-ID bridge will be known to everyone and will become root.

Root bridge periodically broadcasts it’s the root.

Page 36: LinkLayerRouting.ppt

University of Delaware CPEG 419 36

Spanning Tree Algorithm 3

Directly connected bridges update their cost to root and broadcast message on other LANs they are attached.

This is propagated throughout network.On any (non-directly connected) LAN,

bridge closest to root becomes designated bridge.

Page 37: LinkLayerRouting.ppt

University of Delaware CPEG 419 37

Spanning Tree: Example

B3

LAN 2

LAN 1

LAN 3 LAN 4

LAN 5

B5

B4B1

B2

10

10

10

10

5

5

5

5

1055

B3

LAN 2

LAN 1

LAN 3 LAN 4

LAN 5

B5

B4B1

B2

10

10

10

10

5

5

5

5

1055

Page 38: LinkLayerRouting.ppt

University of Delaware CPEG 419 38

Spanning Tree: ExampleB1

LAN 1 LAN 2

B2

LAN 3 LAN 4

LAN 5

B4

B5B3

. Only designated bridgeson each LAN allowed toforward frames.

. Bridges continue exchanging info to react to topology changes.

Page 39: LinkLayerRouting.ppt

University of Delaware CPEG 419 39

Source Routing 1

Route determined a priori by sender.Route included in the frame header

as sequence of LAN and bridge identifiers.

When bridge receives frame: Forward frame if bridge is on the route. Discard frame otherwise.

Page 40: LinkLayerRouting.ppt

University of Delaware CPEG 419 40

Source Routing 2

Route: sequence of bridges and LANs.

LAN 3

B1

LAN 1

B3

B2 B4

LAN 2

LAN 4X

Z

X->Z: L1,B1,L3,B3,L2.X->Z: L1,B2,L4,B4,L2

Page 41: LinkLayerRouting.ppt

University of Delaware CPEG 419 41

Source Routing 4

No need to maintain routing table. Frame has all needed routing

information.However, stations need to find route

to destination.

Page 42: LinkLayerRouting.ppt

University of Delaware CPEG 419 42

Route Discovery 1

Finding all routes. If destination is unknown, source sends

broadcast route discovery frame. Frame reaches every LAN. When reply comes back, intermediate

bridges record their id. Source gets complete route information.

Problem: frame explosion.

Page 43: LinkLayerRouting.ppt

University of Delaware CPEG 419 43

Route Discovery 2

Alternative: single route request frame forwarded according to spanning tree.

B3X

Z

B1

B4

LAN 1 LAN 3LAN 2

LAN 4

Z XSingle-routebroadcast

Page 44: LinkLayerRouting.ppt

University of Delaware CPEG 419 44

Route Discovery 3

B3X

Z

B1

B4

LAN 1 LAN 3LAN 2

LAN 4B2

L2, B3, L3, B1, L1

L2, B4, L4, B2, L1

Page 45: LinkLayerRouting.ppt

University of Delaware CPEG 419 45

Route Selection

Select minimum-cost route, e.g., minimum-hop route.

If tie, choose the one that arrived first.

Routes are cached with a TTL; when TTL expires, re-discover route.

Page 46: LinkLayerRouting.ppt

University of Delaware CPEG 419 46

Routers

Operate at the network layer, i.e., inspect the network-layer header.

Usually main router functionality implemented in software.

Store-and-forward.Ability to interconnect heterogeneous

networks: address translation, link speed and packet size mismatch.