Skip to content

ns timer

The following operations can be performed on "ns timer":

add | rm | set | unset | bind | unbind | show | rename

add ns timer

Create a Timer.

Synopsys

add ns timer <name> (-interval <integer> [<unit>]) [-comment <string>]

Arguments

name

Timer name.

interval

The frequency at which the policies bound to this timer are invoked. The minimum value is 20 msec. The maximum value is 20940 in seconds and 349 in minutes

Default value: 5

Minimum value: 1

Maximum value: 20940000

unit

Timer interval unit

Possible values: SEC, MIN

Default value: SEC

comment

Comments associated with this timer.

Example

add timer policy timer -comment "Timer that would be invoked at interval 10 sec apart."

rm ns timer

Remove a Timer.

Synopsys

rm ns timer <name>

Arguments

name

Timer name.

Example

rm ns timer timer

set ns timer

Set a argument values for existing timer.

Synopsys

set ns timer <name> [-interval <integer>] [<unit>] [-comment <string>]

Arguments

name

Timer name.

interval

The frequency at which the policies bound to this timer are invoked. The minimum value is 20 msec. The maximum value is 20940 in seconds and 349 in minutes

Default value: 5

Minimum value: 1

Maximum value: 20940000

unit

Timer interval unit

Possible values: SEC, MIN

Default value: SEC

comment

Comments associated with this timer.

Example

set ns timer timer -comment "Timer that would be invoked at interval 20 sec apart."

unset ns timer

Unset comment for existing timer..Refer to the set ns timer command for meanings of the arguments.

Synopsys

unset ns timer <name> [-interval <integer>] [<unit>] [-comment <string>]

Example

unset ns timer timer -comment

bind ns timer

Defines the binding relation among timer, and timer policy.

Synopsys

bind ns timer <name> -policyName <string> -priority <positive_integer> [-gotoPriorityExpression <expression>] [-vServer <string>] [-sampleSize <positive_integer>] [-threshold <positive_integer>]

Arguments

name

Timer name.

policyName

The timer policy associated with the timer.

priority

Priority with which the policy is to be bound.

Minimum value: 1

Maximum value: 2147483647

gotoPriorityExpression

Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.

o   If gotoPriorityExpression is not present or if it is equal to END then the policy bank evaluation ends here

o   Else if the gotoPriorityExpression is equal to NEXT then the next policy in the priority order is evaluated.

o   Else gotoPriorityExpression is evaluated. The result of gotoPriorityExpression (which has to be a number) is processed as follows:

    -   An UNDEF event is triggered if

        .   gotoPriorityExpression cannot be evaluated

        .   gotoPriorityExpression evaluates to number which is smaller than the maximum priority in the policy bank but is not same as any policy's priority

        .   gotoPriorityExpression evaluates to a priority that is smaller than the current policy's priority

    -   If the gotoPriorityExpression evaluates to the priority of the current policy then the next policy in the priority order is evaluated.

    -   If the gotoPriorityExpression evaluates to the priority of a policy further ahead in the list then that policy will be evaluated next.

vServer

Name of the vserver which provides the context for the rule in timer policy. When not specified it is treated as a Global Default context.

sampleSize

Denotes the sample size. Sample size value of 'x' means that previous '(x - 1)' policy's rule evaluation results and the current evaluation result are present with the binding. For example, sample size of 10 means that there is a state of previous 9 policy evaluation results and also the current policy evaluation result.

Default value: 3

Minimum value: 1

Maximum value: 32

threshold

Denotes the threshold. If the rule of the policy in the binding relation evaluates 'threshold size' number of times in 'sample size' to true, then the corresponding action is taken. Its value needs to be less than or equal to the sample size value.

Default value: 3

Minimum value: 1

Maximum value: 32

Example

i)  bind ns timer timer_trigger -policyName timer_pol -priority 1   ii) bind ns timer timer_trigger -policyName timer_pol -priority 1

unbind ns timer

Unbind entities from timer

Synopsys

unbind ns timer <name> -policyName <string>

Arguments

name

Timer name.

policyName

The timer policy associated with the timer.

Example

unbind ns timer timer -policyName timer_pol

show ns timer

Display the Timer entities.

Synopsys

show ns timer [<name>]

Arguments

name

Timer name.

Outputs

interval

The frequency at which the policies bound to this timer are invoked. The minimum value is 20 msec. The maximum value is 20940 in seconds and 349 in minutes

unit

Timer interval unit

comment

Comments associated with this timer.

policyName

The timer policy associated with the timer.

priority

Specifies the priority of the timer policy.

gotoPriorityExpression

Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE.

vServer

Name of the vserver which provides the context for the rule in timer policy. When not specified it is treated as a Global Default context.

sampleSize

Denotes the sample size. Sample size value of 'x' means that previous '(x - 1)' policy's rule evaluation results and the current evaluation result are present with the binding. For example, sample size of 10 means that there is a state of previous 9 policy evaluation results and also the current policy evaluation result.

threshold

Denotes the threshold. If the rule of the policy in the binding relation evaluates 'threshold size' number of times in 'sample size' to true, then the corresponding action is taken. Its value needs to be less than or equal to the sample size value.

stateflag

bindPolicyType

devno

count

rename ns timer

Rename a timer.

Synopsys

rename ns timer <name>@ <newName>@

Arguments

name

The name of the timer.

newName

The new name of the timer.

Example

rename ns timer oldname newname

Was this article helpful?