4/24/2019 Outline • Encoding • Bits to digital signal 15-441/641: Datalink • Framing • Bit stream to packets 15-441 Spring 2019 • Packet loss & corruption Profs Peter Steenkiste & Justine Sherry • Error detection • Flow control • Loss recovery Spring 2019 https://computer-networks.github.io/sp19/ Error Detection Error Coding • EDC= Error Detection and Correction bits (redundancy) • Transmission may introduce errors into a message. • D = Data protected by error checking, may include header fields • Error detection not 100% reliable! Received “digital signal” is different from that transmitted • • Protocol may miss some errors, but this is rare (more on this later) Single bit errors versus burst errors • • Larger EDC field yields better detection and correction • Detection: Requires a convention that some messages are invalid • Hence requires extra bits • An (n,k) code has codewords of n bits with k data bits and r = (n-k) redundant • check bits • Correction Forward error correction: many related code words map to the same data word • Detect errors and retry transmission • 1
4/24/2019 Internet Checksum Parity Checking • Goal: detect “errors” (e.g., flipped bits) in transmitted segment • Must be easy to computer in software Sender Receiver Single Bit Parity: Compute checksum of • Treat segment contents as Detect single bit errors • received segment sequence of 16-bit integers Check if computed checksum • equals checksum field value: • Checksum: addition (1’s complement sum) of NO - error detected • segment contents YES - no error detected. • • Sender puts checksum But maybe errors nonethless? value into checksum field in header 6 Basic Concept: Hamming Distance Cyclic Redundancy Codes (CRC) • Hamming distance of two bit strings = 1 0 1 1 0 • Widely used codes that have good error detection properties. HD=2 1 1 0 1 0 number of bit positions in which they • Can catch many error combinations with a small number of differ. redundant bits HD=3 • Based on division of polynomials. • If the valid words of a code have minimum Hamming distance D, then D- • Errors can be viewed as adding terms to the polynomial 1 bit errors can be detected. • Should be unlikely that the division will still work • If the valid words of a code have • Can be implemented very efficiently in hardware minimum Hamming distance D, then • Examples: [(D-1)/2] bit errors can be corrected. • CRC-32: Ethernet • CRC-8, CRC-10, CRC-32: ATM 2
4/24/2019 Take-away: Encoding and Modulation What is Used in Practice? • No flow or error control. Encoding and modulation work together • Must generate a signal that works well for the receiver – has good electrical • • E.g. regular Ethernet, just uses CRC for error detection properties • Flow control only Must be efficient with respect to spectrum use • • E.g. Gigabit Ethernet Can shift some of the burden between the two layers • • Flow and error control. Tradeoff is figured out by electrical engineers • • E.g. X.25 (older connection-based service at 64 Kbs that Maintaining good electrical properties • guarantees reliable in order delivery of data) Spectrum efficient modulation requires more encoding • For example: 4B/5B encoding • • Flow and error control solutions also used in higher layer protocols Error recovery • • E.g., TCP for end-to-end flow and error control Aggressive modulation needs stronger coding • Datalink MAC Architectures Outline • Media Access control (MAC): who gets to send packet next? • Switches connected by point-to-point • Datalink architectures links -- store-and-forward. • Ethernet Used in WAN, LAN, and for home connections • • Wireless networking Conceptually similar to “routing” • But at the datalink instead of network layer • • Wireless Ethernet • Multiple access networks. • Aloha Multiple hosts are sharing the same • transmission medium • 802.11 family Used in LANs and wireless • • Cellular Access control is distributed and much more • complex 13 3
4/24/2019 Scheduled Access MACs Datalink Classification Central • Reservation systems Controller Datalink • Central controller • Distributed algorithm, e.g. using Switch-based Multiple Access reservation bits in frame • Polling: controller polls each nodes Virtual Packet Scheduled Random Circuits Switching Access Access • Token ring: token travels around ring 1 1 and allows nodes to send one packet ATM, Switched Cellular, Ethernet, framerelay LANs FDDI, 802.11 802.11, Aloha • Distributer version of polling 4 2 4 2 • FDDI, … 3 2 17 Random Access Protocols Problem: Sharing a Wire • When node has packet to send yak yak… A B C D E • Transmit at full channel data rate R • No a priori coordination among nodes • Two or more transmitting nodes “collision” • Just send a packet when you are ready • Random access MAC protocol specifies: • Does not work well: collisions! More on this later • How to detect collisions • Natural scheme – listen before you talk … • How to recover from collisions (e.g., via delayed retransmissions) • Works well in practice • Examples of random access MAC protocols: • A cheap form of coordination • CSMA and CSMA/CD • But sometimes this breaks down • Wireless protocols • Why? How do we fix/prevent this? 18 19 4
4/24/2019 Ethernet MAC Features Ethernet MAC – CSMA/CD • Carrier Sense Multiple Access/Collision Detection • Carrier Sense: listen before you talk • Avoid collision with active transmission Packet? • Assumes all nodes can hear each other No Sense Detect • Collision Detection during transmission Send Carrier Collision • Listen while transmitting Yes • If you notice interference assume collision Discard Jam channel Packet • Abort transmission immediately – saves time b=CalcBackoff(); attempts < 16 • Assumes a sender can identify competing wait(b); attempts++; transmissions while transmitting attempts == 16 20 21 Collision Detection: Collision Detection: Depends on the Wire Length Depends on Packet Length • Packets must be long enough to • Wires must be short enough to guarantee all nodes observe guarantee all nodes observe collision collision • In this example: • In this example • A can decode packets • B and C will see collision • C observes collision • A and D cannot see collision • B and D cannot sense collision • Min packet length > 2x max prop • Min packet length > 2x max prop delay delay 24 25 5
4/24/2019 Scaling Ethernet Things to Remember • Trends from CSMA networks to switched networks What about scaling? 10Mbps, 100Mbps, 1Gbps, ... • • Need for more capacity Use a combination of reducing network diameter and • increasing minimum minimum packet size • Low cost and higher line rate Reality check: 40 Gbps is 4000 times 10 Mbps • • Emphasis on low configuration and management complexity and cost 10 Mbps: 2.5 km and 64 bytes -> silly • • Fully distributed path selection Solution: switched Ethernet – see lecture 3 • • Trends are towards “Software Defined Networks” What about a maximum packet size? • • Network is managed by a centralized controller Needed to prevent node from hogging the network • • Allows for the implementation of richer policies 1500 bytes in Ethernet = 1.2 msec on original Ethernet • • Easier to manage centrally For 40 Gps -> 0.3 microsec -> silly and inefficient • • Already common in data centers 27 28 6
Recommend
More recommend