110 likes | 143 Views
Compare hub and switch functionality in data link layer for interconnecting LAN segments. Learn how switches provide dedicated connections, reduce collisions, and optimize data forwarding. Explore examples illustrating switch operations and traffic isolation benefits.
E N D
CMPT 371Data Communications and Networking Chapter 5Data Link Layer – Hub, Switch 5: DataLink Layer
Interconnecting with hubs • Backbone hub interconnects LAN segments • Extends max distance between nodes • But individual segment collision domains become one large collision domain hub hub hub hub 5: DataLink Layer
Switch • hosts have dedicated, direct connection to switch • switches buffer packets • Ethernet protocol used on each incoming link, but no collisions; full duplex • each link is its own collision domain • switching:A-to-A’ and B-to-B’ can transmit simultaneously, without collisions A B C’ 1 2 6 4 5 3 B’ C A’ switch with six interfaces (1,2,3,4,5,6) 5: DataLink Layer
Forwarding Q:how does switch know A’ reachable via interface 4, B’ reachable via interface 5? A B C’ • A:each switch has a switch table,each entry: • (MAC address of host, interface to reach host, time stamp) • looks like a routing table! 1 2 6 4 5 3 B’ C Q:how are entries created, maintained in switch table? • something like a routing protocol? A’ switch with six interfaces (1,2,3,4,5,6) 5: DataLink Layer
MAC addr interface TTL 60 1 A Self learning • A switch has a switch (forwarding) table • switchlearns which hosts can be reached through which interfaces • when frame received, switch “learns” location of sender: incoming LAN segment • records sender/location pair in switch table Switch table (initially empty) 5: DataLink Layer
Filtering/Forwarding When switch receives a frame: index switch table using MAC dest address if entry found for destinationthen{ if dest on segment from which frame arrivedthen drop the frame else forward the frame on interface indicated } else flood forward on all but the interface on which the frame arrived 5: DataLink Layer
Switch example Suppose C sends frame to D address interface switch 1 1 1 2 3 A B E G 3 2 hub hub hub A I F D G B C H E • Switch receives frame from C • notes in switch table that C is on interface 1 • because D is not in table, switch forwards frame into interfaces 2 and 3 • frame received by D 5: DataLink Layer
Switch example Suppose D replies back with frame to C. address interface switch 1 1 2 3 1 A B E G C hub hub hub A I F D G B C H E • Switch receives frame from from D • notes in switch table that D is on interface 2 • because C is in table, switch forwards frame only to interface 1 • frame received by C 5: DataLink Layer
switch hub hub hub Switch: traffic isolation • switch installation breaks subnet into LAN segments • switch filters packets: • same-LAN-segment frames not usually forwarded onto other LAN segments • segments become separate collision domains collision domain collision domain collision domain 5: DataLink Layer
Institutional network mail server to external network web server router switch IP subnet hub hub hub 5: DataLink Layer
Summary comparison 5: DataLink Layer