data link layer performance analysis...stop and wait source transmits frame destination receives...

39
Data Link Layer Data Link Layer Performance Analysis: Performance Analysis: 1. 1. Data Link Control Protocols Data Link Control Protocols 2. Medium Access Control Protocols 2. Medium Access Control Protocols

Upload: others

Post on 17-Mar-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Data Link Layer Data Link Layer

Performance Analysis:Performance Analysis:

1.1.Data Link Control ProtocolsData Link Control Protocols

2. Medium Access Control Protocols 2. Medium Access Control Protocols

Page 2: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Link Protocols PerformancePerformance is computed as a measure of the how efficiently a sender and receiver make use of the communications capacity of a give line (medium).Need to know how much of the potential capacity of the line a protocol can actually use. This is called utilization, and it varies based on the flow control and error control mechanisms used.

Page 3: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Flow ControlFlow Control

ensure sending entity ensure sending entity does not does not overwhelm receiving overwhelm receiving entity entity by preventing buffer overflow by preventing buffer overflow influenced by:influenced by:transmissiontransmission time time

• time taken to emit all bits into mediumtime taken to emit all bits into medium

propagationpropagation time time• time for a bit to traverse the linktime for a bit to traverse the link

assume here no errors but varying delaysassume here no errors but varying delays

Page 4: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Stop and WaitSource transmits frameAfter reception, destination indicates willingness to accept another frame in acknowledgementSource must wait for acknowledgement before sending another frameTwo kinds of errors:

Damaged frame at destination Damaged acknowledgement at source

Page 5: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Stop and WaitStop and Wait

source transmits framesource transmits framedestination receives frame and replies with destination receives frame and replies with acknowledgement (ACK)acknowledgement (ACK)source source waits for ACK waits for ACK before sending next onebefore sending next onedestination can stop flow by destination can stop flow by not sending ACKnot sending ACKworks well for a few large framesworks well for a few large framesStop and wait becomes inadequate if large block of data is Stop and wait becomes inadequate if large block of data is split into small frames split into small frames

Page 6: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Link Utilization - Efficiency

The ratio between the use of a The ratio between the use of a link for sending user data to the link for sending user data to the available bandwidth on the link… available bandwidth on the link… oror

User data that is sentUser data that is sentMaximum capacity of link for sending user Maximum capacity of link for sending user

datadata

Page 7: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next
Page 8: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Error-Free Stop and WaitT = Tframe + Tprop + Tproc + Tack + Tprop + Tproc

Tframe = time to transmit frame (Ttrans)

Tprop = propagation time

Tproc = processing time at station

Tack = time to transmit ack

Assume Tproc and Tack relatively small

Page 9: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

T ≈ Tframe + 2Tprop

Throughput S = 1/T = 1/(Tframe + 2Tprop) frames/sec

Utilization U is ratio of time to transmit data Tframe and the total time to send the data and get the response Tframe + 2Tprop

U = Tframe = 1 Tframe + 2Tprop 1 + 2a

where a = Tprop / Tframe

Error-Free Stop and Wait (2)

Page 10: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

The Parameter aa = propagation time = d/V = Rd transmission time L/R VLwhere

d = distance between stationsV = velocity of signal propagationL = length of frame in bitsR = data rate on link in bits per sec

Rd/V ::= bit length of the linka ::= ratio of link bit length to the length of frame

Page 11: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Stop-and-Wait Link UtilizationIf Tprop large relative to Tframe then throughput reducedIf propagation delay is long relative to transmission time, line is mostly idleProblem is only one frame in transit at a timeStop-and-Wait rarely used because of inefficiency

Page 12: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Error-Free Sliding Window ARQ

Case 1: W ≥ 2a + 1Ack for frame 1 reaches A before A has exhausted

its window

Case 2: W < 2a +1A exhausts its window at t = W and cannot send

additional frames until t = 2a + 1

Page 13: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Stop and Wait Link UtilizationStop and Wait Link Utilization

Page 14: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Figure 11.10

W ≥ 2a + 1

Page 15: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Normalized Throughput

1 for W ≥ 2a + 1 U = W for W < 2a +1 2a + 1

Page 16: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Stop-and-Wait ARQ with ErrorsP = probability that a single frame is in error

Nx = 1

1 - P = average number of times each frame must

be transmitted due to errors

U = 1 = 1 - P Nx (1 + 2a) (1 + 2a)

Page 17: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Selective Reject ARQ

1 - P for W ≥ 2a + 1 U = W(1 - P) for W < 2a +1 2a + 1

Page 18: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Go-Back-N ARQ

