--- In [email protected], "namasteall2000" <namasteall2...@...>
wrote:
>
> Suppose N stations are waiting for another packet to finish on an 
> Ethernet. 
> All transmit at once when the other packet is finished, and collide. 
> Write a 
> program to simulate the continuation of these attempts, and to 
> determine how 
> long it takes before one succeeds.

As I understand it... initially all N stations calculate a backoff
time, as a number of slots. I guess to simulate this you would use
some sort of (pseudo-)random number generator, but there must be an
upper limit - has the teacher mentioned this?

Find the first slot that has been selected by a station as its
transmission slot. If no other station has selected that slot, then
stop - you've got the delay before the first successful
(non-colliding) transmission.

However, if at least one other station has selected the same slot,
calculate backoff times again for those stations, and find the next
slot selected for transmission (by any station). Has it been selected
by more than one station?

Hopefully you can see a loop here - if my understanding is correct,
you just need write the code and you're done :-)

Reply via email to