


Next:Making
new networksUp:Making
new protocolsPrevious:ImplementationContents
Adding new protocols to LYDIAN
When we add a new protocol to LYDIAN, LYDIAN needs some additional information
about the protocol. On the lydian.tcl interface, chose Archives/Protocol-New/Create
New.
|
Figure 16: New protocol generation interface
Then the subsequent interactive steps will follow:
-
First a header of the new protocol will be requested. You must enter a
descriptive title of the protocol up to 80 characters. This title will
help you later to distinguish this protocol from the other protocols also
implemented.
-
Consequently the number of states (excluding the standard initial state
SLEEPING) and their names, WAITING for instance, must be entered.
-
Enter the number of message kinds and their names, for instance BRD
and ACK.
-
The number of protocol parameters and a sort description (prompt) for each
of them are requested. For the protocol Broadcast with ACK, no parameter
is required.
-
Enter the number of timers used in this protocol. Some protocols need timers
to generate interrupts. For instance in protocol Resource Allocation, the
time a process is in critical section is specified by the timer. In protocol
Broadcast with ACK, no timer is needed.
-
Then you must enter the name of the action file that you must have already
constructed. The file is the one containing protocol source code we made
in the previous section.
-
Finally the transition function must be entered according to the following
way. Prompts of the folowing form will be displayed:
STATE x EVENT ->
and you must fill in with three options:
-
Enter action-routine name if it is a legal state-event combination and
there is an action.
-
Enter ' ' (space) if it is a legal combination but there is not any action.
-
Enter '-' (hyphen) if it is not a legal combination, i.e the system is
never going to be in such a configuration.
After the whole previous process has been completed the following files
will be automatically created :
-
protocol x.c
-
protocol x.h
-
names x
where x is the number of the protocol. The protocol also has been
inserted in the simulator catalog. So the new protocol is compiled and
is linked to the simulator. If errors occur during this phase you must
select the Archives/Protocol-Edit from lydian.tcl in order
to correct possible typing or logic errors in protocolx.c. Then
chose Archives/Protocol-New/Import to import the corrected protocol.
To know how to debug a protocol source code, see Section 7.1
and Section 7.2.4
After succesful compilation and linking of the new protocol it is able
to run on the simulator.
For more information about the protocol model in LYDIAN, see Section
4.2.



Next:Making
new networksUp:Making
new protocolsPrevious:ImplementationContents
Ha Hoai Phuong
2002-11-11