1 - P for W ≥ 2a + 1 U = 1 + 2aP

W(1 - P) for W < 2a +1 (2a + 1)(1 – P + WP)

Page 19: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

2. Medium Access Control Protocols 2. Medium Access Control Protocols

Page 20: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

CharacterizationThroughput and EfficiencyLatency

Page 21: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Categorization by CollisionCollision is what occurs when more than

one station transmits on the same medium– Here we assume data cannot be used after

collision– May not be true in some cases, CDMA etc.

useful

Collision must be detected– May or may not be avoided

Collision avoidance may be partial– “Limited contention”

Or complete– “Collision free”

Page 22: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

ALOHAThe oldest of all shared MACsRenewed interest in wireless fieldStraightforward and elementary

– Transmit when you want– Collision may occur – conclude from no

acknowledgement– Retransmit after delay

Important observation– Traffic offered to the medium is different from– Traffic offered to the stations, due to

retransmission

Page 23: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Vulnerability Period

A collision involves two or more stations. If all these stations try to resend their frames after the time-out, the frames will collide again. Pure ALOHA dictates that, when the time-out period passes, each station waits a random amount of time before resending its frame. The randomness will help avoid more collisions. We call this time the back-off time TB .

Pure ALOHA has a second method to prevent congesting the channel with retransmitted frames. After a maximum number of retransmission attempts K max ' a station must give up and try later. The figure shows the procedure for pure ALOHA based on the above strategy.

Page 24: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

24

Procedure for pure ALOHA protocol

Page 25: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

25

The stations on a wireless ALOHA network are a maximum of 600 km apart. If we assume that signals propagate at 3 × 108 m/s, we find Tp = (600 × 103 ) / (3 × 108 ) = 2 ms. Then find the value of TB for different values of K .

a. For K = 1, the range is {0, 1}. The station needs to generate a random number with a value of 0 or 1. This means that TB is either 0 ms (0 × 2) or 2 ms (1 × 2), based on the outcome of the random variable.

Example 1

Page 26: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

26

b. For K = 2, the range is {0, 1, 2, 3}. This means that TB

can be 0, 2, 4, or 6 ms, based on the outcome of the random variable.

c. For K = 3, the range is {0, 1, 2, 3, 4, 5, 6, 7}. This means that TB can be 0, 2, 4, . . . , 14 ms, based on the outcome of the random variable.

d. We need to mention that if K > 10, it is normally set to 10.

Example 1 (continued)

Page 27: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Vulnerability Period The time-out period is equal to the maximum possible round-trip

propagation delay, which is twice the amount of time required to send a frame between the two most widely separated stations

(2 x Tp )' The back-off time TB is a random value that normally depends on K (the number of attempted unsuccessful transmissions). The formula for TB depends on the implementation.

One common formula is the binary exponential back-off. In this method, for each retransmission, a multiplier in the range 0 to 2K - 1 is randomly (R) chosen and multiplied by Tp (maximum propagation time) or T

fr (the average time required to send out a

frame) to find TB. Where TB= Rx(Tp or T

fr ). The range of the

random numbers increases after each collision. The value of K max is usually chosen as 15.

Page 28: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Vulnerability Period Example 2

The stations on a wireless ALOHA network are a maximum of 600 km apart. If we assume that signals propagate at 3x108 m/s, we find Tp = (600 x 103) / (3x108) = 2 ms. Now we can find the value of T

B for different values of K.

a. For K = 1, the range is {0, 1}. The station needs to generate a random number with a value of 0 or 1. This means that T

B is

either ms (0 x 2) or 2 ms (1x 2), based on the outcome of the random variable.

b. For K = 2, the range is {0, 1, 2, 3}. This means that TB can be

0, 2, 4, or 6 ms, based on the outcome of the random variable. c. For K = 3, the range is to, 1,2,3,4,5,6, 7}. This means that TB

can be 0,2,4, ... , 14 ms, based on the outcome of the random variable.

d. Need to mention that if K > 10, it is normally set to 10.

Page 29: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Vulnerability PeriodVulnerability Period• Period during which another transmission collision

Page 30: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Vulnerability Period-Pure ALOHAVulnerability Period-Pure ALOHA

Vulnerable time: Find the length of time, the vulnerable time, in which there is a possibility of collision. We assume that the stations send fixed-length frames with each frame taking T

fr S to send. The

figure above shows the vulnerable time for station A.Station A sends a frame at time t. Now imagine station B has already sent a frame between t - T

fr and t. This leads to a collision

