Skip to content

Networking Basics

This quick guide covers some basic networking concepts that will help you understand how to connect to and communicate with your car over the network.

How a computer uniquely identifies itself on a network

Every network device (computer, robot car, phone, etc.) has a unique hardware identifer called a MAC address. The format of a MAC address is six groups of two hexadecimal digits, separated by colons (e.g., 00:1A:2B:3C:4D:5E). This address is assigned by the manufacturer and is unique to each device. If a single computer has multiple network interfaces (e.g., Wi-Fi and Ethernet), each interface will have its own MAC address.

Fun fact, hardware manufacturers are assigned blocks of MAC addresses by the IEEE. The first three octets (the first half) of a MAC address identify the manufacturer, while the last three octets are unique to the device. For example, Apple Inc.'s mac prefixes can be found here.

What is an IP Address?

An IP address is a unique identifier assigned to each device on a network. It allows devices to communicate with each other and is essential for routing data between them. When connecting to your car, you will use its IP address to establish a connection.

When a device connects to a network, it is assigned an IP address. While the hardware MAC address typically does not change, the IP address can change. The IP address can be assigned statically (manually set by a user or administrator) or dynamically (assigned by a DHCP server). The IP address allows devices on the same network to communicate with each other.

A device can have multiple IP addresses. For example, your car will have a WiFi IP address when connected to a local network and the WireGuard VPN IP address when connected to the FRI network over the internet.

What is a Hostname?

A hostname is a human-readable label assigned to a specific IP address. The process of translating a hostname to an IP address is called DNS resolution. Hostnames are easier to remember than IP addresses, making it more convenient for users to connect to devices on a network.

Note: the first step in the DNS resolution process is to check the local /etc/hosts file on your computer. This file can be edited to map hostnames to IP addresses manually. See Configuring Your Computer for instructions on setting this up for your car.

What is a VPN?

A VPN, or Virtual Private Network, creates a secure connection between your computer and another network over the internet. It allows you to access resources on that network as if you were physically present. We'll use the WireGuard VPN to connect to enable you to connect to your car using a consistent IP address regardless of your physical location.

When connected to the VPN, your computer is assigned an IP address on the FRI network, allowing it to communicate with your car and other devices on the same network. This is particularly useful when your car is connected to the internet via cellular data or a different Wi-Fi network.

Setup

Configuring your Computer to Resolve Car Hostnames

Your computer's /etc/hosts file needs to be updated to resolve the hostnames of the cars on your team.

Add the following lines to your /etc/hosts file:

10.1.0.101   orin01
10.1.0.102   orin02
10.1.0.103   orin03
10.1.0.104   orin04
10.1.0.105   orin05
10.1.0.106   orin06
10.1.0.107   orin07
10.1.0.108   orin08
10.1.0.109   orin09
10.1.0.110   orin10
10.1.0.111   orin11
10.1.0.112   orin12
10.1.0.113   orin13
10.1.0.114   orin14

This will allow you to connect to your car using its hostname (e.g., orin03) instead of its IP address (e.g., 10.1.0.103). Anywhere you would use the IP address of the car, you can now use the hostname instead.

For more details, see the instructions in Configuring Your Computer to set this up.