Over the years, our Iceni servers have undergone a number of design changes in order to accommodate the changing nature of devices being used on networks. In particular, authentication of web traffic has needed special attention constantly.
In the old days, software usually had really good support for authenticating with web proxy servers. Windows clients would silently authenticate each web request using NTLM or Kerberos, non-Windows stuff used HTTP Basic authentication (it pops up a username/password box when you start a session, but you can use the "remember password" checkbox to stop this getting annoying). Every so often we came across a rare example of software that couldn't handle proxy authentication and we'd have to tweak the proxy configuration a bit to bypass the authentication and filtering, but in general life was good.
We're increasingly seeing software support for web proxy servers getting poorer though - quite a lot of software just plain ignores the system-wide settings and bypasses the proxy, and an increasing amount of software can't handle proxy authentication at all. In fact, this latter point has often shown just how poorly built some of the modern software is: Windows 8, for example, tries to log in to login.live.com when you log into a machine, and if the proxy asks for authentication the machine hangs and has to be hard-reset! Apple devices seem particularly bad too - if the proxy asks an iPhone to authenticate when it tries to synchronise its calendar, it just retries immediately, and keeps going indefinitely - hundreds of times a second!
A few years ago we did a lot of work to work around these broken devices: Firstly we introduced a transparent proxy to deal with the software that completely ignores the proxy settings. Then we started caching the last known user for each IP address and for client software that's known to be broken, we just reused those details rather than asking them to authenticate. We also added a captive portal and support for WISPr authentication to help the Apple devices along a bit.
Along the way we his some surprising problems - for example, you would expect every web request to be independent of each other, but we found that if we avoided authenticating certain iPhone traffic, then completely unrelated traffic from that device that would usually work fine suddenly stopped being able to cope with authentication too!
The move to Iceni 2 saw more changes - administrators can now tell the system to only use the captive portal/WISPr authentication for certain problem URIs, or disable authentication entirely in some cases. For example, by default Iceni 2 servers don't authenticate of filter login.live.com.
All this work has gone a long way to avoiding the problems that were cropping up, but increasingly there's a feeling that things like phones and tablets have such poor support for HTTP proxy authentication that its probably preferable to turn it off entirely for those devices and rely on the captive portal and WISPr. But how do you do that just for those devices, and not for things like the on-domain Windows machines which still work fine?
This brings me on the the latest stuff I've just finished working on and is now going through QA testing (soon to be released to the customers, all being well!): We now allow you to define a network - a network address and netmask - and drop it into a user group as if it were a user. This means you can do stuff like disabling authentication for all devices on a particular network - your wifi network, for example.
The bonus of this is that, if your network is split up appropriately, you can also tweak filtering based on the workstation's location - you can relax the filtering for class rooms that are well supervised, for example.
We've also got rid of the "Guest" user and renamed the "Guests" group to "Anonymous" to better reflect what it means.
Over all I really like the new model, and I have plans to extend it to the mail server component as well.
However, my new job for today is to fix a locking bug in the web filter - joy of joys!
Thursday, 11 September 2014
Monday, 1 September 2014
Incompetent billing
I have billing disputes with no less than three separate companies at the moment. Its depressing that this kind of thing is probably going to go completely unnoticed by a lot of customers and result in these companies actually making money out of their mistakes...
BT
I switched my POTS line away from BT on July 25th. My annual "line rental saver" contract expired on July 23rd so this should have been ok. Except BT emailed me to say I was going to be billed £22.22 as an "early cancellation charge" because they thought I was still in contract. I gave them a call and was assured by the call centre agent that the email had been sent by mistake and I wasn't actually going to be charged. He said he had made a note on my account to that effect to ensure it got reviewed before actually billing.Then they took that charge from my bank account by direct debit. So I called them again and they refused to refund it, stating that the only note on my account stated something very generic such as "customer had a billing question, explained it to him" or words to that effect. After about 45 minutes of shouting at them they finally agreed to review their call recording.
I got a call back a few days later saying they had reviewed the call recording. They stated that I had never been told that it was a mistake, never told that I wouldn't be charged and never told that a note had been made on my account.
So I emailed them the recording that I had made of the call... Suddenly they refund the charge, no questions asked. (Ok, they miscalculated the refund and I had to tell them to fix it, but still...)
Originally I would've had no problem switching back to BT in the future, but now I've come to regard them as a company that will outright lie to make money fraudulently so long as the customer can't produce any evidence to prove they are lying... Pretty bad.
(Yeah, I know I could've enacted the DD guarantee to get my money back, but they would've just recorded it as a default so best to get it sorted at the source).
FalconNet / Merula
When I switched away from BT, I moved my internet connection and POTS over to FalconNet (who are a trading name of Merula Ltd). £22/month (inc. VAT) for the internet connection (40Mbps down, 10Mbps up, FTTC) and £9.50/month inc. VAT for the POTS line.They are invoicing me £25 ex. VAT and £8.20 ex. VAT respectively. Emailing them to point out that they're billing me incorrectly has resulted in a grand total of no response at all. Not impressed. We'll wait to see what they take by direct debit and possibly ask the bank to back charge the DD if I can't get any response.
Edit: All cleared up and a credit note has been applied to my account.
Npower
The troubles with Npower seem to be continuing, even after I have stopped being their customer. Over an 18 month period I have received 13 separate bills from them (bearing in mind they are supposed to be billing twice a year...) Most of the bills are wrong and the next bill (usually also wrong) starts by cancelling the previous bill. On the whole I've ended up with a massively confusing mess of bills that has taken me a considerable amount of time to go through and understand exactly what they have billed me for.The latest bill says I owe £144.07, but as far as I can tell they are actually about £166.30 out and they actually owe me £22.23.
Here's the message I just sent to them... I'm through trying to sort this stuff out over the phone, it's just a complete waste of my time...
My latest bill states that I owe you £144.07. As I have previously mentioned to you over the phone, I do not intend to pay you until you send me a correct bill - the bill you have sent is incorrect, just like numerous previous bills:
1. My direct debit discount is supposed to amount to £100/year. In January 2014, the discount for 2013 did not appear on my bill, so I called you and was told that it would be credited to my next bill 6 months later. This did not happen, so I called again on June 9th and was told the direct debit discount would be refunded. I called again on June 25th and was told it was "still being handled". My latest bill, received last week, still shows that this direct debit discount has not been refunded.
2. Although I was a customer until the middle of July this year, I have only received £21.09 as a pro-rata direct debit discount for 2014. It is true that my bill has largely not been paid by direct debit this year. That is your fault though - the direct debit was set up, you just didn't bother to charge it. I still expect to receive a pro-rata discount of around £50.
3. The statement dated October 22 2013 states that my closing balance is £403.50. The following statement, dated January 29 2014 lists the opening balance at £419.80. The £16.30 difference appears to be unaccounted for.
On the whole, I have received an extremely confusing mess of bills, cancelled bills and amended bills since January 2013 - I have received no less than 13 separate bills over this period, most of them wrong in one way or another, and it has been very difficult and time consuming to piece together exactly what you've done.
Thursday, 7 August 2014
Defending Telesales?
I came across this post, which I thought was a remarkably fun idea:
https://plus.google.com/+ChrisBlasko/posts/GzCuzTyUXNq
Essentially, the guy was cold-called by a recorded message that asked if he wanted to talk to someone about his mortgage. So he opted to talk to someone, pretended to be the cold-caller's IT department and convinced him to factory reset his phone. If the phone is auto-provisioned then this is a few seconds inconvenience for the cold-caller, but if it is manually provisioned then his phone is out of action until someone can set it all up again.
What really surprised me were the number of people who were coming out to defend the cold-caller.
So lets look at this rationally:
So at best, cold callers are an annoyance - they know they are annoying the people they call, yet they choose to do the job. At worst, they are breaking the law (certainly sounds like that was the case this time). They are pretty much universally a drain on society.
I don't buy the whole "he was just doing his job" and "maybe it was the only job he can get to feed himself" arguments - you could apply these to any criminal. Should we be defending the drug dealers and the burglars because "maybe they couldn't get a better job?"
I also don't understand the "he probably didn't realise it was unlawful" arguments that I often hear. Firstly, ignorance is no defence - if you're arrested for doing something illegal then "I didn't know it was illegal" isn't going to keep you out of jail; and secondly I just don't believe that none of the thousands of people who have been called haven't informed the cold-caller of their legal position. Whenever I have been cold-called and pointed out to them that they were breaking the law, they have always told me that I was wrong, even when I quoted the relevant legislation at them. Unless you don't care about the law, the sensible thing to do when someone tells you what legislation you're breaking is to actually go and look at it and see if they're right.
If your employer tells you to do something, it is your responsibility to figure out if it is legal before doing it. "I was just following orders" doesn't cut it.
https://plus.google.com/+ChrisBlasko/posts/GzCuzTyUXNq
Essentially, the guy was cold-called by a recorded message that asked if he wanted to talk to someone about his mortgage. So he opted to talk to someone, pretended to be the cold-caller's IT department and convinced him to factory reset his phone. If the phone is auto-provisioned then this is a few seconds inconvenience for the cold-caller, but if it is manually provisioned then his phone is out of action until someone can set it all up again.
What really surprised me were the number of people who were coming out to defend the cold-caller.
"The poor guy was doing the job he was told to so he could get a paycheck."
So lets look at this rationally:
- Cold callers cost the person they are calling (depending on the situation in time, inconvenience or money) and there is no way to preemptively stop them.
- This was a recorded message. I'm not sure what the laws are like in Canada, but in the UK it is illegal to use a recorded message when cold-calling people.
- The caller was ignoring the national "Do Not Call" registers (i.e. Canada's equivalent of our TPS).
- The caller was sending a fake caller ID to disguise their identity.
- Given that they have gone out of their way to disregard the law and disguise their identity, it's probably reasonable to assume that whatever they're selling is a scam - if you were operating a legitimate business you want people to find you, so don't try and hide your identity.
So at best, cold callers are an annoyance - they know they are annoying the people they call, yet they choose to do the job. At worst, they are breaking the law (certainly sounds like that was the case this time). They are pretty much universally a drain on society.
I don't buy the whole "he was just doing his job" and "maybe it was the only job he can get to feed himself" arguments - you could apply these to any criminal. Should we be defending the drug dealers and the burglars because "maybe they couldn't get a better job?"
I also don't understand the "he probably didn't realise it was unlawful" arguments that I often hear. Firstly, ignorance is no defence - if you're arrested for doing something illegal then "I didn't know it was illegal" isn't going to keep you out of jail; and secondly I just don't believe that none of the thousands of people who have been called haven't informed the cold-caller of their legal position. Whenever I have been cold-called and pointed out to them that they were breaking the law, they have always told me that I was wrong, even when I quoted the relevant legislation at them. Unless you don't care about the law, the sensible thing to do when someone tells you what legislation you're breaking is to actually go and look at it and see if they're right.
If your employer tells you to do something, it is your responsibility to figure out if it is legal before doing it. "I was just following orders" doesn't cut it.
Thursday, 17 July 2014
Data Retention and Investigatory Powers (DRIP) bill
In April, the European Court of Justice ruled that the routine collection of location and traffic data about phone calls,
texts, emails and internet use and its retention for between six months
and two years meant a very detailed picture of an individual's private
life could be constructed, that this amounted to a severe incursion of privacy and it therefore contravened EU law.
In response, the British government have put forward the Data Retention and Investigatory Powers (DRIP) bill to restore their ability to snoop on everyone. Not wanting this bill to come under too much scrutiny, it was passed by the commons after a single afternoon's debate. 51 MPs voted to do their job properly and take time to make a decision, but they were overruled by 441 votes to just push it through as quickly as possible. Assuming the Lords agree, this will pass into law tomorrow.
Once enacted, this legislation will allow the government to require internet service providers, internet application providers and telephone companies to record and retain metadata on any members of the public, without needing a warrant. The bill would also apply to non-UK companies like Facebook (although quite how they expect to enforce this I'm not sure).
Traditionally, a certain amount of information was kept by an ISP/telco/whatever for normal day to day business purposes. For example, a telco may keep call metadata records for a certain amount of time for billing purposes. If the police have a suspect then I see no issue with them getting a warrant to access that data.
If someone is a suspect, then I also see no problem with the police getting a warrant to record extra information that wouldn't normally be recorded/retained. e.g. they may get a warrant to have the ISP log web requests made by a suspect, or have the telco record call audio.
However, there is a distinction between the above examples, which require the police to suspect someone and convince a judge to issue a warrant, and what the government is increasingly trying to do, which is to capture data about *everyone's* activities, specifically for law enforcement purposes, just in case they later become a suspect. That is something that's fundamentally wrong IMHO - as someone who has committed no crime, I have a right to privacy, and that right is being violated by having data recorded and retained for law enforcement purposes.
The whole "but it won't be used unless you become a suspect" argument is flawed - once the data is there, I have no confidence that access to it will be tightly controlled. Data may be leaked by accident, on purpose (illegally), the laws regarding under what circumstances it can be accessed may not be robust enough to prevent legal access for questionable purposes, and the whole thing is subject to feature creep - the access controls may be ok now, but I can't demand the historical data be deleted if their scope expands in the future.
Once upon a time, people were considered innocent until proved guilty, but these days it seems that everyone is treated as guilty from the start and just happen to be allowed some freedom until the authorities can figure out what crime they committed.
All three main parties are backing this attack on our privacy, but is an afternoon of debate really enough to decide to throw away everyone's freedom?
In response, the British government have put forward the Data Retention and Investigatory Powers (DRIP) bill to restore their ability to snoop on everyone. Not wanting this bill to come under too much scrutiny, it was passed by the commons after a single afternoon's debate. 51 MPs voted to do their job properly and take time to make a decision, but they were overruled by 441 votes to just push it through as quickly as possible. Assuming the Lords agree, this will pass into law tomorrow.
Once enacted, this legislation will allow the government to require internet service providers, internet application providers and telephone companies to record and retain metadata on any members of the public, without needing a warrant. The bill would also apply to non-UK companies like Facebook (although quite how they expect to enforce this I'm not sure).
"The police will not know who that suspect is until they come to the police’s attention, at which point they have to get historical evidence. These days, part of that historical evidence will be in data records. They have to be able to access everybody’s data records in order to find those of one particular person, because the police, no more than the rest of us, are not given powers of clairvoyance with which to anticipate who is and who is not to be a suspect. Unless or until I hear from opponents of this Bill and of data retention how the police can be expected to identify in advance those who are going to be suspected of crime, I have to say that the whole logical basis of their argument completely falls away." - Jack Straw
Traditionally, a certain amount of information was kept by an ISP/telco/whatever for normal day to day business purposes. For example, a telco may keep call metadata records for a certain amount of time for billing purposes. If the police have a suspect then I see no issue with them getting a warrant to access that data.
If someone is a suspect, then I also see no problem with the police getting a warrant to record extra information that wouldn't normally be recorded/retained. e.g. they may get a warrant to have the ISP log web requests made by a suspect, or have the telco record call audio.
However, there is a distinction between the above examples, which require the police to suspect someone and convince a judge to issue a warrant, and what the government is increasingly trying to do, which is to capture data about *everyone's* activities, specifically for law enforcement purposes, just in case they later become a suspect. That is something that's fundamentally wrong IMHO - as someone who has committed no crime, I have a right to privacy, and that right is being violated by having data recorded and retained for law enforcement purposes.
The whole "but it won't be used unless you become a suspect" argument is flawed - once the data is there, I have no confidence that access to it will be tightly controlled. Data may be leaked by accident, on purpose (illegally), the laws regarding under what circumstances it can be accessed may not be robust enough to prevent legal access for questionable purposes, and the whole thing is subject to feature creep - the access controls may be ok now, but I can't demand the historical data be deleted if their scope expands in the future.
Once upon a time, people were considered innocent until proved guilty, but these days it seems that everyone is treated as guilty from the start and just happen to be allowed some freedom until the authorities can figure out what crime they committed.
All three main parties are backing this attack on our privacy, but is an afternoon of debate really enough to decide to throw away everyone's freedom?
Wednesday, 9 July 2014
Decoding Freesat, Part 2
As I mentioned in the last post, I'm reverse engineering the Freesat transmissions in order to extract the channel numbers so I can automatically update my MythTV system to use sensible channel numbers.
I've now managed to figure out most of the important bits: Transport stream 2315 is broadcast on 11.428GHz Horizontal, at 27.5 Mbaud, FEC 2/3 and contains a stream with PID 3002. This stream transmits a carousel of service description tables (SDTs) and bouquet association tables (BATs). The SDTs aren't especially interesting, so I'm ignoring that for now.
Freesat tailor their channels to groups of consumers by grouping them into bouquets - each of the four countries (England, Wales, Scotland and Northern Ireland) get three bouquets - one for standard definition receivers, one for high definition receivers and one for G2 (second generation) HD receivers, so 12 bouquets in total for the time being. (But more about regionalisation later).
Each BAT is packetised into one or more sections, and there is one BAT for each of Freesat's bouquets. To collect all the information, you just keep watching the carousel until you've seen all of the sections for all of the BATs.
A BAT consists of a header, zero or more "descriptors" (lumps of data that have an ID that identifies the type of data they hold) and zero or more "transport streams". Each "transport stream" in the BAT contains zero or more descriptors that contain information relating to a DVB transport stream (i.e. satellite transponder).
The top level descriptors in the BAT include standard descriptors (bouquet name, country availability, private data specifier descriptor) and some non-standard ones:
I haven't investigated any of these except for the region table. 0xd5 - 0xd7 appear to be binary data. 0xd8 looks like a list of (ID, language, category name) tuples, but I'm not sure what the category IDs are referenced by; the category names are stuff like "Entertainment", "News", "Shopping", etc.
0xd4 is the one that's of interest to me - The bouquets are geographically pretty coarse, and Freesat tailor the channels to much smaller regions. So the south of England gets BBC One South on channel 101 whilst the East Midlands gets BBC One East Midlands on channel 101, etc. Descriptor 0xd4 contains a list of the regions that are served by the bouquet (I don't understand why bouquets are used at all for regionalisation though, since I can't see a reason for not handling it all through this fine grained regionalisation system?) The data in this descriptor is a bunch of variable length chunks concatenated together, with the header of each chunk containing its size so the next chunk can be found. The data format of the chunks is:
"Language" is a three letter text string and is always "eng" at the moment.
Now, as I mentioned above, the BAT also contains a list of transport streams, with a bunch of descriptors in each. So looking at the descriptors within a transport stream, as well as a few standard descriptors there is descriptor ID 0xd3, which maps service IDs to channel numbers. This contains a bunch of variable length chunks concatenated together, with the header of each chunk containing its size. The data format of the chunks is:
The "LCN/region mappings" data is a concatenated set of fixed length subchunks as follows:
So, we can select the appropriate bouquet (e.g. if we're using an HD receiver in England, we would choose bouquet 272, which is England HD) and pick our region (such as region 15 - "E Midlands/Central E"). In theory we can filter down the data to get a list of channel numbers and what transport ID and service ID (i.e. what channel) they are assigned to.
There are a couple of gotchas:
Firstly, one service can be assigned to multiple channel numbers. The BBC regions are all typically available on 9xx channel numbers, but your local region is on 10x as well.
Region number 65535 appears to be a fallback or default region. So, for example, in the England HD region, service ID 10060 (ITV 1 London) is assigned to channel 103 in regions 1, 18, 27, 31 and 38 and channel 977 in region 65535. Region 1 is London, the other regions don't appear in the region list so I assume they are legacy IDs. So in this example, if you're in London then ITV 1 London appears on channel 103, but if you're anywhere else it is on channel 977.
Region number 0 is a complete unknown... See below!
For example, looking at the Wales HD bouquet (274), BBC One London, BBC One West Midlands and BBC One South are all assigned to channel 108 in region 0. Channel 108 isn't assigned in any other region.
Similarly, the Wales SD bouquet (258) assigns these same three channels to 101 for region 0. We clearly can't just ignore region 0 because there's no other way to assign a channel to 101 in this case, but I can't see how set top boxes can choose between the three assigned channels. Also, I note that the SD version of BBC One Wales (service ID 10311) isn't listed in the BAT at all - do SD Freesat receivers in Wales no longer get a regional BBC One?
Even more confusing are bouquets 272 and 280 (England HD and England G2), which seem to have BBC One Scotland HD (service ID 8901) assigned to channel 108 in region 0!
It would certainly be interesting to look at a branded Freesat decoder and see what channels appear on it; unfortunately I don't have one.
I've now managed to figure out most of the important bits: Transport stream 2315 is broadcast on 11.428GHz Horizontal, at 27.5 Mbaud, FEC 2/3 and contains a stream with PID 3002. This stream transmits a carousel of service description tables (SDTs) and bouquet association tables (BATs). The SDTs aren't especially interesting, so I'm ignoring that for now.
Freesat tailor their channels to groups of consumers by grouping them into bouquets - each of the four countries (England, Wales, Scotland and Northern Ireland) get three bouquets - one for standard definition receivers, one for high definition receivers and one for G2 (second generation) HD receivers, so 12 bouquets in total for the time being. (But more about regionalisation later).
Each BAT is packetised into one or more sections, and there is one BAT for each of Freesat's bouquets. To collect all the information, you just keep watching the carousel until you've seen all of the sections for all of the BATs.
A BAT consists of a header, zero or more "descriptors" (lumps of data that have an ID that identifies the type of data they hold) and zero or more "transport streams". Each "transport stream" in the BAT contains zero or more descriptors that contain information relating to a DVB transport stream (i.e. satellite transponder).
The top level descriptors in the BAT include standard descriptors (bouquet name, country availability, private data specifier descriptor) and some non-standard ones:
| Descriptor ID | Description |
|---|---|
| 0xd4 | Region table |
| 0xd5 | Unknown |
| 0xd6 | Unknown |
| 0xd7 | Unknown |
| 0xd8 | Category table |
I haven't investigated any of these except for the region table. 0xd5 - 0xd7 appear to be binary data. 0xd8 looks like a list of (ID, language, category name) tuples, but I'm not sure what the category IDs are referenced by; the category names are stuff like "Entertainment", "News", "Shopping", etc.
0xd4 is the one that's of interest to me - The bouquets are geographically pretty coarse, and Freesat tailor the channels to much smaller regions. So the south of England gets BBC One South on channel 101 whilst the East Midlands gets BBC One East Midlands on channel 101, etc. Descriptor 0xd4 contains a list of the regions that are served by the bouquet (I don't understand why bouquets are used at all for regionalisation though, since I can't see a reason for not handling it all through this fine grained regionalisation system?) The data in this descriptor is a bunch of variable length chunks concatenated together, with the header of each chunk containing its size so the next chunk can be found. The data format of the chunks is:
| Offset (octets) | Length (bits) | Description |
|---|---|---|
| 0 | 16 | Region ID |
| 2 | 24 | Language |
| 5 | 8 | Length of region name |
| 6 | Variable | Region name |
"Language" is a three letter text string and is always "eng" at the moment.
Now, as I mentioned above, the BAT also contains a list of transport streams, with a bunch of descriptors in each. So looking at the descriptors within a transport stream, as well as a few standard descriptors there is descriptor ID 0xd3, which maps service IDs to channel numbers. This contains a bunch of variable length chunks concatenated together, with the header of each chunk containing its size. The data format of the chunks is:
| Offset (bytes) | Length (bits) | Description |
|---|---|---|
| 0 | 16 | Service ID |
| 2 | 16 | Unknown |
| 4 | 8 | Length of remainder of the chunk |
| 5 | Variable | LCN/region mappings |
The "LCN/region mappings" data is a concatenated set of fixed length subchunks as follows:
| Offset (bytes) | Length (bits) | Description |
|---|---|---|
| 0 | 4 | Unknown |
| 0.5 | 12 | Logical channel number |
| 2 | 16 | Region ID |
So, we can select the appropriate bouquet (e.g. if we're using an HD receiver in England, we would choose bouquet 272, which is England HD) and pick our region (such as region 15 - "E Midlands/Central E"). In theory we can filter down the data to get a list of channel numbers and what transport ID and service ID (i.e. what channel) they are assigned to.
There are a couple of gotchas:
Firstly, one service can be assigned to multiple channel numbers. The BBC regions are all typically available on 9xx channel numbers, but your local region is on 10x as well.
Region number 65535 appears to be a fallback or default region. So, for example, in the England HD region, service ID 10060 (ITV 1 London) is assigned to channel 103 in regions 1, 18, 27, 31 and 38 and channel 977 in region 65535. Region 1 is London, the other regions don't appear in the region list so I assume they are legacy IDs. So in this example, if you're in London then ITV 1 London appears on channel 103, but if you're anywhere else it is on channel 977.
Region number 0 is a complete unknown... See below!
Open questions
Region 0 - I can't figure it out at all. It only seems to be used for BBC One (logical channel numbers 101 and 108), and it seems that multiple channels can end up assigned to a single channel number in region 0.For example, looking at the Wales HD bouquet (274), BBC One London, BBC One West Midlands and BBC One South are all assigned to channel 108 in region 0. Channel 108 isn't assigned in any other region.
Similarly, the Wales SD bouquet (258) assigns these same three channels to 101 for region 0. We clearly can't just ignore region 0 because there's no other way to assign a channel to 101 in this case, but I can't see how set top boxes can choose between the three assigned channels. Also, I note that the SD version of BBC One Wales (service ID 10311) isn't listed in the BAT at all - do SD Freesat receivers in Wales no longer get a regional BBC One?
Even more confusing are bouquets 272 and 280 (England HD and England G2), which seem to have BBC One Scotland HD (service ID 8901) assigned to channel 108 in region 0!
It would certainly be interesting to look at a branded Freesat decoder and see what channels appear on it; unfortunately I don't have one.
Monday, 7 July 2014
Decoding Freesat, Part 1
To watch/record TV, I use MythTV connected to a satellite receiver. Unfortunately, MythTV's handling of channel numbering is a bit bonkers... So I've been doing a bit of reverse engineering of the data transmitted by FreeSat to try and automagically pull out the local channel numbers and update the MythTV channels database... Information on the internet seems thin on the ground, so this is what I've figured so far:
The "FreeSat Home" transponder is the interesting one (transport stream ID 2315). This is located at 11.428GHz Horizontal, with a symbol rate of 27500 and FEC 2/3. PID 3002 on this transponder transmits a bouquet association table (BAT).
For each transport stream, there is an entry in the BAT, containing a descriptor tag 0xd3 and an associated lump of data. The data is a set of variable length chunks concatenated together, with each chunk containing a length value so the offset of the next chunk can be calculated.
The chunk format appears to be:
I haven't been able to figure out how the channels are selected by region - for example, local channel number 101 is allocated to BBC 1 London if you're in London, BBC 1 Wales if you're in Wales, etc. but I haven't found this information in the BAT yet. Compare:
Edit: "Unknown 2", "LCN" and "unknown 3" appears to be an array mapping LCNs to regions:
Descriptor 0xd4 in the BAT seems to translate the 16 bit region IDs into human readable strings (is it me, or does 16 bits sound a bit excessive for region IDs?)
The "FreeSat Home" transponder is the interesting one (transport stream ID 2315). This is located at 11.428GHz Horizontal, with a symbol rate of 27500 and FEC 2/3. PID 3002 on this transponder transmits a bouquet association table (BAT).
For each transport stream, there is an entry in the BAT, containing a descriptor tag 0xd3 and an associated lump of data. The data is a set of variable length chunks concatenated together, with each chunk containing a length value so the offset of the next chunk can be calculated.
The chunk format appears to be:
| Offset (octets) | Length (bits) | Description |
|---|---|---|
| 0 | 16 | Service ID |
| 2 | 16 | Unknown |
| 4 | 8 | Length of remainder of the chunk |
| 5 | 4 | Unknown |
| 5 + 1 nybble | 12 | Local channel number |
| 7 | Variable | Unknown |
I haven't been able to figure out how the channels are selected by region - for example, local channel number 101 is allocated to BBC 1 London if you're in London, BBC 1 Wales if you're in Wales, etc. but I haven't found this information in the BAT yet. Compare:
| BBC One London | BBC One West | |
|---|---|---|
| Service ID | 18 9d (6301) | 18 c5 (6341) |
| Unknown 1 | 81 f9 (33273) | 82 01 (33281) |
| Size | 08 (8) | 08 (8) |
| Unknown 2 | d (13) | d (13) |
| LCN | 3 b6 (950) | 3 c5 (965) |
| Unknown 3 | ff ff f0 6c 00 00 | ff ff f0 6c 00 00 |
Edit: "Unknown 2", "LCN" and "unknown 3" appears to be an array mapping LCNs to regions:
| ITV 1 London | ITV 1 Granada | |
|---|---|---|
| Service ID | 27 4c (10060) | 27 60 (10080) |
| Unknown 1 | 83 f3 | 83 f2 |
| Size | 18 (24) | 0c (12) |
| Unknown 2 | d (13) | d (13) |
| LCN | 067 (103) | 067 (103) |
| Region | 00 01 | 00 07 |
| Unknown 2 | d (13) | d (13) |
| LCN | 067 (103) | 067 (103) |
| Region | 00 12 | 00 27 |
| Unknown 2 | d (13) | d (13) |
| LCN | 067 (103) | 067 (103) |
| Region | 00 1b | 00 2b |
| Unknown 2 | d (13) | |
| LCN | 067 (103) | |
| Region | 00 1f | |
| Unknown 2 | d (13) | |
| LCN | 067 (103) | |
| Region | 00 26 | |
| Unknown 2 | d (13) | |
| LCN | 3d1 (977) | |
| Region | ff ff |
Descriptor 0xd4 in the BAT seems to translate the 16 bit region IDs into human readable strings (is it me, or does 16 bits sound a bit excessive for region IDs?)
Changing ISP...
BT just sent round a reminder for me to renew my annual "line rental saver"... it seems to have gone up significantly - £159.84 (so equivalent of £13.32/month) and its kicked me into having a look at my options. Currently I pay BT for the POTS line and then UK Free Software Network (an EntaNet reseller) get £23.70 for my internet connection. The internet connection is a plain old ADSL2+ connection* with a /29 static IPv4 subnet and a /56 static IPv6 subnet and is currently synced at about 6.7Mbps down, 960Kbps up.
(* It's supposedly ADSL2+, but my TP Link ADSL modem won't resync properly when the noise floor increases, so I actually have to run it in G.DMT mode... There isn't a huge difference in speed though).
So anyway, all in I'm basically paying £37.02/month for POTS and internet. The only reason I need the POTS bit at all is because it's required for the ADSL connection - I get free evening/weekend calls from BT, but that's not really worth the cost of the line. In fact, I think it's bonkers that BT are putting their prices up, given the increasingly wide selection of alternative providers. SIPGate, for example, charge 1.19p/minute for geographic calls, and even my pay as you go mobile is only 3p/minute.
Unfortunately, UKFSN don't appear to do the POTS bit themselves, expecting you to use BT for that, but I have been pretty happy with them so I've been looking at other EntaNet resellers. One that has stood out is FalconNet - they are offering FTTC internet connections (40Mbps down, 10Mbps up) for £22 and POTS for £9.50, totalling £31.50/month. Their installation cost is £96 - given that my "line rental saver" has to be paid up front, a £96 up-front cost doesn't seem bad at all - I basically end up in credit for the first 8 months. I fired off an email to FalconNet and they confirm that they do IPv6 and a /32 static IPv4 subnet.
This is pretty compelling: amortised over 18 months, I get a much faster internet connection for about the price I'm already paying and everything after that is a saving; and no more up-front annual fees. I just lose the free evenings and weekends calls - FalconNet charge 1.14p/min for geographic calls, so the amount I'm saving can pay for about 8 hours of calls a month. Although truth be told, for the sake of 0.05p/minute I'll probably just use SIPgate (or another SIP gateway).
Seems like a no brainer.
(* It's supposedly ADSL2+, but my TP Link ADSL modem won't resync properly when the noise floor increases, so I actually have to run it in G.DMT mode... There isn't a huge difference in speed though).
So anyway, all in I'm basically paying £37.02/month for POTS and internet. The only reason I need the POTS bit at all is because it's required for the ADSL connection - I get free evening/weekend calls from BT, but that's not really worth the cost of the line. In fact, I think it's bonkers that BT are putting their prices up, given the increasingly wide selection of alternative providers. SIPGate, for example, charge 1.19p/minute for geographic calls, and even my pay as you go mobile is only 3p/minute.
Unfortunately, UKFSN don't appear to do the POTS bit themselves, expecting you to use BT for that, but I have been pretty happy with them so I've been looking at other EntaNet resellers. One that has stood out is FalconNet - they are offering FTTC internet connections (40Mbps down, 10Mbps up) for £22 and POTS for £9.50, totalling £31.50/month. Their installation cost is £96 - given that my "line rental saver" has to be paid up front, a £96 up-front cost doesn't seem bad at all - I basically end up in credit for the first 8 months. I fired off an email to FalconNet and they confirm that they do IPv6 and a /32 static IPv4 subnet.
This is pretty compelling: amortised over 18 months, I get a much faster internet connection for about the price I'm already paying and everything after that is a saving; and no more up-front annual fees. I just lose the free evenings and weekends calls - FalconNet charge 1.14p/min for geographic calls, so the amount I'm saving can pay for about 8 hours of calls a month. Although truth be told, for the sake of 0.05p/minute I'll probably just use SIPgate (or another SIP gateway).
Seems like a no brainer.
Subscribe to:
Posts (Atom)
