TOBB ETÜ ELE46/ELE563 Communications Networks Lecture 01 May 6, 2014 Fall 2011 Tuesday 10:30 – 12:20 (310) Thursday 15:30 – 17:20 (372) İsrafil Bahçeci Office: 168 ibahceci@etu.edu.tr Data Link Layer Functions of DLL Frame transmission Reliable: Error free Efficient: Transmission Rate vs. Channel condition What to do? Error correction/detection Channel impairements DLL Design Issues Service interface to network layer Dealing with transmission errors Flow control Frame management: Network packets encapsulated Data Path 1. 2. 3. Unacknowledged connectionless service -> Reliable channel ->Ethernet Acknowledged connectionless service -> Unreliable channel -> Wi-Fi Acknowledged connection-oriented service ACK/NACK issue DLL ACK/NACK is an optimization, not requirements PHY medium determines this optimization Higher layers may take care of errors Fiber, ethernet Wireless Connection-oriented service: reliable streaming Appropriate for unreliable, long channels (satellite, longdistance telephone circuit, etc..) Establish a connection before data exchange Numbered frames Each frames received exactly once, all in order 3 phases Connection establishment, initialize counters Frame transmission Connection release Framing Bit stream from PHY layer may contain errors DLL splits bit streams in to discrete frames Checksum: CRC = cyclic redundancy check bits Receiver calculates the checksum bits and compares it with the one contained in the frame Bad frames detection Frame generation Must alleviate the frame reception (e.g., sync) at the receiver side Byte-count Flag bytes with byte stuffing Number of bytes in the header Errors in this info is catastrpohic Frame start at certain slots indicate by a known flag byte (start and end with FLAGs) If FLAG exists in paylod, insert ESC charcater; ESC is removed before forwarding to network layer PPP: point-to-point protocol Flag bits with bit stuffing Physical layer coding violation Byte FLAGing Bit FLAGing Bit level flagging Bit stuffing Ex. HDLC – high level data link control Frame begins with 0x7E : 01111110 Bit sutffing: a consecutive 5 1s stuffed with 0 Frame Length Data based frame length ~12.5% with bit stuffing Ethernet Preamble: all frames start with a known bit pattern 72-bits for 802.11 Error Control ACK/NACK Complete ACK/frame loss ACK: correct reception NACK: error!, retransmit Timers: Time to wait for ACK/NACK Timer cancellation if ACK arrives before Multiple transmission of frames: Frame numbering Overall goal: Each frame is only passed only once to the network layer Flow Control How to control frame rate so that receiver can accept transmissions Sender: fast processors, receiver: slow processor Feedback-based flow control Rx to Tx: send more/less data Rate-based flow control HD Video to a smartphone with small computing power! Tx-built in flow control without feedback Usually feed-back based in DLL: Rx side determines the transmission of additional data until it processes the previously received ones Error Detection/Correction Fiber, cable: small error Wireless links: larger errors Add redundancy for correction Fiber: error detection Wireless: error correction + detection Error types Enough redundancy for detection Depends on channel reliability FER: forward error correction Single-bit errors, few-bit errors Burst errors Erasure channel: easier to correct than flip-errors FEC/ED can be used in PHY,DLL and network layers as well FEC: error correction codes Hamming Binary convolutional Reed-Solomon Low-density parity check codes FEC Frame length: m bits Redundancy: r bits Linear block code: r bits from m information bits via linear combination (e.g., in mod-2 for binary codes) of information block Systematic code: m bits are sent directly Code rate = m/(m+r) Hamming distance Distance between two sequences Binary: seq_d = seq1 XOR seq2 Number of 1s in seq_d Hamming distance of d -> d single bit errors Hamming Code Linear block code Error syndrome Convolutional Code Decoding Soft-decision Hard-decision Cyclic codes A subset of linear block codes Non-binary cyclic codes BCH codes Reed-Solomon codes Error Detection Codes Linear systematic block codes Parity Checksums Cyclic redundancy checks (CRCs)