Chinaunix首页 | 论坛 | 博客
  • 博客访问: 623239
  • 博文数量: 397
  • 博客积分: 2874
  • 博客等级: 少校
  • 技术积分: 3612
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-24 10:34
文章分类

全部博文(397)

文章存档

2018年(40)

2017年(27)

2016年(3)

2015年(58)

2014年(97)

2013年(54)

2012年(54)

2011年(64)

分类: LINUX

2012-08-03 14:17:09

Multicast Setup and Configuration

http://noc.net.internet2.edu/i2network/multicast-cookbook.html

Multicast Troubleshooting Tools
Router Multicast Command References
Iperf Troubleshooting Commands
  • Start a multicast iperf traffic stream (On computer A):

    iperf -u -c -p -b 1 -i 5 -T 10 -t 1000

  • Capture with rtpqual or iperf (On computer B):

    rtpqual @
    iperf -s -i 1 -u -B -p

Creating a Real Multicast Stream with WebCam
  • Use the following (on linux machine):

    vic /

  • Select type of webcam in vic settings
  • On the client machine use the same command to receive the multicast video

    vic /

  • (vic is the same application used by the AccessGrid)
Using SSMping to Test Multicast

Installing SSMping

  • Grab the latest tarball from here
  • Install it to your local pkgs directory tree, assuming the tarball is located in /local/dl

    mkdir /local/pkgs/ssmping
    cd /local/pkgs/ssmping
    tar -zxf /local/dl/ssmping-0.8.tar.gz
    mv ssmping-0.8 0.8
    ln -s 0.8 std
    cd std
    make

  • Create some symbolic links to the executables, so anyone can run the commands

    ln -s /local/pkgs/ssmping/std/asmping /usr/local/bin/asmping
    ln -s /local/pkgs/ssmping/std/ssmping /usr/local/bin/ssmping
    ln -s /local/pkgs/ssmping/std/ssmpingd /usr/local/bin/ssmpingd

  • Add the following to the iptables file in /etc/sysconfig/iptables
    1. Allow Connections to the SSMping daemon
      -A RH-Firewall-1-INPUT -p udp -m udp -s 155.101.0.0/19 --dport 4321 -j ACCEPT
      -A RH-Firewall-1-INPUT -p udp -m udp -s 155.101.0.0/19 --sport 4321 -j ACCEPT
  • Restart your iptables

    service iptables restart

    Running SSMping
  • In the following example SSMping has been installed on machines megamon and orko
  • First start up the daemon on one machine (in this case megamon.chpc.utah.edu)

    ssmpingd &

  • Next, send an asmping to megamon from orko with a dummy multicast group

    asmping 233.3.3.3 megamon.chpc.utah.edu

  • The output you should expect is the following

    ssmping joined (S,G) = (155.101.3.110,233.3.3.234)
    pinging S from 155.101.16.36
    unicast from 155.101.3.110, seq=1 dist=1 time=1.108 ms
    unicast from 155.101.3.110, seq=2 dist=1 time=0.349 ms
    multicast from 155.101.3.110, seq=2 dist=1 time=0.800 ms
    unicast from 155.101.3.110, seq=3 dist=1 time=0.280 ms
    multicast from 155.101.3.110, seq=3 dist=1 time=0.430 ms

Installing the Beacon Software on Redhat/Fedora Linux
  • First download the tarball (version 1.3) from here
  • Create the proper directory tree

    mkdir /local/src/beacon
    mkdir -p /local/pkgs/beacon/1.3

  • Unpack the tarball (assuming it's in /local/dl)

    cd /local/src/beacon
    tar -zxf /local/dl/beacon-1.3.tar.gz
    mv beacon-1.3 1.3

  • Install the perl module Time::HiRes

    perl -MCPAN -e shell

  • At the cpan> prompt type

    install Time::HiRes

  • After the install, quit cpan

    quit

  • Create a user for the beacon process to use (other linux distro may require more - adding the group, etc)

    adduser beacon

  • Edit the main beacon configuration file in
    • Add/Change the following in /local/src/beacon/1.3/src/beacon.conf

      CONTACTNAME =
      CONTACTINFO = @chpc.utah.edu
      CONTACTLOCATION = University of Utah

RUNASUSER = beacon

RUNASGROUP = beacon

#STOPME = 1

  • Configure and make the package

    cd /local/src/beacon/1.3
    ./configure --prefix=/local/pkgs/beacon/1.3
    make
    make install

  • Edit the beacon executable to include the proper location of the beacon perl module
    • Add the following to /local/pkgs/beacon/1.3/bin/beacon (in amongst similar "use lib" lines)
    • Keep in mind that this is an example (look in the /local/pkgs/beacon/1.3/lib directory for similar perl path to use)

      use lib "/local/pkgs/beacon/1.3/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi";

  • Create a directory in /home/beacon for the process to use (otherwise PID file creation will fail)

    mkdir /home/beacon/outputfiles
    chown beacon.beacon /home/beacon/outputfiles

  • Create a symbolic link for beacon

    ln -s /local/pkgs/beacon/1.3/bin/beacon /usr/local/bin/beacon

  • Edit the /etc/hosts file to include an entry for your correct hostname
    • Something like the following

      127.0.0.1 localhost localhost.localdomain
      155.101.3.109 megatron megatron.chpc.utah.edu

  • Edit your iptables to something similar as below
    1. Allow Mulicast Beacon to talk
      -A RH-Firewall-1-INPUT -p udp -m udp -s 0/0 -d 0/0 --dport 10002 -j ACCEPT
      -A RH-Firewall-1-INPUT -p udp -m udp -s 0/0 -d 0/0 --dport 10003 -j ACCEPT
      -A RH-Firewall-1-INPUT -p tcp -m tcp -s 0/0 -d 0/0 --dport 10004 --syn -j ACCEPT
  • Restart your iptables

    service iptables restart

  • Before starting, make sure you have a valid hostname that will resolve (also add to your /etc/hosts file)
  • Test out the software by firing off the executable

    beacon &

  • Go to the listed webpage (http://jhereg.ncsa.uiuc.edu) to verify that you're talking to the main server
  • Create a startup script for beacon
    • Uncomment the background line in /local/pkgs/beacon/1.3/etc/beacon.conf
      1. Move the Beacon process to background processing automatically at startup?
        BACKGROUND = 1
  • Create a script file named beacon in /etc/rc.d/init.d/ that includes the following

    #!/bin/sh
    #

    1. Start/stop/restart the multicast beacons
    2. Assume backgrounding has been enabled in configuration file
    3. chkconfig: 345 90 10
    4. description: Beacon Multicast daemon

BEACON_HOME=/home/beacon/outputfiles

beacon_start() {
cd $

Unknown macro: {BEACON_HOME}

&& /local/pkgs/beacon/1.3/bin/beacon
}

beacon_stop() {
cd $

Unknown macro: {BEACON_HOME}

&& kill -HUP `cat multicastbeacon.PID`
}

beacon_restart()

Unknown macro: { beacon_stop sleep 1 beacon_start }

case "$1" in
'start')
beacon_start
;;
'stop')
beacon_stop
;;
'restart')
beacon_restart
;;
*)
echo "usage $0 start|stop|restart"
esac

  • Make the file world executable

    chmod a+x /etc/rc.d/init.d/beacon

  • Add beacon to the chkconfig list

    chkconfig --level 345 beacon on

  • Kill any existing beacon processes if necessary

    ps -eaf |grep beacon
    kill

  • Then fire up beacon with the script

    service beacon start

参考:

阅读(5214) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
请登录后评论。

登录 注册