All Classes Namespaces Files Functions Pages
Layer5.Dhcp Class Reference

The Layer5.Dhcp is the entry point to configure the DHCP client behavior of a ByteBlowerPort. More...

Methods

 BroadcastFlag.Enable enable
 Enable/disable sending Broadcast DHCP messages. More...
 
 BroadcastFlag.IsEnabled
 Returns whether or not a ByteBlowerPort will use Broadcast DHCP messages. More...
 
 Description.Get
 Returns a textual description of the object.
 
 Destructor
 
 Discover.InitialTimeout.Get
 Returns the current <InitialTimeout> for the DHCP discover stage. More...
 
 Discover.InitialTimeout.Set InitialTimeout
 Sets the <InitialTimeout> for the DHCP discover stage. More...
 
 Discover.MaxRetries.Get
 Returns the current maximum retries for the DHCP discover stage. More...
 
 Discover.MaxRetries.Set maxRetries
 Sets the maximum retries for the DHCP discover stage. More...
 
 Discover.Retries.Maximum.Get
 
 Discover.Retries.Maximum.Set
 
 Discover.Timeout.Initial.Get
 
 Discover.Timeout.Initial.Set
 
 Parent.Get
 Returns the parent object.
 
 Perform.Async
 Will start DHCP and return immediately. More...
 
 Perform
 Start DHCP and wait for the result. More...
 
 Release.Enable enable
 Enable/disable sending DHCP release during destruction. More...
 
 Release.IsEnabled
 Return whether sending DHCP release during destruction is enabled. More...
 
 Release
 Release the DHCP lease. More...
 
 ReleaseEnabled enable
 Enable/disable sending DHCP release during destruction. More...
 
 Request.InitialTimeout.Get
 Returns the current <InitialTimeout> for the DHCP request stage. More...
 
 Request.InitialTimeout.Set InitialTimeout
 Sets the <InitialTimeout> for the DHCP request stage. More...
 
 Request.MaxRetries.Get
 Returns the current maximum retries for the DHCP Request stage. More...
 
 Request.MaxRetries.Set maxRetries
 Sets the maximum retries for the DHCP Request stage. More...
 
 Request.Retries.Maximum.Get
 
 Request.Retries.Maximum.Set
 
 Request.Timeout.Initial.Get
 
 Request.Timeout.Initial.Set
 
 RetransmissionPolicy.Get
 
 RetransmissionPolicy.Set.FromString policy
 Configures the Retransmission Policy. More...
 
 RetransmissionPolicy.Set
 
 RetransmissionPolicy.String.Get
 Returns the current configured retransmission policy. More...
 
 Session.Info.Get
 Returns the sessionInfo object for this DHCP Session. More...
 

Class overview

The Layer5.Dhcp is the entry point to configure the DHCP client behavior of a ByteBlowerPort.

A ByteBlowerPort can perform DHCP the get an IP address, gateway and netmask. Currently, no other options are supported but this will change in the future.

Users can configure the timing parameters used in the different stages of the DHCP protocol:

Discover
During the discover stage the ByteBlower port will broadcast discover messages.
Request
Once one or more offers are received the ByteBlower port will broadcast its request message. If acknowledge the ByteBlower port will start using this address. {Renew, When half of the lease time received in the acknowledge message of the request has passed\, a ByteBlowerPort will sent a renew message to the server to extend its lease.}

Although DHCP allows clients to use unicast messages in the Request stage, ByteBlower currently only supports broadcast messages in this stage.

A Layer5.Dhcp object also supports different retransmission strategies:

Fixed
This policy will use the same timeout value for each timeout.
RFCSuggested
This policy implements the policy described in RFC2131.

Definition at line 10787 of file api.tcl.

Method documentation

Layer5.Dhcp::BroadcastFlag.Enable   enable  

Enable/disable sending Broadcast DHCP messages.

Since
2.11.2

When a ByteBlower port performs DHCP, the port will use the unicast DHCP method as described in the DHCP RFC. Pre-2.11.2 ByteBlower servers used the legacy broadcast technique, which is sometimes detected by devices as a broadcast storm.

Parameters
enableBoolean to enable or disable the sending of broadcast DHCP messages.
true
Will enable sending of Broadcast DHCP messages.
false
Will disable sending of Broadcast DHCP messages.
Default: false
Example

This example will enable sending of the legacy DHCP messages

1 { [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] BroadcastFlag.Enable false }

Definition at line 10803 of file api.tcl.

Layer5.Dhcp::BroadcastFlag.IsEnabled

