TP3 Flashcards

1
Q

Complete this sender.py code:
sock.sendto(____________, _______)

A

sock.sendto(pickle.dumps(datagram), receiverAddress)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Complete this sender.py code:
data_block = f.read(__________)

A

data_block = f.read(bufferSize)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Complete this sender.py code:
rx, tx, er = select.select([__________], [ ], [ ], ________________)
if rx == [ ]:
return False
else:
return True

A

rx, tx, er = select.select([uSocket], [ ], [ ], timeout)
if rx == [ ]:
return False
else:
return True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Complete this receiver.py code for receiving the datagram:
message, senderAddress = sc.recvfrom(____________________)
type, seqN, data = pickle.loads(__________)

A

message, senderAddress = sc.recvfrom(bufferSize + 8 + sys.getsizeof(cSeqN+1))
type, seqN, data = pickle.loads(message)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain how the sliding window works.

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can the packet loss influence the go back n when the server sends a block?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the timeout?

A

It’s the time the sender waits for an acknowledge, when it ends it resends the blocks in the window.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can the packet loss influence the go back n when the receiver sends an ack?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

If the receiver sends an ack of the block 4 to the sender what it means?

A

It means until the block 4 everything was received and so the window can move forward of those blocks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly