OSI Reference Model. Application Layer. Presentation Layer. Session Layer. Chapter 4: Application Protocols. Transport Layer.

Similar documents
Chapter 2: Computer Networks

Physical-Layer Services and Systems

Chapter 10 Error Detection and Correction 10.1

Data and Computer Communications

Lecture 3 Data Link Layer - Digital Data Communication Techniques

Lecture 5 Transmission

Wireless Communications

CSE 461: Bits and Bandwidth. Next Topic

Datacommunication I. Layers of the OSI-model. Lecture 3. signal encoding, error detection/correction

Digital Data Communication Techniques

Lecture 5 Transmission. Physical and Datalink Layers: 3 Lectures

Wireless Networks. Why Wireless Networks? Wireless Local Area Network. Wireless Personal Area Network (WPAN)

Detecting and Correcting Bit Errors. COS 463: Wireless Networks Lecture 8 Kyle Jamieson

Computer Networks. Week 03 Founda(on Communica(on Concepts. College of Information Science and Engineering Ritsumeikan University

Lecture 23: Media Access Control. CSE 123: Computer Networks Alex C. Snoeren

Department of Computer Science and Engineering. CSE 3213: Computer Networks I (Fall 2009) Instructor: N. Vlajic Date: Dec 11, 2009.

Error Detection and Correction

Layering and Controlling Errors

Module 3: Physical Layer

CSE 461 Bits and Links. David Wetherall

Sirindhorn International Institute of Technology Thammasat University

Lecture 8: Media Access Control. CSE 123: Computer Networks Stefan Savage

CSEP 561 Bits and Links. David Wetherall

DATA COMMUNICATION (CS601) FINAL TERM MEGA FILE

The Last Mile Problem

Week 2 Lecture 1. Introduction to Communication Networks. Review: Analog and digital communications

Structure of the Lecture

CSE 123: Computer Networks Alex C. Snoeren. Project 1 out Today, due 10/26!

Lecture 3: Modulation & Clock Recovery. CSE 123: Computer Networks Stefan Savage

BSc (Hons) Computer Science with Network Security, BEng (Hons) Electronic Engineering. Cohorts: BCNS/17A/FT & BEE/16B/FT

Multiple Access (3) Required reading: Garcia 6.3, 6.4.1, CSE 3213, Fall 2010 Instructor: N. Vlajic

Department of Computer Science and Engineering. CSE 3213: Communication Networks (Fall 2015) Instructor: N. Vlajic Date: Dec 13, 2015

MULTIPLE CHOICE QUESTIONS

Chapter 2 Overview. Duplexing, Multiple Access - 1 -

Cellular systems 02/10/06

Medium Access Control

Physical Layer. Networked Systems 3 Lecture 5

Medium Access Control. Wireless Networks: Guevara Noubir. Slides adapted from Mobile Communications by J. Schiller

Lecture 6: Reliable Transmission"

and coding (a.k.a. communication theory) Signals and functions Elementary operation of communication: send signal on

Lecture 8: Media Access Control

Mobile Computing. Chapter 3: Medium Access Control

Outline. EEC-484/584 Computer Networks. Homework #1. Homework #1. Lecture 8. Wenbing Zhao Homework #1 Review

QUIZ : oversubscription

Lecture 3: Modulation & Clock Recovery. CSE 123: Computer Networks Alex C. Snoeren

Digital to Digital Encoding

RECOMMENDATION ITU-R F (Question ITU-R 158/9) b) that it is desirable to specify the requirements of HF packet radio systems,

Physical Layer. Networked Systems Architecture 3 Lecture 6

Wireless Transmission & Media Access

ROM/UDF CPU I/O I/O I/O RAM

Multiple Access Methods

Computer Networks

CPSC Network Programming. How do computers really communicate?

Multiple Access System

INTRODUCTION TO WIRELESS SENSOR NETWORKS. CHAPTER 3: RADIO COMMUNICATIONS Anna Förster

Lecture Progression. Followed by more detail on: Quality of service, Security (VPN, SSL) Computer Networks 2

Fiber Distributed Data Interface

Transmission Principles

Representation of Information. Transmission Principles. Agenda. Transmission of Information

Lecture on Sensor Networks

Media. Twisted pair db/km at 1MHz 2 km. Coaxial cable 7 db/km at 10 MHz 1 9 km. Optical fibre 0.2 db/km 100 km

COMPUTER COMMUNICATION AND NETWORKS ENCODING TECHNIQUES

EECS 122: Introduction to Computer Networks Encoding and Framing. Questions

Chapter 3 : Media Access. Mobile Communications. Collision avoidance, MACA

Physical Layer. Transfers bits through signals overs links Wires etc. carry analog signals We want to send digital bits. Signal

Encoding and Framing

Lecture Progression. Followed by more detail on: Quality of service, Security (VPN, SSL) Computer Networks 2

ICT 5305 Mobile Communications. Lecture - 4 April Dr. Hossen Asiful Mustafa

Encoding and Framing. Questions. Signals: Analog vs. Digital. Signals: Periodic vs. Aperiodic. Attenuation. Data vs. Signal

UNIT-1. Basic signal processing operations in digital communication

CSCI-1680 Physical Layer Rodrigo Fonseca

Medium Access Schemes

Chapter-1: Introduction

BSc (Hons) Computer Science with Network Security BEng (Hons) Electronic Engineering

Chapter 4 Digital Transmission 4.1

Last Time. Transferring Information. Today (& Tomorrow (& Tmrw)) Application Layer Example Protocols ftp http Performance.

Outline. EECS 122, Lecture 6. Error Control Overview Where are Codes Used? Error Control Overview. Error Control Strategies ARQ versus FEC

ECE 333: Introduction to Communication Networks Fall Lecture 15: Medium Access Control III

CS601 Data Communication Solved Objective For Midterm Exam Preparation

6.1 Multiple Access Communications

Chapter 3 Digital Transmission Fundamentals

Lecture 2: Links and Signaling"

Mobile Communications

Optical Fiber Communications p. 1 Introduction p. 1 History of Optical Fibers p. 1 Optical Fibers Versus Metallic Cable Facilities p.

Class 4 ((Communication and Computer Networks))

The Physical Layer Outline

DigiPoints Volume 1. Leader Guide. Module 6 Error Detection and Correction

CS601-Data Communication Latest Solved Mcqs from Midterm Papers

COSC 3213: Computer Networks I Instructor: Dr. Amir Asif Department of Computer Science York University Section B

CSCD 433 Network Programming Fall Lecture 5 Physical Layer Continued

Local Area Networks NETW 901

Communication Networks

Simple Algorithm in (older) Selection Diversity. Receiver Diversity Can we Do Better? Receiver Diversity Optimization.

16.36 Communication Systems Engineering

Chapter 2 Overview - 1 -

Basic Communications Theory Chapter 2

Computer Networks - Xarxes de Computadors

King Fahd University of Petroleum & Minerals Computer Engineering Dept

Network Management System for Telecommunication and Internet Application

BSc (Hons) Computer Science with Network Security. Examinations for Semester 1

Transcription:

Chapter 2: Computer Networks 2.1: Physical Layer and Data Link Layer 2.2: Examples for Local Area Networks 2.3: Examples for Wide Area Networks 2.4: Wireless Networks OSI Reference Model Application Layer Presentation Layer Chapter 4: Application Protocols Chapter 3: Internet Protocols Session Layer Transport Layer Network Layer Data Link Layer Computer Networks Physical Layer Page 1

Layer 1 Physical Layer Connection parameters mechanical electric and electronic functional and procedural More detailed: Physical transmission medium (Copper cable, optical fiber, radio,...) Pin usage in network connectors Representation of raw bits (Code, voltage, etc.) Data rate Control of bit flow: serial or parallel transmission of bits synchronous or asynchronous transmission simplex, half-duplex or full-duplex transmission mode Page 2

Transmission Media Copper conductor Braided outer conductor Coaxial cable Twisted Pair Interior insulation Protective outer insulation Several media, varying in transmission technology, capacity, and bit error rate (BER) Glass core Optical fiber Satellites Glass cladding Plastic Radio connections Page 3

Twisted Pair Lehrstuhl für Informatik 4 Characteristics: Data transmission through electrical signals Problem: electromagnetic signals of the environment can disturb the transmission within copper cables Solution: two insulated, twisted copper cables Twisting reduces electromagnetic interference with environmental disturbances Simple principle (costs and maintenance) Well known (e.g. telephony) Can be used for digital as well as analogous signals Bit error rate ~ 10-5 Twisted Pair: 4 pairs of twisted copper cables in one outer insulation are named Twisted Pair cable! Insulation Copper core Page 4

Coaxial Cable Lehrstuhl für Informatik 4 Structure Insulated copper cable as center conductor Braided outer conductor reduces environmental disturbances Interior insulation separates center and outer conductor Braided outer conductor Copper conductor Interior insulation Protective outer insulation Characteristics: Higher data rates over larger distances than twisted pair: 1-2 GBit/sec up to 1 km Better shielding than for twisted pair, resulting in better signal quality Bit Error Rate ~ 10-9 Early networks were build with coaxial cable, in the last ten years however it was more and more replaced by twisted pair. Page 5

Optical Fiber Lehrstuhl für Informatik 4 Characteristics: Nearly unlimited data rate (theoretically up to 50.000 GBit/s) over very large distances Wavelength in the range of microns (determined by availability of light emitters and attenuation of electromagnetic waves: range of the wavelength around 0.85µm, 1.3µm and 1.55µm are used) Insensitive to electromagnetic disturbances Good signal-to-noise-ratio Bit Error Rate: ~ 10-12 Page 6

Optical Transmission Structure of an optical transmission system Optical source (converts electrical into optical signals; normally in the form 1 light pulse ; 0 no light pulse ) Communication medium (optical fiber) Detector (converts optical into electrical signals) electrical signal optical signal electrical signal optical source optical fiber optical detector Physical principle: Total reflection of light at another medium Medium 2 Medium 1 Refractive index: Indicates refraction effect relatively to air Page 7

Optical Fiber Lehrstuhl für Informatik 4 Structure of a fiber Core: optical glass (extremely thin) Internal glass cladding Protective plastic covering The transmission takes place in the core of the cable: Core has higher refractive index, therefore the light remains in the core Ray of light is reflected instead of transiting from medium 1 to medium 2 Refractive index is material dependent A cable consists of many fibers Medium 2 optical source (LED, Laser) Medium 1 (core) Medium 2 Page 8

Problems with Optical Fiber The ray of light is increasingly weakened by the medium! Absorption can weaken a ray of light gradually Impurities in the medium can deflect individual rays Dispersion (less bad, but transmission range is limited) Rays of light are spreading in the medium with different speed: - Ways (modes) of the rays of light have different length (depending on the angle of incidence) - Rays have slightly different wavelengths (and propagation speed) Refractive index in the medium is not constant (effect on speed) Here only a better quality of radiation source and/or optical fiber helps! kurzes, Electrical starkes input signal Signal Optical Glasfaser Fiber langes, Electrical schwaches output signal Signal Page 9

Encoding of Information Shannon: The fundamental problem of communication consists of reproducing on one side exactly or approximated a message selected on the other side. Objective: useful representation (encoding) of the information to be transmitted Encoding categories Source encoding (Layer 6 and 7) Channel encoding (Layer 2 and 4) Cable encoding (Layer 1) Encoding of the original message E.g. ASCII-Code (text), tiff (pictures), PCM (speech), MPEG (video), Representation of the transmitted data in code words, which are adapted to the characteristics of the transmission channel (redundancy). Protection against transmission errors through error-detecting and/or -correcting codes Physical representation of digital signals Page 10

Baseband and Broadband The transmission of information can take place either on the baseband or on broadband. This means: Baseband The digital information is transmitted over the medium as it is. For this, encoding procedures are necessary, which specify the representation of 0 resp. 1 (cable codes). Broadband The information is transmitted analogous (thereby: larger range), by modulating it onto a carrier signal. By the use of different carrier signals (frequencies), several information can be transferred at the same time. While having some advantages in data communications, broadband networks are rarely used baseband networks are easier to realize. But in optical networks and radio networks as well as for Cable TV this technology is used. Page 11

Cable Code: Requirements How can digital signals be represented electrically? As high robustness against distortion as possible 1 1 Transmission 0 0 T 2T 3T 4T 5T 6T 7T t 0 0 T 2T 3T 4T 5T 6T 7T t Efficiency: as high data transmission rates as possible by using code words binary code: +5V/- 5V? ternary code: +5 V/0V/- 5V? quaternary code: 4 states (coding of 2 bits at the same time) Synchronization with the receiver, achieved by frequent changes of voltage level regarding to a fixed cycle Avoiding direct current: positive and negative signals should alternatively arise Page 12

NRZ: Non Return to Zero Simple approach: Encode 1 as positive tension (+5V) Encode 0 as negative tension (- 5V) +5V 0 1 0 1 1 0 0 1-5V Advantage: Very simple principle The smaller the clock pulse period, the higher the data rate Disadvantage: Loss of clock synchronization as well as direct current within long sequences of 0 or 1 Page 13

Differential NRZ Differential NRZ: similar principle to NRZ Encode 1 as tension level change Encode 0 as missing tension level change +5V -5V 0 1 0 1 1 0 0 1 Very similar to NRZ, but disadvantages only hold for sequences of zeros. Remark: In some implementations (e.g. CISCO) the level change is effected in the middle of the bit (not at the beginning of the bit) but this is no principal difference. Page 14

Manchester Code For automatic synchronization, with each code element the clock pulse is transferred. Used is a tension level change in the middle of each bit: encode 0 as tension level change of positive (+5V) to negative (-5V) encode 1 as tension level change of negative (- 5V) to positive (+5V) +5V -5V 0 1 0 1 1 0 0 1 Advantages Clock synchronization with each bit, no direct current End of the transmission easily recognizable Disadvantage Capacity is used only half! Page 15

Differential Manchester Code Variant of the Manchester Code. Similar as it is the case for the Manchester code, a tension level change takes place in the bit center, additionally a second change is made: Encode 1 as missing level change between two bits Encode 0 as level change between two bits +5V -5V 0 1 0 1 1 0 0 1 Page 16

4B/5B Code Lehrstuhl für Informatik 4 Disadvantage of the Manchester code: 50% efficiency, i.e. 1B/2B Code (one bit is coded into two bits) An improvement is given with the 4B/5B Code: four bits are coded in five bits: 80% efficiency Functionality: Level change with 1, no level change with 0 (differential NRZ code) Coding of hexadecimal characters: 0, 1,, 9, A, B,, F (4 bits) in 5 bits, so that long zero blocks are avoided Selection of the most favorable 16 of the possible 32 code words (maximally 3 zeros in sequence) Further 5 bit combinations for control information Expandable to 1000B/1001B Codes? Page 17

4B/5B Code Table Decimal Data Transmitted Symbol Assignment 0 0000 00000 Q uiet -line state (status) 1 0001 00001 Invalid 2 0010 00010 Invalid 3 0011 00011 Invalid 4 0100 00100 Halt -line state (status) 5 0101 00101 Invalid 6 0110 00110 Invalid 7 0111 00111 R-Reset (logical 0)-control (control) 8 1000 01000 Invalid 9 1001 01001 Data 10 1010 01010 Data 11 1011 01011 Data 12 1100 01100 Invalid 13 1101 01101 T-Ending delimiter (control) 14 1110 01110 Data 15 1111 01111 Data 16 10000 Invalid 17 10001 K-starting delimiter (control) 18 10010 Data 19 10011 Data 20 10100 Data 21 10101 Data 22 10110 Data 23 10111 Data 24 11000 J-starting delimiter (control) 25 11001 S - set (logical 1) - control (control) 26 11010 Data 27 11011 Data 28 11100 Data 29 11101 Data 30 11110 Data Chapter 2.1: Physical 31 Layer and Data Link Layer 11111 Idle-line state (status) Worst case: 11100 01110 3 Zeros Page 18

Sicherungsebene Lehrstuhl für Informatik 4 Layer 2: Division into two Parts Logical Link Control (LLC) (Layer 2b) Organization of the data to be sent into frames Guarantee (if possible) an error free transmission between neighboring nodes through: Detection (and recovery) of transfer errors Flow Control (avoidance of overloading the receiver) Buffer Management Medium Access Control (MAC) (Layer 2a) Control of the access to the communication channel in broadcast networks Data Link Layer LLC MAC (Medium MAC Access Control) 802.3 CSMA/CD (Ethernet) 802.4 Token Bus IEEE 802.2 Logical Link Control 802.5 Token Ring 802.6 DQDB ANSI X3T9.5 FDDI ATM Forum ATM LAN Emulation...... ISO/OSI Existing Reale Networks Netze Page 19

LLC: Frame Construction Organization of a message into uniform units (for simpler transmission) Well-defined interface to the upper layer (layer 3) Marking of the units: Header Data Trailer Error check (checking sequence for the frame) Control information (addresses, frame numbers, ) FCS = Frame Checking Sequence (Physical) mark the frame by: Start and end flags Start flag and length Code injuries Next task of the LLC layer: protected transmission of the frames to the communication partner. The transmission over layer 1 is not necessarily free of errors! Question: how can errors be recognized and repaired? Page 20

Error-detecting and -correcting Codes From the data, compute a short checksum and send it together with the data to the receiver. The receiver also computes a checksum from the received data and compares it with those of the sender. Simplest procedure - parity bit: count the number of 1s: Sender: 10111001 PB: 1 sends: 101110011 Receiver: 001011011 PB computes: 0 1-Bit errors are detected 2-Bit errors are not detected Variant: double parity Corrections are not possible! Improvement of the parity bit procedure by further parity bits. For this, several blocks of bits are grouped and treated together: Sender: 1011 1 Receiver: 1011 1 0010 1 0110 0 1100 0 1100 0 0110 0 0110 0 0011 0111 An incorrect bit can be identified and corrected by this procedure. Page 21

Error-correcting Codes Error correction Error correction generally means: Transmission of redundancies: Length of the transmission: n bit (2 n possible binary sequences) Message length: m (<n) bit (2 m permissible code words) k parity bits (k = n - m) Form a sphere of code words around each message Hamming Distance D: Number of places, in which two binary sequences differ Then: D 2t + 1 code is t-error-correcting D t + 1 code is t-error-detecting That means: for error-correction, a relatively large overhead has to be transmitted and it is not guaranteed, that the identified correction really is the right one. Page 22

Hamming Code Goal: Use of several parity bits, each of them considering several bits (overlapping). Errors can be identified and corrected by combining the parity bits. The Hamming code is the minimal code of this category. Idea: Representation of each natural number by sum of powers to two. In a code word w = z 1,, z n the parity bits are placed exactly at the k positions, for them the index is a power of two. At the remaining m = n - k positions the data bits are placed. Each of the k additional bits is a parity bit for all places, for which the representation in powers of two contains the position of the additional bit. Page 23

Hamming Code ASCII-Code H 1001000 A 1100001 M 1101101 M 1101101 I 1101001 N 1101110 G 1100111 Parity bit 1: Data bit 3, 5, 7, 9, 11 3 = 1 + 2 Parity bit 2: Data bit 3, 6, 7, 10, 11 5 = 1 + 4 Parity bit 4: Data bit 5, 6, 7 6 = 2 + 4 Parity bit 8: Data bit 9, 10, 11 7 = 1 + 2 + 4 Problem with Hamming code: errors involving several following bits are usually wrongly corrected 9 = 1 + 8 10 = 2 + 8 11 = 1 + 2 + 8 Codeword 1 2 3 4 5 6 7 8 9 10 11 0 0 1 1 0 0 1 0 0 0 0 1 0 1 1 1 0 0 1 0 0 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 0 1 0 1 0 1 0 1 Receiver: examine parity bits if necessary, sum up indices of the incorrect parity bits index of the incorrect bit 1-bit errors can definitely be identified and corrected Page 24

Hamming Code 00110010000 Transmission error 00110000000 Receiver computes parity bits: 11100000000 Summing up the indizes 1, 2 and 4, bit 7 is detected as false Weaknesses: 2-bit errors are not corrected (or wrongly corrected!) 3-bit errors are not recognized a) Bit 4 and bit 11 inverted: parity bits 1, 2, 4, 8 are wrong bit 15 is to be corrected, but does not exist b) Bit 2 and bit 4 inverted parity bits 2, 4 wrong bit 6 is falsely recognized as incorrect c) Bits 1, 8, 9 inverted all parity bits are correct no error is recognized Page 25

