Application Interface to Protocols Chuan-Ming Liu Computer Science - - PowerPoint PPT Presentation

application interface to protocols
SMART_READER_LITE
LIVE PREVIEW

Application Interface to Protocols Chuan-Ming Liu Computer Science - - PowerPoint PPT Presentation

Mobile Computing & Software Engineering Lab Application Interface to Protocols Chuan-Ming Liu Computer Science and Information Engineering National Taipei University of Technology Taipei, TAIWAN MCSE Lab, NTUT, TAIWAN 1 Mobile Computing


slide-1
SLIDE 1

MCSE Lab, NTUT, TAIWAN 1

Mobile Computing & Software Engineering Lab

Application Interface to Protocols

Chuan-Ming Liu Computer Science and Information Engineering National Taipei University of Technology Taipei, TAIWAN

slide-2
SLIDE 2

MCSE Lab, NTUT, TAIWAN 2

Mobile Computing & Software Engineering Lab

Introduction

Graphical view Loosely specified protocol software interface Interface functionality Conceptual interface specification System calls Two basic approaches to network communication Basic I/O functions in Linux Using Linux I/O with TCP/IP

slide-3
SLIDE 3

MCSE Lab, NTUT, TAIWAN 3

Mobile Computing & Software Engineering Lab

Graphical View

applications TCP/UDP IP hardware sockets user process kernel

slide-4
SLIDE 4

MCSE Lab, NTUT, TAIWAN 4

Mobile Computing & Software Engineering Lab

Loosely Specified Protocol

TCP/IP protocol software resides in OS Routines in OS for the interface between the applications and protocol are known as Application Program Interface (API)

slide-5
SLIDE 5

MCSE Lab, NTUT, TAIWAN 5

Mobile Computing & Software Engineering Lab

Loosely Specified Protocol

TCP/IP designers

design to operate in a multi-vendor environment avoid choosing any vendor’s internal data representation avoid specifying the interface in terms of features available only on a single vendor’s OS

slide-6
SLIDE 6

MCSE Lab, NTUT, TAIWAN 6

Mobile Computing & Software Engineering Lab

Loosely Specified Protocol

The interface between TCP/IP and application is loosely specified Advantages

Flexibility Tolerance

Disadvantage

designer can make the interface details different for each OS

slide-7
SLIDE 7

MCSE Lab, NTUT, TAIWAN 7

Mobile Computing & Software Engineering Lab

Loosely Specified Protocol

Only a few APIs have been developed to use with TCP/IP

UNIX: socket API, socket interface, or sockets MS Window: window sockets AT&T: acronym TLI

slide-8
SLIDE 8

MCSE Lab, NTUT, TAIWAN 8

Mobile Computing & Software Engineering Lab

Interface Functionality

TCP/IP standards do suggest the functionality for the interface including:

Allocate local resources for communication Specify local and remote communication endpoints Initiate a connection (client) Wait for an incoming connection (server) Send or receive data Determine when data arrives Generate urgent data

slide-9
SLIDE 9

MCSE Lab, NTUT, TAIWAN 9

Mobile Computing & Software Engineering Lab

Interface Functionality

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 resource when communication finishes

slide-10
SLIDE 10

MCSE Lab, NTUT, TAIWAN 10

Mobile Computing & Software Engineering Lab

Conceptual Interface Specification

The conceptual interface defined by the TCP/IP standards does not specify data representations or programming details; it merely provides an example of one possible API that an operation system can offer to application programs that use TCP/IP OS designers are free to implement as long as the functionality holds

slide-11
SLIDE 11

MCSE Lab, NTUT, TAIWAN 11

Mobile Computing & Software Engineering Lab

System Calls

System calls

Mechanism that most OS’s use to transfer control between applications and OS procedures Like function calls (for a programmer)

slide-12
SLIDE 12

MCSE Lab, NTUT, TAIWAN 12

Mobile Computing & Software Engineering Lab

System Calls

System functions called by applications OS kernel containing TCP/IP protocol software

Applica- tion 1 Applica- tion 2 Applica- tion n

slide-13
SLIDE 13

MCSE Lab, NTUT, TAIWAN 13

Mobile Computing & Software Engineering Lab

Approaches to Network Communication

Designers must choose the exact set of procedures used to access TCP/IP protocols Two approaches

New implementation on all conceptual

  • perations

Using convention I/O primitives but overload them

slide-14
SLIDE 14

MCSE Lab, NTUT, TAIWAN 14

Mobile Computing & Software Engineering Lab

Basic I/O Functions

six system functions for I/O (on file or device)

  • pen

close read write lseek ioctl

slide-15
SLIDE 15

MCSE Lab, NTUT, TAIWAN 15

Mobile Computing & Software Engineering Lab

Using LUNIX I/O with TCP/IP

when adding TCP/IP protocols to UNIX system, we extend the conventional I/O facilities

the set of file descriptor for application to use read and write system calls to with new network descriptor

Not all network communication fit easily into UNIX open-read-write-close paradigm