By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Connectivity refers to the technologies and protocols that enable devices, systems, and networks to exchange data. You’d use it to build IoT systems, automate workflows, integrate cloud services, or enable real-time communication between applications.
Modern businesses rely on seamless data flow. Connectivity powers: - Real-time decision-making (e.g., sensor data in factories).- Automation (e.g., APIs triggering workflows).- Scalability (e.g., cloud services communicating with edge devices).- Customer experiences (e.g., mobile apps syncing with backend databases).
Without reliable connectivity, systems fragment, latency increases, and opportunities for automation disappear.
Protocols define how data is formatted, transmitted, and received. Key types: - HTTP/HTTPS: Web-based communication (REST APIs, webhooks).- MQTT: Lightweight pub/sub protocol for IoT (low bandwidth, high reliability).- WebSockets: Full-duplex, real-time communication (chat apps, live updates).- TCP/IP: Foundational internet protocol (reliable, ordered data delivery).- UDP: Fast but unreliable (video streaming, gaming).
Rule of thumb: Use HTTP for request-response, MQTT for IoT, WebSockets for real-time.
Data must be serialized for transmission. Common formats: - JSON: Human-readable, widely supported (APIs, configs).- XML: Verbose, schema-validated (legacy systems, SOAP).- Protocol Buffers (protobuf): Binary, efficient (high-performance systems).- CSV: Simple, tabular data (spreadsheets, logs).
Example JSON payload:
{ "device_id": "sensor-001", "temperature": 23.5, "timestamp": "2024-05-20T14:30:00Z" }
Trade-offs: | Topology | Pros | Cons | |----------------|-------------------------------|-------------------------------| | Star | Simple, centralized control | Single point of failure | | Mesh | Redundant, scalable | Complex, higher power usage | | P2P | Decentralized, resilient | Harder to manage |
Optimize for: - Low latency: Real-time systems (e.g., trading, gaming).- High bandwidth: Large data transfers (e.g., video streaming).
Never transmit sensitive data unencrypted.
Simple Diagram:
[Sensor] → (MQTT) → [Gateway] → (Internet) → [Cloud Broker] → [Database] → [Dashboard]
paho-mqtt
Install Mosquitto (open-source MQTT broker):
# On Linux/macOS sudo apt install mosquitto mosquitto-clients # Debian/Ubuntu brew install mosquitto # macOS # Start the broker mosquitto -v
import paho.mqtt.client as mqtt import json import time from random import randint # Simulate sensor data # MQTT setup broker = "localhost" topic = "sensors/temperature" client = mqtt.Client() client.connect(broker) # Publish fake sensor data while True: temp = randint(20, 30) payload = json.dumps({"device": "sensor-001", "temp": temp}) client.publish(topic, payload) print(f"Published: {payload}") time.sleep(5)
In a new terminal:
mosquitto_sub -t "sensors/temperature" -v
Expected Output:
sensors/temperature {"device": "sensor-001", "temp": 25} sensors/temperature {"device": "sensor-001", "temp": 28}
randint
Adafruit_DHT
python client.publish(topic, payload, qos=1) # At least once delivery
python import os broker = os.getenv("MQTT_BROKER") # Set via `export MQTT_BROKER="localhost"`
client.on_disconnect = on_disconnect ```
python time.sleep(1) # Send every second instead of continuously
python client.tls_set(ca_certs="ca.crt") # For MQTT over TLS
python import logging logging.basicConfig(filename="mqtt.log", level=logging.ERROR)
tc
bash sudo tc qdisc add dev eth0 root netem delay 100ms # Add 100ms latency
iperf3
You’re building a real-time chat app. Which protocol is best suited for this use case? - A) HTTP - B) MQTT - C) WebSockets - D) SMTP
Correct Answer: C) WebSocketsExplanation: WebSockets provide full-duplex, persistent connections ideal for real-time apps like chat. HTTP (A) is request-response, MQTT (B) is better for IoT, and SMTP (D) is for email.Why the Distractors Are Tempting: - A) HTTP: Familiar for web apps, but not real-time.- B) MQTT: Lightweight, but designed for IoT, not chat.- D) SMTP: Protocol for email, irrelevant here.
A sensor sends temperature data every second to a cloud broker. After 1 hour, the broker crashes due to too many messages. What’s the most efficient fix? - A) Increase the broker’s RAM.- B) Switch from MQTT to HTTP.- C) Throttle the sensor to send data every 10 seconds.- D) Use QoS 2 for guaranteed delivery.
Correct Answer: C) Throttle the sensor to send data every 10 seconds.Explanation: Reducing the message frequency (throttling) is the simplest and most efficient fix. Increasing RAM (A) or switching protocols (B) doesn’t address the root cause. QoS 2 (D) adds overhead and won’t reduce message volume.Why the Distractors Are Tempting: - A) Increase RAM: Treats the symptom, not the cause.- B) Switch to HTTP: HTTP has higher overhead than MQTT.- D) QoS 2: Ensures delivery but doesn’t reduce load.
You’re designing a system where 10,000 IoT devices send small, infrequent updates (e.g., once per hour). Which connectivity technology is most cost-effective? - A) 4G Cellular - B) Wi-Fi - C) LoRaWAN - D) Ethernet
Correct Answer: C) LoRaWANExplanation: LoRaWAN is designed for long-range, low-power, low-bandwidth IoT use cases. 4G (A) is expensive for many devices, Wi-Fi (B) has limited range, and Ethernet (D) requires wired infrastructure.Why the Distractors Are Tempting: - A) 4G Cellular: Works but costly for 10,000 devices.- B) Wi-Fi: Short range, not scalable for outdoor IoT.- D) Ethernet: Impractical for remote devices.
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.