Error Detection with Cyclic Codes Problem: how to recognize errors in several bits, especially sequences of bit errors? The use of simple parity bits is not suitable. However, in data communication (modem, telephone cables) such errors arise frequently. Most often used: Polynomial Codes Idea: a k-bit PDU (a k-1,, a 0 ) is seen as a polynomial a k-1 x k-1 + + a 0 with the coefficients 0 and 1. Example: 1100101 is seen as x 6... x 1 x 0 = x 6 + x 5 + x 2 + 1 For computations, polynomial arithmetic modulo 2 is used, i.e. addition and subtraction without carriage. Both operations become Exclusive-OR operations. Page 26

Error Detection with Cyclic Codes Idea for error detection: Sender and receiver agree upon a generator polynomial G(x) = x r + + x 0. The first and the last coefficient have to be 1. The sender interprets a data block of length m as polynomial M(x). The sender extends M(x), i.e. adds redundant bits in a way that the extended polynomial M (x) is divisible by G(x). (Redundancy = remainder R(x) by division of the sequence with G(x)) The receiver divides the received extended M(x) by G(x). If the remainder is 0, there was (probably!) no error, otherwise some error occurred. Name: Cyclic Redundancy Checksum (CRC) Note: also the parity bit can be seen as CRC, with generator polynomial x + 1! Page 27

