What is Command and Control?

Command and control is the process of directing a device or system and checking the outcome. In a connected-device system, an authorised controller sends an instruction, the target decides whether it can perform it, and status or measured feedback shows what happened. In cybersecurity, command and control, often shortened to C2 or C&C, instead describes communications used by an attacker to direct compromised systems.
The distinction is authority and purpose, not simply the protocol being used. A smart-home service controlling your own equipment can be legitimate. An intruder using a similar network channel to operate an infected device is not. This guide focuses on networked devices, the reliability of authorised control and the defensive meaning of malicious C2.
How is control different from telemetry?
Telemetry reports observations such as temperature, connection state or traffic volume. A command requests a change, such as setting a reporting interval or asking a fan to run. Control connects the requested action with a decision and, where needed, feedback about the resulting state.
Message or function | What it tells you |
|---|---|
Command | What an authorised actor wants the target to do. |
Delivery acknowledgement | What a particular receiver accepted at a defined protocol boundary. |
Execution result | What the device application says happened while handling the instruction. |
State feedback | What is reported or measured afterwards, including its time and quality. |
Control policy | Who may request an action, under which conditions and limits. |
A fan controller can accept “run” while a jammed fan remains stationary. A configuration service can store a new interval before the device receives it. The useful success condition must match the job: accepted request, applied configuration and observed physical behaviour are different outcomes.
Open-loop control applies an action without using measured feedback to correct it. Closed-loop control uses feedback to adjust behaviour towards a target. A remote command channel can support either design. A cloud dashboard is not automatically a suitable place for a fast or safety-critical feedback loop.
Follow an authorised instruction through the system
Consider a lab controller asking a small cooling fan to run at an approved setting. The instruction must name the intended device and action. Both the service and the device need to enforce the permissions and limits appropriate to their part of the system.
The user or automation authenticates to the controlling service.
The service checks permission for the target device, operation and parameters.
The instruction travels over the configured connection or messaging path.
The device checks the instruction’s validity, freshness and applicable local conditions.
The device performs or rejects the action and reports the relevant result.
The controller correlates that result with the request and checks any required fresh state feedback.
A device normally needs device provisioning before it can trust the service and present an operational identity. That establishes a starting relationship. It does not remove the need to authorise individual control actions, protect credentials or revoke access when ownership changes.
An MQTT broker can route commands and responses between clients, but the application defines their meaning. Topic permissions, payload validation and result correlation still matter. A broker should not need to guess whether “success” means that a request was queued or that a physical actuator reached its intended state.
The infographic follows the two directions separately: an instruction goes towards the device, while a result returns towards the controller. Its timeout warning matters because losing the return path can leave the action’s outcome uncertain.

