The GigE Vision Standard is owned by the Automated Imaging Association(AIA) and was developed by a group of companies from every sector within the machine vision industry with the purpose of establishing a standard that allows camera and software companies to integrate seamlessly on the Gigabit Ethernet bus. It is the first standard that allows images to be transferred at high speeds over long cable lengths.
While Gigabit Ethernet is a standard bus technology, not all cameras with Gigabit Ethernet ports are GigE Vision compliant. In order to be GigE Vision Compliant, the camera must adhere to the protocols laid down by the GigE Vision standard and must be certified by the AIA. If you are unsure whether your camera supports the GigE Vision standard, look for the following logo in the camera documentation.
Figure 3. Official logo for the GigE Vision Standard
The GigE Vision standard defines the behavior of the host as well as the camera. There are four discrete components to this behavior
GigE Vision Device Discovery
When a GigE Vision device is powered on, it attempts to acquire an IP address in the following order:
Persistent IP: If the device has been assigned a persistent IP, it will assume that IP address.
DHCP Server: If no IP address is already assigned to the device, it searches the network for a DHCP server and requests the server to assign the device an IP address.
Link Local Addressing: If the first two methods fail, the device automatically assumes an IP address of the form 169.254.x.x. It then queries the network to check if the IP address is already taken. If it is the only device with that IP address, the device keeps the IP address; otherwise, it picks a new IP address and repeats the process until it finds an IP address that is not already taken.
Since cameras can be added to the network at anytime, the driver must have some way to discover new cameras. To accomplish this, the driver broadcasts a discovery message over the network periodically. Each GigE Vision compliant device responds with its IP address.
The following algorithm describes the device discovery process.
Figure 4. Device discovery flowchart
GigE Vision Control Protocol (GVCP)
GVCP allows applications to configure and control a GigE Vision device. The application sends a command using the UDP protocol and waits for an acknowledgment (ACK) from the device before sending the next command. This ACK scheme ensures data integrity. Using this scheme, the application can get and set various attributes on the GigE Vision device, typically a camera.
The GigE Vision standard defines a minimal set of attributes that GigE Vision devices must support. These attributes, such as image width, height, pixel format, etc., are required to acquire an image from the camera and hence are mandatory. However, a GigE Vision camera can expose attributes beyond the minimal set. These additional attributes must confirm to the GenICam standard.
GenICam provides a unified programming interface for exposing arbitrary attributes in cameras. It uses a computer readable XML datasheet, provided by the camera manufacturer, to enumerate all the attributes. Each attribute is defined by its name, interface type, unit of measurement and behavior.
GenICam compliant XML datasheets eliminate the need for custom camera files for each camera. Instead, the manufacturer can describe all the attributes for the camera in the XML file so that any GigE Vision driver can control the camera. Additionally, the GenICam standard recommends naming conventions for features such as gain, shutter speed, and device model that are common to most cameras.
GigE Vision Stream Protocol (GVSP)
The GigE Vision standard uses UDP packets to stream data from the device to the application. The device includes a GigE Vision header as part of the data packet that identifies the image number, packet number, and the timestamp. The application uses this information to construct the image in user memory.
Figure 5. A GigE Vision Packet
Packet loss and resends
Since image data packets are streamed using the UDP protocol, there is no protocol level handshaking to guarantee packet delivery. Therefore, the GigE Vision standard implements a packet recovery process to ensure that images have no missing data. However, this packet recovery implementation is not required to be GigE Vision compliant. While most cameras will implement packet recovery, some low-end cameras may not implement it.
The GigE Vision header, which is part of the UDP packet, contains the image number, packet number, and timestamp. As packets arrive over the network, the driver transfers the image data within the packet to user memory. When the driver detects that a packet has arrived out of sequence (based on the packet number), it places the packet in kernel mode memory. All subsequent packets are placed in kernel memory until the missing packet arrives. If the missing packet does not arrive within a user-defined time, the driver transmits a resend request for that packet. The driver transfers the packets from kernel memory to user memory when all missing packets have arrived.