Establishing a multi-camera setup with multiple Ethernet adapters on a system can cause connectivity/routing issues if the network layout is not carefully configured. In this KB, we outline the best practices for configuring this network type on Linux. We also delve into the best practices for multi-NIC setups.
To configure each camera on Linux systems, we use the IpConfigUtility application found in the Utilities directory of the Arena SDK.
System Requirements
- Linux system
- Two or more Ethernet adapters
- LUCID cameras
Single NIC on the host computer
GigE Vision cameras must be on the same subnet as the Ethernet adapter and have a valid IP address before use. Matching the IP and subnet between the camera and the Ethernet adapter is essential to establish communication. For example, to establish a connection, both the camera IP and NIC IP must be 169.254.0.*, and netmask must match (255.255.0.0).
- Camera 1
- Eth0 IP address: 169.254.0.100
- Camera IP address: 169.254.0.101
- Netmask: 255.255.0.0
- Gateway: 0.0.0.0
Multiple NICS on the same host computer:
If there two or more cameras connected directly to separate NICs on the same system, each camera and NIC must be on its own IP address and subnet.
- Camera 1
- Eth0 IP address: 192.168.0.100
- Camera IP address: 192.168.0.101
- Netmask: 255.255.255.0
- Gateway: 0.0.0.0
- Camera 2
- Eth1 IP address: 192.168.1.100
- Camera IP address: 192.168.1.102
- Netmask: 255.255.255.0
- Gateway: 0.0.0.0
You can also have each camera on its own IP address and subnet range:
- Camera 1
- Eth0 IP address: 169.254.0.100
- Camera IP address: 169.254.0.101
- Netmask: 255.255.0.0
- Gateway: 0.0.0.0
- Camera 2
- Eth1 IP address: 192.168.1.100
- Camera IP address: 192.168.1.101
- Netmask: 255.255.255.0
- Gateway: 0.0.0.0
Multiple NICs with two or more ports
If there are three or more cameras connected directly to separate NICs with multiple ports on the same system, you can have the following IP address and subnet matching options:
Dual-port NIC 1:
- Camera 1
- Eth0 IP address: 169.254.0.100
- Camera IP address: 169.254.0.101
- Netmask: 255.255.0.0
- Gateway: 0.0.0.0
- Camera 2
- Eth1 IP address: 169.254.1.110
- Camera IP address: 169.254.1.102
- Netmask: 255.255.0.0
- Gateway: 0.0.0.0
Dual-port NIC 2:
- Camera 3
- Eth2 IP address: 192.168.2.100
- Camera IP address: 192.168.2.101
- Netmask: 255.255.255.0
- Gateway: 0.0.0.0
- Camera 4
- Eth3 IP address: 192.168.3.110
- Camera IP address: 192.168.3.102
- Netmask: 255.255.255.0
- Gateway: 0.0.0.0
Next, to ensure that the persistent IP flag is setup correctly in the system configuration. It may be necessary to re-toggle the persistent IP flag after setting an IP on each device.
After you have set Persistent IP, update the following node on each camera:
Arena::SetNodeValue<bool>( pDevice->GetNodeMap(), "GevPersistentARPConflictDetectionEnable", false);
This is because when the camera notices a network connection is available again (even if the camera didn’t lose power, e.x. it’s powered externally), the standard GigE Vision behavior is for the camera to send three ARP probes to the OS to confirm its defined persistent IP isn’t already taken.
General Conditions for Configuring Multi-NIC Systems:
Condition A) Caution with automatic IP assignment (DHCP or link-local addressing)
Many operating systems automatically acquire TCP/IP settings via DHCP or assign link-local IP addresses (e.g., 169.254.x.x) when no DHCP server is available. Be sure to understand the DHCP server’s settings on your network and the IP address ranges and subnets it employs. You need to know if your adapters use DHCP. Whenever possible, manually configuring IP settings for each NIC is the best approach, but in some cases, DHCP may be necessary.
Condition B) Avoid multiple NICs on the same subnet
Using multiple NICs on the same subnet is a common cause of connectivity problems in multi-NIC systems. While some operating systems can handle this gracefully, others may incorrectly route packets. To mitigate this problem, assign different NICs to distinct subnets. For instance, you can use one subnet for wired and another for wireless connections. It’s best to use designated private IP address ranges to prevent conflicts with public servers.
Condition C) Limit default gateways to one NIC
When an IP address falls outside any NIC’s subnet, a default gateway is used to route packets to external networks. Assigning multiple default gateways can lead to incorrect routing and undeliverable packets. Generally, only one NIC should have a default gateway specified, typically the one connected to the internet or to a corporate network. Leave default gateway entries empty for other interfaces. In cases where gateways connect to different interfaces, you may need to manually configure network routes or leave default gateways blank if supported by your network gateways.
Ethernet Networking Concepts
MAC addressing
Each port on an Ethernet adapter is assigned a unique Medium Access Control (MAC) address. MAC addresses consist of 48 bits, often expressed as pairs of hexadecimal digits (e.g., 01:23:45:67:89:ab). MAC addresses are either printed on the device or accessible through operating system networking settings. When data is sent between computers, it’s transmitted in packets that contain the MAC address of the recipient’s interface. Each interface continuously listens for packets addressed to its unique MAC.
Internet layer addressing (IPv4)
While MAC addresses serve as local identifiers, a different addressing scheme is required for global communication. Internet Protocol (IP) addresses are assigned to MAC addresses, typically using 32-bit values expressed as four groups of three-digit decimal values (e.g., 192.168.100.100). IP addresses are user-configurable and can be organized to facilitate efficient routing to reduce data collisions. Private IP address ranges, like 10.x.x.x, 192.168.x.x, or 172.x.x.x, are designated for local network use, ensuring there are no conflicts with public servers.
Subnet masks
Subnet masks, consisting of 32 bits like IP addresses, play a pivotal role in determining if an IP address falls within a local network or requires access to an external network. A binary 1 in the subnet mask position means that a difference in the corresponding IP bit mandates routing to an external network, while a binary 0 means no routing is necessary if all other bits match.
Gateways and default gateways
Routers, often referred to as network gateways, mediate the transfer of Ethernet packets between local and external networks. For each Ethernet adapter, users specify an IP address, subnet mask, and a default gateway, which is the router’s address used for packets outside the local network.
ARP Requests
Ethernet communication relies on knowing the MAC address of the destination. Address Resolution Protocol (ARP) requests are broadcast messages used to obtain MAC addresses for specific IP addresses. Devices on the network respond with their MAC address if their IP matches the request, and this information is cached to streamline future communication. Routers can also respond to ARP requests, facilitating “proxy ARP.”
Ethernet packet transfer
An Ethernet packet’s journey from source to destination involves several steps, including IP address analysis, subnet matching, ARP requests, and, if necessary, gateway selection. These processes ensure that the packet reaches the correct destination.