CRC - Example Data to be transmitted: 10111001 Generator polynomial: x 4 + x +1 Note: usually, the extra positions are preset with zeros but in some cases, e.g. Ethernet, uses the inverted bits as presets. Sender: 101110010000 : 10011 = 10100111 10011 10000 10011 11100 10011 11110 10011 11010 10011 1001 = x 3 + 1 = R(x) CRC = 1001, sending 101110011001 Receiver: 101110011001 : 10011 = 10100111 10011 10000 10011 11110 10011 11010 10011 10011 10011 0 Data received correctly Page 28

Computation of CRC: Shift Registers Implementation by Shift Registers: XOR for substraction AND for applying substraction: first register = 0: no substraction first register = 1: substraction Generator polynomial x 4 + x +1: R R R R R 1 0 0 1 1 Simplified realization: R R R R R When no more input is given in the leftmost register, the other registers contain the CRC result. Page 29

Shift Registers - Example Data to be transmitted: 10111001 Generator polynomial: x 4 + x +1 0 0 0 0 0 101110010000 Sent data Sent data 1 0 0 0 0 1 01110010000 0 0 Sent data 10 0 0 0 1 0 1110010000 0 0 Page 30

Shift Registers - Example Sent data 101 0 0 1 0 1 110010000 0 0 Sent data 1011 0 1 0 1 1 10010000 0 0 Sent data 10111 1 0 1 1 1 0010000 1 1 Sent data 101110 0 1 0 0 0 010000 0 0 Page 31

