Advanced UNIX programming - PowerPoint PPT Presentation

About This Presentation
Title:

Advanced UNIX programming

Description:

TCP only supports point to point communication. Why UDP. socket, bind, sendto, ... See example1.c and example2.c for communication using UDP. Lost packets in UDP ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 8
Provided by: asri9
Learn more at: http://www.cs.fsu.edu
Category:

less

Transcript and Presenter's Notes

Title: Advanced UNIX programming


1
Advanced UNIX programming
  • Fall 2002
  • Instructor Ashok Srinivasan
  • Lecture 24

Acknowledgements The syllabus and power point
presentations are modified versions of those by
T. Baker and X. Yuan
2
Announcements
  • Reading assignment
  • Chapter 8
  • Especially sections 8.1 to 8.8
  • Chapter 9
  • Midterm next Monday

3
Week 9 Topics
  • Socket options
  • getsockopt, setsockopt
  • fcntl
  • ioctl
  • Introduction to UDP
  • TCP vs UDP
  • UDP interface

4
TCP vs UDP
  • TCP
  • Reliable byte stream service
  • Connection setup overhead
  • UDP
  • Unreliable datagram service
  • Data may get lost
  • Application may need to deal with more details
    in the communication

5
Why UDP
  • Applications that do not need 100 reliability
    communication
  • Examples
  • VoIP, video stream, DNS servers
  • Applications that care about performance
  • Example
  • Some high performance computing applications
  • Applications that need multicast or broadcast
  • TCP only supports point to point communication

6
UDP interface
  • socket, bind, sendto, recvfrom, close

TCP server TCP client socket
socket bind
connect listen accept
read/write
close read/write close

UDP server UDP client socket
socket bind
sendto recvfrom recvfrom sendto
close
7
UDP interface ... continued
  • include ltsys/socket.hgt
  • ssize_t recvfrom(int sockfd, void buff, size_t
    nbytes, int flags, struct sockaddr from,
    socklen_t addrlen)
  • ssize_t sendto(int sockfd, void buff, size_t
    nbytes, int flags, const struct sockaddr to,
    socklen_t addrlen)
  • See example1.c and example2.c for communication
    using UDP
  • Lost packets in UDP
  • How does the error rate vary with size of data?
Write a Comment
User Comments (0)
About PowerShow.com