Network Technology Bleg. Please Be Gentle

OK, this is an incredibly noob question and you will all lose respect for me.  But take this situation:

OK, I am streaming media from the server on the left to the PC on the left running XBMC at my TV.  The data rate is slower than I would have thought over all gigabit lines.  I know there are a jillion things that could be causing this, from software to drivers to, well, lots of stuff.  I have one narrow question.

And this is the embarassingly noob part.  I am presuming that all the data does not actually go through the router, that it can just go from server to switch to TV.  The router is actually on the other side of the house connected by a long line across the roof of questionable quality.  I know the router is involved - I picture small packets of data going to the switch with routing information.

So the question: is there any reason a bad cable from the router to the switch above -- one that still passes data but slower than gigabit speeds -- would slow down streaming from the server to the TV?

Update:  Thanks for the help in the comments.  I am increasingly suspicious I have a graphics driver problem that is causing stuttering on 1080p playback, and I will test that out this weekend.  Turns out there are a lot of XBMC users in the group.  I used to be  a SageTV guy, and I still think their HD hardware streamers were a great solution.  But after Google bought them a couple of years ago they went dark.  There is still an active community but I was ready to move on.  I have switched to XBMC and have been very happy (I never used the TV/recording functions in Sage so the fact XBMC does not have these was no problem, though the OpenElec variant does have them).    I hope to put a post up with my experiences and observations.  I have now done XBMC installations on Windows PCs, an Ubuntu box, using OpenElec (a linux variant), and on an old Apple TV2.  As it turns out I still have not found the perfect installation, but with the right box I may find it with Openelec.

  • http://www.facebook.com/jin.choi.5855 Jin Choi

    If you have any sort of monitoring configured for the switch, it may. If I were in your shoes, I would plug into the router and run a packet analyzer to see what, if any, packets from the server or XBMC you might be seeing.

  • a_random_guy

    Darn, message disappeared. Sorry if this appears twice after all...

    Theoretically, the router should be completely unaware of any traffic between the server and the TV. That is a fundamental property of a switch (as opposed to a hub): messages are only sent between the two involved devices.

    You can try one visual test and one physical test:

    Visual: During streaming, you should see intense activity on the server and TV lines; the router line should remain inactive (most switches have LEDs that blink to show activity, and remain steady when there is none.

    Physical: Unplug the router cable from the switch; this should make no difference at all.

    If either of these tests gives an unexpected result, something strange is going on...

  • CMJDad

    Assuming both the TV and the server are on the same subnet (eg 192.168.1.0/24 or 255.255.255.0), you are correct. Traffic between the server and the XBMC device only hits the switch, assuming you don't have some funky security policies, which I doubt you have.

  • Ghost of Christmas Past

    The connection between the switch and the router shouldn't affect streaming between server and PC unless one or another box is misconfigured. The first critical point is to make sure the server and the PC are on the same IP subnet (that is, their IP address start with the same numbers, like 192.168.10.X for the server and 192.168.10.Z for the PC, assuming a subnet mask of 255.255.255.0) and are either "static" addresses (set on the console of server and PC) or are DHCP addresses with a reasonable "lease time" (set by your router, probably-- make sure the lease time is more than 4 hours-- I would recommend a week). (Additional unlikely problem: streaming using multicast-- don't do that at home.) The second critical point is to check switch settings versus actual speed to router. Bad cable may have caused router link to be negotiated down to 100 instead of 1000, and wrong switch settings might force all other switch ports to slow speed as well.

    Also make sure that neither the server nor the PC is trying to go to the Internet as part of any media-streaming session (you know, to display album art for music or subtitles for movies or any stuff like that). There may be a slight possibility some DRM scheme is trying to access the Internet while you're streaming; if so, turn it off or spoof it.

    Additional performance tip: if switch, server, pc, and router all support jumbo frames (many gigabit switches and most gigabit NIC's do, but a cheap router likely doesn't) you should enable jumbo frames on all devices-- choose the largest frame size supported by all devices, and then adjust the IP MTU settings accordingly.

    If none of this helps, we can get into a plethora of more obscure possibilities, such as faulty static routes on server or PC.

  • Ffred

    A switch sends packets from from device A to B; you don't need any router in that picture at all. Unplug the router from the switch and test it again, if the results are the same then you probably have a bad cable in between the 3 devices. If not, hmmmmm...?

  • http://www.facebook.com/profile.php?id=691482281 Brett Nottingham

    If it is a true switch and not a hub that connects your XBMC to your server then the long cable run should have absolutely nothing to do with your speed. Can you update with what kind of speeds you are getting from the server? XBMC usually doesn't even need true 1Gb connection to run even 1080p blue-ray images, as long as you are getting about 10MB/S from your Server it should work flawlessly. On a side note, I have the same type of set up and I saw a lot of problems when I was running a super cheap CPU on the server end (it was a single core AMD), when I upgrade my server to an Intel dual core my speeds jumped quite a lot. I know that most people say that is nonsense, that a server really doesn't need a good CPU, but just in my own experience it was night and day when I upgraded my server.

  • CMJDad

    Not all gigE switches are created equally, but for your situation, even a cheap switch should suffice. Anything else running on the server which would swamp the NIC? WireShark is your friend here, if you are comfortable using it.

  • smilerz

    I spent a lot of time tuning XBMC. I'm assuming that your content is on the server with the head-end (XMBC) reading from either a Windows share or a NFS share. If you want I can offer some pointers. I'll send you a seperate email that you can reply to.

  • Ron

    To answer your question first, no, not unless you've got an unusual network setup.

    Big question I have, what other work is the network and that server doing while you're streaming to the TV. If the server is moving a lot of other data at the same time, then you might get bandwidth issues. Also if that server is performing a lot of other work, you might get delays in starting data transfers.

    If you have a laptop - or don't mind lugging that server around - it would be useful to move it next to the cable modem and plug it in directly to it using the cable you use to connect the server to the switch, and run a few speed tests (www.speakeasy.net/speedtest/ is a good one). That's your baseline. Then pull that cable and replace it with the TV-to-switch cable and test again. Then do the same with that long questionable cable. Run the test 2-3 times with each; if any of the cables are consistently slower than the others, you may have a bad cable. Given the rock-bottom markup on bulk cabling, they are made very cheaply these days, and even a new one can be bad. (Despite what you may be paying at retail.) As long as you're going to the effort, it can't hurt to test all the cables you can easily unplug.

    If you need new cable, I would recommend the Link Depot brand, available at newegg. It's inexpensive and consistently gets excellent reviews on newegg. It's not American made, but I don't think anyone makes network cabling for consumer use here anymore.

  • ErikTheRed

    One other possibility if a sketchy cable is involved is that it's putting enough garbage into the switch to cause it to malfunction. At a geeky level, this can involve packets with corrupted MAC addresses that overflow the MAC tables on the switch and make it freak out and deliver as many packets as its emotionally equipped to handle. There are a LOT of consumer-grade switches that handle this scenario (and other errors) poorly. I've also seen NICs send corrupted data out and cause this scenario.

    I would see if you can put some content local to your playback device (flash drive, or whatever) and see if that plays well. That way you can isolate this to the network, or some issue (driver, as you say) local to the playback device.

  • abtinf

    Is the XBMC machine capable of playing 1080p video at all? Copy a video to that machine and then try to play the file with VLC and fire up some background process, like a youtube video, to simulate CPU being consumed by network traffic. If that plays fine, take a look in to your XBMC settings to ensure that VDPAU is activated.