Why is My Internet Slow? (Packet Loss)

Lag spikes. Rubbanding. We all hate it. But for robots, packet loss causes crashes. Understanding UDP vs. TCP.

“Why is My Internet Slow?” (Packet Loss)

You’re playing a game. Suddenly, your character teleports back 5 feet. “LAG!” you scream. What actually happened? Packet Loss. The internet sends data in tiny envelopes called “Packets.” Sometimes, the mailman drops an envelope.

TCP vs. UDP: The Protocols

  • TCP (Transmission Control Protocol): The Reliable One.
    • “I sent Packet 1. Did you get it?”
    • “Yes.”
    • “Okay, sending Packet 2.”
    • Used for: Webbrowsing, Email, Text. Accuracy > Speed.
  • UDP (User Datagram Protocol): The Fast One.
    • “Sending Packet 1, 2, 3, 4, 5! Catch them if you can! I don’t care!”
    • Used for: Video Games, Voice Chat, Robots. Speed > Accuracy.

The Robot Heartbeat

FTC Robots communicate via Wi-Fi Direct using UDP. Every 20 milliseconds, the gamepad sends a packet: “Joystick X = 1.0”. If a packet is lost due to interference (too many Wi-Fi signals in the stadium):

  1. Packet 1 (“Drive Forward”) arrives. Robot drives.
  2. Packet 2 (“Stop!”) is Dropped.
  3. Packet 3 is delayed. Result: The robot keeps driving forward for an extra 100ms and smashes into the wall. This is a “Lag Spike.”

The Spectrum War

In a robotics competition, there are 200 phones and hotspots. The 2.4GHz and 5GHz airwaves are a battlefield. This is why we teach teams to:

  • Use 5GHz channels (Less crowded).
  • Avoid metal shielding around the antenna (Faraday Cage).
  • Keep the Driver Station close to the robot.

Lag isn’t just annoying; in robotics, it’s dangerous.