Returns whether or not a ByteBlowerPort will use Broadcast DHCP messages.

Since
2.11.2

When a ByteBlower port performs DHCP, the port will use the unicast DHCP method as described in the DHCP RFC. Pre-2.11.2 ByteBlower servers used the legacy broadcast technique, which is sometimes detected by devices as a broadcast storm.

Returns
A boolean whether or not the Broadcast DHCP messages will be used.
Example

This example will query the dhcp protocol whether or not it will send legacy DHCP messages

1 { [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] BroadcastFlag.IsEnabled } Returns: \verbatim false \endverbatim

Definition at line 10819 of file api.tcl.

Layer5.Dhcp::Discover.InitialTimeout.Get

Returns the current <InitialTimeout> for the DHCP discover stage.

During the Discover stage, one ore more discover messages will be sent by the DHCP client to get an offer message from one or more DHCP servers. The <InitialTimeout> is the timeout used to decide if the discover message must be retransmitted or not. The next timeout value will be calculated using the configured retransmission policy.

Returns
Current '<InitialTimeout> value for the discover stage. The unit is nanosecond (ns).
Example

This example will get the current <InitialTimeout> for the discover stage.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Discover.InitialTimeout.Get

Returns:

1000000000 
Default value: 1000000000
The default value is 1 second.

Definition at line 10846 of file api.tcl.

Layer5.Dhcp::Discover.InitialTimeout.Set   InitialTimeout  

Sets the <InitialTimeout> for the DHCP discover stage.

During the Discover stage, one ore more discover messages will be sent by the DHCP client to get an offer message from one or more DHCP servers. The <InitialTimeout> is the timeout used to decide if the discover message must be retransmitted or not. The next timeout value will be calculated using the configured retransmission policy.

Parameters
InitialTimeoutNew value for the initial timeout. By default, the unit is in nanosecond (ns), but the unit can be appended, like this: '5s', meaning 5 seconds.
Example

This example will set the <InitialTimeout> for the discover stage.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Discover.InitialTimeout.Set 2s

Definition at line 10860 of file api.tcl.

Layer5.Dhcp::Discover.MaxRetries.Get

Returns the current maximum retries for the DHCP discover stage.

During the Discover stage, one ore more discover messages will be sent by the DHCP client to get an offer message from one or more DHCP servers. The maximum number of times the DHCP client will retransmit the discover message is returned by this method.

Returns
Current value for the number of retries in the discover stage.
Example

This example will get the current maximum number of retries for the discover stage.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Discover.MaxRetries.Get

Returns:

5 
Default value: 5
The default value is 5 times.

Definition at line 10877 of file api.tcl.

Layer5.Dhcp::Discover.MaxRetries.Set   maxRetries  

Sets the maximum retries for the DHCP discover stage.

During the Discover stage, one ore more discover messages will be sent by the DHCP client to get an offer message from one or more DHCP servers. The maximum number of times the DHCP client will retransmit the discover message is configured by this method.

Parameters
maxRetriesThe new value for the maximum number of retransmission of the discover message.
Example

This example will set the maximum number of retries for the discover stage to 3 times.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Discover.MaxRetries.Set 3

Definition at line 10891 of file api.tcl.

Layer5.Dhcp::Discover.Retries.Maximum.Get
Deprecated:
This method has been renamed, use Discover.MaxRetries.Get now.

Definition at line 10897 of file api.tcl.

Layer5.Dhcp::Discover.Retries.Maximum.Set
Deprecated:
This method has been renamed, use Discover.MaxRetries.Set now.

Definition at line 10903 of file api.tcl.

Layer5.Dhcp::Discover.Timeout.Initial.Get
Deprecated:
This method has been renamed, use Discover.InitialTimeout.Get now.

Definition at line 10909 of file api.tcl.

Layer5.Dhcp::Discover.Timeout.Initial.Set
Deprecated:
This method has been renamed, use Discover.InitialTimeout.Set now.

Definition at line 10915 of file api.tcl.

Layer5.Dhcp::Perform

Start DHCP and wait for the result.

This method will force the DHCP client on the ByteBlower port to send a first DHCP discover message. It the client is already active, a new discover message will be sent.This is a synchronous call, so the full DHCPv6 solicit and request will be done once this call returns, or an error have occurred.

Returns
This method will return nothing, but will return after DHCP is performed successfully. If DHCP fails, and exception is thrown.
Exceptions
ByteBlower.Exception.API.DHCPFailedThrown if no offer was received during the DHCP discover stage or when no DHCPAck was received during DHCPRequest stage
Example

