<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>davidrickard.net &#187; Networking</title>
	<atom:link href="http://www.davidrickard.net/category/computers/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidrickard.net</link>
	<description>Random stuff, randomly updated.</description>
	<lastBuildDate>Fri, 23 Dec 2011 18:54:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Don&#8217;t touch that dial!</title>
		<link>http://www.davidrickard.net/2010/06/18/dont-touch-that-dial/</link>
		<comments>http://www.davidrickard.net/2010/06/18/dont-touch-that-dial/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 22:18:36 +0000</pubDate>
		<dc:creator>David Rickard</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[TV]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.davidrickard.net/2010/06/18/dont-touch-that-dial/</guid>
		<description><![CDATA[VideoLan (or VLC as it is otherwise known) is a great piece of software. It’s capable of playing a plethora of video and audio file types. It’s also capable of converting files, streaming files over the network, and viewing live TV via any TV cards you might have. Because of the way it works, it’s [...]]]></description>
			<content:encoded><![CDATA[<p>VideoLan (or VLC as it is otherwise known) is a great piece of software. It’s capable of playing a plethora of video and audio file types. It’s also capable of converting files, streaming files over the network, and viewing live TV via any TV cards you might have.</p>
<p>Because of the way it works, it’s possible to take any input, and spit it out in any way pretty much. Some time ago I’d seen a discussion on a mailing list about using VLC and a digital TV card to broadcast live TV over the network (using multicast). I’d had a quick play, but never got it working. A discussion popped up on the Multiplay forums, so I thought I’d try and get it working again. Last night I was successful, so I thought I’d blog it up in case it’s useful for others. VLC is documented, but the documentation is a bit hit and miss in places – always the problem for many Open Source projects.</p>
<p>Read more after the jump.</p>
<p><span id="more-586"></span></p>
<h3>Background</h3>
<p>Digital TV, using either satellite (DVB-S) or terrestrial (DVB-T) is fundamentally the same – MPEG2 Transport Streams, which are multiplexed into one stream, then broadcast on a single frequency. The tuner will tune to the frequency, then pick the stream it wants, and play it on screen.</p>
<p>The idea behind what we’re doing here is to take that multiplex, and pick out the streams we want, then just multicast them as is onto the network. Using the SAP protocol, it’s possible to announce them in a nice neat way so clients can pick them up easily.</p>
<p>Because it’s already MPEG2, no re-encoding is really needed. I suppose you could do that, but I’ve not tried. This method uses hardly any CPU time, as it’s just pulling data in, patting it about a bit, and throwing it out the other side. In the original mailing list postings I read, the author was using some old Pentium 4 PCs with hardly any RAM. They were capable of tuning multiple channels with ease.</p>
<p>One caveat of this is that the tuner can only lock onto one frequency, so one multiplex is all you can play with; on Terrestrial (i.e. Freeview), the BBC multiplex contains all the BBC channels. If you wanted to multicast BBC and ITV channels for example, you’d need to add a second tuner and tune to the ITV multiplex.</p>
<p>In my investigations, I had the following setup:</p>
<table border="0" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td width="200" valign="top"><strong>Server</strong></td>
<td width="200" valign="top"><strong>Client PC</strong></td>
</tr>
<tr>
<td width="200" valign="top">Windows 7<br />
Hauppauge WinTV HVR-1300 Terrestrial Digital card<br />
VLC 1.0.5</td>
<td width="200" valign="top">Mac OSX 10.6<br />
VLC 1.0.5</td>
</tr>
</tbody>
</table>
<p>Both are connected over a Gigabit network. However, the video streams are quite small (5-6Mb/s). Even 10Mb network could cope with that, although not many concurrently!</p>
<h3>The server end</h3>
<p>First of all, here’s the full command to kick start VLC on the Server.</p>
<pre>vlc dvb-t://frequency=578000000 :adapter=0:dvb-bandwidth=8 --programs=4171,4235
--sout #duplicate{dst=std{access=udp,mux=ts,dst=239.255.255.239,sap,name="BBC One",
group="BBC"},select="program=4171",dst=std{access=udp,mux=ts,dst=239.255.255.238,
sap,name="BBC Two",group="BBC"},select="program=4235"</pre>
<p>That’s all on one line, I had to break it up a bit!</p>
<p>So an explanation of it. Basically it runs VLC, tunes the frequency, using a selected adapter and channel bandwidth. It then selects the two programs I want (BBC One and Two), then outputs them via UDP on two different multicast addresses, using SAP to announce it.</p>
<p>First of all, I’d recommend running VLC up manually. Go to <strong>Media</strong> &gt;<strong>Open Capture Device</strong>. Change the capture mode to <strong>DVB Directshow</strong>. Select the video format you’re using (I’m using DVB-T). Then dial in the frequency of the multiplex you want. Select <strong>8Mhz</strong> for the bandwidth. You can find out the multiplex frequency using <a href="http://www.ukfree.tv/" target="_blank">UKfree.tv</a>.</p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="Opening the TV card" src="http://www.davidrickard.net/wordpress/wp-content/uploads/2010/06/OpenCard.png" border="0" alt="Opening the TV card" width="548" height="545" /></p>
<p>Click Play, and it should open.</p>
<p><a href="http://www.davidrickard.net/wordpress/wp-content/uploads/2010/06/VideoWorking.png"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="Testing the video works" src="http://www.davidrickard.net/wordpress/wp-content/uploads/2010/06/VideoWorking_thumb.png" border="0" alt="Testing the video works" width="644" height="361" /></a></p>
<p>If it doesn’t you might need to select your video adapter explicitly. I have two in my PC. The DVB-T card is adapter 0, whilst my DVB-S card is adapter 1. Click <strong>Media</strong> &gt; <strong>Open Capture Device</strong> again , then tick<strong> Show more options</strong> and enter “<strong>:adapter=0</strong>” into the options box. In the previous screenshot I have highlighted this. Change the number until it works.</p>
<p>Once you are able to see the video, go to <strong>Tools</strong> &gt; <strong>Messages</strong>. Change the Verbosity to <strong>2</strong>. Stop and start VLC and watch the log fill up. There’s too much to try and work with it in the window, so click <strong>Save as…</strong>. Open the file you have saved, and look for a section similar to the following:</p>
<pre>ts debug: new SDT ts_id=4107 version=3 current_next=1 network_id=9018
ts debug:   * service id=4171 eit schedule=1 present=1 running=4 free_ca=0
ts debug:     - type=1 provider=BBC name=BBC ONE
main debug: EsOutProgramMeta: number=4171
ts debug:   * service id=4235 eit schedule=1 present=1 running=4 free_ca=0
ts debug:     - type=1 provider=BBC name=BBC TWO
main debug: EsOutProgramMeta: number=4235
ts debug:   * service id=4415 eit schedule=1 present=1 running=4 free_ca=0
ts debug:     - type=1 provider=BBC name=BBC NEWS
main debug: EsOutProgramMeta: number=4415
ts debug:   * service id=4479 eit schedule=0 present=1 running=4 free_ca=0
ts debug:     - type=1 provider=BBC name=BBC Red Button
main debug: EsOutProgramMeta: number=4479
ts debug:   * service id=4671 eit schedule=1 present=1 running=4 free_ca=0
ts debug:     - type=1 provider=BBC name=CBBC Channel
main debug: EsOutProgramMeta: number=4671
ts debug:   * service id=4351 eit schedule=1 present=1 running=4 free_ca=0
ts debug:     - type=1 provider=BBC name=BBC THREE
main debug: EsOutProgramMeta: number=4351</pre>
<p>Notice all the Service IDs. As you can probably tell, each of these represents a TV channel within the multiplex. You need to note down the ones you want to multicast. In this case I want BBC One (4171) and BBC Two (4235).</p>
<p>The next part of the command selects those programs and outputs them:</p>
<pre>--programs=4171,4235 --sout</pre>
<p>The next part is to make up the multicast. As the video is already in MPEG2 we don’t need to go re-encoding it, so it’s simply a case of spitting it out.</p>
<p>I’ll be honest, I’m not sure what this next section does – I <em>think</em> it is basically saying take the input and duplicate it to output elsewhere (i.e. other than on screen).</p>
<pre>#duplicate{</pre>
<p>We are going to broadcast on a multicast address (anything in the range 224.0.0.0 to 239.255.255.255). You need to choose your addresses. On a large network with multicast enabled, these could be in use, so it’s worth checking first. If you know you don’t have any multicast I think it’s fairly safe to pick a random address. I chose 239.255.255.255.239 and went down from there!</p>
<p>This next line is where we select UDP, make it a Transport Stream, select the target IP, and advertise it with SAP. The channel name, and group name are set here too:</p>
<pre>dst=std{access=udp,mux=ts,dst=239.255.255.239,sap, \
name="BBC One",group="BBC"},select="program=4171",</pre>
<p>Repeat for BBC Two. Use a different multicast address though!</p>
<pre>dst=std{access=udp,mux=ts,dst=239.255.255.238,sap, \
name="BBC Two",group="BBC"},select="program=4235"</pre>
<p>Now we have a full command, it’s a case of running it. I used a command prompt and ran VLC from there, but you could of course put it into a shortcut, batch file, registry run key, or whatever.</p>
<p><a href="http://www.davidrickard.net/wordpress/wp-content/uploads/2010/06/Multicasting.png"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border: 0px;" title="Multicasting" src="http://www.davidrickard.net/wordpress/wp-content/uploads/2010/06/Multicasting_thumb.png" border="0" alt="Multicasting" width="644" height="444" /></a> Once it’s running, a very simple, hacky way of checking it is working is to look at your network switch. If it’s flashing away merrily on all ports, then it’s doing <em>something</em>!</p>
<h3>The clients</h3>
<p>Run VLC on another PC, Go into <strong>Preferences</strong> &gt; <strong>Playlist</strong> &gt; <strong>Services Discovery</strong> and tick <strong>SAP</strong>. You might need to re-start VLC. Go to the playlists, and you should see a group with the name you made, and your channels. Click one, it plays!</p>
<p><a href="http://www.davidrickard.net/wordpress/wp-content/uploads/2010/06/Screenshot20100618at23.14.41.png"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border: 0px;" title="Screen shot 2010-06-18 at 23.14.41" src="http://www.davidrickard.net/wordpress/wp-content/uploads/2010/06/Screenshot20100618at23.14.41_thumb.png" border="0" alt="Screen shot 2010-06-18 at 23.14.41" width="644" height="394" /></a> As you can see, I’m doing this on my Mac, so it’s truly cross platform!</p>
<p>I did find in testing that it caused an effective DoS on my Wireless. I&#8217;m guessing the multicast was too fast for the slowest wireless device associated to the AP, and just wiped the lot out or something. Wired carried on working fine though. Something to bear in mind anyway!</p>
<p>I’m sure it’s possible to refine this a little more. The original version of this I saw had VLC daemonizing itself, which I’m not entirely sure is possible in Windows. Still, it’s a great way to get video served up over the network.</p>
<p>Oh, and remember, you still need a TV licence!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidrickard.net/2010/06/18/dont-touch-that-dial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bridgedy-doo-dah</title>
		<link>http://www.davidrickard.net/2010/05/26/bridgedy-doo-dah/</link>
		<comments>http://www.davidrickard.net/2010/05/26/bridgedy-doo-dah/#comments</comments>
		<pubDate>Wed, 26 May 2010 07:47:47 +0000</pubDate>
		<dc:creator>David Rickard</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.davidrickard.net/?p=572</guid>
		<description><![CDATA[At work we often have a requirement to test out things on our network, as if we were an external user. It&#8217;s useful to check that firewall settings are right, or to check access rights. We recently had an ADSL connection installed which serves that purpose. Via some spare fibres and various spare switches, we&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>At work we often have a requirement to test out things on our network, as if we were an external user. It&#8217;s useful to check that firewall settings are right, or to check access rights. We recently had an ADSL connection installed which serves that purpose.</p>
<p>Via some spare fibres and various spare switches, we&#8217;ve got access to it in various switch closets. I wanted to be able to access it from my desktop. My preference was to use a virtual machine, which I could set up with all the software I needed and test. This would mean bridging said virtual machine to that network.</p>
<p>I added a second network adapter to my PC, unbound it from all the local protocols (so my PC doesn&#8217;t touch that network) and set VMware Player to use bridged mode. With VMware workstation, you can use the virtual network tool to configure which NIC bridges to the virtual machines. However, that tool is missing with VMware player. By default, it was bridging to my first NIC, which was no good, as it was on the uni network.</p>
<p>A little bit of clicking around, and I found that there is a protocol bound to all the network cards called VMware Bridge Protocol. By default, it seems to bind itself to all the NICs. I simply unbound it from my main NIC:</p>
<p><a href="http://www.davidrickard.net/wordpress/wp-content/uploads/2010/05/mainadapter1.png"><img class="aligncenter size-full wp-image-576" title="mainadapter" src="http://www.davidrickard.net/wordpress/wp-content/uploads/2010/05/mainadapter1.png" alt="" width="377" height="474" /></a><a href="http://www.davidrickard.net/wordpress/wp-content/uploads/2010/05/mainadapter.png"></a></p>
<p>And left it bound to the NIC connected to the ADSL network:</p>
<p><a href="http://www.davidrickard.net/wordpress/wp-content/uploads/2010/05/zenadsl.png"><img class="aligncenter size-full wp-image-575" title="zenadsl" src="http://www.davidrickard.net/wordpress/wp-content/uploads/2010/05/zenadsl.png" alt="" width="377" height="474" /></a></p>
<p>I restarted VMware Player, and my virtual machine nows bridges to the ADSL connection.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidrickard.net/2010/05/26/bridgedy-doo-dah/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco Useful thing: Why isn&#8217;t this on by default?!</title>
		<link>http://www.davidrickard.net/2009/09/23/cisco-useful-thing-why-isnt-this-on-by-default/</link>
		<comments>http://www.davidrickard.net/2009/09/23/cisco-useful-thing-why-isnt-this-on-by-default/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 19:01:28 +0000</pubDate>
		<dc:creator>David Rickard</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Rave]]></category>

		<guid isPermaLink="false">http://www.davidrickard.net/2009/09/23/cisco-useful-thing-why-isnt-this-on-by-default/</guid>
		<description><![CDATA[If you’ve ever worked on a Cisco IOS device, you’ve probably encountered the joy that is the terminal monitoring of events. IOS will happily dump bits of information onto the screen (very useful) but it’s also horribly disruptive if you’re typing in a command. Everything disappears into this sea of debug output or other info. [...]]]></description>
			<content:encoded><![CDATA[<p>If you’ve ever worked on a Cisco IOS device, you’ve probably encountered the joy that is the terminal monitoring of events. IOS will happily dump bits of information onto the screen (very useful) but it’s also horribly disruptive if you’re typing in a command. Everything disappears into this sea of debug output or other info.</p>
<p>In my case, I often do ISDN Q.931 debugs to find out what’s going on on my voice gateways. I’ve gotten used to it now, but typing ‘undebug all’ whilst a ton of information whizzes by is less fun than it sounds.</p>
<p>Today, I found this useful command:</p>
<p>“logging synchronous”</p>
<p>If you enable that on your vtys or con (or aux) ports, it basically causes IOS to dump the debug still, but it’ll do it on all other lines EXCEPT the one you’re typing on, leaving it alone. I imagine it could cause some slowdowns as it has to draw your command in the same place, whilst interleaving other junk, so it could potentially cause problems on a direct console, but if you remotely telnet (I really should enable SSH one day), it’ll be a lot easier to see what’s going on.</p>
<p>Here’s the gist of what you need to do:</p>
<pre>  Router(config)#line con 0
  Router(config-line)#logging synchronous
  Router(config-line)#line vty 0 4
  Router(config-line)#logging synchronous</pre>
<p>Then wr mem as usual.</p>
<p>Easy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidrickard.net/2009/09/23/cisco-useful-thing-why-isnt-this-on-by-default/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

