Package: inet.applications.dhcp
DhcpClient
simple moduleImplements the DHCP client protocol. DHCP (Dynamic Host Configuration Protocol), described in RFC 2131, provides configuration parameters to Internet hosts. Requires UDP.
See also: DhcpServer, DhcpMessage
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
interfaceTableModule | string |
path to the InterfaceTable module |
|
routingTableModule | string |
path to the Ipv4RoutingTable module |
|
interface | string | "" |
which NIC should be configured (i.e. wlan0, eth1 etc.) |
startTime | double | 0s |
starting time of DHCP initialization |
stopOperationExtraTime | double | -1s |
extra time after lifecycle stop operation finished |
stopOperationTimeout | double | 2s |
timeout value for lifecycle stop operation |
Properties
Name | Value | Description |
---|---|---|
display | i=block/app2 | |
lifecycleSupport | ||
selfMessageKinds | inet::DhcpTimerType |
Gates
Name | Direction | Size | Description |
---|---|---|---|
socketIn | input | ||
socketOut | output |
Scheduled messages (observed)
msg | kind | ctrl | tags | msgname | context |
---|---|---|---|---|---|
omnetpp::cMessage | 1 (DhcpTimerType::WAIT_OFFER) | DHCP Timeout | |||
omnetpp::cMessage | 3 (DhcpTimerType::T1) | TN Timer | |||
omnetpp::cMessage | 4 (DhcpTimerType::T2) | TN Timer | |||
omnetpp::cMessage | 5 (DhcpTimerType::LEASE_TIMEOUT) | Lease Timeout | |||
omnetpp::cMessage | 6 (DhcpTimerType::START_DHCP) | Starting DHCP |
Direct method calls (observed)
call to | function | info |
---|---|---|
MessageDispatcher | inet::MessageDispatcher::arrived | arrived |
ScenarioManager | inet::ScenarioManager::moduleOperationStageCompleted | moduleOperationStageCompleted |
InterfaceTable | inet::InterfaceTable::findInterfaceByName | findInterfaceByName |
InterfaceTable | inet::InterfaceTable::interfaceChanged | interfaceChanged |
Ipv4RoutingTable | inet::Ipv4RoutingTable::addRoute | addRoute(...) |
Ipv4RoutingTable | inet::Ipv4RoutingTable::deleteRoute | deleteRoute(...) |
Called methods (observed)
function | info | call from |
---|---|---|
inet::DhcpClient::handleOperationStage | handleOperationStage | ScenarioManager |
inet::DhcpClient::receiveSignal | l2Associated | Ieee80211MgmtSta |
Incoming messages (observed)
gate | msg | kind | ctrl | srcModule | tags |
---|---|---|---|---|---|
socketIn | Indication | 2 (UdpStatusInd::UDP_I_SOCKET_CLOSED) | UdpSocketClosedIndication | Udp | SocketInd |
socketIn | Packet | 0 (UdpStatusInd::UDP_I_DATA) | Udp | DscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, L4PortInd, MacAddressInd, NetworkProtocolInd, SocketInd, TosInd, TransportProtocolInd, ErrorRateInd?, Ieee802SapInd?, SignalPowerInd?, SignalTimeInd?, SnirInd?, Ieee80211ChannelInd?, Ieee80211ModeInd? |
Outgoing messages (observed)
gate | msg | kind | ctrl | destModule | tags |
---|---|---|---|---|---|
socketOut | Packet | 0 (UdpCommandCode::UDP_C_DATA) | Udp | DispatchProtocolReq, InterfaceReq, L3AddressReq, L4PortReq, SocketReq | |
socketOut | Request | 1 (UdpCommandCode::UDP_C_BIND) | UdpBindCommand | Udp | DispatchProtocolReq, SocketReq |
socketOut | Request | 3 (UdpCommandCode::UDP_C_SETOPTION) | UdpSetBroadcastCommand | Udp | DispatchProtocolReq, SocketReq |
socketOut | Request | 4 (UdpCommandCode::UDP_C_CLOSE) | UdpCloseCommand | Udp | DispatchProtocolReq, SocketReq |
Packet operations (observed)
chunkType | packetAction |
---|---|
DhcpMessage | insertAtBack, peekAtFront |
Shared Tagging operations (observed)
tagType | tagAction |
---|---|
DispatchProtocolReq | addTagIfAbsent |
InterfaceReq | addTagIfAbsent |
L3AddressReq | addTagIfAbsent |
L4PortReq | addTagIfAbsent |
SocketInd | findTag |
SocketReq | addTagIfAbsent |
Tagging operations (observed)
tagType | tagAction |
---|---|
inet::Ipv4InterfaceData | getTag, getTagForUpdate |
Source code
// // Implements the DHCP client protocol. DHCP (Dynamic Host Configuration Protocol), // described in RFC 2131, provides configuration parameters to Internet hosts. // Requires UDP. // // @see ~DhcpServer, ~DhcpMessage // simple DhcpClient like IApp { parameters: string interfaceTableModule; // path to the InterfaceTable module string routingTableModule; // path to the Ipv4RoutingTable module string interface = default(""); // which NIC should be configured (i.e. wlan0, eth1 etc.) double startTime @unit(s) = default(0s); // starting time of DHCP initialization @display("i=block/app2"); @lifecycleSupport; double stopOperationExtraTime @unit(s) = default(-1s); // extra time after lifecycle stop operation finished double stopOperationTimeout @unit(s) = default(2s); // timeout value for lifecycle stop operation @selfMessageKinds(inet::DhcpTimerType); gates: input socketIn @labels(UdpControlInfo/up); output socketOut @labels(UdpControlInfo/down); }File: src/inet/applications/dhcp/DhcpClient.ned