How Do You Configure Multicast and IGMP Snooping on a Camera Network?

IGMP snooping, querier and PIM settings for camera multicast streams: Cisco IOS XE examples, why video freezes after a few minutes, and verification commands.
Technical summary
Technology
IGMPv2/v3, IGMP snooping, PIM-SM, SSM, Cisco IOS XE
Topic
Multicast distribution of camera streams
Level
Intermediate–advanced
Prerequisites
  • Knowledge of VLANs and layer 3 routing
  • Experience with the Cisco IOS command line
In this article8 sections

When ten operators watch the same camera in a unicast architecture, the camera sends the same stream ten times. Multicast removes this repetition; but if IGMP snooping and a querier are missing on the switch, a single camera stream floods every port in the VLAN. Below is when multicast is needed on a camera network, setting up snooping and the querier, the need for PIM in an inter-VLAN scenario and the verification order we use on site.

Unicast and multicast: differences for camera streams

With unicast, each client opens a separate RTSP session to the camera or recording server, and a separate stream is sent for each session. Load at the source grows linearly with the number of clients. The camera’s processor is limited; most models also limit the number of simultaneous unicast sessions. The fifth operator can’t connect.

With multicast, the camera sends the stream once to a single group address (for example 239.20.1.15). Clients join this group with an IGMP membership message; the network copies the stream only to member ports. Load at the source is independent of the number of clients. The price is that the network has to track group memberships. On the camera side, multicast usually starts in one of two ways: the client requests multicast transport in the RTSP SETUP request, or the stream is defined as “always multicast” in the camera/VMS settings. In ONVIF profiles, the multicast address, port and TTL are part of the stream configuration.

When multicast is needed, and when it isn’t

Multicast doesn’t suit every camera network. The decision follows this table:

Scenario Recommended approach
A single recording server, few viewing clients Unicast; multicast is unnecessary complexity
The VMS relays live streams through the server Unicast is enough on the camera side; the load is on the server
Control room, many operators watching the same cameras Multicast should be considered
Video wall decoders pull directly from cameras Multicast is suitable
Recording server and client in different VLANs Multicast only with PIM; otherwise unicast
Viewing over WAN or VPN Unicast; multicast is rarely supported over the WAN

The VMS architecture is decisive. Some platforms always relay live viewing through the recording server and support multicast only between server and client; others send the camera’s multicast stream directly to clients. Before writing a single line on the switch, clarify in the VMS documentation which segment multicast is used in. For the role of stream profiles, the main, sub and recording stream profiles article is complementary.

The role of IGMP snooping and the querier

By default, a layer 2 switch treats multicast frames as unknown destinations and floods them to all ports in the VLAN. IGMP snooping lets the switch listen to IGMP Report and Leave messages from clients, learn which port is a member of which group and forward traffic only to those ports. The behavior is based on the snooping approach defined in RFC 4541.

Snooping alone isn’t enough. For memberships to stay alive, a querier that sends periodic IGMP Queries in the VLAN is needed. Clients respond to the Query and renew their memberships, and the switch updates its table. Without a querier, the reports from the initial join work for a while, then membership entries time out. With IGMPv2 default timers, this period (the group membership interval) is 260 seconds. When we hear the complaint “video comes through for a few minutes, then freezes” on site, the first thing we check is the querier. Four minutes and twenty seconds. Some switches then flood the stream back to all ports; behavior varies by vendor.

The querier role is normally taken by the layer 3 device that is the VLAN’s default gateway (a PIM-enabled SVI). In a pure layer 2 camera VLAN, the IGMP snooping querier feature is enabled on one switch. If there are multiple querier candidates in the same VLAN, the one with the lowest IP address is elected.

Switch configuration examples

The example below is Cisco IOS XE (Catalyst) syntax; the camera VLAN is 20, and the management address of the switch that will be the querier is 10.20.0.2. On Catalyst, IGMP snooping is enabled globally by default; writing it explicitly still documents the configuration and makes the next engineer’s job easier.

ip igmp snooping
ip igmp snooping vlan 20
ip igmp snooping querier
ip igmp snooping querier address 10.20.0.2
!
interface Vlan20
 ip address 10.20.0.2 255.255.255.0

On access switches where each port has a single client, such as a video wall decoder or operator station, immediate-leave can be used so the stream stops immediately on a Leave message. If there are multiple receivers behind the port (an intermediate switch, a virtualization host), this feature also cuts the other receivers’ stream. Don’t use it on those ports.

ip igmp snooping vlan 20 immediate-leave

Commands differ with other vendors, but the settings to check are the same: is snooping enabled per VLAN, is a querier defined, what is the behavior for unknown multicast (flood or drop), and are uplink ports learned as mrouter ports or statically defined. The picture is the same in other multicast-heavy environments; the industrial network equivalent is explained in the IGMP snooping in EtherNet/IP networks note.

