450 likes | 458 Views
Learn about interconnecting LANs using repeaters, hubs, switches, and bridges. Understand the importance of VLANs and hierarchical network architecture.
E N D
Today • Networking at the link layer University of Delaware CPEG 419
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. University of Delaware CPEG 419
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. University of Delaware CPEG 419
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. University of Delaware CPEG 419
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. University of Delaware CPEG 419
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! University of Delaware CPEG 419
Bridges Bridges 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. LAN A Extended LAN Bridge 1 4 LAN B 5 8 University of Delaware CPEG 419
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) bridges lower speed LAN (in a building) lower speed LAN (in a building) lower speed LAN (in a building) University of Delaware CPEG 419
Bridge Protocol Architecture • IEEE 802.1D specification for MAC bridges. LLC LLC MAC MAC MAC LAN LAN PHY PHY PHY PHY Bridge Station Station University of Delaware CPEG 419
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. University of Delaware CPEG 419
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. University of Delaware CPEG 419
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. University of Delaware CPEG 419
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. University of Delaware CPEG 419
LAN A Extended LAN Bridge 1 4 LAN B 5 8 Forwarding Tables The bridge has a table that maps destinations to out-going links. • 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. University of Delaware CPEG 419
Routing • Determining where to send frame so that it reaches the destination. • Routing by learning: adaptive or backward learning. University of Delaware CPEG 419
Routing with Bridges • 3 algorithms: • Fixed routing. • Spanning tree. • Source routing. University of Delaware CPEG 419
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. University of Delaware CPEG 419
Fixed Routing: Example 1 2 3 Source LAN A B C D E F G LAN A 107 A 101 103 105 106 102 102 101 106 B 101 102 103 104 105 LAN B LAN C 105 C 102 101 103 107 106 107 104 D 101 103 102 105 106 106 103 105 104 E LAN D 107 102 103 E F G 104 105 106 105 107 106 F 102 101 103 4 5 6 7 102 101 106 107 105 G 103 Ex: E-> F: 107; 102; 105. University of Delaware CPEG 419
Fixed Routing 101 From A From B • 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. Dest Next hop Dest Next hop A A C A D - E - F A G A B B C D B E F G University of Delaware CPEG 419
Fixed Routing • Simple and minimal processing. • Too limited for internets with dynamically changing topology. University of Delaware CPEG 419
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). University of Delaware CPEG 419
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]. University of Delaware CPEG 419
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. University of Delaware CPEG 419
Backward Learning • Bridges look at frame’s (MAC) source address to find which machine is accessible on which LAN. LAN 4 A B C LAN 1 B2 LAN 2 B1 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. LAN 3 University of Delaware CPEG 419
Address Learning 3 • RT 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. University of Delaware CPEG 419
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. University of Delaware CPEG 419
Loops 1 2 • Alternate routes: loops. • Example: • LAN A, bridge 101, • LAN B, bridge 104, • LAN E, bridge 107, • LAN A. LAN A 101 LAN B 107 103 104 E 4 5 University of Delaware CPEG 419
Loop: Problems B LAN 1 B1 B2 LAN 2 A 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. University of Delaware CPEG 419
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. University of Delaware CPEG 419
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. University of Delaware CPEG 419
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. University of Delaware CPEG 419
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. University of Delaware CPEG 419
Spanning Tree Algorithm 1 • 1. Determine root bridge. • 2. Determine root port on all bridges. • 3. Determine designated bridges. University of Delaware CPEG 419
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. University of Delaware CPEG 419
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. University of Delaware CPEG 419
Spanning 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 University of Delaware CPEG 419
Spanning 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 University of Delaware CPEG 419
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. University of Delaware CPEG 419
Source Routing 2 • Route: sequence of bridges and LANs. LAN 3 X->Z: L1,B1,L3,B3,L2. X->Z: L1,B2,L4,B4,L2 B3 LAN 2 B1 LAN 1 Z B4 B2 LAN 4 X University of Delaware CPEG 419
Source Routing 4 • No need to maintain routing table. • Frame has all needed routing information. • However, stations need to find route to destination. University of Delaware CPEG 419
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. University of Delaware CPEG 419
Route Discovery 2 • Alternative: single route request frame forwarded according to spanning tree. LAN 1 X LAN 3 B3 B1 LAN 2 Single-route broadcast Z X Z LAN 4 B4 University of Delaware CPEG 419
Route Discovery 3 L2, B3, L3, B1, L1 LAN 1 X LAN 3 B3 B1 LAN 2 Z L2, B4, L4, B2, L1 LAN 4 B2 B4 University of Delaware CPEG 419
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. University of Delaware CPEG 419
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. University of Delaware CPEG 419