Sometimes a technological scramble is triggered by the most mundane events. In this case, the season finale of “X Factor”.
Last night, there was a special church choir rehearsal for the Christmas Eve services, and all seven of Win’s and my kids went. Since the rehearsal would overlap the broadcast finale of X Factor, Erica asked Win to record it. Maybe the appearance of 1 Direction had something to do with it as well.
We used to have Replay TVs to solve things like this, and cable TV to deliver the bits, but the conversion to digital TV and the crazy anti-customer behavior of Comcast has changed all that. We don’t get cable, and the TV is hooked up to an antenna. We’ve also got a Silicon Dust HDHomeRun network tuner connected to the antenna on my front porch, so we can watch TV on any computer as well. Win has the copy of EyeTV that came with the HDHomeRun, and he planned to record the show.
About an hour before air time, he called to ask me about video artifacts and bad audio. I said I’d take a look.
I used hdhomerunner (a now lost Google Code project to develop an open source HDHomeRun control program) and directed the video to VLC running on my Macbook Pro. Indeed, the video was blocky and the audio spotty.
I power cycled the HDHomeRun, replaced the ethernet cable, and plugged it into a different switch port on the 16-port gigE switch. No change. I looked for firmware upgrades, and found the device running 4-year old firmware. The upgrade went smoothly, but there was no change in video quality.
After sitting and swiveling back and forth for a while, I went back downstairs and plugged the device into the 100 Mbps switch instead of the 1000 Mbps switch. I had some vague memory that the negotiation doesn’t always work right. This fixed the problem and I was able to watch good video and audio with VLC.
Win called back to report his video was still breaking up. This suggested some other networking problem between the houses.
Backgound. Win and I are neighbors, and we have a conduit between the houses with a couple of outdoor rated Cat V cables and a 6-fiber multimode fiber. One pair of fibers are connected to 1000base-SX media converters at the two ends and plugged into the house gigE switches.
I remembered once setting up netperf on the home servers, and indeed it was still installed. Win’s house to mine reported 918 Mbps, but mine to Win’s reported 16! At this point, there wasn’t much time to debug the networking, and X Factor was about to start.
I remembered that VLC can record an input video stream, and set that up to record the program on my Macbook. (I had 45 GB free on disk, and the program was running at 2 Megabytes/second, so it would take 14 GB for the two hours. No doubt there is a way to transcode, but not enough time to learn how to do it!)
The VLC recording froze once, at about the one hour point, but I only missed a couple of minutes. I copied the files to an external USB drive for sneakernet delivery.
This morning, Win and I started taking a look at the networking. First, we got netperf running on our respective Macbook and iMacs, in order to figure out if the link was bad or one of the home servers. I was able to talk both ways to my server at about 600 Mbps, and Win to his at about 95 Mbps. Win’s results are explained by a fast Ethernet hop somewhere, but all these rates are way above the pitiful 16 Mbps across the fiber.
Next Win wiggled his connectors, dropping the path to about 6 Mbps. We swapped the transmit and receive fibers at both ends, and the direction of the problem did not change. It was looking more and more like a bad media converter.
I was staring at the wiring in my basement, wondering if we could use the copper link as backup while waiting for parts. It never worked very well, but we did use it to cross connect our DMZs before the firewalls at one point. I found the cable, and found it plugged into the ethernet switch on the back of my FIOS router – with LINK active! Huh? What was it plugged into at Win’s end? He reported it plugged into a small switch, but that it wasn’t easy to tell what else was plugged in.
For experiment, we unplugged the copper link and … Win lost Internet access. Evidently (a) his routes were set to use the Serissa business FIOS rather than his home Comcast, and (b) the traffic was going over this moldy waterlogged CatV instead of our supposedly shiny gigabit fiber. Now the gears are turning. If we did have a loop in the switch topology, then it was entirely possible that one direction between the houses would use the fiber while the other direction would use the copper. I don’t know much about how these cheap switches figure out things like that. We tried unplugging the fiber, forcing all traffic onto copper, but the netperf results were much worse. ping seemed to work, and ping -c 1000 gave fairly good results, but ping -c 1500 had a lot of trouble. That would explain why, generally, ping and ssh seemed to work but netperf gave bad results.
We unplugged the copper and plugged the fiber back in, and after a few seconds, the asymmetrical performance resumed. I’ve placed an order for another media converter, and we’ll see if that fixes it. At least they now cost half as much as when we got the first pair!
So, there was a lot going on here.
The hdhomerun was plugged into a gigabit switch, and working poorly. Changing to fast Ethernet fixed that.
The topology loop was routing off-site traffic over a poor copper link, but it was working well enough that we didn’t notice.
The media converter is probably bad, working well in one direction but not the other, and probably that explains the poor video quality .
And Erica gets to watch 1 Direction.
How are just plain folks supposed to figure this stuff out?
UPDATE
The new media converter arrived… and didn’t fix the problem. Well we have a spare now! The actual problem was a bad 8-port switch in Win’s basement, which we belatedly figured out once ruling out the fiber. We could have tested the link standalone by plugging computers into both ends, but we did’t think of it. Does gigE need crossover cables to do that? Or is the magic echo cancellation make crossover cables unneccesary?
Author: stewart
The Fault in our Stars
The Fault in our Stars is the new book by John Green. You will likely find it in the children’s section of your local library, as it is usually filed under Youth.
I think you should go read it. Buy a copy, or check it out of the library, or borrow one from a friend, or see if your middle school english teacher has a copy.
Actually I think you should go read all of John Green’s books. Looking for Alaska, Paper Towns, An Abundance of Katherines, Will Grayson, Will Grayson, and The Fault in our Stars. I like them all.
The Fault in our Stars is a love story, a search for meaning. Its about the survivors, at least temporarily, of cancer, and about those whose survival is even more temporary. Is the purpose of our existance to do things? Or is the purpose of our consciousness to pay attention to what is around us? All of our times are limited, but there are still an infinite number of moments in each day, to be used as best we can.
PS. If you don’t believe me, (and who would?) go read some of the reviews on Amazon.
Comcast DigitalNow
Comcast has not achieved even my low expectations.
We get “Limited Basic” cable, which means we get the local broadcast channels plus a couple of things like New England Cable News. After the conversion to broadcast Digital, Comcast was sending these channels in analog (SD) format, but also sending QAM unencrypted digital versions of them. The local broadcast HD signals were also being delivered. Since we have a modern TV with NTSC, QAM, and ATSC tuners, life was fairly pleasant. Our old Replay TV works with the analog channels, and we can watch the digital or HD digital versions live.
Now, Comcast is completing their “digital conversion” and taking away the analog signals. This is fine. They are providing “Digital Transport Adapters” so you can convert the digital versions (SD) to analog on channel 3, for analog sets or our old ReplayTV.
However, they are (evidently) also taking away, or encrypting, the local broadcast HD channels! The only way to continue to receive them is to get a Digital Set Top Box, for which they will charge an extra $10/month.
Hello! The HD signals are broadcast and free. The real effect of this will be for us to drop Comcast altogether in favor of over the air HD. Our ReplayTV will stop working, but I have a nice HDHomeRun digital tuner, and I can assemble a (free) MythTV box to record things. I had this working already, but converted that box for the kids to do gaming. I can make another one. And it will work for the internet streaming TV as well: Netflix, crackle, hulu, youtube, etc.
Comcast’s only value to me was convenience, and they are making it rather less convenient and rather more expensive.
The right thing to do is just to transcode the local broadcast signals from ATSC to QAM, and to leave them alone. No DTA, no extra box, no extra remote.
Elegy for a boot
I had not been skiing since 1990 or so. When I moved to New England in 1989, I thought that skiing here was just too darn icy and cold, compared to Lake Tahoe. I put my ski boots and other gear in a box in the basement. This year, my 12 year old son announced he wanted to try snowboarding, so during winter vacation week we went to Nashoba Valley here in Massachusetts. It was what we used to call “spring skiing” conditions. Alex had a good time and might want to go again, but here’s what happened when I hit a bump on my first intermediate run.
It looks to me like the plastic just got brittle and shattered. Now I am kind of bemused. What happened really? I know that plastics get brittle when exposed to ultraviolet light, but that is not the case here. Perhaps this is an example of the plasticizers evaporating over many years.
Anyway, farewell boots! You served me well, at Squaw Valley, Alpine Meadows, Kirkwood, Soda Springs, Heavenly Vally, Boreal, and farther afield at Mammoth Mountain, Snowbird, and Sun Valley. Even Waterville Valley was no match for you, but little Nashoba was too tough.

