Docsity

UDP Sockets: Reliable Communication and Flow Control, Slides of Computer Programming

Partial preview of the text

Download UDP Sockets: Reliable Communication and Flow Control and more Slides Computer Programming in PDF only on Docsity!

Week 10 Topics

  • Advanced UDP sockets
    • Reliable communication over UDP
      • Time out
      • Sequence numbers
  • Unix domain protocols
    • Address structure
    • Client-server
    • socketpair

Reliable communication over UDP

  • Flow control
  • Error control

Time out

  • example1b.c and example2a.c resolve the flow control problem - What will happen if some packet gets lost? - example1b.c and example2b.c - Solution - Add timeout to the sender - If a packet gets lost, the sender should timeout and resend the packet - How can we implement a timeout? - See example1c.c and example2b.c

Sequence numbers

  • Problems with example1c.c and example2b.c - Some packets get duplicated - How can we resolve this problem? - The receiver must be able to recognize whether it has received a packet - It should discard the duplicate - How can we accomplish this? - Add an identifier to each packet sent – a sequence number - The receiver should record sequence numbers that is has received » example1d.c and example2c.c implement this