Multicast server and client for UNetLab

I am giving myself a little rest before returning to my CCIE Security attempt(s). This gives me time to finish off something I started some time ago; the fourth volume in the CCIE Routing and Switching, “Multicast and QoS for Cisco Networks”.

The challenge of an interesting Multicast book

Multicast is not my favorite topic, neither is QoS. When I sat in Narbik’s Bootcamp, pretty much everyone said that both were their weak areas, mine included. The reason that these two topics are generally weaker areas, is not because they are the hardest topics to grasp, but because the examples used in the books are less than stimulating.

We enable PIM, we join a group, we run a few commands to check it’s working. This is fine for the majority of the other topics, in general, if the route is in the routing table then we are happy.

It’s not so interesting for multicast, though. I wanted something that is visually stimulating.

So therein lied the challenge.

How to make a proper Multicast network in UNetLab

Originally, I pinned my hopes on using a pre-built SuSe Linux VM, but abandoned this, as getting VLC to run on it was troublesome and turned to one pre-rolled by OSBoxes.org. I installed VLC and all the requirements on it and tested it within VirtualBox, using a video file downloaded from Archive.org. The VM was then exported it from VirtualBox as a zip file and copied it to my UNetLab server – into a folder called “linux-multicast”:

Setup

We start by extracting the VDI file and converting it:

root@unl01:~# cd /opt/unetlab/addons/qemu/linux-multicast/
root@unl01:/opt/unetlab/addons/qemu/linux-multicast# ls
multicast.zip
root@unl01:/opt/unetlab/addons/qemu/linux-multicast# unzip multicast.zip 
Archive:  multicast.zip
  inflating: multicast.vdi
root@unl01:/opt/unetlab/addons/qemu/linux-multicast# ls
multicast.vdi  multicast.zip
root@unl01:/opt/unetlab/addons/qemu/linux-multicast# /opt/qemu/bin/qemu-img convert -f vdi -O qcow multicast.vdi hda.qcow2

Now a little bit of tidying up, and making sure the permissions are set correctly:

root@unl01:/opt/unetlab/addons/qemu/linux-multicast# rm -f multicast.zip
root@unl01:/opt/unetlab/addons/qemu/linux-multicast# rm -f multicast.vdi 
root@unl01:/opt/unetlab/addons/qemu/linux-multicast# /opt/unetlab/wrappers/unl_wrapper -a fixpermissions

Testing Multicast in UNetLab

I already had a network set up, so I just added the new VMs and set up VLC.

Here is the network:

Multicast Topology

We have a multicast server at one end and a client at the other.

VLC streaming configuration

Setting up VLC to stream, I used these steps:

Start up VLC by clicking on the Ubuntu icon, typing in “VLC” and clicking the icon when it appears:

VLC

Click on “Stream” from the menu.

vlc-2

Click on “Add…” to select the file for streaming:

vlc-3

Select the file. I chose to include a Lego Star Wars film, because, you know, Star Wars and Lego!

vlc-4

Click on Stream:

vlc-5

Click Next:

vlc-6

We want to stream it as RTP/MPEG, so select that option and click “Add”:

vlc-7

I am using the address 239.1.1.1, with a port of 5004 and a stream name of “Lego-StarWars”. Click Next:

vlc-8

Enable Active Transcoding, under the options (the screwdriver wrench icon), I selected MPEG4 and a video bitrate of 4000K and saved the options. Select “Next”:

vlc-9

I selected to “Stream all elementary streams”:

vlc-10 vlc-11

The next bit is VERY important. You MUST add a TTL value. VLC streams with a TTL of 1, so you need to increase it to match the network hops. In my network, there are 6 hops between the server and the client, but I could have made the TTL 100 to be on the safe side. Add “,ttl=XXX” before the final curly brace as below: vlc-12

Then you can press “Stream”.

To connect the source, open VLC, select “Open Network Stream” from the Media menu:

vlc-open-stream-1

Enter the address and click “Play”:

vlc-open-stream-2

After a few moments, the stream should start playing on the client!

sw-introsw-3posw-dv sw-droidssw-hanVideo streaming proof

This is all well and good, but how do we know that it is, in fact, the network carrying the stream? Well, check out this video, where I use the commands “no ip pim dense” and “ip pim dense” to turn off and on PIM dense mode on the ISP-2 router. As you can see, the stream stops, and resumes once we rejoin our PIM neighbor:

I know the video quality is not great, the cropping left a little to be desired and having one of my kids walk into the room meant I removed the audio track, but that’s just me talking, as there will not be any sounds coming from the UNetLab VMs anyway.

This means it’s game-on for the book now. Not sure how long it will take, but I am feeling motivated for it again, now that we can make it a little more visually captivating.

I will make the VM available in due course.

3 Comments

  1. Patrick Denis April 7, 2017
  2. Patrick Denis April 8, 2017
  3. Andrey November 22, 2017

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.