Embedded Web Server for the CR16
OS Tick Time (4mS)
OS task switch time
Figure 5. Protocol Task flow (typical HTTP request)
A. The Transport Layer TCP
Several data structures are created and maintained by TCP to facilitate coherent operation. The
RFC explicitly refers to one such data structure, namely the Transmission Control Block (TCB). TCP
must create and maintain one of these structures for each active socket. It is instructive to
examine the nature and operations of these structures, which will help shed some light on the
interworkings of the various protocol layers. We will therefore discuss each of these structures in
The TCP interface, or, API
The Application layer interfaces with TCP by means of the data structure listed in Figure 6.
Similar to the call-return APIs found in many stacks, this API includes all necessary
parameters to permit concurrent TCP utilization by multiple applications.
The TCP task reacts to events (occurring at the IP level), and responds to commands (issued
by the application(s)). Each application wishing to use TCPs services must first issue a
TCP_OPEN command. If successful, TCP will return a unique connection name (CRSOCK_T
*Socket) thereafter used by the application for all future interactions with TCP.
Specifically, an event is defined as either:
The reception of a TCP segment from the underlying IP layer as indicated by the
IPRECV flag in the Cmd field of IPs interface data structure