"Henry Hewgill" <23*1*7*
8@s*u*e*t*u*a*e*u*a*> wrote:
> I haven't gotten to duplicate retransmissions yet (though was thinking about it, maybe we store checksums and check against multiple matches? Maybe that's naive...).
No, no need to store multiple checksums anywhere. We can always recalculate a checksum at any time required. We detect duplicates through the use of sequence-numbers.
> Timing makes sense, I can see how we:
> 1. start timer whenever sending
> 2. stop timer whenever receiving
> 3. resend & restart timer when negative acknowledgement / junk received
> 4. resend & restart timer whenever timer runs out
> 5. success = acknowledgement received (timer already stopped, tell network layer to proceed)
One advantage to using simulation is that you can 'exhaustively' check your protocols, as opposed to formally proving that they work. Each node in your protocol can only be in a finite (small) number of different states, and the randomness that is introduced means that your protocol will be forced to eventually visit each of those states.
Rather than waiting for your protocol to visit all the states, which may take ages, your can run cnet with
cnet -F ...
and it will advance time as quickly as possible. If it runs successfully for, say, a minute it doesn't *prove* that it's correct, just fairly robust. However, if there is a bug in your protocol, and your check for problems, it's almost guaranteed to find the bug.