When a Host Detects a Collision It Waits 25 Seconds Then Sends Its Packet Again
Prerequisite – Basics of CSMA/ CD, Collision Detection in CSMA/CD
Dorsum-off algorithm is a standoff resolution machinery which is used in random admission MAC protocols (CSMA/CD). This algorithm is mostly used in Ethernet to schedule re-transmissions afterward collisions.
If a collision takes place between ii stations, they may restart transmission as before long as they can after the standoff. This volition always atomic number 82 to another standoff and form an infinite loop of collisions leading to a deadlock. To preclude such scenario dorsum-off algorithm is used.
Let us consider an scenario of 2 stations A and B transmitting some data:
Afterward a collision, time is divided into discrete slots (Tslot ) whose length is equal to 2t, where t is the maximum propagation delay in the network.
The stations involved in the collision randomly pick an integer from the fix Thousand i.e {0, one}. This fix is chosen the contention window. If the sources collide once more because they picked the same integer, the contention window size is doubled and it becomes {0, 1, 2, 3}. At present the sources involved in the second collision randomly pick an integer from the prepare {0, one, 2, 3} and wait for that number of time slots before trying again. Earlier they try to transmit, they heed to the channel and transmit only if the channel is idle. This causes the source which picked the smallest integer in the contention window to succeed in transmitting its frame.
So, Back-off algorithm defines a waiting time for the stations involved in collision, i.e. for how much time the station should look to re-transmit.
Waiting time = back–off time Allow n = collision number or re-transmission series number. And so, Waiting fourth dimension = K * Tslot where K = [0, 2northward – 1 ]
Example –
Example-1 :
Suppose ii stations A and B offset transmitting data (Package one) at the same time then, collision occurs. So, the collision number n for both their data (Packet 1) = one. At present, both the station randomly pick an integer from the set G i.e. {0, i}.
- When both A and B choose Thou = 0
–> Waiting time for A = 0 * Tslot = 0
Waiting time for B = 0 * Tslot = 0Therefore, both stations volition transmit at the aforementioned time and hence standoff occurs.
- When A chooses Yard = 0 and B chooses M = ane
–> Waiting time for A = 0 * Tslot = 0
Waiting fourth dimension for B = i * Tslot = TslotTherefore, A transmits the packet and B waits for time Tslot for transmitting and hence A wins.
- When A chooses M = one and B chooses K = 0
–> Waiting time for A = i * Tslot = Tslot
Waiting time for B = 0 * Tslot = 0Therefore, B transmits the packet and A waits for time Tslot for transmitting and hence B wins.
- When both A and B cull Yard = 1
–> Waiting fourth dimension for A = 1 * Tslot = Tslot
Waiting time for B = 1 * Tslot = TslotTherefore, both will wait for the aforementioned time Tslot and then transmit. Hence, collision occurs.
Probability that A wins = i/iv Probability that B wins = 1/4 Probability of collision = 2/four
Instance-two :
Assume that A wins in Case 1 and transmitted its data(Bundle one). Now, as soon as B transmits its packet one, A transmits its packet 2. Hence, collision occurs. Now collision no. n becomes 1 for parcel 2 of A and becomes 2 for parcel i of B.
For packet 2 of A, G = {0, 1}
For package one of B, K = {0, 1, 2, 3}
Probability that A wins = five/eight Probability that B wins = 1/8 Probability of collision = 2/eight
Then, the probability of collision decreases equally compared to Case 1.
Advantage –
- Standoff probability decreases exponentially.
Disadvantages –
- Capture effect: Station who wins ones keeps on winning.
- Works merely for ii stations or hosts.
GATE Practice Question –
- GATE-CS-2004 | Question 90
- GATE-CS-2016 (Prepare ii) | Question 34
- GATE-It-2004 | Question 85
constablelesellizen66.blogspot.com
Source: https://www.geeksforgeeks.org/back-off-algorithm-csmacd/
0 Response to "When a Host Detects a Collision It Waits 25 Seconds Then Sends Its Packet Again"
Post a Comment