- create a function that checks if a timer has already been set
- use it in both the sender and receiver function
- should have a function that turns off the timer whenever a packet is received.
- starts again when realizes there are still packets waiting to be received
- keep in mind of the scenario where the first "next"packet is sent but there are still packets awaiting a receive. the timer still restarts with these packets as well once the ACK is received.
- can have the timer "restart" when the buffer is recognized as not empty. once the buffer is empty the clock is completely wiped.
- keep in mind of the scenario where the first "next"packet is sent but there are still packets awaiting a receive. the timer still restarts with these packets as well once the ACK is received.
- once the timeout happens, the packets in the window are resent. buffer is cleared and the window packets are put back into the buffer
- sender/receiver in UDP protocol
- implementation of GBN on top of UDP on both sender and receiver
- guarantee packets be sent in correct order to higher layers****
- unreliable channel emulation:
- sender/receiver drops incoming packet/ACK w/ prob
- [python3 gobackn.py self-port peer-port window-size [-d value-of-d | -p value-of-p]]
- argv[0] = file name
- argv[1] = sender port
- argv[2] = receiver port
- argv[3] = window size
- argv[4] = d/p
- argv[5] = value
- packet
- each char = one packet (packet max len = 1 byte)
- data packet = seq # (no format requirement) + data
- ACK = seq #
- buffer
- sender/receiver have sending buffer
- data packets put in buffer before send
- data packets removed from buffer when corresp. ACK received
- sending buff should be long enough to avoid conflict of packet #s
- full buffer -> wait until more space is available
- window
- moves along sending buff
- window should wrap if implemented as array
- packets in window = sent out immediately
- window size = passed as argument****
- timer
- starts after first packet sent out, stops when ACK received
- timer restarts when window moves
- timeout = 500ms
- GBN nodes to send packets over UDP protocol
- receiver = deilberately discard data packets (probability)
- sender = deliberately discard ACKs before handling them (probability)
- probability = determinstic and probabilistic (passed as an arg)
- a summary at the end of transmission
- both sender and receiver print out ratioof packet failures/total packets received
- tests provided
- Will be done later. Will see if have enough time