TP3 Flashcards
Complete this sender.py code:
sock.sendto(____________, _______)
sock.sendto(pickle.dumps(datagram), receiverAddress)
Complete this sender.py code:
data_block = f.read(__________)
data_block = f.read(bufferSize)
Complete this sender.py code:
rx, tx, er = select.select([__________], [ ], [ ], ________________)
if rx == [ ]:
return False
else:
return True
rx, tx, er = select.select([uSocket], [ ], [ ], timeout)
if rx == [ ]:
return False
else:
return True
Complete this receiver.py code for receiving the datagram:
message, senderAddress = sc.recvfrom(____________________)
type, seqN, data = pickle.loads(__________)
message, senderAddress = sc.recvfrom(bufferSize + 8 + sys.getsizeof(cSeqN+1))
type, seqN, data = pickle.loads(message)
Explain how the sliding window works.
The sliding window has a defined size. Sends the blocks inside its limits and once it receives an acknowledge of the sent block it shifts to the right of that block.
How can the packet loss influence the go back n when the server sends a block?
When a the sender sends a block which isn’t received it waits the timeout to resend the blocks in the window again or until in receives an acknowledge of a higher number block.
What is the timeout?
It’s the time the sender waits for an acknowledge, when it ends it resends the blocks in the window.
How can the packet loss influence the go back n when the receiver sends an ack?
When an ack is lost during the process the receiver doesn’t resend it, assumes the sender received the ack it will wait for the next block and then send the ack for that block.
If the receiver sends an ack of the block 4 to the sender what it means?
It means until the block 4 everything was received and so the window can move forward of those blocks.