cmpe 150 – winter 2009 lecture 9 february 3, 2009 p.e. mantey

47
CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Upload: amie-marsh

Post on 11-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

CMPE 150 – Winter 2009

Lecture 9

February 3, 2009

P.E. Mantey

Page 2: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

CMPE 150 -- Introduction to Computer Networks

Instructor: Patrick Mantey [email protected] http://www.soe.ucsc.edu/~mantey/

Office: Engr. 2 Room 595J Office hours: Tues 3-5 PM, Mon 5-6 PM* TA: Anselm Kia [email protected] Web site: http://www.soe.ucsc.edu/classes/cmpe150/Winter09/

Text: Tannenbaum: Computer Networks (4th edition – available in bookstore, etc. )

Page 3: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Syllabus

Page 4: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Internet Layering

Level 5 -- Application Layer (rlogin, ftp, SMTP, POP3, IMAP, HTTP..)

Level 4 -- Transport Layer(a.k.a Host-to-Host)(TCP, UDP, ARP, ICMP, etc.)

Level 3 -- Network Layer (a.k.a. Internet) (IP)Level 2 -- (Data) Link Layer / MAC sub-layer

(a.k.a. Network Interface or Network Access Layer)

Level 1 -- Physical Layer

Page 5: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Today’s Agenda

Repeaters, Hubs, Switches, Routers, …

VLANS Midterm Review

Page 6: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Data Link Layer Switching

• Bridges from 802.x to 802.y

• Local Internetworking

• Spanning Tree Bridges

• Remote Bridges

• Repeaters, Hubs, Bridges, Switches, Routers, Gateways

• Virtual LANs

Page 7: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Bridges• Bridges used to connect multiple LANS

• Link Layer – Do not look at anything in packets

• Work for any payload within the frame– IPv4, IPv6, Apple Talk, etc. – (vs. routers which work at packet (IP) level)

• Individual LANS are shared media (cable or hub)

• (Few hubs still in use – now switched Ethernet)

• LANS have promiscuous mode (i.e. “party line”)– Bridges provide isolation between LANS

Page 8: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Data Link Layer Switching

• Multiple LANs connected by a backbone to handle a total load higher than the capacity of a single LAN.

Page 9: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Bridges from 802.x to 802.y

Operation of a LAN bridge from 802.11 to 802.3.

Page 10: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Bridges from 802.x to 802.y (2)

The IEEE 802 frame formats. The drawing is not to scale.

Page 11: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Local Internetworking

• A configuration with four LANs and two bridges.

Page 12: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Bridge Operations• Promiscuous mode – send all frames to all connected

LANs

• Discard frames whose destination is same LAN as source

– Keeps table of (LAN) addresses for each LAN

• Tables built by “flooding”

– Send everything to everybody if not in table

– See where frame comes from – add them to table

– “backward learning”

– Tables have time stamp of last use for each address

– TTL

Page 13: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Spanning Tree Bridges

Two parallel transparent bridges – bridges communicate to avoid loops.

Page 14: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Spanning Tree Bridges (2)

(a) Interconnected LANs. (b) A spanning tree covering the LANs.

(The dotted lines are not part of the spanning tree.)

Page 15: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Remote Bridges

Remote bridges can be used to interconnect distant LANs.

Page 16: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Repeaters, Hubs, Bridges, Switches, Routers and

Gateways

(a) Which device is in which layer.

(b) Frames, packets, and headers.

Page 17: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Repeaters, Hubs, Bridges, Switches, Routers and

Gateways

(a) A hub. (b) A bridge. (c) a switch.

Page 18: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

http://www.cisco.com/warp/public/473/lan-switch-transparent.swf

Page 19: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Switched Ethernet• Point-to-point connections to multi-port

hub acting like switch; no collisions.

• More efficient under high traffic load: break large shared Ethernet into smaller segments.

Hub

Switch

Page 20: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

LAN Interconnection

• Extend LAN coverage.

