ASP is a bare-bones transport-layer protocol which uses IP to transmit messages to an ASP "port" at the destination host. ASP is somewhat similar to UDP in the real world.
The main purpose of ASP is as a simple example, to demonstrate the infrastructure which has to be in place to implement even the simplest protocol. As such, it makes a good template for constructing other protocols. ASP itself is really not that simple, at least not until you understand the x-kernel!
This very schematic diagram shows the crucial difference between session objects and protocol objects
/* * asp.h * * x-kernel v3.3 * * Copyright (c) 1993,1991,1990,1996 Arizona Board of Regents */ typedef u_short ASPport;--Is that all? Yes, this is all that any other protocol needs to know about ASP.
A higher-level protocol or application (HLP), which wants to use ASP to transmit messages to its peer on another machine, would need to know the IP address of the remote machine and the ASP port number of its peer. The ASP port address must have some data type, which is what the external header file provides.
But doesn't the HLP need to know what functions are provided by ASP, such as opening and closing connections, transmitting messages, etc? In ASP, these functions all follow a standard interface. For example, to open an ASP connection the HLP will contain code which looks something like this:
The generic "xOpen" call gets linked into the aspOpen() call which will appear later as part of the ASP implementation. This linking is performed by a complex "make" operation, which we'll discuss later.