Architecture

The Active Packet Buffer

Overview
FIP runs on the idea of an "active packet buffer". This active buffer is what most operations occur on. Depending on the CPU multiple packet buffers are permissible, and it can switch between various ones being active at a time. On a constrained CPU only a single packet buffer is stored, and that packet buffer is always active.

The active packet buffer stores not only the active packet, but also the state and other metadata surrounding that packet. This allows a very flexible and efficient architecture for processing IP data. When a packet is being received for example, the buffer can be marked as "receive in progress". The rest of the stack can continue working, and knows that buffer is not ready to be processed. Once the data is finished being received, the buffer is set as ready to process. The IP stack can then process the data.

The active packet uses buffer pointers to allow efficient insertion of headers as is often required in IPv6 networks. For more information about the active packet buffer specifics see Packet Buffer.

When sending out data, again the idea of a packet buffer "state" makes working with the system simple. When a message is ready to be sent, it is marked as ready to send. The act of actually delivering that message might require address resolution to occur, in which case the IP stack will mark the buffer state as now "awaiting address resolution to finish". Once that occurs it's state automatically changes to "ready to send", and the lower-layer functions can send it out.

Using one packet buffer which can maintain state means different layers can all use this same buffer. There is no need to pass pointers or data inbetween different layers. Consider for example how a generic LL driver would receive some data in the following paragraph.

Data Receive Example
Receiving data makes use of the packet buffer interface. A new active packet is selected, and memory is allocated if required. Data is then received into the packet. After data is complete, any other attributes such as link-layer addresses are set.
inline_mscgraph_1

The Host Interface

The host interface is designed to be as simple as possible. The host must provide functions described in Host Interface for FIP , which primarily deal with getting the time. FIP deals with any events or timers, reducing the requirements of what a host must provide.

FIP attempts to store as much as possible in the "active packet buffer" system. This means that if you need to support task switching, you don't need to be as worried about clobbering or re-entrant functions. For example if you are in the middle of doing some processing, and switch to a task which is receiving some LL data, it uses the same packet buffer access method as the other task. Hence it will see that the other task is currently using the active packet buffer. If a new buffer is allocated however, it is important the proper one is restored on switching back to the other task! This needs some work to figure out...


Generated on Wed Dec 8 13:00:21 2010 for FIP by  doxygen 1.5.7.1