Lecture 7 Dataink Ethernet, Home Peter Steenkiste Schoo of Computer Science Department of Eectrica and Computer Engineering Carnegie Meon University 15-441 Networking, Spring 2004 http://www.cs.cmu.edu/~prs/15-441 Peter A. Steenkiste, SCS, CMU 1 Dataink Layer Architectures Packet forwarding. Error and fow contro. Media access contro. Scaabiity. Peter A. Steenkiste, SCS, CMU 2 Page 1
Mutipe Access Protocos Prevent two or more nodes from transmitting at the same time over a broadcast channe.» If they do, we have a coision, and receivers wi not be abe to interpret the signa Severa casses of mutipe access protocos.» Partitioning the channe, e.g. frequency-division or time division mutipexing With fixed partitioning of bandwidth not fexibe» Taking turns, e.g. token-based, reservation-based protocos, poing based» Contention based protocos, e.g. Aoha, Ethernet Peter A. Steenkiste, SCS, CMU 3 Today s Lecture LAN technoogies: Ethernet. Bridges and LAN switches. Connectivity to the home. Peter A. Steenkiste, SCS, CMU 4 Page 2
Aoha Nodes sends the message when it has data to send. If it receives an ack, it considers the transmission competed, otherwise it retransmits after a random deay. Simpe, distributed protoco, but not very efficient» 18% maximum utiization Sotted Aoha: more efficient.» Reduces chances of coision» 37% maximum utiization Centra Computer Peter A. Steenkiste, SCS, CMU 5 802.3 Ethernet Broadcast technoogy host host host host host host host host Hub Carrier-sense mutipe access with coision detection (CSMA/CD).» MA = mutipe access» CS = carrier sense» CD = coision detection Base Ethernet standard is 10 Mbs.» Origina design was ~2 Mbs» Faster versions discussed ater Peter A. Steenkiste, SCS, CMU 6 Page 3
Contention-Based Protoco Goa: share the communication channe among mutipe hosts sharing it. Probem: how to arbitrate between the connected hosts. Desired properties:» High bandwidth utiization» Avoid starvation, achieve fairness» Simpe soution Idea: access the channe in a random way - when coisions occur, recover.» Coision: two or more nodes transmitting at the same time Peter A. Steenkiste, SCS, CMU 7 CSMA/CD Agorithm Sense for carrier. If carrier present, wait unti carrier ends.» Sending woud force a coision and waste time Send packet and sense for coision. If no coision detected, consider packet deivered. Otherwise, abort immediatey, perform exponentia back off and send packet again.» Start to send at a random time picked from an interva» Length of the interva increases with every retransmission Peter A. Steenkiste, SCS, CMU 8 Page 4
Coision Detection A B C Time Peter A. Steenkiste, SCS, CMU 9 Coision Detection: Impications A B C A nodes must be abe to detect the coision.» Any node can be sender The impication is that either we must have a short wires, or ong packets.» Or a combination of both Can cacuate ength/distance based on transmission rate and propagation speed.» Messy: propagation speed is media-dependent, ow-eve protoco detais,..» Minimum packet size is 64 bytes Cabe ength ~256 bit times» Exampe: maximum coax cabe ength is 2.5 km Peter A. Steenkiste, SCS, CMU 10 Page 5
CSMA/CD: Some Detais Successive frames are separated by an interframe gap.» Nodes must switch from send to receive mode» Set to 9.6 µsec or 96 bit times When a sender detects a coision, it sends a jam signa.» Make sure that a nodes are aware of the coision» Length of the jam signa is 32 bit times Exponentia backoff operates in mutipes of 512 bit times.» Longer than a roundtrip time» Guarantees that nodes that back off onger wi notice the earier retransmission before starting to send Peter A. Steenkiste, SCS, CMU 11 Why a Minimum Packet Size Give a host enough time to detect a coision. In Ethernet, the minimum packet size is 64 bytes.» 18 bytes of header and 46 data bytes» If the host has ess than 46 bytes to send, the adaptor (pads) bytes to increase the ength to 46 bytes What is the reationship between the minimum packet size and the size of LAN? LAN = (min frame size) * ight speed / (2 * bandwidth) How did they pick the minimum packet size? Peter A. Steenkiste, SCS, CMU 12 Page 6
Ethernet Frame Format 8 6 6 2 4 Preambe Dest Source Type Data Pad CRC Preambe marks the beginning of the frame.» Aso provides cock synchronization Source and destination are 48 bit IEEE MAC addresses.» Fat address space» Hardwired into the network interface Type fied is a demutipexing fied.» What network ayer (ayer 3) shoud receive this packet?» Is actuay a ength fied in the 802.3 standard CRC for error checking. Peter A. Steenkiste, SCS, CMU 13 Ethernet Physica Layer 10Base2 standard based on thin coax.» Thick coax no onger used» Nodes are connected using thin coax cabes and T connectors in a bus topoogy 10-BaseT uses twisted pair and hubs.» Hub acts as a concentrator The two designs have the same protoco properties.» Key: eectrica connectivity between a nodes» Depoyment is different host host host host Host host host host host Hub Peter A. Steenkiste, SCS, CMU 14 Page 7
Traditiona IEEE 802 Networks: MAC in the LAN and MAN Ethernet defined as IEEE 802.3. The IEEE 802.* set of standards defines a common framing and addressing format for LAN protocos.» Simpifies interoperabiity» Addresses are 48 bit strings, with no structure 802.3 (Ethernet) 802.4 (Token bus) 802.5 (Token ring) 802.6 (Distributed queue dua bus) 802.11 (Wireess LAN) 802.14 (Cabe Modem) 802.15 (Wireess Persona Area networks) 802.16 (Broadband wireess access) Peter A. Steenkiste, SCS, CMU 15 LAN Properties Expoit physica proximity.» Often a imitation on the physica distance» E.g. to detect coisions in a contention based network» E.g. to imit the overhead introduced by token passing Reies on singe administrative contro and some eve of trust.» Broadcasting packets to everybody and hoping everybody (other than the receiver) wi ignore the packet» Token-based protocos: everybody pays by the rues Broadcast: nodes can send messages that can be heard by a nodes on the network.» Amost essentia for network administration» Can aso be used for appications, e.g. video conferencing But broadcast fundamentay does not scae. Peter A. Steenkiste, SCS, CMU 16 Page 8
How Do We Go Faster? How about FDDI?» Too compex How about switching, e.g. ATM?» Too expensive and compicated How about a faster Ethernet? Or How about switching Ethernet?» It is simpe» It inter-operates with a arge instaed base» It is Ethernet» Fast Ethernet and Gigabit Ethernet Peter A. Steenkiste, SCS, CMU 17 Why Ethernet? Easy to manage.» You pug in the host and it basicay works» No configuration at the dataink ayer Broadcast-based.» In part expains the easy management» Some of the LAN protocos (e.g. ARP) rey on broadcast Networking woud be harder without ARP» Not having natura broadcast capabiities adds a ot of compexity to a LAN Exampe: ATM Drawbacks.» Broadcast-based: imits bandwidth since each packets consumes the bandwidth of the entire network» Distance (if shared) Peter A. Steenkiste, SCS, CMU 18 Page 9
802.3u Fast Ethernet Appy origina CSMA/CD medium access protoco at 100Mbps Must change either minimum frame or maximum diameter: change diameter Requires» 2 UTP5 pairs (4B5B) or» 4 UTP3 pairs (8B6T) or» 1 fiber pair No more shared wire connectivity.» Hubs and switches ony Peter A. Steenkiste, SCS, CMU 19 802.3z Gigabit Ethernet Same frame format and size as Ethernet.» This is what makes it Ethernet Fu dupex point-to-point inks in the backbone are ikey the most common use.» Added fow contro to dea with congestion Aternative is haf-dupex shared-medium access.» Cannot cut the diameter any more (set to 200m)» Raise the min frame time (256 bytes), but not frame size Choice of a range of fiber and copper transmission media. Defining jumbo frames for higher efficiency. Peter A. Steenkiste, SCS, CMU 20 Page 10
Buiding Larger LANs: Bridges Bridges connect mutipe IEEE 802 LANs at ayer 2.» Ony forward packets to the right port» Reduce coision domain compared with singe LAN In contrast, hubs rebroadcast packets. host host host host host host Bridge host host host host host host Peter A. Steenkiste, SCS, CMU 21 Transparent Bridges Design goas:» Pug and pay capabiity» Sef-configuring without hardware or software changes» Bridge do not impact the operation of the individua LANs Three parts to making bridges transparent: 1) Forwarding of frames 2) Learning of addresses 3) Spanning tree agorithm Peter A. Steenkiste, SCS, CMU 22 Page 11
Frame Forwarding Each switch maintains a forwarding database: <MAC address, port, age> MAC address: host or group address Port: port number on the bridge Age: age of the entry Meaning: A machine with MAC address ies in the direction of number port of the bridge For every packet, the bridge ooks up the entry for the packets destination MAC address and forwards the packet on that port.» Other packets are broadcasted why? Peter A. Steenkiste, SCS, CMU 23 Address Lookup 3 1 Bridge 2 Address Next Hop A21032C9A591 1 99A323C90842 2 8711C98900AA 2 301B2369011C 2 695519001190 3 Info 8:36 8:01 8:15 8:16 8:11 Address is a 48 bit IEEE MAC address. Next hop: output port for packet. Timer is used to fush od entries Size of the tabe is equa to the number of hosts. Peter A. Steenkiste, SCS, CMU 24 Page 12
Learning Bridges Bridge tabes can be fied in manuay.» Time consuming, error-prone» Sef-configuring preferred Keep track of source address of packets arriving on every ink, showing what segment hosts are on.» Fi in the forwarding tabe based on this information host host host host host host Bridge host host host host host host Peter A. Steenkiste, SCS, CMU 25 Spanning Tree Bridges More compex topoogies can provide redundancy.» But can aso create oops. What is the probem with oops? host host host host host host Bridge Bridge host host host host host host Peter A. Steenkiste, SCS, CMU 26 Page 13
Spanning Tree Protoco Overview Embed a tree that provides a singe unique path to each destination: 1) Eect a singe bridge as a root bridge 2) Each bridge cacuates the distance of the shortest path to the root bridge 3) Each LAN identifies a designated bridge, the bridge cosest to the root. It wi forward packets to the root. 4) Each bridge determines a root port, which wi be used to send packets to the root 5) Identify the ports that form the spanning tree Peter A. Steenkiste, SCS, CMU 27 Spanning Tree Agorithm Steps Root of the spanning tree is the bridge with the owest identifier.» A ports are part of tree Each bridge finds shortest path to the root.» Remembers port that is on the shortest path» Used to forward packets Seect for each LAN the designated bridge that has the shortest path to the root.» Identifier as tie-breaker» Responsibe for that LAN 1 2 B3 B5 1 B2 B1 B6 1 1 B4 1 B7 Peter A. Steenkiste, SCS, CMU 28 Page 14
Spanning Tree Agorithm Each node sends configuration message to a neighbors.» Identifier of the sender» Id of the presumed root» Distance to the presumed root» E.g. B5 sends (B5, B5, 0) When B receive a message, it decide whether the soution is better than their oca soution.» A root with a ower identifier?» Same root but ower distance?» Same root, distance but sender has ower identifier? After convergence, each bridge knows the root, distance to root, root port, and designated bridge for each LAN. B2 B3 B6 B1 B5 B4 B7 Peter A. Steenkiste, SCS, CMU 29 Spanning Tree Agorithm (part 2) Each bridge B can now seect which of its ports make up the spanning tree:» B s root port» A ports for which B is the designated bridge on the LAN Bridges can not configure their ports.» Forwarding state or bocked state, depending on whether the port is part of the spanning tree Root periodicay sends configuration messages and bridges forward them over LANs they are responsibe for. B2 B3 B6 B1 B5 B4 B7 Peter A. Steenkiste, SCS, CMU 30 Page 15
Spanning Tree Agorithm Exampe Node B2:» Sends (B2, B2, 0)» Receives (B1, B1, 0) from B1» Sends (B2, B1, 1) up» Continues the forwarding forever Node B1:» Wi send notifications forever Node B7:» Sends (B7, B7, 0)» Receives (B1, B1, 0) from B1» Sends (B7, B1, 1) up and right» Receives (B5, B5, 0) - ignored» Receives (B5, B1, 1) - better» Continues forwarding the B1 messages forever to the right 1 2 B3 B5 1 B2 B1 B6 1 1 B4 1 B7 Peter A. Steenkiste, SCS, CMU 31 Ethernet Switches Bridges make it possibe to increase LAN capacity.» Packets are no onger broadcasted - they are ony forwarded on seected inks» Adds a switching favor to the broadcast LAN Ethernet switch is a specia case of a bridge: each bridge port is connected to a singe host.» Can make the ink fu dupex (reay simpe protoco!)» Simpifies the protoco and hardware used (ony two stations on the ink) no onger fu CSMA/CD» Can have different port speeds on the same switch Unike in a hub, packets can be stored An aternative is to use cut through switching Peter A. Steenkiste, SCS, CMU 32 Page 16
Virtua LANs Singe physica LAN infrastructure that carries mutipe virtua LANs simutaneousy. Each virtua LAN has a LAN identifier in the packet.» Switch keeps track of what nodes are on each segment and what their virtua LAN id is Can bridge and route appropriatey. Broadcast packets stay within the virtua LAN.» Limits the coision domain for the packet host host host host host host Switch host host host host host host Peter A. Steenkiste, SCS, CMU 33 Exampe LAN Configuration 10 or 100 Mbit/second connectivity to the desk top using switch or hubs in wiring cosets. 100 or 1000 Mbit/second switch fabric between wiring cosets or foors. Management simpified by having wiring based on star topoogy with wiring coset in the center. Network manager can manage capacity in two ways:» speed of individua inks» hub/bridge/switch tradeoff Foor 4 Foor 3 Foor 2 Foor 1 Peter A. Steenkiste, SCS, CMU 34 Page 17