between the frames from station A and station B. The end of B's frame collides with the beginning of A's frame. On the other hand, suppose that station C sends a frame between t and t + T

fr . Here,

there is a collision between frames from station A and station C. The beginning of C's frame collides with the end of A's frame.

Page 31: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Vulnerability Period-Pure ALOHA

Vulnerable period/time for pure ALOHA protocol

Page 32: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Vulnerability Period-Pure ALOHA

Looking at Figure above, the vulnerable time, during which a

collision may occur in pure ALOHA, is 2 times the frame transmission time. Pure ALOHA vulnerable time = 2 x T

fr

Page 33: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Vulnerability Period-Pure ALOHA

A pure ALOHA network transmits 200-bit frames on a shared channel of 200 kbps. What is the requirement to make this frame collision-free?

SolutionAverage frame transmission time T

fr is 200 bits/200 kbps

or 1 ms. The vulnerable time is 2 x1 ms = 2 ms. This means no station should send later than 1 ms

before this station starts transmission and no station should start sending during the one 1-ms period that this station is sending.

Page 34: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Pure Aloha – Throughput Analysis

Throughput: Let G be the average number of frames generated by the system during one frame transmission time. Then it can be proved that the average number of successful transmissions for pure Aloha is S = G x e- 2G . The maximum throughput S

max is

0.184, for G = 1/2. In other words, if one-half a frame is generated during one frame transmission time (in other words, one frame during two frame transmission times), then 18.4 percent of these frames reach their destination successfully. This is an expected result because the vulnerable time is 2 times the frame transmission time.

Therefore, if a station generates only one frame in this vulnerable time (and no other stations generate a frame during this time), the frame will reach its destination successfully.

Page 35: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Pure Aloha – Throughput Analysis Metric – efficiency (fraction of time spent transmitting

packets successfully)– More sensible metric than success rate (why?)

Model – unified queue, Poisson arrivals– P (k) = (G)k e-G / k!– k, Transmission attempts per frame time.– G is the mean number of frames generated by the system

during one frame transmission time (old and new).

Arrival and departure rates same at equilibrium

Throughput is given by S = GP0 where P0 is the success probability of a frame(frame does not suffer a collision).

Page 36: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Vulnerability Period

Hence = P (0,2) = e-2G, S = Ge-2G

– k =0, frame time =2 Differentiate to find that

– S ≤ 1/2e, or 18%

At G = 0.5, P0 = 1/e

Page 37: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Pure Aloha – Throughput Analysis

Example 3A pure ALOHA network transmits 200-bit frames on a shared channel of 200 kbps. What is the throughput if the system (all stations together) produces 1000 frames per second

SolutionThe frame transmission time is 200/200 kbps or 1 ms. If the system creates 1000 frames per second, this is a 1

frame per millisecond. The load is 1. In this case S = G x e-2G or S = 0.135 (13.5 percent). This

means that in one second (1000ms) the throughput is 1000 X 0.135 = 135 frames. Only 135 frames out of 1000 will

probably survive.

Page 38: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

Slotted ALOHA

Time is slottedCan start transmitting only at beginning of next slot, when frame arrivesVulnerability period is halvedBy same logic, P0= e-G, S = Ge-G

Or consider P (1) , to obtain same thingEfficiency goes straight up to 36%

Page 39: Data Link Layer Performance Analysis...Stop and Wait source transmits frame destination receives frame and replies with acknowledgement (ACK) source waits for ACK before sending next

ExercisesTanenbaum: Questions from chapter 4: .4, 5, 6Stallings: Question from Chapters 7 and 16: 16.7: Consider a slotted ring of length 10 km with a data rate of 10 Mbps and 500 repeaters, each of which introduces a 1-bit delay. Each slot contains room for one source address byte, one destination-address byte, two data bytes, and five control bits for a total length of 37 bits. How many slots are on the ring? 16.1 A disadvantage of the contention approach for LANs is the capacity wasted due to multiple stations attempting to access the channel at the same time. Suppose that time is divided into discrete slots with each of N stations attempting to transmit with prob ability p during each slot. What fraction of slots is wasted due to multiple simultaneous transmission attempts?7.9 Two neighboring nodes (A and B) use a sliding-window protocol with a 3-bit sequence number. As the ARQ mechanism, Go-back-N is used with a window size of 4. Assuming A is transmitting and B is receiving, show the window positions for the following succession of events: a. Before A sends any frames. b. After A sends frames 0, 1 , 2 and B acknowledges 0, 1 and the ACKs are received by A. c. After A sends frames 3, 4, and 5 and B acknowledges 4 and the ACK is received by A.