Successfully reported this slideshow.
Upcoming SlideShare
×

# Computer network (8)

327 views

Published on

a

Published in: Education
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

### Computer network (8)

1. 1. Announcements ● Lab 1: Due Monday 12.49pm Late (capped at 90%) due Wed at 8.59pm ● BUG: make submit does not include README file. See piazza for workaround. ● Writing assignment: Due Sunday at 5.59pm. (8 writing assignments total; choose 2.)
2. 2. Outline ● Lab 1 theory ● Lab 1 practice ● GDB ● Questions
3. 3. Theory + Preview Network Sender Receiver
4. 4. Theory + Preview Network pkt Sender Receiver
5. 5. Theory + Preview Network pkt Sender Receiver What are all the terrible things that can happen to this data packet in the network?
6. 6. Things that can happen to a packet ● Corrupted ● Dropped ● Delayed ● Duplicated What are some primitives used to address these problems?
7. 7. Things that can happen to a packet ● Corrupted ● Dropped ● Delayed ● Duplicated What are some primitives used to address these problems? -Acknowledgments/retransmissions -Sequence numbers -Checksums
8. 8. Original example Sender Receiver
9. 9. Receiver's view ● Data packet with sequence #1 arrives
10. 10. Receiver's view ● Data packet with sequence #1 arrives ● Packet's checksum, etc. are correct
11. 11. Receiver's view ● Data packet with sequence #1 arrives ● Packet's checksum, etc. are correct ● Send ack for #1
12. 12. Receiver's view ● Data packet with sequence #1 arrives ● Packet's checksum, etc. are correct ● Send ack for #1 ● Data packet with sequence #1 arrives
13. 13. Receiver's view ● Data packet with sequence #1 arrives ● Packet's checksum, etc. are correct ● Send ack for #1 ● Data packet with sequence #1 arrives Send ack or do nothing?
14. 14. Don't Send Ack SeqNo: #1 X SeqNo: #1 SSeeqqNNoo:: ##11 Sender Receiver ... If we do not re-send ack, can get into a case where we have infinite retransmissions. (Bad) Therefore, we should re-send the ack.
15. 15. ● Edge cases matter ● Think through all states system can be in
16. 16. Outline ● Lab 1 theory ● Lab 1 practice ● GDB ● Questions
17. 17. A Quote “A professor once told me that the secret to teaching is that students aren't going to learn what you tell them during lecture. What they're going to learn is what you make them build themselves.” -????
18. 18. A Quote “A professor once told me that the secret to teaching is that students aren't going to learn what you tell them during lecture. What they're going to learn is what you make them build themselves.” -Phil Levis
19. 19. A Quote “A professor once told me that the secret to teaching is that students aren't going to learn what you tell them during lecture. What they're going to learn is what you make them build themselves.” -Phil Levis ● Labs are a lot of work. ● You'll get something out of them. ● Start them early. ● Think about them while you're working on them.
20. 20. Goals of Labs 1 & 2 ● Understand edge cases for reliable transport and techniques for accomplishing it. ● Get experience working with and using others' code.
21. 21. Event-based structure ● What are events that system needs to handle? ● What parts of the given code map to these events? ● How should you respond to each? (Generally it will depend on the “state” that you are in.) ● How do you track what state you are in? How do you change states?
22. 22. Events ● Receive data packet ● Receive ack packet ● Input goes from empty to having data ● Output goes from full to having room ● Timer expires ● Create a new connection ------ ● Receive shutdown from opposite end ● Receive shutdown from input
23. 23. Event-based structure X ● What are events that system needs to handle? ● What parts of the given code map to these events? ● How should you respond to each? (Generally it will depend on the “state” that you are in.) ● How do you track what state you are in? How do you change states?
24. 24. Events ● Create a new connection rel_create ● Receive data packet ● Receive ack packet rel_recvpkt ● Input goes from empty to having data rel_read ● Output goes from full to having room rel_output ● Timer expires rel_timer
25. 25. Event-based structure X X ● What are events that system needs to handle? ● What parts of the given code map to these events? ● How should you respond to each? (Generally it will depend on the “state” that you are in.) ● How do you track what state you are in? How do you change states?
26. 26. Events ● Create a new connection rel_create ● Receive data packet ● Receive ack packet rel_recvpkt ● Input goes from empty to having data rel_read ● Output goes from full to having room rel_output ● Timer expires rel_timer
27. 27. Timer expires
28. 28. Timer expires ● Timer expiration maps to retransmits. ● When do we retransmit? – Have an unacknowledged packet in flight and – We sent it more than cc­> timeout milliseconds ago. (Where cc is of type config_common* .)
29. 29. Timer expires for conn in openConnections: if ((conn.hasUnackedPkt) and (conn.timeSinceSentPkt > THRESHOLD)) { resend(conn.unackedPkt); }
30. 30. Timer expires for conn in openConnections: if ((conn.hasUnackedPkt) and (conn.timeSinceSentPkt > THRESHOLD)) { resend(conn.unackedPkt); } “Style” grade is 25% of lab score.