CS 4470 Computer Networking Protocols 5 Data Link

  • Slides: 28
Download presentation
CS 4470 Computer Networking Protocols 5. Data Link Layer 3 Huiping Guo Department of

CS 4470 Computer Networking Protocols 5. Data Link Layer 3 Huiping Guo Department of Computer Science California State University, Los Angeles

Outline r Overview of data link layer m Framing m Error detection r LANs

Outline r Overview of data link layer m Framing m Error detection r LANs m Topologies m Ethernet m Extended LANs 5. Link CS 4470 5 -2

LAN Distance Limitations r LANs use shared medium - Ethernet, token ring r Why

LAN Distance Limitations r LANs use shared medium - Ethernet, token ring r Why limit the length of LANs m Fare Access • CSMA/CD –with minimum frame size, if propagation delay too long we won’t detect collision while transmitting m Hardware is engineered to emit a fixed amount of electrical power • An electrical signal gradually becomes weaker as it travels along a copper wire. 5. Link CS 4470 5 -3

LAN Distance Limitations r Standards set a maximum distance for LANs m 10 Base.

LAN Distance Limitations r Standards set a maximum distance for LANs m 10 Base. T 100 m per segment m 10 Base 2 185 m per segment m 10 Base 5 500 m per segment r Can extend distances m Repeaters/Hubs m Bridges/Switches 5. Link CS 4470 5 -4

Repeaters r A bidirectional, analog amplifier that retransmits analog signals m m Simply copy

Repeaters r A bidirectional, analog amplifier that retransmits analog signals m m Simply copy signals between segments Do not understand frame formats or addresses • Act on bits r One repeater can effectively double the length of an LAN segment, e. g. 100 m to 200 m 5. Link CS 4470 5 -5

Hubs r Hubs act as repeaters r Connect multiple LAN segments hub 5. Link

Hubs r Hubs act as repeaters r Connect multiple LAN segments hub 5. Link CS 4470 5 -6

Limits on Repeaters/Hubs r Can't extend Ethernet with repeaters infinitely m At most 4

Limits on Repeaters/Hubs r Can't extend Ethernet with repeaters infinitely m At most 4 repeaters r CSMA/CD requires low delay m if medium is too long, CSMA/CD won't work m Run into the problem of not being able to detect collisions while transmitting the frame 5. Link CS 4470 5 -7

Limits on Repeaters/Hubs r Repeaters/Hubs don’t understand frames m Don’t distinguish between signals that

Limits on Repeaters/Hubs r Repeaters/Hubs don’t understand frames m Don’t distinguish between signals that correspond to a valid frame and other electrical signals m If a collision or electrical interference occurs on one segment, repeaters cause the same problem to occur on all other segments r Even two computers are in the different LAN segments, they cannot transmit at the same time r Aside from hubs, bridges are used today in favor of repeaters 5. Link CS 4470 5 -8

Bridges A device that connects two LANs r Act on frames r 1) 2)

Bridges A device that connects two LANs r Act on frames r 1) 2) List to traffic on each segment When it receives a frame from LAN 1, it checks the destination address • • 3) In LAN 1? Discard! In LAN 2? Go to 3) The frame arrived intact? m Yes! Forward it to LAN 2 m No! discard 5. Link CS 4470 5 -9

Bridge Operation 5. Link CS 4470 5 -10

Bridge Operation 5. Link CS 4470 5 -10

Advantages of Bridges r They help isolate problems m Don’t forward interference signals in

Advantages of Bridges r They help isolate problems m Don’t forward interference signals in one segment to another m Don’t forward collisions from one segment to another m Only forward complete and correct frames 5. Link CS 4470 5 -11

Frame filtering r A bridge doesn’t forward a frame unless necessary r How to

Frame filtering r A bridge doesn’t forward a frame unless necessary r How to determine whether to forward a frame? m. A bridge receives a frame from LAN 1 m Checks the destination address m If the destination address is in LAN 1, discard the frame m If not, forward the frame on the other segment 5. Link CS 4470 5 -12

Frame filtering (cont. ) r How does a bridge know which computers are attached

Frame filtering (cont. ) r How does a bridge know which computers are attached to which segment? r Adaptive learning m Bridges can learn automatically m No configurations required 5. Link CS 4470 5 -13

Bridge Learning Algorithm r Receive some data packet on some input port r Look

Bridge Learning Algorithm r Receive some data packet on some input port r Look at the packet’s source MAC address. If it’s not a broadcast address then: m m m Lookup address in internal lookup table If not in the table, store it in the table using the address and the port it is on If it is in the table, change the entry if it’s on a different port 5. Link CS 4470 5 -14

