Modeling and Simulation NETW 707 Lecture 6 ARQ Modeling: Modeling Error/Flow Control Course Instructor: Dr.-Ing. Maggie Mashaly maggie.ezzat@guc.edu.eg C3.220 1
Data Link Layer Data Link Layer provides a service for Network Layer (transfer of data from the network layer of a sender to the network layer of a receiver) Network LLC Data Link Layer uses the Physical Layer to transmit bits of Data Link Frames over the physical medium MAC Physical 2
Data Link Layer Functions Framing (Grouping Bits into Frames) Error Control Flow Control Medium Access Control 3
Bit errors in Communication Systems At the physical layer, bit errors are inevitable to occur with small but non zero probability, example: Bit error probability in the order of 10-6 for systems using copper wires Bit error probability in the order of 10-9 for modern optical fiber systems High bit error probability in the order of 10-3 for wireless transmission systems Some services are tolerant to relatively high bit error rates such as digital speech transmission Some applications must experience error-free communications such as electronic funds transfer 4
Error Control Error Control is a system to deal with errors that occur due to disturbances on the physical channel. Components of an error control system: Error Correction and Detection Acknowledgement (ACK) & Non- Acknowledgement Control Messages (NAK) Timers Sender Data Frame Timer 0 1 1 No Errors Frame is Good Errors No Errors Frame is Good Receiver 0 1 1 Detection/ Correction ACK Detection/ Correction Detection/ Correction ACK 5
Error Control Mechanisms Forward Error Correction (FEC) - Detection of erroneous frames or packets - Processing of received frame bits in attempt to correct the errors Automatic Retransmission request (ARQ) - Detection of erroneous frames or packets - Retransmission of erroneous frames with the hope that no errors would occur in the next attempt 6
Automatic Repeat request (ARQ) protocols Purpose: To ensure a sequence of information packets is delivered in order and without errors or duplications despite transmission errors & losses (Error Control & Flow Control ) 7
Modeling of Stop and Wait Protocol 8
Stop-and Wait ARQ Stop after Transmitting a Packet Wait for an Acknowledgement Packet Transmitter Information Frame CRC H H CRC ACK Receiver Error Free Packet H CRC : Header : Cyclic Redundancy Check (Error Detection) 9
Stop and Wait ARQ Operation Machine A Machine B Physical Channel First Packet-Bit enters Channels Last Packet-Bit enters Channels Channel is Idle First Packet-Bit arrives at B Last Packet-Bit arrives at B Processing Time for Error Detection Last ACK-Bit Arrives at A 10
Stop and Wait ARQ Operation Machine A Machine B Physical Channel 11
Stop and Wait ARQ Modeling Assumptions L a L pk, t a t pk t a 0 t proc t proc 0 Forward Channel BER ε Machine A Physical Channel Machine B Backward Channel (i.e., ACK/NAK) is Error Free Infinite number of retransmissions 12
Stop and Wait ARQ Markov Model Model Details State s k corresponds to k retransmissions of a given packet The time step is equal to t 0 Transition probabilities are governed by probability of packet error p e p e = 1 1 ε L pk p e = 1 1 L pk 1 ε + L pk 2 ε2 For εl pk 1 p e εl pk Define π k as the probability of s k Define δ kj as the transition probability from s k to s j 13
Stop and Wait ARQ Markov Model Δ = 1 p e p e 0 0 1 p e 0 p e 0 1 p e 0 0 p e At steady State Π Δ = Π With boundary condition k=0 π k = 1 Solving: Π n = 1 p e p e n 14
Stop and- Wait ARQ Performance Average number of retransmissions per packet N rt Pr N rt = 0 = 1 p e Pr N rt = 1 = p e 1 p e Pr N rt = 2 = p e 2 1 p e N rt = E N rt = k Pr N rt = k k=0 N rt = k 1 p e pk e N rt = k=0 p e 1 p e N rt = k=0 k 1 p e p e k N rt = 1 p e k k=0 p e k N rt = 1 p e p e + 2p 2 e + 3p 3 e + p e + p 2 e + p 3 e + N rt = 1 p e + p 2 e +p 3 e + +p 3 e + N rt = 1 p e N rt = 1 p e N rt = p e 1 p e p e p 2 e p 3 e + + + 1 p e 1 p e 1 p e p e 1 p 2 e 15
Stop and Wait ARQ Efficiency Efficiency measures number of transmissions required to send one packet η 1 η = 1 + p = 1 p e e 1 p e For p e 1 & εl pk 1 η = 1 p e 1 εl pk Efficiency Decreases with: Increase in BER Increase in Packet Size Notes The efficiency is expressed in terms of the time step t 0 The closed form solution presents a simple equation in terms of ε, L pk 16
Stop and-wait ARQ Throughput Throughput measures the percentage of time slots that are utilized for successful transmissions Th = k=0 π k Pr Succ. Tx at s k Th = 1 p e π k k=0 = 1 p e Notes Throughput does not care how many attempts have been done to successfully transmit a packet Throughput measures the channel utilization for successful transmission Efficiency rather measures the delay of a given packet Both efficiency and throughput represent two faces of the same coin 17
Stop and-wait ARQ Simplified Model State s 0 corresponds to new transmission and State s rt corresponds to a retransmission state. 1 p e p e p e At steady State s 0 s rt Π = π 0 π rt 1 p e p e 1 p e p e With boundary condition π 0 + π rt = 1 Solving: π 0 = 1 p e π rt = p e 1 p e Π = π 0 π rt Δ = 1 p e 1 p e p e p e Th = 1 p e 18