This example will perform DHCP on the specified ByteBlowerPort.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Perform

Definition at line 10952 of file api.tcl.

Layer5.Dhcp::Perform.Async

Will start DHCP and return immediately.

This method will force the DHCP client on the ByteBlower port to send a first DHCP discover message. If the client is already active, a new discover message will be sent. This is a asynchronous call, so it will return immediately. If you want to see if there an exception occurred during this async, call the Perform method.

Returns
This method will return nothing and return immediately
Since
API 2.2
Example

This example will perform DHCP on the specified ByteBlowerPort.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Perform.Async

Definition at line 10936 of file api.tcl.

Layer5.Dhcp::Release

Release the DHCP lease.

This method will release the address previously received using DHCP. After this, the address will not be used anymore by the ByteBlower port and the DHCP server can reuse the address for other DHCP clients. Of course, packets sent by the ByteBlower port as part of Tx.Streams can still use the address.

Returns
This method will return nothing, but will return after DHCP Release is performed
Example

This example will release the DHCP address.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Release

Definition at line 10998 of file api.tcl.

Layer5.Dhcp::Release.Enable   enable  

Enable/disable sending DHCP release during destruction.

When a ByteBlowerPort is destructed and this port has performed DHCP, such a port should release its address. If this behavior is prefered, then this should be done by using the Release.Enable method to indicate the ByteBlowerPort should release its address if possible. A ByteBlowerPort is able to release its address at destruction time if the destination mac address is in the ByteBlowerPort's ARP cache. If not, the DHCP release messages will not be sent out, because it could delay the whole cleanup.

If you want to force the release of an address received through DHCP, use Release.

Parameters
enableBoolean to enable or disable the release of the address at the end of the test.
true
Will enable the automatic release of the address at the end of the test.
false
Will disable the automatic release of the address at the end of the test.
Default: true
Example

This example will disable the automatic release of the DHCP address at the end of the test.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Release.Enable false

Definition at line 10968 of file api.tcl.

Layer5.Dhcp::Release.IsEnabled

Return whether sending DHCP release during destruction is enabled.

When a ByteBlowerPort is destructed and this port has performed DHCP, it should release its address. If this behavior is prefered, then this should be done by using the Release.Enable method to inidicate the ByteBlowerPort should release its address if possible. A ByteBlowerPort is able to release its address at destruction time if the destination mac address is in the ByteBlowerPort's ARP cache. If not, the DHCP release messages will not be sent out, because it could delay the whole cleanup.

If you want to force the release of an address received through DHCP, use Release.

Returns
If the port will release its IP at destruction
Example

This example will disable the automatic release of the DHCP address at the end of the test.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Release.IsEnabled

Returns:

true  

Definition at line 10984 of file api.tcl.

Layer5.Dhcp::ReleaseEnabled   enable  

Enable/disable sending DHCP release during destruction.

Deprecated:
Please use Release.Enable

When a ByteBlowerPort is destructed and this port has performed DHCP, such a port should release its address. If this behavior is prefered, then this should be done by using the Release.Enable method to indicate the ByteBlowerPort should release its address if possible. A ByteBlowerPort is able to release its address at destruction time if the destination mac address is in the ByteBlowerPort's ARP cache. If not, the DHCP release messages will not be sent out, because it could delay the whole cleanup.

If you want to force the release of an address received through DHCP, use Release.

Parameters
enableBoolean to enable or disable the release of the address at the end of the test.
true
Will enable the automatic release of the address at the end of the test.
false
Will disable the automatic release of the address at the end of the test.
Default: true
Example

This example will disable the automatic release of the DHCP address at the end of the test.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] ReleaseEnabled false

Definition at line 11016 of file api.tcl.

Layer5.Dhcp::Request.InitialTimeout.Get

Returns the current <InitialTimeout> for the DHCP request stage.

During the Request stage, one ore more request messages will be sent by the DHCP client to get an ack message from the DHCP server. The <InitialTimeout> is the timeout used to decide if the request message must be retransmitted or not. The next timeout value will be calculated using the configured retransmission policy.

Returns
Current <InitialTimeout> value for the request stage. The unit is nanosecond (ns).
Example

This example will get the current <InitialTimeout> for the request stage.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Request.InitialTimeout.Get

Returns:

1000000000 
Default value: 1000000000
The default value is 1 second.

Definition at line 11033 of file api.tcl.

Layer5.Dhcp::Request.InitialTimeout.Set   InitialTimeout  

Sets the <InitialTimeout> for the DHCP request stage.

During the Request stage, one ore more request messages will be sent by the DHCP client to get an ack message from the DHCP server. The <InitialTimeout> is the timeout used to decide if the request message must be retransmitted or not. The next timeout value will be calculated using the configured retransmission policy.

Parameters
InitialTimeoutNew value for the initial timeout. By default, the unit is in nanosecond (ns), but the unit can be appended, like this: \'5s\', meaning 5 seconds.
Example

This example will set the <InitialTimeout> for the request stage.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Request.InitialTimeout.Set 2s

Definition at line 11047 of file api.tcl.

Layer5.Dhcp::Request.MaxRetries.Get

Returns the current maximum retries for the DHCP Request stage.

During the Request stage, one ore more request messages will be sent by the DHCP client to get an ack message from the DHCP server. The maximum number of times the DHCP client will retransmit the request message is returned by this method.

Returns
Current value for the number of retries in the request stage.
Example

This example will get the current maximum number of retries for the request stage.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Request.MaxRetries.Get

Returns:

5 
Default value: 5
The default value is 5 times.

Definition at line 11064 of file api.tcl.

Layer5.Dhcp::Request.MaxRetries.Set   maxRetries  

Sets the maximum retries for the DHCP Request stage.

During the Request stage, one ore more request messages will be sent by the DHCP client to get an ack message from the DHCP server. The maximum number of times the DHCP client will retransmit the request message is configured by this method.

Parameters
maxRetriesThe new value for the maximum number of retransmission of the request message.
Example

This example will set the current maximum number of retries for the request stage.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Request.MaxRetries.Set 5
Default value: 5
The default value is 5 times.

Definition at line 11081 of file api.tcl.

Layer5.Dhcp::Request.Retries.Maximum.Get
Deprecated:
This method has been renamed, use Request.MaxRetries.Get now.

Definition at line 11087 of file api.tcl.

Layer5.Dhcp::Request.Retries.Maximum.Set
Deprecated:
This method has been renamed, use Request.MaxRetries.Set now.

Definition at line 11093 of file api.tcl.

Layer5.Dhcp::Request.Timeout.Initial.Get
Deprecated:
This method has been renamed, use Request.InitialTimeout.Get now.

Definition at line 11099 of file api.tcl.

Layer5.Dhcp::Request.Timeout.Initial.Set
Deprecated:
This method has been renamed, use Request.InitialTimeout.Set now.

Definition at line 11105 of file api.tcl.

Layer5.Dhcp::RetransmissionPolicy.Get
Deprecated:
This method has been renamed, use RetransmissionPolicy.String.Get now.

Definition at line 11111 of file api.tcl.

Layer5.Dhcp::RetransmissionPolicy.Set
Deprecated:
This method has been renamed, use RetransmissionPolicy.Set.FromString now.

Definition at line 11131 of file api.tcl.

Layer5.Dhcp::RetransmissionPolicy.Set.FromString   policy  

Configures the Retransmission Policy.

The Retransmission Policy defines the timing for the DHCP messages.

Parameters
policyPossible values are:
FixedTiming
Each retry will use the same timeout value.
RfcSuggested
Use the retransmission algorithm defined in RFC 2131.
Example

This example will set the retransmission policy to fixed timing.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] RetransmissionPolicy.Set.FromString FixedTiming

Definition at line 11125 of file api.tcl.

Layer5.Dhcp::RetransmissionPolicy.String.Get

Returns the current configured retransmission policy.

This policy is used in calculating the timeout value for each outstanding message and is the same for all message types.

Returns
Current configured Retransmission Policy Possible values are:
FixedTiming
Each retry will use the same timeout value.
RfcSuggested
Use the retransmission algorithm defined in RFC 2131.
{FixedTiming}
Example

This example will get the retransmission policy.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] RetransmissionPolicy.String.Get

Returns:

FixedTiming 

Definition at line 11145 of file api.tcl.

Layer5.Dhcp::Session.Info.Get

Returns the sessionInfo object for this DHCP Session.

This object contains all the DHCP sessionInfo like Tx,Rx, current leaseTime, giaddr etc...

Returns
The Layer5.Dhcp.SessionInfo object for this dhcp session
Example

This example will return the <Layer5.Dhcp.SessionInfo object> object for this DHCP session.

1 [ [ $port Layer3.IPv4.Get ] Protocol.Dhcp.Get ] Session.Info.Get

Returns:

<Layer5.Dhcp.SessionInfo object> 

Definition at line 11159 of file api.tcl.