Shift Registers - Example Sent data 1011100 1 0 0 0 0 10000 1 1 10111001 Sent data 0 0 1 1 1 0000 0 0 10111001 Sent data 0 1 1 1 0 000 0 0 10111001 Sent data 1 1 1 0 0 00 1 1 Page 32

Shift Registers - Example 10111001 Sent data 1 1 1 1 0 0 1 1 10111001 Sent data 1 1 0 1 0 1 1 101110011 Sent data 1 0 0 1 x 1 1 1011100110 Sent data x 0 0 1 x 0 0 Page 33

Shift Registers - Example 10111001100 Sent data x x 0 1 x 0 0 101110011001 Sent data x x x 1 x 0 0 101110011001 Sent data x x x x x 0 0 Page 34

CRC is not perfect Receiver: 001010010001 : 10011 = 00101110 10011 11110 10011 11010 10011 10010 10011 11 Error detected Receiver: 001110110001 : 10011 = 00111111 10011 11101 10011 11100 10011 11110 10011 11010 10011 10011 10011 0 Error not detected Page 35

CRC: Characteristics Common generator polynomials: CRC-16: G(x) = x 16 + x 15 + x 2 +1 CRC CCITT: G(x) = x 16 + x 12 + x 5 +1 Ethernet: G(x) = x 32 + x 26 + x 23 + x 22 + x 16 + x 12 + x 11 + x 10 + x 8 + x 7 + x 5 + x 4 + x 2 + x + 1 Error detection (for 16-bit generator polynomials): all single bit errors all double bit errors all three-bit errors all error samples with odd number of bit errors all error bursts with 16 or fewer bits 99.997% of all 17-bit error bursts 99.998% of all error bursts with length 18 bits Remaining error rate < 0.5 * 10-5 block error rate Page 36

