It's UWAweek 17 (1st semester, week 8)

help3002

This forum is provided to promote discussion amongst students enrolled in CITS3002 Computer Networks.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message. How do I ask a good question?

Displaying the 4 articles in this topic
Showing 4 of 275 articles.
Currently 9 other people reading this forum.


 UWA week 13 (1st semester, week 5) ↓
SVG not supported

Login to reply

👍?
helpful
3:34am Tue 26th Mar, Henry H.

Hi Chris, I used a different approach than you did to solve the issue of working NACKs into the stop & wait protocol, and I'm wondering if it's equally valid (it certainly works, though might not scale in context of later content?). Instead of testing if you're an outstanding (unacknowledged) sender by checking if 'nextdatatosend != ackexpected' I'm testing if 'lasttimer != NULLTIMER', and updating 'lasttimer = NULLTIMER' when I stop it after receiving a valid acknowledgement. I wanted to get your thoughts on testing against the timers for this, it seems like an equivalent solution, though to see if it's a bad approach for any reason (like upcoming protocol features / considerations). Let me know your thoughts, Henry


SVG not supported

Login to reply

👍x1
helpful
2:40pm Tue 26th Mar, Christopher M.

"Henry Hewgill" <23*1*7*8@s*u*e*t*u*a*e*u*a*> wrote:
> Instead of testing if you're an outstanding (unacknowledged) sender by checking if 'nextdatatosend != ackexpected' I'm testing if 'lasttimer != NULLTIMER', and updating 'lasttimer = NULLTIMER' when I stop it after receiving a valid acknowledgement.
Yes, such approaches work as well - you're using the fact that a timer is still 'running' as a Boolean value, which is the same as checking the equivalence of two integer values. However, as those integer values have a *value* that reflects how future frames should be numbered, you'll need to also keep updating it. Don't forget to set the value of your timer to NULLTIMER, both when the ack arrives AND when/if the timer times-out.


SVG not supported

Login to reply

👍?
helpful
4:43pm Tue 26th Mar, Henry H.

Yep makes sense, thanks for the reply. Only thing I wasn't doing was setting the timer to NULLTIMER when it timed out because it immediately sends the data frame again (which restarts the timer). I assumed that setting it to NULLTIMER in-between wouldn't make a difference so I omitted it.


SVG not supported

Login to reply

👍x1
helpful
3:05pm Wed 27th Mar, Christopher M.

"Henry Hewgill" <23*1*7*8@s*u*e*t*u*a*e*u*a*> wrote:
> Only thing I wasn't doing was setting the timer to NULLTIMER when it timed out because it immediately sends the data frame again (which restarts the timer). I assumed that setting it to NULLTIMER in-between wouldn't make a difference so I omitted it.
You are correct; it's the sort of thing I often do in my coding 'just in case', so it's not forgotten. It's termed defensive programming. Other examples include adding {...} around code blocks, even if they're only a single line, and the pairing free(pointer); pointer = NULL;

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  5:07AM Sep 06 2023
Privacy policy