• Interconnect different types of LAN.

• Connect to an internetwork.• Reliability and security.

Page 21: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Bridges 1• Operate at the MAC layer.

– Interconnect LANs of the same type, or– LANs that speak different MAC protocols.

B1 4

5 8

Frames for5->8.

Frames for1->4

LAN A

LAN B

Page 22: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Bridges 2• Function:

– Listens to all frames on LAN A and accepts those addressed to stations on LAN B.

– Using B’s MAC protocol retransmits the frames onto B.

– Does the same for B-to-A traffic.

Page 23: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Bridges 3• Behave like a station; have multiple

interfaces, 1 per LAN.

• Use destination address to forward unicast frames; if destination is on the same LAN, drops frame; otherwise forwards it.

• Forward all broadcast frames.

• Have storage and routing capability.

Page 24: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Bridges 4• No additional encapsulation.

• 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 25: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Bridge Protocol Architecture

• IEEE 802.1D specification for MAC bridges.

PHYMACLLC

Station

LAN LANBridge Station

MACPHY PHY

MACLLC

PHY

Page 26: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Need “Plug ‘n Play” for LANS

• Delivery of frames at Link layer uses MAC address

• Switch / Bridge have tables of MAC addresses and corresponding LAN links

• Any time a port is connected, tables needed to be dynamically updated

• When a device is disconneceted, tables need to reflect change

• Switch derives its table for local connections

Page 27: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Address Learning – Bridges

• Problem: determine locations of destinations.• 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 28: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Address Learning – Bridges (2)

• When bridges start, all tables are empty.• So they flood: every frame for unknown

destination, is forwarded on all interfaces except the one it came from.

• As bridge learns where destinations are --when its routing table (RT) contains that destination -- it no longer needs to flood for those destinations.

Page 29: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Address Learning 3

• RT entries have a time-to-live (TTL). • RT entries get refreshed when frames from

source already in the table arrive at the bridge.• Periodically, process running on bridge scans

RT and purges stale entries, i.e., entries older than TTL.

• Bridge reverts to flooding forwarding for unknown destinations reverts to flooding.

Page 30: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Routing with Bridges

• Uses MAC (physical) addresses

• May have alternate paths (via bridges) to destination

• Choose best path

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

Page 31: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Fixed Routing

• Fixed route for every source-destination pair of LANs.

• Does not automatically respond to changes in load/topology.

Page 32: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

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 33: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Frame Forwarding

• Depends on source and destination LAN.– 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 34: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

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 35: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

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 36: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

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 37: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

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 38: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

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 39: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Routing • Determining where to send frame so that

it reaches the destination.

• Routing by learning: adaptive or backward learning.

Page 40: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Note on Terminology: Repeaters and Bridges

• Repeaters: – Extend scope of LANs.– Serve as amplifiers.– No storage/routing capabilities.

• Bridges:– Also extend scope of LANs.– Routing/storage capabilities.

Page 41: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Bridges• Operate at the data link layer.

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

Page 42: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Virtual LANs

A building with centralized wiring using hubs and a switch.

Page 43: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Virtual LANs (2)

(a) Four physical LANs organized into two VLANs, gray and white, by two bridges. (b) The same 15 machines organized into two VLANs by switches.

Page 44: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

The IEEE 802.1Q Standard

Transition from legacy Ethernet to VLAN-aware Ethernet. The shaded symbols are VLAN aware. The empty ones are not.

Page 45: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

The IEEE 802.1Q Standard (2)

The 802.3 (legacy) and 802.1Q Ethernet frame formats.

Page 46: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Review of Terminology: Repeaters and Bridges

Repeaters: Extend scope of LANs. Serve as amplifiers. No storage/routing capabilities.

Bridges: Also extend scope of LANs. Routing/storage capabilities.

Page 47: CMPE 150 – Winter 2009 Lecture 9 February 3, 2009 P.E. Mantey

Bridges

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