CRC is not perfect 1.) There are still remaining some error-combinations which can occur undetected the probability is very small, but in principle it is possible 2.) Assume, the receiver only gets part of the original message: Header / Data FCS Header / Data The receiver interprets the end of the message as FCS and tries to check the rest of the received bits as sent data. Probability for assumed FCS = FCS for assumed data : 1/2 r for r-bit FCS, because each of the r bits is correct with probability ½. This problem can be eliminated by using a fixed byte structure for the data frame or a length field in the header. 3.) An error could consist of adding a multiple of G(x) to M (x) Page 37

CRC: Error Correction In exceptional cases even errors are correctable by CRCs. Example: ATM (Asynchronous Transfer Mode) Data units have fixed length 5 byte header + 48 byte data The last header byte is a checksum for the header Generator polynomial G(x) = x 8 + x 2 + x +1 It is even possible to correct a 1-bit error, due to: there are 40 possible 1-bit errors in the 40-bit header and those lead on 40 different non-zero remainders. Correction is not assigned with e.g. Ethernet: an Ethernet frame has a length between 64 and 1512 byte. Page 38

Error Protection Mechanisms Error correction: FEC (Forward Error Correction) Use of error-correcting codes Falsified data in most cases can be corrected. Uncorrectable data are simply dismissed. Feedback from the receiver to the sender is not necessary. Suitable for transmissions tolerating no transmission delays (video, audio) as well as for coding resp. protecting data on CDs or DVDs. Error detection: ARQ (Automatic Repeat Request) Use of error-detecting codes (CRC) Errors are detected, but cannot be corrected. Therefore, falsified data must be requested again. Introduction of flow control: number the data blocks to be sent acknowledgement of blocks by the receiver incorrectly transferred blocks are repeated Suitable for transmissions which do not tolerate errors (files). Page 39

