How is connection-sharing implemented in the custom application model suite?

Categories:
Solution Number:
S20799
Last Modified:
2013-08-20
Issue

How is connection-sharing implemented in the custom application model suite?

Solution

If you haven't done so already, review FAQ#1092. You can also see a summary of this in the attribute comments (details) for the Task Configuration object attribute Task Specification [a].Manual Configuration [b].Transport Connection.Policy.There are four levels of connection sharing in the OPNET custom application API:__________I. UNDERSTANDING SHARING0) No sharing at all---every request opens a new connection.1) Sharing across all requests within a phase---connections are shared within a phase, but different phases use different connections. This is the default behavior.2) Sharing across all phases within a task---connections are shared within a task, but different tasks use different connections.3) Sharing across all tasks within an application---connections are shared within an application, but different applications use different connections.__________II. How such sharing is represented in the Task Config, Application Config object attributes:- To use no connection sharing at all (0 from section I), set the Task Config attributeTask Specification [a].Manual Configuration [b].Transport Connection.Policy attribute to New Connection Per Request.- To use connection sharing across all requests within a phase (1 from section I), set the set the Task Config attributeTask Specification [a].Manual Configuration [b].Transport Connection.Policy attribute to As Specified Per Connection AND Task Specification [a].Manual Configuration [b].Transport Connection.Policy.Connections [n].Policy to Refresh After Phase.- To use connection sharing across all phases within a task (2 from section I), set the Task Config attributeTask Specification [a].Manual Configuration [b].Transport Connection.Policy attribute to As Specified Per Connection AND set the Task Specification [a].Manual Configuration [b].Transport Connection.Policy.Connections [n].Policy attribute to Reuse Across Phases.- To use connection sharing across all tasks within an application (3 from section I), set the Task Config attributeTask Specification [a].Connection Policy to Reuse Across Tasks. I think this is the configuration you're looking for as it will minimize connection setup overhead in the network.__________III. How connection-sharing implemented in the Phase and Task APIs so that you can write your own application to have similar behavior.- To use no connection sharing at all (0 from section I), set the primary_policy field in your phase connection description (GnaT_Phase_Conn_Desc) to the value GnaC_New_Connection_Per_Request. - To use connection sharing across all requests within a phase (1 from section I), set the primary_policy field in your phase connection description (GnaT_Phase_Conn_Desc) to the value GnaC_New_Connection_Per_Request AND set the conn_spec_lptr field of the same connection description to contain connection specifications (GnaT_Phase_Conn_Spec) with their policy field set to GnaC_Conn_Refresh_After_Phase.- To use connection sharing across all phases within a task (2 from section 1), set the primary_policy field in your phase connection description (GnaT_Phase_Conn_Desc) to the value GnaC_New_Connection_Per_Request AND set the conn_spec_lptr field of the same connection description to contain connection specifications (GnaT_Phase_Conn_Spec) with their policy field set to GnaC_Conn_Reuse_Across_Phases.- To use connection sharing across all tasks within an application (3 from section I), set the share_conns_across_task field in your task specification structure (GnaT_Task_Spec) to be OPC_TRUE. Note that these fields are set within the Task API, in structures defined in the file gna_sup_task_api.h.Hopefully this clarifies the relationship of the attributes and data structures. In a custom application configured in the project editor alone, the attributes from section II would be converted into the given data structures in section III.__________IV. What happens behind the scenes when using different connection-sharing options:- If you use no connection sharing at all, then each request has a hash table called phase_unshared. The connection handle is kept in that hash table and shared with no other requests.- If you use connection sharing across all requests within a phase, then any connection handles are placed in a hash table called phase_shared. All requests within the phase access connection information from this hash table.- If you use connection sharing across all phases within a task, then any connection handles are placed in a hash table called task_shared. All requests within the task access connection information from this hash table.- To use connection sharing across all tasks within an application, then any connection handles are placed in a hash table called app_shared. All requests within the application access connection information from this hash table.

Environment

Application Modeling->Custom Applications

Attachments
NOTICE: Riverbed® product names have changed. Please refer to the Product List for a complete list of product names.
Can't find an answer? Create a case