1 / 6

CSC 552 - Advanced Unix Programming, Fall 2015

CSC 552 - Advanced Unix Programming, Fall 2015. Wednesday, September 30 TCP and UDP socket system calls. Example code. ~parson/UnixSysProg/udptcp.fall2015.zip ~parson/UnixSysProg/udptcp/. Transmission Control Protocol / Internet Protocol (TCP/IP).

Download Presentation

CSC 552 - Advanced Unix Programming, Fall 2015

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. CSC 552 - Advanced Unix Programming, Fall 2015 Wednesday, September 30 TCP and UDP socket system calls

  2. Example code • ~parson/UnixSysProg/udptcp.fall2015.zip • ~parson/UnixSysProg/udptcp/

  3. Transmission Control Protocol / Internet Protocol (TCP/IP) • Pipe-like, connection oriented, virtual circuit protocol. (But, a pipe lives inside one machine’s OS.) • Reliable data delivery via sequence numbers, acknowledgments, timeouts, retransmissions • TCP/IP has guaranteed order of delivery. • There is overhead associated with TCP/IP reliability. • Write() data boundaries for sender may differ from read() data boundaries for receiver.

  4. TCP/IP Connection Establishment Server Process Client Process socket() (local endpoint) socket() bind() (IP address + TCP port) listen() (wait for connect) SYNconnect() accept() (grant connection request, makes new fd) SYN, ACK read() ACK write() write () ACK read() close() FIN or RST close()

  5. User DatagramProtocol / Internet Protocol (UDP/IP) • Discrete, atomic messages from a sender’s sendto() call arrive at a receiver’s recvfrom(). • Unreliable data delivery may discard datagrams. • UDP has no guaranteed order of delivery. • There is minimal overhead with UDP/IP. • Sendto() data boundaries for sender do not differ from recvfrom() data boundaries for receiver. • Good medium for media streams where dropped datagrams can be ignored.

  6. UDP/IP Connectionless Interaction Server Process Client Process socket() (local endpoint) socket() bind() (IP address + TCP port) recvfrom() sendto() sendto() recvfrom() close() (closes local endpoint) close() (local)

More Related