Flow Control: Send and Wait Simple procedure: The sender sends a data block and waits, until an acknowledgement of the receiver arrives or a timeout is reached. Incorrect blocks are repeated, otherwise the next block is sent. Disadvantage: large waiting periods between the transmission of single blocks. Thus much transmission capacity is wasted. Waiting period Transmitter 1 2 2 3 ACK time out ACK Receiver 1 F 2 3 ACK: Acknowledgment, i.e. everything ok Page 40

Flow control: Sliding Window Introduction of a transmission window Common procedure to avoid long waiting periods of the sender Sender and receiver agree upon a transmission window. If W is the window size, it means: the sender may send maximally W messages without an acknowledgement of the receiver. The messages are sequentially numbered in the frame header (0, 1, 2,, MODULUS-1, 0, ; whereby W < MODULUS). The sender may send sequentially numbered messages up to W, without getting an acknowledgement for the first frame. The receiver confirms by acknowledgements (ACK). The sender moves the window as soon as an ACK arrives. Advantages of the procedure: The sender can take advantage of the network capacity A sender who is too fast for the receiver is slowed down (the receiver only can read data from the network slowly, thus it rarely sends ACKs) Sending and receiving speed are adapted Page 41

Sliding Window Example (for 3-bit sequence/acknowledgement number) with 3 bits for sequence/acknowledgement number, m = 8 possible combinations Stations agree upon a window size W with 1 W < m, e.g. W = 7 The window limits the number of unconfirmed frames allowed at one time (here max. 7, because of W = 7) With receipt of an acknowledgement, the window is shifted accordingly Frames are numbered sequentially modulo m (for m = 8 thus numbers from 0 to 7) 7 0 7 0 ACK 6 0 ACK 2 ACK 6 1 6 1 5 2 5 2 5 2 5 2 5 2 0 41 3 2 3 4 4 5 3 6 7 0 4 1 3 2 3 4 4 53 6 7 04 13 2 6 7 0 Station Station sendet sends Station Station receives erhält Station Station verschiebt slides Station Station receives erhält Station Station verschiebt slides Frames - Quittung 0 Fenster um 1, Quittung 1, 2 Fenster um 2, frames 0-6 acknowledgement 0 sendet window Frame by 1 7 acknowledgement sendet window Frame by 0, 2 Time 1 and sends 1,2 and sends frame 7 frames 0,1 1 6 7 0 1 6 7 0 1 Page 42

