Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Example: Configuring a Multicast Flow Map


This example shows how to configure a flow map to prevent certain forwarding cache entries from aging out, thus allowing for faster failover from one source to another. Flow maps enable you to configure bandwidth variables and multicast forwarding cache timeout values for entries defined by the flow map policy.


Before you begin:

  • Configure the router interfaces.

  • Configure an interior gateway protocol. See the Junos OS Routing Protocols Library.

  • Configure a multicast protocol. This feature works with the following multicast protocols:

    • DVMRP

    • PIM-DM

    • PIM-SM

    • PIM-SSM


Flow maps are typically used for fast multicast source failover when there are multiple sources for the same group. For example, when one video source is actively sending the traffic, the forwarding states for other video sources are timed out after a few minutes. Later, when a new source starts sending the traffic again, it takes time to install a new forwarding state for the new source if the forwarding state is not already there. This switchover delay is worsened when there are many video streams. Using flow maps with longer timeout values or permanent cache entries helps reduce this switchover delay.


The permanent forwarding state must exist on all routing devices in the path for fast source switchover to function properly.

This example includes the following statements:

  • bandwidth—Specifies the bandwidth for each flow that is defined by a flow map to ensure that an interface is not oversubscribed for multicast traffic. If adding one more flow would cause overall bandwidth to exceed the allowed bandwidth for the interface, the request is rejected. A rejected request means that traffic might not be delivered out of some or all of the expected outgoing interfaces. You can define the bandwidth associated with multicast flows that match a flow map by specifying a bandwidth in bits per second or by specifying that the bandwidth is measured and adaptively modified.

    When you use the adaptive option, the bandwidth adjusts based on measurements made at 5-second intervals. The flow uses the maximum bandwidth value from the last 12 measured values (1 minute).

    When you configure a bandwidth value with the adaptive option, the bandwidth value acts as the starting bandwidth for the flow. The bandwidth then changes based on subsequent measured bandwidth values. If you do not specify a bandwidth value with the adaptive option, the starting bandwidth defaults to 2 megabits per second (Mbps).

    For example, the bandwidth 2m adaptive statement is equivalent to the bandwidth adaptive statement because they both use the same starting bandwidth (2 Mbps, the default). If the actual flow bandwidth is 4 Mbps, the measured flow bandwidth changes to 4 Mbps after reaching the first measuring point (5 seconds). However, if the actual flow bandwidth rate is 1 Mbps, the measured flow bandwidth remains at 2 Mbps for the first 12 measurement cycles (1 minute) and then changes to the measured 1 Mbps value.

  • flow-map—Defines a flow map that controls the forwarding cache timeout of specified source and group addresses, controls the bandwidth for each flow, and specifies redundant sources. If a flow can match multiple flow maps, the first flow map applies.

  • forwarding-cache—Enables you to configure the forwarding cache properties of entries defined by a flow map. You can specify a timeout of never to make the forwarding entries permanent, or you can specify a timeout in the range from 1 through 720 minutes. If you set the value to never, you can specify the non-discard-entry-only option to make an exception for entries that are in the pruned state. In other words, the never non-discard-entry-only statement allows entries in the pruned state to time out, while entries in the forwarding state never time out.

  • policy—Specifies source and group addresses to which the flow map applies.

  • redundant-sources—Specify redundant (backup) sources for flows identified by a flow map. Outbound interfaces that are admitted for one of the forwarding entries are automatically admitted for any other entries identified by the redundant source configuration. in the example that follows, the two forwarding entries, ( and (,) match the flow map defined for flowMap1. If an outbound interface is admitted for entry (, it is also automatically admitted for entry ( so one source or the other can send traffic at any time.


CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the [edit] hierarchy level, and then enter commit from configuration mode.

Step-by-Step Procedure

Multicast flow maps enable you to manage a subset of multicast forwarding table entries. For example, you can specify that certain forwarding cache entries be permanent or have a different timeout value from other multicast flows that are not associated with the flow map policy.

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure a flow map:

  1. Configure the flow map policy. This step creates a flow map policy called policyForFlow1. The policy statement matches the source address using the source-address-filter statement, and matches the group address using the prefix-list-filter. The addresses must match the configured policy for flow mapping to occur.

  2. Define a flow map, flowMap1, that references the flow map policy, policyForFlow1, we just created.

  3. Configure permanent forwarding entries (that is, entries that never time out), and enable entries in the pruned state to time out.

  4. Configure the flow map bandwidth to be adaptive with a default starting bandwidth of 2 Mbps.

  5. Specify backup sources.

  6. Commit the configuration.


Confirm your configuration by entering the show policy-options and show routing-options commands.


To verify the configuration, run the following commands: