Interview Prep Docs
HelioVision/2. Hardware and Edge / Network Protocols

Network Protocols (Software Layer)

Once data leaves the physical wires (I2C/SPI) and is serialized (JSON/Protobuf), it must be routed across standard network stacks using Software/Network Protocols.

1. The Transport Layer

TCP (Transmission Control Protocol)

  • Core Feature: Reliability. TCP establishes a connection (3-way handshake) and guarantees that all packets arrive in the exact order requested. If a packet is lost, it re-transmits it automatically.
  • Use Case: File transfers, REST APIs, loading webpages.
  • Downside in Vision: Sudden re-transmissions cause unpredictable latency spikes.

UDP (User Datagram Protocol)

  • Core Feature: Speed. Connectionless "fire and forget". It blasts packets at an IP address without checking if they received them.
  • Use Case (Crucial for Vision!): Streaming 60 FPS live video from a camera. If frame #3 drops, you don't want the network to freeze waiting to re-download it while frame #4 and #5 stack up. You just want the freshest frame instantly.

2. The Application Layer

MQTT (Message Queuing Telemetry Transport)

  • The IoT Standard.
  • Architecture (Pub/Sub): Machines connect to a central Broker (like Mosquitto).
    • Publisher: The edge camera publishes {"status": "defect"} to a specific "Topic" (factory/line1/cameraA).
    • Subscriber: The Node.js backend subscribes to that topic and gets notified instantly.
  • Why it wins IoT: Extremely lightweight headers (perfect for unstable WiFi/cellular) and gracefully handles unreliable network disconnects.

WebRTC (Real-Time Communication)

  • How it works: Peer-to-Peer (P2P). Once two devices find each other via a signaling server, they connect directly and bypass the server entirely.
  • Key Feature: The absolute lowest possible latency for video/audio on the web.
  • Use Case: Streaming the actual manufacturing floor camera feed directly into a React dashboard so an operator can monitor it with zero lag.

Architecture Flow

graph LR
    subgraph edge ["The Edge"]
        Camera[Camera] -- I2C/SPI --> EdgeNode[Raspberry Pi]
    end
    
    subgraph net ["The Network"]
        Broker[MQTT Broker]
        Dashboard[React App]
    end

    subgraph cloud ["The Cloud"]
        Backend[Node.js API]
    end

    EdgeNode -- "MQTT (Telemetry)" --> Broker
    EdgeNode -- "WebRTC (UDP Stream)" --> Dashboard
    Broker -- "TCP" --> Backend