Maximum Window Size with Sliding Window There is a reason why window size W has to be smaller than MODULUS: Sequence numbers e.g. have 3 bits: 2 3 = 8 sequence numbers (0,, 7) I.e. MODULUS = 8 Assume the window size to be W = 8. A sends frames to B. A has recently received an ACK for frame 2; A is allowed to send 8 more frames 3 4 5 6 7 0 1 2 A receives ACK 2. There are two possibilities: Case 1: B only has received 0 1 2 and retransmits the (old) number ACK number. Everything in between has been lost. Case 2: B has received 0 1 2 3 4 5 6 7 0 1 2 and confirms the (new) number 2 (all ACKs may have been lost or forgotten in between) A does not know whether case 1 or 2 holds: the ACK is ambiguous! W must be less than 8 (W < MODULUS in general). Page 43

Elimination of Errors: Go-back-n The sender sends data blocks continuously (within the transmission window). The receiver answers: ACK j : everything up to block j is correct REJ j /NACK j : up to block j-1 everything is correct, block j is incorrect Go-back-n: with a REJ j, starting from block j everything is transferred again Disadvantage: With a REJ j the transmitter must repeat all blocks starting from j Advantage: the receiver needs only one buffer place Example of W = 5; MODULUS = 8 Source 0 1 2 3 4 5 2 3 4 5 6 Destination ACK 0 ACK 1 REJ 2 ACK 2 Page 44

High Level Data Link Control (HDLC) Protocol for layer 2: HDLC Frame identification: mark the beginning and end with a flag: 01111110 Flag may never occur within a frame Used for this purpose: Bitstuffing Sender inserts a zero after each sequence of five ones. The receiver removes this zero. Sender: 11111111 Receiver: 111110111 111110111 11111111 Page 45

HDLC Frame Lehrstuhl für Informatik 4 8 8 8 (16) 0 16 8 01111110 Address Control DATA FCS 01111110 Flag Header Data Trailer Flag Bits For synchronization on layer 1 D/C N(S) P/F N(R) D/C: DATA (0) resp. control (1) P/F: Poll/final for the coordination of several senders In the idle state, only 1 s are sent. The receiver recognizes a transmission with the first 0. Address contains an identifier to inform the receiver about what to do, e.g. 00000110 means IP protocol used for processing the data. The checksum is computed by using a CRC. Since CRC conducts no error correction, flow control is necessary. Control contains the sequence number N(S) for the message; at the same time, in the opposite direction a message can be acknowledged using the acknowledgement number N(R) ( Piggybacking ). Page 46

Medium Access Control (MAC) Controlling the competitive access of several users to a shared medium Simplest procedures: firm assignment of a limited capacity Time Division Multiple Access (TDMA) Frequency 1 2 3 3 1 2 3 3 1 2 3 3 1 Time Each user gets the entire transmission capacity for fixed time intervals (Baseband transmission) Frequency Division Multiple Access (FDMA) Frequency User 1 User 2 User 3 Time Each user gets a fixed portion of the transmission capacity (a frequency range) for the whole time (Broadband transmission) Page 47

MAC - Reservation Protocols Communication follows a two-phase schema (alternating phases): In the reservation phase the sender makes a reservation by indicating the wish to send data (or even the length of the data to be sent) In the transmission phase the data communication takes place (after successful reservation) Advantage: very efficient use of the capacity Disadvantage: Delay by two-phase procedure; further, often a master station is needed, which cyclically queries all other stations whether they have to send data. This master station assigns sending rights. Techniques for easy reservation without master station: Explicit reservation Implicit reservation Page 48

Explicit Reservation Uses two frame types: reservation frame (very small) in the first phase data frame (constant length) in the second phase Variant 1: without contention Only suitable for small number of users Each user i is assigned the i-th slot in the reservation frame. If it wants to send data, it sets the i-th bit in the reservation frame to 1. After the reservation phase, all stations having set their reservation bit can send their data in the order of their bits in the reservation frame. reservation frame data frames of stations having reserved 1 1 1 2 5 7 1 4 1 1 1 1 This procedure is called Bitmap Protocol Page 49

Explicit Reservation Uses two frame types: reservation frame (very small) in the first phase data frame (constant length) in the second phase Variant 2: with contention For higher number of users The reservation frame consists of a limited number of contention slots (smaller than the number of participating stations) Users try to get a contention slot (and by that make a reservation for a data slot) by random choice, writing their station number into a slot If there is no collision in the reservation phase, a station may send. reservation frame with contention slots data frames of stations having reserved 22 31 5 22 31 34 17 45 4 17 45 4 11 11 25 12 Page 50

