Packet Protocol Modules
Home/Documents/Development/High-Level Design/Packet Protocol Modules
by Benad
The Packet Protocol Modules are used to define, in packets, the stream of communication between two nodes in the network.
Table of Contents
While AEPs[1] are ready to be sent on the network, they don't have any limit on their size. This can be a major problem, as an usually large packet will block the transfer of the following smaller packets.
Thus, imposing a limit on the size of the AEPs would be useful. Instead of simply filtering packets that are too big (with a Cluster Filter Module[2]), the packets should be instead broken down into smaller pieces. But simply breaking down the packets would imply that some additionnal information need to be sent to be able to merge those pieces back together.
Also, it would be sometime useful to place the AEPs inside another protocol. For example, you could place the data inside a proper HTTP[3] transaction, or you could make ANet queries work inside the Gnutella[4] format.
So, the goal of a Packet Protocol Module is to tranform AEPs back and fourth to another format it supports.
The Bandwidth Manager cannot know how much overhead is done by the Packet Protocol Module by itself. Thus, the Packet Protocol Module should send an approximate value, in bytes, of the overhead it created each time its "main" function is called. If it doesn't send that information, the Bandwitdh manager will assume that little or no overhead is created by the Protocol Module.
- Users are not required to use a Packet Protocol Module for a connection. In that case, the AEPs will be sent directly the the Connection Protocol Module, without any change.
- The Bandwidth Manager does not need an exact value for the overhead that a Packet Protocol Module creates. It uses that value to estimate the amount of data that will be sent to the connection when new AIPs are created[5].
- Implementing other Peer-to-Peer protocols within ANet can easily be done by implementing both a Core Module[1] and a Packet Protocol Module. The advantage of doing so is that clusters using different protocols, that, at first glance, seem totally incompatible, can begin to exchange some information, by being in the same Cluster Group[6] in an ANet deamon, and leaving the work of filtering "irrelevant" information to the Packet Protocol Module[7].
- It is possible that a Packet Protocol requires to send some special data to mark the end of the data stream. So, the instance of the Packet Protocol Module will always be destroyed before its corresponding Connection Protocol Module[8]. Since that can (and should) be done asynchronously, you can write a function that will be polled by the run-time wrapper that returns a special value only when the Packet Protocol has finished using the connection.
See the complete DTD for more information.
References
About the references...
[1] Benad: "Core Modules". Local link.
[2] Benad: "Cluster Filter Modules". Local link.
[3] Network Working Group: "Hypertext Transfer Protocol". External link.
[4] Semi-Official Gnutella Web Site. External link.
[5] Benad: "Bandwidth Manager Module". Local link.
[6] Benad: "Cluster Group Modules". Local link.
[7] Benad: "Future". Local link.
[8] Benad: "Connection Protocol Modules". Local link.
Last update for this document: August 24, 2001, at 1:18:28 PST