18 Ethernet Hubs Bridges Switches Last Modified 142022
18: Ethernet, Hubs, Bridges, Switches Last Modified: 1/4/2022 2: 29: 31 AM 5: Data. Link Layer 5 a-1
Ethernet “dominant” LAN technology: r First widely used LAN technology r �Kept up with speed race: 10, 1000 Mbps Metcalfe’s Ethernet sketch 5: Data. Link Layer 5 a-2
Ethernet Frame Structure Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame Preamble: r 7 bytes with pattern 1010 followed by one byte with pattern 10101011 r used to synchronize receiver, sender clock rates 5: Data. Link Layer 5 a-3
Ethernet Frame Structure (more) r Addresses: 6 bytes, frame is received by all adapters on a LAN and dropped if address does not match r Type: indicates the higher layer protocol, mostly IP but others may be supported such as Novell IPX and Apple. Talk) r CRC: checked at receiver, if error is detected, the frame is simply dropped 5: Data. Link Layer 5 a-4
Ethernet: Unreliable, connectionless r connectionless: No handshaking between sending and receiving NICs r unreliable: receiving NIC doesn’t send acks or nacks to sending NIC m m m stream of datagrams passed to network layer can have gaps (missing datagrams) gaps will be filled if app is using TCP otherwise, app will see gaps r Ethernet’s MAC protocol: unslotted CSMA/CD Data Link Layer 5 -5
Ethernet: uses CSMA/CD A: sense channel, if idle then { transmit and monitor the channel; If detect another transmission then { abort and send jam signal; update # collisions; delay as required by exponential backoff algorithm; goto A } else {done with the frame; set collisions to zero} } else {wait until ongoing transmission is over and goto A} 5: Data. Link Layer 5 a-6
Ethernet’s CSMA/CD (more) Jam Signal: make sure all other transmitters are aware of collision; 48 bits; Exponential Backoff: r Goal: adapt retransmission attempts to estimated current load m heavy load: random wait will be longer r first collision: choose K from {0, 1}; delay is K x 512 bit transmission times r after second collision: choose K from {0, 1, 2, 3}… r after ten or more collisions, choose K from {0, 1, 2, 3, 4, …, 1023} 5: Data. Link Layer 5 a-7
Manchester encoding r used in 10 Base. T r each bit has a transition r allows clocks in sending and receiving nodes to synchronize to each other m no need for a centralized, global clock among nodes! r Hey, this is physical-layer stuff! Data Link Layer 5 -8
Repeaters r Physical Layer devices: operating at bit levels: repeat received bits on one interface to all other interfaces r Extend the range of a signal by amplifying r Useful when want to connect devices beyond the IEEE 802. 3 specifications for distance limitation of 328 feet or 100 meters 5: Data. Link Layer 5 a-9
Hubs � r Also physical layer device, but may have some management r Hubs can be arranged in a hierarchy (or multi-tier design), with backbone hub at its top r Hubs do not isolate collision domains: node may collide with any node residing at any segment in LAN r Hub Advantages: m Simple, inexpensive device m Multi-tier provides graceful degradation: portions of the LAN continue to operate if one hub malfunctions m Extends maximum distance between node pairs 5: Data. Link Layer 5 a-10 (100 m per Hub)
Hubs … physical-layer (“dumb”) repeaters: m bits coming in one link go out all other links at same rate m all nodes connected to hub can collide with one another m no frame buffering m no CSMA/CD at hub: host NICs detect collisions twisted pair hub Data Link Layer 5 -11
Hub limitations r Single collision domain results in no increase in max throughput m multi-tier throughput same as single segment throughput m Also less secure – hear traffic from/to everyone on the hub r Individual LAN restrictions pose limits on number of nodes in same collision domain and on total allowed geographical coverage r Difficult to connect different Ethernet types, but can have dual speed hubs (e. g. , 10 Base. T and 100 base. T) 5: Data. Link Layer 5 a-12
Switch r link-layer device: smarter than hubs, take active role m store, forward Ethernet frames m examine incoming frame’s MAC address, selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment, uses CSMA/CD to access segment r transparent m hosts are unaware of presence of switches r plug-and-play, self-learning m switches do not need to be configured Data Link Layer 5 -13
Switch: allows multiple simultaneous transmissions A r Switch isolates collision C’ B domains m m m Hosts have dedicated, direct connection to switch A-to-A’ and B-to-B’ simultaneously, without collisions not possible with dumb hub Does not forward out all interfaces Buffers frames r Ethernet protocol used on each incoming link, but no collisions; full duplex m each link is its own collision domain 6 1 5 2 3 4 C B’ A’ switch with six interfaces (1, 2, 3, 4, 5, 6) Data Link Layer 5 -14
r Collision domain m When I speak, who else can I prevent from speaking at the same time m Hub = one collision domain; Switch = collision domain per port r Broadcast domain m When I deliberately send a broadcast address, who all hears it m VLANs separate broadcast domains 5: Data. Link Layer 5 a-15
Managed vs Unmanaged r Switches more likely than hubs or repeaters to have sophisticated management features r Log in remotely and configure, get reports/statistics etc. r More control over what each port or group of ports can do (e. g. establish groups of ports into virtual LANs or VLANs that further divide the broadcast domain) 5: Data. Link Layer 5 a-16
Switches (more) r Switch advantages: m Isolates collision domains resulting in higher total max throughput and more security m Can connect different type Ethernet since it is a store and forward device ( dual speed hub is compromise between full switch and hub that does this) 5: Data. Link Layer 5 a-17
Switch: frame filtering, forwarding r Switches filter packets m same-LAN -segment frames not forwarded onto other LAN segments r Forwarding: m how to know which LAN segment on which to forward frame? m looks like a routing problem? 5: Data. Link Layer 5 a-18
Switch: self-learning r switch learns which hosts can be reached through which interfaces m m Source: A Dest: A’ A A A’ C’ when frame received, switch “learns” location of sender: incoming LAN segment records sender/location pair in switch table B 1 6 5 2 3 4 C B’ A’ MAC addr interface TTL A 1 60 Switch table (initially empty) Data Link Layer 5 -19
Switch: frame filtering/forwarding When frame received: 1. record link associated with sending host 2. index switch table using MAC dest address 3. if entry found for destination then { if dest on segment from which frame arrived then drop the frame else forward the frame on interface indicated } else flood forward on all but the interface on which the frame arrived Data Link Layer 5 -20
Self-learning, forwarding: example Source: A Dest: A’ A A A’ C’ B r frame destination unknown: flood v A 6 A’ 1 2 4 5 destination A location known: selective send C A’ A B’ 3 A’ MAC addr interface TTL A A’ 1 4 60 60 Switch table (initially empty) Data Link Layer 5 -21
r Generally on a switch only see traffic to/from your machine and broadcast traffic r Can attack switch by sending many MACs and overflowing its storage of which MACs on which port => will begin to act like hub ( flooding each packet out every port) 5: Data. Link Layer 5 a-22
Interconnecting switches r switches can be connected together S 4 S 1 S 2 A B S 3 C F D E v v I G H Q: sending from A to G - how does S 1 know to forward frame destined to F via S 4 and S 3? A: self learning! (works exactly the same as in single-switch case!) Data Link Layer 5 -23
Switches vs. Routers r both store-and- forward devices m m routers: Layer 3 or network-layer devices (examine network-layer headers) switches are Layer 2 or link-layer devices (examine link-layer headers) application transport datagram network frame link physical switch network datagram link frame physical r routers maintain routing tables, implement routing algorithms r switches maintain switch tables, implement filtering, learning algorithms frame link physical application transport network link physical Data Link Layer 5 -24
Switch Pros and Cons + Switch operation is simpler requiring less processing bandwidth - Topologies are restricted with bridges: a spanning tree must be built to avoid cycles - Switch do not offer protection from broadcast storms (endless broadcasting by a host will be forwarded by a bridge) 5: Data. Link Layer 5 a-25
Routers Pros and Cons + arbitrary topologies can be supported, cycling is limited by TTL counters (and good routing protocols) + provide firewall protection against broadcast storms - require IP address configuration (not plug and play) - require higher processing bandwidth 5: Data. Link Layer 5 a-26
Summary r Layer 3 Devices (Network Layer) m Router r Layer 2 Devices (Link Layer) m Bridge m Switch r Layer 1 Devices (Physical Layer) m Repeaters m Hubs 5: Data. Link Layer 5 a-27
Outtakes 5: Data. Link Layer 5 a-28
Institutional network to external network mail server router web server IP subnet Data Link Layer 5 -29
Switch Learning: example Suppose C sends frame to D and D replies back with frame to C r C sends frame, switch has no info about D, so floods to both LANs m m m switch notes that C is on port 1 frame ignored on upper LAN frame received by D 5: Data. Link Layer 5 a-30
Switch Learning: example r D generates reply to C, sends m switch sees frame from D m switch notes that D is on interface 2 m switch knows C on interface 1, so selectively forwards frame out via interface 1 5: Data. Link Layer 5 a-31
Spanning Tree r for increased reliability, desirable to have redundant, alternate paths from source to dest r with multiple simultaneous paths, cycles result bridges may multiply and forward frame forever r solution: organize bridges in a spanning tree by disabling subset of interfaces Disabled 5: Data. Link Layer 5 a-32
Spanning Tree Algorithm 5: Data. Link Layer 5 a-33
r VLAN tagging 5: Data. Link Layer 5 a-34
Interconnection Without Backbone r Not recommended for two reasons: - single point of failure at Computer Science hub - all traffic between EE and SE must path over CS segment 5: Data. Link Layer 5 a-35
Backbone Switch 5: Data. Link Layer 5 a-36
Ethernet Switches r Sophisticated bridges m Switches usually switch in hardware, bridges in software m large number of interfaces r Like bridges, layer 2 (frame) forwarding, filtering using LAN addresses r Can support combinations of shared/dedicated, 10/1000 Mbps interfaces 5: Data. Link Layer 5 a-37
Switching r Switching: A-to-B and A’-to-B’ simultaneously, no collisions r cut-through switching: frame forwarded from input to output port without awaiting for assembly of entire frame m slight reduction in latency r Store and forward switching: entire frame received before transmission out an output port r Fragment-free switching: compromise, before send out the output port receive enough of the packet to do some error checking (ex. detect and drop partial frames) 5: Data. Link Layer 5 a-38
Ethernet Limitations Q: Why not just one big Ethernet? r Limited amount of supportable traffic: on single LAN, all stations must share bandwidth r limited length: 802. 3 specifies maximum cable length r large “collision domain” (can collide with many stations) 5: Data. Link Layer 5 a-39
- Slides: 39