Implicit Reservation No reservation slots, only data slots of certain length. A window consists of N data slots, windows a cyclically repeated The duration of the window must be longer than the round-trip time Procedure: A station which wants to send observes N slots without doing anything and marks the slots as follows: 0, if the slot if empty or collided 1, if the slot is used by somebody else In the following window the station randomly chooses one of the slots marked with 0 (Simplification: choose the first slot marked with 0 ) Two cases: conflict: try again successful transmission: slot reserved for the station as long as it sends data. If the station is not using its slot in one window, the reservation is dismissed. Page 51

Implicit Reservation Example: 8 data slots, Stations A - F Reservation Slots: 1 2 3 4 5 6 7 8 Window 1 Stations observing 8 slots ACDABA-F Window 2 A C D A B A B/D F Collision within slot 7; the other slots are reserved Window 3 A C A B A AC-ABA-- Window 4 A B/F B A F A---BAF- Window 5 A B A F D A---BAFD Window 6 A C E E B A F D t Page 52

MAC Decentralized Protocols Best known protocol has the name ALOHA Developed on the Hawaiian islands: stations are connected by satellite Very simple principle, no coordination: Stations are sending completely uncoordinated, all using the same frequencies When two (or more) stations are sending at the same time, a collision occurs: both messages are destroyed. Problem: collisions occur even with very small overlaps! Vulnerability period: 2 times the length of a frame When a collision occurs, frames are repeated after a random time Problem: since traffic runs over a satellite, a sender only hears after very long time, whether the transmission was successful or not. Collision Sender A Sender B Sender C t Page 53

MAC Decentralized Protocols Problem with ALOHA: even small laps already lead to transmission conflicts. Therefore often collisions arise, causing many repetitions: No guaranteed response times Low throughput Improvement: Slotted ALOHA (first version was pure ALOHA ) The whole time axis is divided into time slots (similar to TDMA, but time slots are not firmly assigned to stations) The transmission of a block starts at the beginning of a time slot fewer collisions, vulnerability period of one frame length But: the stations must be synchronized! Collision Sender A Sender B Sender C t Page 54

How to estimate the Efficiency of ALOHA? Which possible states do we have in ALOHA? G: average number of frames per time unit thinking users no conflict S: throughput, i.e. rate of successful transmissions Relation between G and S? common channel Depends significantly on the traffic structure. backlogged users total traffic G conflict Model A: only one sender. No collisions, so S = G is possible Model B: many users, each of them inactive most time new arrivals are totally random Page 55

Randomness Lehrstuhl für Informatik 4 Suppose that the total traffic is absolutely random. What is the biggest randomness possible? arrival Random arrivals: consider time interval of length h. Observe arrivals in that interval. h Arrivals have a certain intensity G (average rate per time unit) Randomness : probability of an arrival in a (small) time interval h is proportional to the intensity G o( h) to h h... to G h For very small h, only 0 or 1 arrivals are possible: Prob(exactly one arrival within interval length h) = G h + o(h) Prob(no arrivals within interval length h) = 1 G h + o(h) o(h): disturbance function with 0 for h 0 t Page 56

Application for ALOHA access protocol These conditions/requirements lead to the Poisson distribution. Consider the total number i of events in an interval of length T Prob(exactly i arrivals in [0;T]) = ( G T) i! Back to ALOHA: relation between S and G Suppose that G follows the poisson distribution, i.e. G is totally random. i e G T S = G Prob(no collision occurs) = G Prob(nobody else started in my vulnerability period) = G Prob(no arrival in interval of length T = 2) for pure ALOHA G Prob(no arrival in interval of length T = 1) for slotted ALOHA Prob(0 arrivals in [0;T]) = e -G T = G e -2G for pure ALOHA G e -G for slotted ALOHA Note: randomness (i.e. Poisson) is not valid for high traffic and if waiting time after retransmission is short Page 57

Throughput vs. Offered Traffic Analytical computation: Both, Pure ALOHA and Slotted ALOHA cannot achieve a high throughput But: simple principle, no coordination necessary between the stations Page 58

MAC Decentralized Protocols Variant of ALOHA for networks with small range exists Similar to ALOHA: no coordination of the stations But: each station which wants to send first examines whether already another station is sending If no sending takes place, the station begins to send (Carrier Sense Multiple Access, CSMA, see chapter 2.2) Note: this principle only works within networks having a short transmission delay using the principle within satellite systems is not possible because there would be no chance to know whether a conflict occurred before end of the transmission Advantages: simple, because no master station and no tokens are needed; nevertheless good utilization of the network capacity Disadvantage: no guaranteed medium access, a large delay up to beginning a transmission is possible Page 59

MAC Coordination by using a Token Introduction of a token (determined bit sequence) Only the holder of the token is allowed to send Token is cyclically passed on between all stations particularly suitable for ring topologies Token Ring (4/16/100 Mbit/s, see chapter 2.2) Characteristics: Guaranteed accesses, no collisions Very good utilization of the network capacity, high efficiency Fair, guaranteed response times Possible: multiple tokens But: complex and expensive Passing on of the token Page 60