Introduction to Computer Networks 0923 Presenter Fatemah Panahi

  • Slides: 14
Download presentation
Introduction to Computer Networks 09/23 Presenter: Fatemah Panahi

Introduction to Computer Networks 09/23 Presenter: Fatemah Panahi

Outline • • Client-Server code Project overview Review from last session Spanning Tree Algorithm

Outline • • Client-Server code Project overview Review from last session Spanning Tree Algorithm

Review • Shared medium vs. Point to point links • Ethernet as a shared

Review • Shared medium vs. Point to point links • Ethernet as a shared medium link • LAN is a Local Area Network, Usually based on the Ethernet technology • Ethernet limitation: Cable length, Host number

Extending LANs • Repeaters: A device that forwards signals, just like an amplifier •

Extending LANs • Repeaters: A device that forwards signals, just like an amplifier • Hub: A multi-way repeater; Usually used when you cannot attach a host directly to a thin cable. • No notion of frames • Broadcast: Everybody can get the message that someone sends.

Bridges = LAN switches • Switch: multi-input, multi-output device which transfers packets from an

Bridges = LAN switches • Switch: multi-input, multi-output device which transfers packets from an input to one or more outputs • Using repeaters to extend a LAN has its own limits: – Total number of repeaters – Total length • Alternative: Have a node between 2 Ethernet segments to forward frames – Isolates collision domains if used carefully – Increases total bandwidth of the network

Learning Bridges • It is inefficient to always broadcast message to all Ethernet segments

Learning Bridges • It is inefficient to always broadcast message to all Ethernet segments • How do we know on which port a host is? – Manual table – Learning mechanism • Learning: – Inspect the source address of each frame – Each table entry has a timeout – Not sure what to do? Broadcast

Spanning Tree How to handle forwarding in complex Layer 2 topologies? CS 640 7

Spanning Tree How to handle forwarding in complex Layer 2 topologies? CS 640 7

Each LAN segment can have many bridges • More complex topologies can provide redundancy.

Each LAN segment can have many bridges • More complex topologies can provide redundancy. – But can also create loops. • E. g. What happens when there is no table entry? – Multiple copies of data Could crash the network has happened often! host host Bridge host

What is a Spanning Tree? • Reduce our topology graph to a tree: –

What is a Spanning Tree? • Reduce our topology graph to a tree: – Make sure there are no loops in the topology – All LAN segments are still connected to the LAN and can receive messages • Main idea: Bridges choose the ports over which they have to forward frames.

Spanning Tree Protocol Overview Embed a tree that provides a single unique default path

Spanning Tree Protocol Overview Embed a tree that provides a single unique default path to each destination: Bridges designate ports over which they will or will not forward frames By removing ports, extended LAN is reduced to a tree Addresses the crashing problem; but tree is not resilient When switch/link fails, rerun protocol to converge to new tree

Spanning Tree Algorithm • Root of the spanning tree is elected first the bridge

Spanning Tree Algorithm • Root of the spanning tree is elected first the bridge with the lowest identifier. – All ports are part of tree • Each bridge finds shortest path to the root. 2 B 3 B 5 1 1 B 7 1 B 2 – Remembers port that is on the shortest path – Used to forward packets • B 1 Select for each LAN a designated bridge that will forward frames to root – Has the shortest path to the root. – Identifier as tie-breaker B 6 1 1 B 4

Spanning Tree Algorithm • Each node sends configuration message to all neighbors. – Identifier

Spanning Tree Algorithm • Each node sends configuration message to all neighbors. – Identifier of the sender – Id of the presumed root – Distance to the presumed root • 2 B 3 Initially each bridge thinks it is the root. B 5 1 – B 5 sends (B 5, 0) • When B receive a message, it decide whether the solution is better than their local solution. 1 B 7 1 B 2 – A root with a lower identifier? – Same root but lower distance? – Same root, distance but sender has lower identifier? • Message from bridge with smaller root ID – Not root; stop generating config messages, but can forward • B 1 Message from bridge closer to root – Not designated bridge; stop sending any config messages on the port B 6 1 1 B 4

Spanning Tree Algorithm • Each bridge B can now select which of its ports

Spanning Tree Algorithm • Each bridge B can now select which of its ports make up the spanning tree: – B’s root port – All ports for which B is the designated bridge on the LAN • States for ports on bridges 2 B 3 B 5 1 1 B 7 1 B 2 – Forward state or blocked state, depending on whether the port is part of the spanning tree • Root periodically sends configuration messages and bridges forward them over LANs they are responsible for • Any bridge failure => Start over B 1 B 6 1 1 B 4

Spanning Tree Algorithm Example –B 3 receives (B 2, 0) –Since 2<3 B 3

Spanning Tree Algorithm Example –B 3 receives (B 2, 0) –Since 2<3 B 3 accepts B 2 as a root –B 3 adds one to the distance advertised by B 2(0) and thus sends (B 3, B 2, 1) toward B 5 –Meanwhile B 2 accepts B 1 as the root and sends (B 2, B 1, 1) –B 5 accepts B 1 as the root and sends (B 5, B 1, 1) –B 3 accepts B 1 as the root and figures that B 1 and B 2 are closer to the root. So stops forwarding on both interfaces. 2 B 3 B 5 1 1 B 7 1 B 2 B 1 B 6 1 1 B 4