Inter-VLAN multicast and PIM

If cameras are in the camera VLAN and viewing clients in a separate operator VLAN, multicast has to be routed. For the reasoning behind segmentation, see the why a camera VLAN is needed article; the topic here is carrying multicast between these segments. Multicast routing and PIM are enabled on the layer 3 switch:

ip multicast-routing
ip pim rp-address 10.0.0.1
!
interface Vlan20
 description CAMERA
 ip pim sparse-mode
!
interface Vlan30
 description OPERATOR
 ip pim sparse-mode

On some Catalyst platforms the global command takes the form ip multicast-routing distributed; check the platform documentation. A PIM-enabled SVI becomes the IGMP querier for that VLAN; there’s no need to define a separate snooping querier in the same VLAN.

PIM-SM needs a Rendezvous Point (RP). For camera streams with known source addresses, the alternative is Source-Specific Multicast (SSM): ip pim ssm default reserves the 232.0.0.0/8 range for SSM and removes the need for an RP; however, clients must join with IGMPv3, specifying the source (ip igmp version 3 on the client-side SVI). Don’t move to SSM without testing that the VMS client supports IGMPv3 source-filtered joins.

The setting forgotten in a routed scenario is TTL. Some cameras send multicast with a default TTL of 1; the packet is dropped at the first router. The configuration looks right, but no video arrives. In the camera stream settings, raise the TTL to a value greater than the number of routers to be crossed.

Common mistakes: flooding and a missing querier

  • Snooping without a querier: Video stops after a few minutes or reverts to flooding. Verify there is a querier in every multicast VLAN.
  • Wrong group address range: Only the lower 23 bits of an IPv4 multicast address map to the Ethernet MAC address; 32 different IP groups share the same MAC. Addresses such as 239.0.0.x and 239.128.0.x map to the same MAC as the 224.0.0.x local control block, and many switches send them to all ports without applying snooping. For camera groups, choose a sub-range of the organization-local scoped 239.0.0.0/8 block (RFC 2365) whose third octet isn’t 0 or 128.
  • Assigning the same group to more than one camera: The client receives both cameras’ streams together and the image breaks up. Keep a per-camera group and port plan, and store the table with the IP plan.
  • An intermediate switch without snooping: A single unmanaged switch in the chain floods the stream to every connected device. Use managed switches in the network of corporate camera systems.
  • Wireless or low-speed segments: Flooded multicast saturates narrow links such as a wireless bridge. The bridge drops, and the cause is somewhere else.

Verification commands and test method

After configuration, check the status with these commands (Cisco IOS XE):

show ip igmp snooping querier
show ip igmp snooping groups vlan 20
show ip igmp snooping mrouter vlan 20
show ip igmp groups
show ip mroute 239.20.1.15
show ip pim neighbor

Test order: open the stream on a client and see the client’s port in the group table; close the stream and watch the port drop from the table. On a laptop connected to a non-member port, apply the ip.dst == 239.20.1.15 filter in Wireshark; no traffic should appear. Keep the test running for at least 10 minutes. A querier-related outage doesn’t show up in the first few minutes; a five-minute test misses it. To tie these steps to project acceptance, you can use the scenario structure in the camera project acceptance testing guide.

To assess the place of multicast in control room and video wall design, see the scope of our video wall and security control center and camera VLAN and network segmentation services.

Frequently asked questions

Is enabling IGMP snooping on the camera network enough?

No. Snooping learns memberships, but an IGMP querier that sends periodic queries in the VLAN is needed for memberships to be renewed. Without a querier, memberships time out; video stops after a few minutes or traffic floods all ports.

Does every camera project need multicast?

No. In networks with few viewing clients, or where the VMS relays live streams through the server, unicast is simpler. Multicast is useful in control rooms where many operators or video wall decoders watch the same cameras at once.

Does multicast work if the camera and viewing client are in different VLANs?

It works if multicast routing and PIM are enabled on the layer 3 device. Since source addresses are known, SSM is also an option, but the client must join with IGMPv3. Also check that the camera’s multicast TTL is greater than 1.

What should you watch for when choosing a multicast group address?

Use the organization-local scoped 239.0.0.0/8 block, but stay away from sub-ranges such as 239.0.0.x and 239.128.0.x, which map to the same MAC address as 224.0.0.x and can be flooded without snooping. Assign a separate group to each camera stream.

Support

Contact us for support or a discovery session on this topic.

Contact form
[email protected]

Eretek Video Surveillance

IP cameras, recording and central management infrastructure. We plan blind spots, retention periods and the camera network around the risks of each site.

Knowledge Center

Other articles