CITS3002 Computer Networks  
prev
next CITS3002 help3002 CITS3002 schedule  

An Example Network API - Berkeley Sockets

Sockets are a generalization of the original Unix file system model. The most important difference is that the operating system binds file descriptors, once, to files and devices when they are opened. With sockets, applications can specify the destination each time they use the socket.

When sockets were first proposed (1982 in 4.1cBSD), it was unclear how significant TCP/IP would become. As a (beneficial) consequence, sockets have been designed to use many different protocols.

tcpstack

The current (kernel) socket implementation consists of three parts :

  1. The socket layer provides the interface between user programs and the networking (via operating system system calls).
  2. The protocol layer supports different protocols in use, such as TCP/IP, X.25, etc.
  3. The device driver supports the physical devices such as Ethernet controllers.

Essential reading:

A Guide to Network Programming using Internet sockets, by Brian "Beej" Hall.


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