Lecture14-sockets

Lecture14-sockets - CSCE 313 Introduction to Computer...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSCE 313 Introduction to Computer Systems Instructor: Dr. Ronnie Ward Based on material from Dr. Riccardo Bettati Network Programming Network Programming as Programming across Machine Boundaries The Sockets API Reliable Communication Channels: TCP Dangerous at any Speed; connectionless communication and UDP Server Design Reading: R&R, Ch 18 Naming in a Networked Environment hostX.cs.tamu.edu 128.144.xxx.yyy web server printer server telnet server sshd httpd lpd TCP UDP HTTP 1.1 where? who? how? what? application layer transport layer network layer physical layer link layer Protocols for a Networked Environment hostX.cs.tamu.edu 128.144.xxx.yyy web server printer server telnet server sshd httpd lpd TCP UDP HTTP 1.1 Specifying a Protocol Interface Reality Check: All networks today are based on TCP/IP. How to define a network API, then?! Approach 1: Define functions that specifically support TCP/IP communication. e.g. makeTCPconnection(int32 host, int16 portno); Approach 2: Define functions that support network communication in general , and use parameters to handle TCP/IP as a special case. The socket API provides generalized functions that support network communication using many possible protocols . The programmer specifies the type of service required rather than the name of a specific network protocol . What is a socket? All I/O in Unix is through file descriptors, including communication with a computer across Internet. An interface between application and network The application creates a socket The socket type dictates the style of communication reliable vs. best effort connection-oriented vs. connectionless Once configured, the application can pass data to the socket for network transmission receive data from the socket (transmitted through the network by some other host) The Socket API What does a socket API need to support? [Comer&Stevens] allocate local resources (buffers) specify local and remote communication endpoints initiate a connection wait for an incoming connection send or receive data determine when data arrives generate urgent data handle incoming urgent data terminate a connection gracefully handle connection termination from the remote site abort communication handle error conditions or a connection abort release local resources when communication finishes Existing TCP/IP APIs: Berkeley Socket API aka socket API, socket interface, sockets adapted by Linux and others Windows Sockets System V Unix TLI (Transport Layer Interface) 7 file descriptor table [0]...
View Full Document

This note was uploaded on 02/14/2012 for the course CSCE 313 taught by Professor Gu during the Spring '11 term at Texas A&M.

Page1 / 48

Lecture14-sockets - CSCE 313 Introduction to Computer...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online