Network Performance¶
In order to get optimal performance from Ethernet cameras while doing CPU intensive tasks you should optimize your network settings. Default settings of many network interface cards will cause high jitter in image transfer times and maybe even frame loss when the processor is under load.
Background¶
On some computers you might observe high packet loss counts when doing CPU intensive work (e.g. ComputeDisparityMap) during image transfer. This causes significant jitter in transfer times due to the latency for resending packets and can eventually also lead to missing entire frames at rather low frame rates.
Solutions¶
The root cause is that the operating system’s network stack cannot fetch data from the network card quick enough to get all data from the network card while the camera is streaming image data to the PC. The network card will then drop some packets and the camera driver needs to re-request the missing data packets from the camera after a short timeout period.
Update Your Network Card Drivers¶
Check if the drivers for your network card are up to date and update them if necessary. You can usually download the newest drivers from the card manufacturer’s website.
Setting Network Card Properties¶
Make sure that the network card’s settings for receive buffer size and MTU are as high as possible.
Receive Buffer Size¶
On Windows you can open the Device Manager and open the properties dialog of your network card. Select the Advanced tab and find the entry for the receive buffers and set them as high as possible.
On Debian/Ubuntu Linux (assuming your network interface to the camera is eth0
) you might be able to query receive buffers using:
ethtool -g eth0
To increase buffers to 2048 then simply run:
ethtool -G eth0 rx 2048
Maximum Transmission Unit (MTU)¶
GigE Vision based cameras can use Jumbo Frames when all participating network hardware supports it. This means that the image data gets split up into less network packets, leading to a more reliable image transfer.
If you have any additional network devices between the camera and your network adapter, you should make sure that Jumbo Frames are enabled on all of them. NxView will also show a warning when the camera cannot use high packet sizes.
On Windows you can open the Device Manager and open the properties dialog of your network card. Select the Advanced tab and find the entry for the MTU or Maximum Transmission Unit and set it as large as possible. The MTU setting is also sometimes listed as Jumbo Frames. Either enable Jumbo Frames or set their frame size as large as possible.
On Debian/Ubuntu Linux (assuming your network interface to the camera is eth0
) you can change the MTU parameter using the command:
ip link set eth0 MTU 9000
Beware that the MTU setting is not persistent across reboots and you need to set it in /etc/network/interfaces
or the corresponding location for your distribution to make the setting persistent.
Note
Not all network adapters support setting the receive buffer or MTU parameters. This can usually only be done on integrated or PCIe cards which have DMA access to the main memory. Unfortunately we cannot give precise advice how to set the necessary parameters because the available settings and parameter names differ between vendors and even driver versions for the same product. Please contact your network card manufacturer in order to find out how to set receive buffer sizes on your system.
Disable Energy Saving Settings¶
Some network adapters and switches enable Energy Efficient Ethernet (EEE) by default. While this might result in power savings, EEE can add latency and cause packet loss. It is therefore recommended to disable EEE on all adapters and switches for maximum performance and stability.
You should also check that any other energy saving settings are disabled for the network card.
On Windows you can find this in the tab Power Management of the network adapter properties.
On Debian/Ubuntu Linux you can have a look at the /sys/devices/.../power/control
files. See the kernel documentation for more information.
Lowering Packet Rate From the Camera¶
If you cannot resolve the problem via network card configuration you can try to specify a bandwidth limit or decrease the camera’s pixel clock to lower the packet sending rate. This will decrease the likelihood that the network card buffers overflow when the operating system’s response times to network traffic increase due to high CPU load.
Note
Lowering the pixel clock will cause slightly higher black level noise in the images as a side effect.