Bridge Operation Example 5. Link CS 4470 5 -15

Bridge Operation Example 5. Link CS 4470 5 -15

Exercise r Four LANs are connected by three bridges. Each bridge maintains two tables

Exercise r Four LANs are connected by three bridges. Each bridge maintains two tables which describe what stations are in each LAN. r Initially, all the tables are empty. 5. Link CS 4470 5 -16

Exercise r Show the tables of the four bridges change after each of the

Exercise r Show the tables of the four bridges change after each of the following events happen in sequence. A sends a frame to B 2. A sends a frame to F 3. F sends a frame to A 4. E sends a frame to I 5. G sends a frame to H 6. H sends a BROADCAST frame. 7. D sends a frame to G 8. G sends a frame to D 9. H sends a frame to C 10. A moves to LAN 3 and then sends a frame to B 1. 5. Link CS 4470 5 -17

Bridge 1 Bridge 2 Bridge 3 Actions LAN 1 LAN 2 LAN 3 LAN

Bridge 1 Bridge 2 Bridge 3 Actions LAN 1 LAN 2 LAN 3 LAN 2 LAN 4 a. A sends a frame to B A A A b. A sends a frame to F A A A c. F sends a frame to A A F A F A, F d. E sends a frame to I A F, E A, F, E e. G sends a frame to H A F, E, G A, G F, E f. H sends a BROADCAST frame. A F, E, G, H A, G, H g. D sends a frame to G A F, E, G, H, A, G, H, D D F, E h. G sends a frame to D A F, E, G, H, D A, G, H, D F, E i. H sends a frame to C A F, E, G, H, A, G, H, D D F, E A, F, E, D F, E, A A, F, E, D j. A moves to LAN 3 and then sends a frame to B 5. Link F, E, G, H, D, A G, H, D CS 4470 F, E A, F, E, D G G, H G, H 5 -18

Multiple LANs 5. Link CS 4470 5 -19

Multiple LANs 5. Link CS 4470 5 -19

Multiple Bridges r Anything wrong with this picture? 5. Link CS 4470 5 -20

Multiple Bridges r Anything wrong with this picture? 5. Link CS 4470 5 -20

A cycle of bridges r Bridged LANs contain a loop and all bridges forward

A cycle of bridges r Bridged LANs contain a loop and all bridges forward broadcast frames m m frames flow around the cycle forever Computers on all segments receive an infinite number of copies r How to prevent this? m A bridged network must NOT allow both of the following conditions to occur simultaneously • All bridges forward all broadcast frames • The bridged network contains a cycle of bridged segments. 5. Link CS 4470 5 -21

A cycle of bridges r A network is managed by more than one administrator

A cycle of bridges r A network is managed by more than one administrator m m In such a setting, it is possible that no single person knows the entire configuration of the network A bridge that closes a loop might be added without anyone knowing r Loops are built into the network on purpose m Redundancy is provided to make the network more immune o failure r Bridges must be able to handle loops m Run a distributed spanning tree algorithm 5. Link CS 4470 5 -22

Switches r Switches are similar to bridges m They both operate at the link

Switches r Switches are similar to bridges m They both operate at the link layer m They both know frame addresses m The two terms are often used interchangeably 5. Link CS 4470 5 -23

Combining switches and hubs 5. Link CS 4470 5 -24

Combining switches and hubs 5. Link CS 4470 5 -24

Switch example Suppose C sends a frame to D 1 switch 3 2 B

Switch example Suppose C sends a frame to D 1 switch 3 2 B C hub hub A address interface I D E F G A B E G 1 1 2 3 H r Switch receives frame from C m m notes in the switch table that C is on interface 1 because D is not in table, switch forwards frame into interfaces 2 and 3 r frame received by D 5. Link CS 4470 5 -25

Switch example Suppose D replies back with frame to C. 1 3 2 B

Switch example Suppose D replies back with frame to C. 1 3 2 B C hub hub A address interface switch I D E F G A B E G C 1 1 2 3 1 H r Switch receives frame from D m m notes in switch table that D is on interface 2 because C is in table, switch forwards frame only to interface 1 r frame received by C 5. Link CS 4470 5 -26

Switches and Bridges? r Most switches act just like a bridge m Segments traffic

Switches and Bridges? r Most switches act just like a bridge m Segments traffic m Typically implements spanning tree algorithm m Has more ports than a bridge 5. Link CS 4470 5 -27

Hub vs. Bridge vs. Switch A B A C C bridge hub D B

Hub vs. Bridge vs. Switch A B A C C bridge hub D B E F D 5. Link A B C E F switch E F CS 4470 D 5 -28