CITS3002 Computer Networks  
prev
next CITS3002 help3002 CITS3002 schedule  

Network Application Program Interfaces (APIs)

Dating back to early operating system implementations, applications attempted to provide a common framework to access both files and devices.

Calls to Unix open() return a file descriptor which is then used in calls to read() and write().

It is preferable if the application program interfaces (API) to network I/O exhibit the same semantics as file, or stream, I/O, but this is difficult for a number of reasons:

  • The typical client-server relationship is not symmetrical - each program must know what role it has to play.
  • Network connections may be connection-oriented or connectionless. With a connectionless protocol there is nothing akin to open() since every network I/O operation could be with a different process on a different host.
  • Identification is more important to networking than for file operations. Networking applications need to verify peer processes when accepting new connections.
  • There are more associations to be made for network I/O than for file I/O:

    { protocol, local-address, local-process, remote-address, remote-process }

  • Many file I/O models presume all data is in a continuous data stream; this precludes networking applications working with variable length datagrams.



CITS3002 Computer Networks, Lecture 8, Transport layer protocols and APIs, p8, 24th April 2024.