Choose between an immediate request, desired state and a job
Pattern | Useful when |
|---|---|
Request and response | A connected device should handle an interactive instruction and provide a prompt result. |
Desired-state reconciliation | The device should converge on a persistent setting, including after a disconnection. |
Queued command or tracked job | Work needs its own identity, progress, expiry and recovery behaviour. |
Microsoft’s Azure IoT Hub direct methods illustrate the first pattern. They use request and response for interactive operations, with device-side handling and configurable timeouts. The documentation also states that method calls have no ordering or concurrency guarantees. Availability and behaviour are specific to IoT Hub’s supported tier and interfaces.
A method response still has the meaning implemented by the device application. A device can acknowledge that it has started a longer task and report completion separately. Do not label that initial response “finished” unless the application contract and evidence support it. Likewise, a configurable wait for a disconnected device is not the same as a durable queue of arbitrary future actions.
The AWS IoT Device Shadow service illustrates desired-state coordination. An application writes desired properties, the device reports properties, and differences can be represented as a delta. Stored shadow state remains accessible while the device is offline. The device and applications must still implement the logic that keeps their states consistent.
Setting a reporting interval is a natural desired-state use case. “Take one diagnostic capture” is a discrete action that usually needs its own operation record. A shadow or twin is not automatically an ordered history of every instruction, and a stored reported value is not necessarily a fresh physical measurement.
For queued work, decide which instruction remains valid when the device returns. A delayed configuration update may be useful; a momentary command intended for a particular situation may no longer make sense. The correct behaviour depends on the action, not simply on whether the queue can retain it.
Define exactly what “completed” means
Use separate states for separate evidence. The following is an illustrative application model, not a status vocabulary imposed by every protocol or cloud platform. A product may combine states, but it should not erase an important distinction in the user interface or audit trail.
Illustrative state | Evidence required |
|---|---|
Accepted | The controlling service has accepted an authorised request. |
Delivered | The defined receiving component has acknowledged the instruction. |
Running | The device application reports that it has begun the work. |
Completed | The application reports its defined successful outcome for that operation. |
Verified | The required fresh feedback supports the intended resulting state. |
Rejected, failed or expired | A specific decision or failure is known and recorded. |
Unknown | Available evidence does not establish the outcome. |
Match the strength of feedback to the task. Reading back a configuration version may be enough to confirm an interval change. Confirming a fan’s physical movement needs an appropriate measurement, not merely the software variable that requested movement. Even matching state does not establish which command caused it if another controller or local operator could have made the same change.
Keep the operation identity, target, requested parameters, relevant version, result and observation time together. Protect this record from containing reusable secrets. A helpful audit trail lets someone distinguish “the service accepted it” from “this device applied this version and reported this result”.
A timeout can mean the result is unknown
The controller can lose the response after the device has acted. It can also time out while the request is still queued, before the target receives anything. Those situations look similar from a waiting application, but repeating the action has different consequences.
Illustrative event | What a timeout establishes |
|---|---|
Request never reaches the device | No timely response; non-execution still needs evidence. |
Device executes, response is lost | The action may already have happened. |
Device starts slow work | The operation may still be running. |
Device reports through a delayed path | A later result may resolve the uncertainty. |
A timeout is a limit on waiting, not universal proof of cancellation. AWS IoT Commands documentation makes that distinction explicit in its own status model: a cloud-detected timeout can remain non-terminal and accept later device updates. Other platforms have different rules, so inspect the operation’s actual lifecycle rather than treating a status name as a guarantee.
An interface should show uncertainty honestly. Displaying a definite failure can encourage a user to press the same button repeatedly, while showing definite success can hide an incomplete action. Reconcile the original operation and current state before deciding whether another attempt is appropriate.
Retries need a stable identity and a defined repeat effect
Compare “toggle the fan” with “set the fan to off”. If a lost response causes the toggle to run twice, the second action can undo the first. Repeating a fixed target-state request can be easier to reason about, provided the device’s side effects and concurrent changes are also handled correctly.
That repeat behaviour is idempotency. A stable operation identifier allows supported services or device logic to recognise attempts belonging to the same intended action. Creating a new identifier on every retry removes that relationship. An MQTT Packet Identifier is not a permanent application operation ID.
Define which actions can be repeated and which need reconciliation before another attempt.
Keep duplicate-detection state for the required retry window, with suitable persistence across restarts.
Reject reuse of an operation identity with conflicting parameters rather than silently changing its meaning.
Use bounded retries and appropriate backoff so a reconnecting fleet does not overload the controller.
Record uncertainty after a crash between a physical action and its saved completion record.
No messaging setting makes an arbitrary physical action and a database update one atomic transaction. MQTT 5.0, standardised by OASIS in March 2019, defines delivery QoS for the messaging exchange. That does not make a motor movement, external API call or device reboot execute exactly once under every failure condition.
Expiry and ordering protect against yesterday’s intent
Give time-sensitive instructions a validity policy. In a simple illustrative case, a request valid for five seconds should not be treated as fresh after a thirty-second disconnection. The design needs to define where validity is checked, what the clock or elapsed-time assumptions are, and how an expired request is reported.
MQTT 5 has a Message Expiry Interval for publication delivery, but transport expiry does not cancel a command the application has already accepted or begun executing. Keep message lifetime, the caller’s response timeout and the action’s execution deadline distinct. Cancellation also needs its own documented semantics and acknowledgement.
When a user sends “on” and then “off”, an old delayed request should not casually override the newer intention. Use the platform’s supported version checks, sequencing or concurrency controls. AWS shadow documentation describes version information for handling out-of-order state messages. That is a specific state-reconciliation mechanism, not a guarantee that every transport orders all application work.
Define who wins when a mobile app, schedule and local control disagree. An authorised cloud request may be superseded by a newer setting or rejected by a local operating limit. Recording “superseded” or a precise rejection reason can be more useful than a generic network error.
Techie Broadband calculation: where response time goes
Here is a deliberately illustrative response-time budget for one successful command and its result. The chosen network contributions represent the complete outward and return paths in this model, not a measured ISP round-trip time. Assume stages run sequentially, with no retry, reconnection or additional queue.
Stage | Chosen contribution |
|---|---|
Authorisation and service processing | 30 ms |
Outward network path | 80 ms |
Waiting for the device worker | 120 ms |
Action and local verification | 250 ms |
Return network path | 80 ms |
Total | 30 + 80 + 120 + 250 + 80 = 560 ms |
The network contributes 160 ms, or about 28.6% of this 560 ms total. If both network legs were reduced from 80 ms to 20 ms, the same model would total 440 ms. Removing 120 ms from transport does not remove the worker queue or the physical action. These are explanatory calculations, not expected product performance or a latency guarantee.
A small command also does not need much serialisation time on an otherwise idle fast link. A 500-byte payload takes 500 × 8 ÷ 10,000,000 = 0.0004 seconds, or 0.4 ms, to serialise at 10 Mbit/s, before headers and other overhead. That idealised calculation excludes queueing, propagation, processing and connection setup. More headline bandwidth alone cannot explain or repair every slow control response.
Measure the relevant stages where the system exposes them, using suitable timing methods. Unsynchronised clocks on different hosts can make one-way timings misleading. Record queue time, execution time, late results and timeout rates as well as a convenient overall average.
Local or cloud control: follow the failure dependency
In a UK FTTP installation, cloud control can depend on the local network, router, ONT, access network, ISP and remote service. If the WAN path fails, the phone app may lose control even while the device still has power and can run its existing local programme. A local controller can remove the WAN dependency for local actions, provided its other dependencies remain available.
Many cloud-connected devices initiate an outbound session to their service and receive instructions over that established path. They do not inherently require an unsolicited inbound port forward. NAT, carrier-grade NAT, IPv6 firewall policy and vendor relay behaviour affect particular designs differently. Check the actual connection direction before changing router exposure.
Local hosting still needs working power, networking, credentials and a functioning controller. Cloud hosting still needs an intentional offline policy. Decide what continues autonomously, what pauses, how local override works and how the system reconciles state after reconnection. Test those decisions on the supported equipment rather than inferring them from a “local” or “cloud” label.
Control authority needs narrower permissions than visibility
Permission to read a temperature is different from permission to change an actuator. Restrict control by identity, device, operation and appropriate parameter range. Separate routine automation from administrative functions, and protect human administrator accounts with suitable authentication. Avoid sharing one unrestricted credential across unrelated devices.
NIST’s IoT technical capability catalogue describes logical-access controls, roles, least privilege and revocation. Use those as questions to ask of a device’s actual capabilities, not as evidence that a particular product is certified. Protect transport, validate destinations and keep broker, API and management interfaces within their intended exposure.
Device-side operating limits and appropriate independent protections matter where an action can affect equipment or people. A valid remote request must not automatically bypass local safeguards. A public broadband connection and a convenient app response are not a safety guarantee. Use the equipment manufacturer’s supported control design and the requirements of the actual installation.
What does malicious command and control mean?
MITRE ATT&CK’s Command and Control tactic, TA0011, describes adversary communications with compromised systems. Attackers can abuse familiar application protocols and services, so traffic that resembles ordinary web or messaging activity is not automatically legitimate. Equally, encryption, periodic connections or a remote server do not by themselves prove infection.
Defensive investigation needs context: which process opened the connection, the device’s expected services, destination reputation, authentication events and changes from its normal behaviour. A legitimate remote-support tool can also be misused through a compromised account. The relevant question is who authorised the activity and what the endpoint is doing, not just whether the port is familiar.
If a security alert reports possible C2, preserve the alert details and investigate through the organisation’s incident process. Where appropriate, isolate the affected device while maintaining necessary evidence and operational safety. Blocking one destination may interrupt a channel without removing the underlying compromise. Do not test by installing untrusted remote-control software or disabling protections.
Troubleshoot the first incomplete part of the control path
Symptom | Check next |
|---|---|
Telemetry arrives but commands fail | Separate publish/subscribe or API permissions, command handler, target identity and supported operation. |
Service accepts but device does nothing | Subscription or receive path, payload format, device-side rejection and local operating limits. |
Device acts but app times out | Result correlation, return permissions, response path, timeout definition and delayed reporting. |
Action repeats after reconnection | Queue replay, retained commands, duplicate handling, expiry and session settings. |
Old state replaces a newer setting | Version handling, multiple writers, delayed work and reconciliation policy. |
Cloud control fails but local works | WAN reachability, DNS, TLS, service availability and the device’s established connection. |
Connection is healthy but action is slow | Worker queues, rate limits, device processing, physical operation and feedback collection. |
A healthy telemetry feed proves only that its own reporting path is working. It may use different permissions or application handlers from commands. Likewise, a device marked “online” may have a broken command subscription or an overloaded worker. Use a safe, supported test operation with a known result to locate the failing boundary.
Test the outcome, including interruption and recovery
Choose a harmless supported action and define the evidence that will count as completion.
Confirm the intended identity, target and permissions before issuing the request.
Trace one operation identity through acceptance, device handling and fresh result evidence.
In a controlled test, check a lost connection, delayed result and repeated submission without risking the installation.
Verify expiry, restart recovery, multiple-controller behaviour and the documented local override.
Record the actual limits and unresolved outcomes before extending the design to more devices.
Command and control questions answered
Is command and control always malicious?
No. Authorised systems use it to direct devices and verify outcomes. In cybersecurity, C2 refers to an attacker’s communications with compromised systems. Authority, purpose and endpoint behaviour determine the distinction.
What is the difference between telemetry and commands?
Telemetry reports observations. Commands request changes or actions. Reliable control also needs a defined result and, where required, fresh feedback about the resulting state.
Does a successful delivery mean the action completed?
No. Delivery confirms a defined receiving boundary. Device execution and physical state may require separate evidence. The application must define what each acknowledgement means.
Does a timeout mean the command failed?
It means the expected response did not arrive within the relevant waiting period. The command may not have arrived, may still be running or may have completed without its response reaching the controller.
Will faster broadband make commands respond faster?
It can help when available capacity or network delay is the limiting factor. Authorisation, queues, device processing, physical action and feedback can dominate instead. Measure the path before changing the connection.
Can local command and control work without the internet?
Yes, if the required controller, devices and services remain available locally. Local power, networking and credentials still matter. Remote access and cloud-dependent functions need their respective external paths.
Does remote control require port forwarding?
Not inherently. Many devices initiate an outbound connection and receive instructions over it. Other designs use a VPN, local controller or another authorised path. Check the product’s supported architecture before exposing an inbound service.
Key takeaway
Command and control works when the right actor can request the right action on the right device, and the result is understood. Follow authority, delivery, execution and feedback separately. When the evidence is incomplete, preserve the unknown state rather than turning a timeout into a confident answer.
The broadband terminology guide explains the networking, security and device concepts behind those connections.