SOPA and ProtectIP Followup
I wrote to both my senators, Kerry (D) and Brown (R) about SOPA and ProtectIP. I sent substantially the same letter to both:
I urge you to vote against SOPA/ProtectIP.
This pernicious legislation would give the government the power to shut down websites and internet domains with no evidence, no due process, and no redress, essentially at the behest of private interests.
Even without this new legislation, the government is <already> seizing domains without due process. In a recent example, a domain was seized and not returned for a year, in violation of numerous “policies” without any opportunity for the people whose property was seized to confront their accusers or even learn the charges. In the end it turned out there was no evidence at all.
SOPA and ProtectIP will make the current intolerable overreach of the US Government with respect to the internet immeasurably worse.
-Lawrence Stewart, PhD
Software Engineer
I sent my senators an email. Others sent cash. According to http://sopatrack.com/state/massachusetts, Sen. Kerry received $358,270 from pro-PIPA groups and $403,422 from anti-PIPA groups (plus $4,485,003 from big media generally), and Sen. Brown received $473,745 from pro-PIPA groups and $152,173 from anti-PIPA groups. It’s hard to draw any conclusion from the money flow except that Kerry is more senior.
I have now received answers from my senators. Here they are:
From Senator John Kerry <senator@kerry.senate.gov
Dear Dr. Stewart:
Thank you for your letter regarding the Preventing Real Online Threats to Economic Creativity and Theft of Intellectual Property Act (PROTECT IP Act). I appreciate hearing from you on this important issue.
I have long championed the cause of innovation and an open Internet. Firms operating on and off the Internet strongly rely on intellectual property laws to help protect their investments and ensure a just return for their goods and services. Online piracy and copyright infringement hurts our economy and costs American businesses more than 200 billion dollars a year. Many infringers operate from foreign countries in order to avoid US law enforcement. As a result, under current law, American authorities are limited in what they can do to bring these rogue sites to justice.
As you know, the PROTECT IP Act was intended to protect American businesses from intellectual property theft on foreign websites. Among other things, the bill would provide the Attorney General with the authority to seek a court injunction against a foreign website that engages in copyright infringement. The court could also require U.S. websites to block access to websites found to be dedicated to infringing activities. For example, search engines could be required to disable links to the website that is found to be violating copyright of a US company.
However, there are a number of serious and legitimate concerns regarding the scope of the legislation, as well as the potential for abuse, censorship, or other unintended consequences. The authors recognize the legislation still needs work and I will oppose any proposal that would fundamentally undermine or impede the ability of people to communicate, compete, and innovate using the Internet.
I am pleased that Majority Leader Reid has indefinitely postponed Senate consideration of the PROTECT IP Act, and I will continue to review and work to improve legislation to both protect the intellectual property of American businesses and to ensure the web remains free and open. As I consider proposals to address these issues, I will keep your views in mind.
Thank you again for contacting me on this topic. Please don’t hesitate to reach me again on this or any other issue in the future.
From Senator Scott P. Brown <sbrown@scottbrown.senate.gov>
Dear Dr. Stewart,
Thank you for contacting me regarding the Preventing Real Online Threats to Economic Creativity and Theft of Intellectual Property (PROTECT IP) Act (S. 968). I am strongly opposed to this legislation.
As you know, Senator Patrick Leahy (D-VT) introduced S. 968 on May 12, 2011. The PROTECT IP Act aims to provide law enforcement with tools to stop websites dedicated to online piracy and the sale of counterfeit goods. However, many Americans feared that S. 968 would stifle freedom of expression and harm the Internet.
The Internet has been a source of dynamic growth in our economy and is responsible for employing many people in Massachusetts. I have very serious concerns about increased government interference in this area and the effect of the PROTECT IP Act and the Stop Online Piracy Act (H.R. 3261, House companion legislation) on the Internet. On January 18, 2012, I announced my opposition to the PROTECT IP Act. You will be pleased to know that with opposition to the bill mounting, on January 20, 2012, the Senate Majority Leader announced that the scheduled vote on the PROTECT IP Act has been indefinitely postponed.
Again, thank you for sharing your views with me. As always, I value your input and appreciate hearing from you. Should you have any additional questions or comments, please feel free to contact me or visit my website at www.scottbrown.senate.gov.
Well. The letter from Sen. Brown is completely straightforward. Internet Good, PIPA Bad. The letter from Sen. Kerry is quite a piece of mealy-mouth apology for the entertainment industry. However, Sen. Kerry is willing to admit that PIPA “needs work”.
I kind of think the right thing for Massachusetts might be Elizabeth Warren and Scott Brown. Too bad Sen. Kerry is not up for reelection.
A Debugging Story
I’ve been working on fos at MIT CSAIL in recent months. fos is a factored operating system, in which the parts of the OS communicate by sending messages to each other, rather than by communicating by shared memory with locks and traps and so forth. The idea of fos is to make an OS for manycore chips that is more scalable than existing systems. It also permits system services to be elastic – to grow and shrink with demand, and it permits the OS to span more than one box, if you want.
The fos messaging system has several implementations. When you haven’t sent a message to a particular remote mailbox, you send it to the microkernel, which delivers it. If you keep on sending messages to the same place, then the system creates a shared page between the source and destination address spaces and messages can flow in user mode, which is faster. Messages that cross machine boundaries are handled by TCP/IP between proxy servers on each end.
I’ve been making the messaging system a bit more object oriented, so that in particular you can have multiple implementations of the user space shared message message transport, with different properties.After I got this to pass the regression tests, I checked it in and went on to other stuff.
Charles Gruenwald, one of the grad students, started using my code in the network stack, as part of a project to eliminate multiple copies of messages. (I added iovec support, which makes it easier to prepend headers to messages), and his tests were hanging. Charles was kind enough to give me a repeatable test case, so I was able to find two bugs. (And yes, I need to fix the regression tests so that they would have found these!)
Fine.
Next, Chris Johnson, another one of the grad students, picked up changes from Charles (and me) and his test program for memcached started to break.
All the above is just the setup. Chris and I spent about two days tracking this down…
Memcached is a multithreaded application that listens for IP connections, stores data, and gives it back later. It is used by some large scale websites like facebook.com to cache results that would be expensive to recompute.
When a client sends a data object to memcached for storage, memcached replies on the TCP connection with “STOREDrn”. On occasion, this 8 character message would get back to Chris’s client as “