Pages

4/02/2013

Juniper EX simple multicast router (PIM & IGMPv2)

In next few lines I will show you how to set Juniper EX4200 switch with Junos version 12.2 to act as PIM dense-mode router. Dense mode is configured because it is simpler to configure as sparse-mode.

Background

I am currently testing some L2 access switches for 3play services. Some of feature I test is a multicast service handling by switch. Especially IGMP snooping. Because of that, I need IGMP querier - a device that listens and sends IGMP packets. Simple running VLC server will not automatically listens and respond to IGMP packets from client so DUT switch will not hear and investigate IGMP snooping packets exept these from receivers (and that is not enough). You should have two-way communication to get IGMP snooping operational. I use BackTrack 5 or Ubuntu with VLC as video stream server/source and receivers. I use tagged interfaces on both devices EX 4200 ge-0/0/0, ge-0/0/1 and also on multicast stream server. DUT could be any manageable L2 switch with IGMP snooping (with or without IGMP proxy). IGMP snooping feature: http://en.wikipedia.org/wiki/IGMP_snooping. I am not going to provide IGMP snooping test here, but shortly, this feature helps reduce multicast traffic on LAN segment (VLAN), so that multicast stream is received only on interface/port/MC stream receiver that wants it, not on all ports. Switch with this feature listens to IGMP (Query, Report, Leave) packets and behave according it. Try read this http://www.juniper.net/techpubs/en_US/junos9.4/topics/concept/igmp-snooping-ex-series-overview.html or this http://www.cisco.com/en/US/docs/switches/datacenter/nexus5000/sw/configuration/guide/cli_rel_4_0_1a/IGMPSnooping.html. There is also other technology for cope somehow with multicast streams - MVR, IGMP Proxy, IGMP querier configured on switch.

Topology
Topology

Setting up a multicast stream server

All commands are run under root. You don't have to run vlc under root on Ubuntu.

(optional) install VLC
apt-get install vlc
 
(Backtrack 5) allow run VLC under root
http://www.backtrack-linux.org/forums/showthread.php?t=44590 - change file /usr/bin/vlc ... 'u should open it with an hex editor and find in file for "geteuid._libc_start_main" without quotes! when u find it change it to "getppid._libc_start_main" without quotes!'


Next five lines is a setup of vlan tagged interface on interface eth0.
Add IP address, change routing
apt-get install vconfig
modprobe 8021q
vconfig add eth0 130
ifconfig eth0.130 130.0.0.10/24
route add 224.0.0.0/4 via 130.0.0.1 dev eth0.130

run VLC stream server video
cvlc /root/Videos/MPEG-2.mpg --sout '#udp{mux=ts,dst=238.1.1.30:1234}' --ttl=4 --repeat

Juniper EX4200 configuration

## Last commit: 2013-03-28 09:55:20 UTC by root
version 12.2R2.5;
interfaces {
    ge-0/0/0 {
        unit 0 {
            family ethernet-switching {
                port-mode trunk;
                vlan {
                    members [ 30 ];


                }
            }
        }
    }
    ge-0/0/1 {
        unit 0 {
            family ethernet-switching {
                port-mode trunk;
                vlan {
                    members [ 130 ];
                }
            }
        }
    }
    vlan {
        mtu 9216;
        unit 30 {
            family inet {
                mtu 1500;
                address 30.0.0.1/24;
            }
        }
        unit 130 {
            family inet {
                mtu 1500;
                address 130.0.0.1/24;
            }
        }
    }
}
protocols {

# you don't have to set igmp when pim is enabled on interface. This will automatically enable IGMPv2. 
    igmp {
        interface vlan.30;
        interface vlan.130;
    }
    pim {
        interface vlan.30 {
            mode dense;
        }
        interface vlan.130 {
            mode dense;
        }
    }
    igmp-snooping {
        vlan all {
            version 2;
        }
    }
}
vlans {
    v130 {
        vlan-id 130;
        l3-interface vlan.130;
    v30 {
        vlan-id 30;
        l3-interface vlan.30;
    }
}



Setting up a DUT switch

Sorry, you should have to set it by yourself. You only have to set one uplink - tagged port with vlan 30 and one downlink client port - untagged port with vlan 30 (port vlan id 30, untagged frames will be tagged to vlan 30. And also you could also set up IGMP snooping on vlan 30 with router port (uplink port) to test it.

Setting up a multicast receiver

Forcing IGMP version 2 on a receiver. Default version today is IGMPv3.
echo "2" > /proc/sys/net/ipv4/conf/eth0/force_igmp_version

Add ip address on untagged port on receiver connected to DUT switch, vlan 30:
ifconfig eth0 30.0.0.123/24
route add 224.0.0.0/4 via 30.0.0.1 dev eth0
apt-get install vlc

Run VLC and open stream on a receiver
menu Applicaton -> Sound & Video -> VLC media player
press CTRL+N (File -> Open Network Stream)
select protocol: UDP
set multicast address: udp://@238.1.1.30:1234

You should be able to ping Juniper from stream receiver. Run ping 30.0.0.1. They are L2-connected with vlan 30. And you also should be able to see your video.


A simple troubleshooting guide

  • Check cabling
  • observe blinking LEDs on switches and NICs
  • try to connect receiver directly to Juniper. Change Juniper config to be untagged interface or add vlan tagged interface to receiver.
  • use tcpdump on receiver and on streamer. Check for vlan tag (tcpdump -ni eth0 -e), destination and source IP and MAC
  • check IGMP snooping on DUT and Juniper
  • check IGMP packets on receiver: tcpdump -ni eth0 igmp
 

No comments:

Post a Comment