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... | |
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:
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:
Layer5.Dhcp::BroadcastFlag.Enable | enable | ||
Enable/disable sending Broadcast DHCP messages.
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.
enable | Boolean to enable or disable the sending of broadcast DHCP messages.
false |
This example will enable sending of the legacy DHCP messages
Layer5.Dhcp::BroadcastFlag.IsEnabled |
Returns whether or not a ByteBlowerPort will use Broadcast DHCP messages.
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.
This example will query the dhcp protocol whether or not it will send legacy DHCP messages
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.
This example will get the current <InitialTimeout> for the discover stage.
Returns:
1000000000
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.
InitialTimeout | New 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. |
This example will set the <InitialTimeout> for the discover stage.
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.
This example will get the current maximum number of retries for the discover stage.
Returns:
5
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.
maxRetries | The new value for the maximum number of retransmission of the discover message. |
This example will set the maximum number of retries for the discover stage to 3 times.
Layer5.Dhcp::Discover.Retries.Maximum.Get |
Layer5.Dhcp::Discover.Retries.Maximum.Set |
Layer5.Dhcp::Discover.Timeout.Initial.Get |
Layer5.Dhcp::Discover.Timeout.Initial.Set |
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.
ByteBlower.Exception.API.DHCPFailed | Thrown if no offer was received during the DHCP discover stage or when no DHCPAck was received during DHCPRequest stage |
This example will perform DHCP on the specified ByteBlowerPort.
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.
This example will perform DHCP on the specified ByteBlowerPort.
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.
This example will release the DHCP address.
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.
enable | Boolean to enable or disable the release of the address at the end of the test.
true |
This example will disable the automatic release of the DHCP address at the end of the test.
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.
This example will disable the automatic release of the DHCP address at the end of the test.
Returns:
true
Layer5.Dhcp::ReleaseEnabled | 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.
enable | Boolean to enable or disable the release of the address at the end of the test.
true |
This example will disable the automatic release of the DHCP address at the end of the test.
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.
This example will get the current <InitialTimeout> for the request stage.
Returns:
1000000000
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.
InitialTimeout | New 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. |
This example will set the <InitialTimeout> for the request stage.
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.
This example will get the current maximum number of retries for the request stage.
Returns:
5
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.
maxRetries | The new value for the maximum number of retransmission of the request message. |
This example will set the current maximum number of retries for the request stage.
Layer5.Dhcp::Request.Retries.Maximum.Get |
Layer5.Dhcp::Request.Retries.Maximum.Set |
Layer5.Dhcp::Request.Timeout.Initial.Get |
Layer5.Dhcp::Request.Timeout.Initial.Set |
Layer5.Dhcp::RetransmissionPolicy.Get |
Layer5.Dhcp::RetransmissionPolicy.Set |
Layer5.Dhcp::RetransmissionPolicy.Set.FromString | policy | ||
Configures the Retransmission Policy.
The Retransmission Policy defines the timing for the DHCP messages.
policy | Possible values are:
|
This example will set the retransmission policy to fixed timing.
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.
This example will get the retransmission policy.
Returns:
FixedTiming
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...
This example will return the <Layer5.Dhcp.SessionInfo object> object for this DHCP session.
Returns:
<Layer5.Dhcp.SessionInfo object>