Iterfaces and Buses / Networking / Layer_Protocol
Code File Location: VisualSim/Actor/lib/Layer_Protocol
o Used to describe the connectivity and attributes of each layer of the protocol stack.
o Connections between this layer and the one's above/below can be done using connected wires or connectionless
o Detailed logic and timing information can be augmented to the layer by associating with external definitions.
The Layer_Protocol block processes data by appending header (H) and trailer (T) bytes to each protocol layer, see below. The Layer_Header_Trailer_Bytes is a total sum of Header and Trailer quantity. The overhead is added to the Task_Overhead and the Task_Size fields. The overhead is computed by first dividing the incoming Task_Size by the Layer_Frame_Size bytes. The overhead is the Layer_Header_Trailer_Bytes* Number of Frames. If the addition of the overhead exceeds the last frame size, then overhead is added for an additional frame.
A Protocol Layer accepts data structures from a NODE actor or intermediate (Child or Parent) Protocol Layer. The Data Structures are passed to/from a Protocol Layer by either a direct connection, or a virtual connection. The connection flow is for the lower block output to be connected to the ds_up_input port while the output from this block to the upper block is the ds_up_output. The connection from the upper layer ouput is to ds_dn_input port and the connection to the lower layer input is from the ds_dn_output. Virtual Connections are via Parent_Name (going up), or Child_Name (going down) parameter references. A 'Layer_Table' Block is required to define the parameter of the 'Layer_Protocol' Block. The Layer_Table provides the common layer parameters values. Multiple Layer_Protocol block can reference a single Layer_Table. users can add delay and other logic operations between the Layer_Protocols and the Nodes.
The block works as following in the Up direction:
The block works as following in the Down direction:
Users can obtain statistics for each Layer_Protocol block through the use of RegEx functions shown below. The statistics output
looks like:
DISPLAY AT TIME ------ 4999.99999999990 sec ------
{A_Layer = "MAC3",
A_Layer_Table = "LT",
BLOCK = "Layer_MAC2",
DELTA = 0.0,
DS_NAME = "Layer_Stats",
Dn_MBps = 9.9616053598169,
Dn_Max_Delay = 1.00000141,
Dn_Max_Occupancy = 1.0,
Dn_Mean_Delay = 1.000001161506,
Dn_Mean_Occupancy = 0.0783582089552,
Dn_Min_Delay = 1.00000016,
Dn_Min_Occupancy = 0.0,
Dn_Number_Entered = 499,
Dn_Number_Exited = 498,
Dn_StDev_Delay = 5.1305080090995E-7,
Dn_StDev_Occupancy = 0.268734441493,
Dn_Utilization = 9.9616053598169,
ID = 1,
INDEX = 0,
TIME = 4999.9999999999,
Up_MBps = 9.9816080693188,
Up_Max_Delay = 1.00000111,
Up_Max_Occupancy = 1.0,
Up_Mean_Delay = 1.00000111,
Up_Mean_Occupancy = 0.0118811881188,
Up_Min_Delay = 1.00000111,
Up_Min_Occupancy = 0.0,
Up_Number_Entered = 499,
Up_Number_Exited = 499,
Up_StDev_Delay = 0.0,
Up_StDev_Occupancy = 0.1083513981806,
Up_Utilization = 9.9816080693188}
This shows that each Layer_Protocol collects the up/dn layer number entered, number exited, throughput, layer delay,
queue occupancy, and utilization statistics. The RegEx function allows one to collect all of the statistics for each
Layer_Protocol block, using the following expression, assuming the Layer_Protocol name is "MAC_1":
getBlockStatus("MAC_1","Any Value", "stats", 1,"Any Integer") // Returns 'MAC_1' statistics
getBlockStatus("MAC_1","Any Value", "stats", -1,"Any Integer") // Resets 'MAC_1' statistics
getBlockStatus("MAC_1","Any Value", "length", 1,Any Integer) // Returns 'MAC_1' up queue length
getBlockStatus("MAC_1","Any Value", "length", 2,Any Integer) // Returns 'MAC_1' down queue length
Using getBlockStatus to collect the layer queue length returns the current queue length. To learn more, click on the getBlockStatus example.
User Fields:
Task_Source: Message Source Node. If the Task_Source does not have a name, it sets it to the current Node Name. If it does have a name, it is not modified. If this layer generates a Retry or this block is the original source for a Retry, then the Task_Source=Task_Destination. This field is modified for Network_Message=="Retry_*" and if the field is empty (or -1).
Task_Hop: Next Node in the data transfer. The user will set it to the current node. This field is not modified by this block.
Task_Destination: Final Destination Node Name. If this layer generates a Retry or this block is the original source for a Retry, then the Task_Destination=Task_Source. This field is modified for Network_Message=="Retry_*". only.
Task_Size: Size in Bytes of the data, excluding Header and Trailers. This field is modified by this block to add the overhead.
Task_ID: First Layer_Protocol block encountered will generated a sequence number. This is a single sequence is for all Layers in all the Nodes. When a new packets arrives a Layer for the first time, the sequence number is incremented. For the Task_ID to be updated, the entering Task_ID=-1. This field is modified if the Task_ID ==-1.
Network_Message: Currently used only for identifying Retry_ and Drop_Packet. This field is modified if this block generates a Retry.
Internal Fields:
Task_Retry: Number of retries for this packet. When this number exceeds the threshold, the packet is dropped by updating Network_Message="Drop_Packet", and then returned to the top Layer_Protocol of the Source_Node. This field is incremented by this block every time a Retry is generated for a packet. This field is modifiedl.
Task_Trace: This is a array of Node names that this packet has encountered. This field is not used and this field is not modified.
Task_Layer: It is used to set the layer where the retry occurs. It is used to match the layer number when the packet gets back to the source. This block modifies this field when a retry is generated.
Task_Overhead: This block will maintain the amount of overhead bytes accumulated. Subtracting this from Task_Size will give the original data size. This block adds the overhead size to this field on the downpath and subtracts the overhead size from this field on the upward movement. This field is modified.
Retry_Layer1 Demo Model shows the connection between the Layers and to the Node. It also shows the association of the Layer_Table to the Layer_Protocol. This models shows the use of multiple Layer_Tables in the model and the setting of the retry.
Network_External_Defn Demo Model shows the Configuration Layer setting to External Delay and the conenctivity for this.
Mulitcast Demo model showing the use of the Multicast function along with the Node block.
Parameter |
Explanation |
Type |
Example |
Layer_Name |
Layer_Name of this Layer_Protocol block, must be unique for all blocks in the model |
String |
"MAC_1" |
Node_Name |
Name of the node that this Layer is associated with. |
String |
"Node_1" |
Layer_Table_Name |
Layer_Table containing the parameters for this Layer_Protocol block. More than one Layer_Protocol block can reference a single Layer_Table. |
String |
"LT" |
Parent_Layer_Name |
Name of parent Layer_Protocol block (the layer above), if using a virtual connection. For connected, Name is set to "none" and processing of node sent to "ds_up_output" port. |
String |
"none" |
Child_Layer_Name |
Name of child Layer_Protocol (the layer below) block or NODE block, if using a virtual connection. For connected, Name is set to "none" and processing of node sent to "ds_dn_output" port. |
String |
"Node_1" |
Port |
Explanation |
Type |
ds_up_input |
Input port for connection from lower Layer_Protocol or Node. This is ignored if the Parent_Layer_Name is set in lower block. This port is connected to the output of the lower layer. |
General |
ds_dn_input |
Input port for connection from upper Layer_Protocol. This is ignored if the Child_Layer_Name is set in the upper block. This port is connected to the output of the layer above. |
General |
up_ext_output |
Output port for external processing in the Up direction. User must set Layer_Configuration (Layer_Table) to 'External_Delay'. |
General |
dn_ext_output |
Output port for external processing in the Down direction. User must set Layer_Configuration (Layer_Table) to 'External_Delay'. |
General |
ds_up_output |
Output port for connection from this block to the upper Layer_Protocol. This is ignored if the Parent_Layer_Name is set. This port is connected to the input of the upper layer. |
General |
ds_dn_output |
Output port for connection to lower Layer_Protocol or Node. This is ignored if the Child_Layer_Name is set. This port is connected to the input of the lower layer. |
General |
Created with the Personal Edition of HelpNDoc: Easily create CHM Help documents