1 / 80

Lab 2: Admin details

Lab 2: Admin details. Lab 2 is out! Due: November 4th, 12 noon November 6th, 12 noon (90 % cap) Assignment and starter code online Start early ! On average, took students 14 hours to complete Lab 2 last year. Functionality. Functionality. Write an application that:

alcina
Télécharger la présentation

Lab 2: Admin details

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab 2: Admin details • Lab 2 is out! • Due: • November 4th, 12 noon • November 6th, 12 noon (90% cap) • Assignment and starter code online • Start early! On average, took students 14 hours to complete Lab 2 last year

  2. Functionality

  3. Functionality Write an application that: • Takes in data from one host

  4. Functionality Write an application that: • Takes in data from one host • Turns those data into packets

  5. Functionality Write an application that: • Takes in data from one host • Turns those data into packets • Transmits those packets reliably and in-order to the other host

  6. Example

  7. Beware the appearance of simplicity

  8. Why the Internet isn't just "tubes" • A packet can be corrupted • A packet can be delayed • A packet can be dropped • A packet can be duplicated

  9. corrupted delayed dropped duplicated

  10. corrupted delayed dropped duplicated Please transfer $100 from my bank account to Phil's

  11. corrupted delayed dropped duplicated Please transfer $100 from my bank account to Phil's Please transfer $14837135 from my bank account to Phil's

  12. corrupted delayed dropped duplicated

  13. corrupted delayed dropped duplicated Please deposit $100 into my account Please transfer $100 from my bank account to Phil's

  14. corrupted delayed dropped duplicated Please transfer $100 from my bank account to Phil's Please deposit $100 into my account Please transfer $100 from my bank account to Phil's Please deposit $100 into my account

  15. corrupted delayed dropped duplicated

  16. corrupted delayed dropped duplicated Please transfer $100 from my bank account to Phil's

  17. corrupted delayed dropped duplicated Please transfer $100 from my bank account to Phil's

  18. corrupted delayed dropped duplicated

  19. corrupted delayed dropped duplicated Please transfer $100 from my bank account to Phil's Please transfer $100 from my bank account to Phil's Please transfer $100 from my bank account to Phil's

  20. Tools for ordered, reliable streams • Checksums • Sequence numbers • Acknowledgments • Timeouts

  21. cksums seq nos acks timeouts

  22. cksums seq nos acks timeouts Hash: cksum(data) integer

  23. cksums seq nos acks timeouts Hash: cksum(data) integer cksum("a") 1

  24. cksums seq nos acks timeouts Please transfer $100 from my bank account to Phil's Please transfer $14837135 from my bank account to Phil's

  25. cksums seq nos acks timeouts Tag packet with checksum before sending Please transfer $100 from my bank account to Phil's Please transfer $14837135 from my bank account to Phil's

  26. cksums seq nos acks timeouts Tag packet with checksum before sending Please transfer $100 from my bank account to Phil's Please transfer $14837135 from my bank account to Phil's cksum("Please ...") cksum("Please ...") Please transfer $100 from my bank account to Phil's Please transfer $14837135 from my bank account to Phil's

  27. cksums seq nos acks timeouts Note: cksum("Please transfer ... $100 ...") cksum("Please transfer ... $14837135 ...")

  28. cksums seq nos acks timeouts Note: cksum("Please transfer ... $100 ...") cksum("Please transfer ... $14837135 ...") cksum("Please ...") cksum("Please ...") Please transfer $100 from my bank account to Phil's Please transfer $14837135 from my bank account to Phil's

  29. cksums seq nos acks timeouts Monotonically increasing number appended to packet

  30. cksums seq nos acks timeouts Monotonically increasing number appended to packet Please transfer $100 from my bank account to Phil's Please transfer $100 from my bank account to Phil's Please transfer $100 from my bank account to Phil's

  31. cksums seq nos acks timeouts Monotonically increasing number appended to packet Please transfer $100 from my bank account to Phil's Please transfer $100 from my bank account to Phil's Seq no: 152 Seq no: 152 Please transfer $100 from my bank account to Phil's Seq no: 152

  32. cksums seq nos acks timeouts Monotonically increasing number appended to packet Please transfer $100 from my bank account to Phil's Please transfer $100 from my bank account to Phil's Seq no: 152 Seq no: 152 Please transfer $100 from my bank account to Phil's Seq no: 152

  33. cksums seq nos acks timeouts Monotonically increasing number appended to packet Please transfer $100 from my bank account to Phil's Please transfer $100 from my bank account to Phil's Seq no: 152 Seq no: 152 Please transfer $100 from my bank account to Phil's Seq no: 152

  34. cksums seq nos acks timeouts Monotonically increasing number appended to packet Please transfer $100 from my bank account to Phil's Please transfer $100 from my bank account to Phil's Seq no: 152 Seq no: 152 Please transfer $100 from my bank account to Phil's Seq no: 152 Sender: Last sequence number sent (and last sequence number ack-d) Receiver: Last sequence number received

  35. cksums seq nos acks timeouts Receiver acknowledges received packets If sender does not receive ack, retransmits

  36. cksums seq nos acks timeouts Receiver acknowledges received packets If sender does not receive ack, retransmits Please transfer $100 from my bank account to Phil's Seq no: 152

  37. cksums seq nos acks timeouts Receiver acknowledges received packets If sender does not receive ack, retransmits Please transfer $100 from my bank account to Phil's Please transfer $100 from my bank account to Phil's Seq no: 152 Seq no: 152 Please transfer $100 from my bank account to Phil's Seq no: 152

  38. cksums seq nos acks timeouts Receiver acknowledges received packets If sender does not receive ack, retransmits Please transfer $100 from my bank account to Phil's Please transfer $100 from my bank account to Phil's Seq no: 152 Seq no: 152 Please transfer $100 from my bank account to Phil's Seq no: 152 Ack no: 153

  39. Checksums Sequence numbers Acknowledgments Timeouts Duplicate Corrupt Delay Drop

  40. Stop and wait If you have a Sender and a Receiver: • Sender sends a data message. • Sender waits until receiver acknowledges reception • If Sender receives ack, sends its next available packet • If Sender does not receive ack, the Sender re-transmits the data that had not been acknowledged

  41. Beware the appearance of simplicity

  42. Difficulties • Conceptual • The "little" things

  43. Conceptual: Event-based code

  44. Conceptual: Event-based code • What are the events? • What parts of code map to events? • How to respond to events? • How track state in? When transition between states?

  45. 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

  46. Conceptual: Event-based code • What are the events? • What parts of code map to events? • How to respond to events? • How track state in? When transition between states?

  47. 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

  48. Conceptual: Event-based code • What are the events? • What parts of code map to events? • How to respond to events? • How track state in? When transition between states?

  49. 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

  50. Timer expires

More Related