Massive CSFB Speed Improvement in LTE Live Networks

LTE has been great so far because of its speed and because it brings high speed wireless Internet to the German countryside.  One major downside of LTE on my smartphone so far, however, have been the very long call establishment times for incoming and outgoing voice calls due to the required fallback to GSM or UMTS.

In practice I observed typical CSFB (circuit switched fallback) times of about 2.5 seconds in live networks in addition to the normal 3G call setup time. A call from an LTE to LTE smartphone thus takes 5 seconds longer than a 3G mobile to mobile call establishment, which is around 5 seconds. 5 vs. 10 seconds, it almost felt like eternity.

Recently, to my surprise however, setup times have significantly reduced in my network of choice and CSFB calls from between two LTE mobiles are now established almost as fast as pure 3G-3G calls. The difference is around half a second at most. Something that one can quite live with.

Kudos to the network engineers, LTE is now finally usable for me on smartphones!

Real World Interaction: A Raspberry Pi as a Water Alarm System With Internet Connectivity

A couple of weeks ago I wrote about my re-discovery of the fascination and use of the electronics kits I experimented with in my youth and how I wanted to make good use of them again in combination with a Raspberry Pi. The project I had in mind and which has borne some fruits now is a water alarm system with Internet connectivity.

I'm a practical guy so playing around with new hardware and software always has to have an application for me. When you enter the kitchen in the morning and are welcomed by a pool of water on the floor you instantly know something is wrong. In my case it was a leak in the rooftop that subsequently proved to be a bit difficult to find so we went through a trial and error phase. During the trial and error phase I wanted to know at once when water started accumulating on the kitchen floor again to take the appropriate counter measures.

Pi-hardware1A perfect application for the Raspberry Pi that could warn me of a new water pool building on the floor via email. The Pi itself has some I/O pins that are, however, not well protected so I decided to buy one of the hardware extension boards that offers buffered and protected I/O ports. There are a number of different boards available and my choice fell on the Pi-Face as it's the same size as the Raspberry Pi and hence I could fit it into a small casing. As the Pi-Face is only a generic I/O board I needed additional hardware to detect water on the floor. This is were my electronics kit came in for prototyping a detector as seen on the first picture on the left.

Pi-hardware2Once this was working I decided to go for the real thing and build five of those sensors on a real board so I could place five detectors at different locations on the floor. The second picture on the right shows how the final solution looks like: The casing contains the Raspberry Pi with a tiny Wi-Fi adapter below the PiFace which is connected to the self made electronic board via a number of cables. From there 2x five 3m sensor cables leave the casing on the right to different locations on the floor. On the other end I just taped the uninsulated cables to the floor. Water between the ends of two cables change the resistance between the two cables which is detected by the detector on my self soldered board.

When one of the detectors on the board recognizes a change in resistance at the end of the cable it drives an input port on the PiFace which in turn is detected by a Phython program running on the Pi. The Phython program in turn will immediately send me an eMail to notify me of the event. The program also sends me regular status updates of all input ports and also notifies me in case an input is switched off again, i.e. the water has disappeared again.

Sending an email with Python by the way is pretty much straight forward as there are already libraries that can even handle encryption via secure SMTP. I've attached the source to this part of the program at the end of this post as this could come in quite handy for other projects you might to want to try.

Quite frankly I wouldn't have gone through the whole thing if I just had a water leak. But a RasPi project, real world interaction, connectivity to the Internet, a little electronics project and a real world problem to solve was too hard a thing to resist.

And here's the source for sending email in Python:

As I wanted the email transmission to be independent from the rest of the alarm system I decided to spawn the python email code in an independent process. If something fails here, the system would still work and continue to monitor the alarm sensors and show the result on the LEDs on the PiFace. Also should one email task get stuck for one reason or another I would still get informed of the problem with the next periodic status email. Here's the code to spawn a new independent task without waiting for it to be finished:

EMAIL_SCRIPT_WITH_PATH = "/home/pi/send-email.py"
EMAIL_FROM = "test-name@domain.com"
EMAIL_TO = "my-name@another-domain.com"
EMAIL_SERVER = "smtp.my-domain.com"
EMAIL_PASSWORD = "very-secret-of-course"
EMAIL_PORT = "587"

    syslog.syslog ('sending status email')
    subprocess.Popen([EMAIL_SCRIPT_WITH_PATH, EMAIL_FROM,
                      EMAIL_TO,
                      "System status: " + PrintString,
                      "Status of monitoring system " + PrintString,
                      EMAIL_SERVER,
                      EMAIL_FROM,
                      EMAIL_PASSWORD,
                      EMAIL_PORT]).pid

And on the other end, send-email.py looks like this:

#!/usr/bin/env python

# send a text email from the command line using python
#
# version 1.0
#
# Original code found at http://www.cs.cmu.edu/~benhdj/Mac/unix.html#smtpScript
#
# NOTE: if smtp username is "" then code will not use the smtp authentication method
#
# input parameters
#    sys.argv[1] is the sender email address
#    sys.argv[2] is the reciever email address,
#        this can be a comma separated string for multiple recievers
#    sys.argv[3] is the subject text
#    sys.argv[4] is the body text
#    sys.argv[5] is the smtp host
#    sys.argv[6] is the smtp username
#    sys.argv[7] is the smtp password
#    sys.argv[8] is the smtp port
#

import smtplib, email, sys, time
import syslog
from email.mime.text import MIMEText

# check to make sure the number of arguments is correct
if len(sys.argv) != 9:
  print 'Usage: pythonEmail.py <sender> <receiver> <subject> <bodyText> <smptHost> <username> <password> <port>'
  sys.exit(1)

# get the argv variables
sender = sys.argv[1]
receiver = sys.argv[2]
subj = sys.argv[3]
bodyText = sys.argv[4]
smtpHost = sys.argv[5]
username = sys.argv[6] # use "" if no SMTP authentication is required
passwd = sys.argv[7] # ignored if no SMTP authentication is required
port = sys.argv[8] # ignored if no SMTP authentication is required
 
# create a list from the receiver in case we have a comma separated string of multiple receivers
rList = []
rList = receiver.split(',');

# setup the message header
msg = MIMEText(bodyText)
msg['Subject'] = subj
msg['From'] = sender
msg['To'] = receiver

# determine if a passworded smpt host is being used and connect as necessary
if username == "":
    server = smtplib.SMTP(smtpHost) # smtp server is not password protected
else:
    server = smtplib.SMTP(smtpHost, port)
    server.login(username, passwd)

failed = 0
failed = server.sendmail(sender, rList, msg.as_string())
server.quit()

# return the status
if failed:
  print 'send-email.py: Failed:', failed
  syslog.syslog('send-email.py: Failed: ' + str(failed))
else:
  print 'send-email.py: Finished with no errors.'
  syslog.syslog('send-email.py: OK: ' + str(failed))

Have fun hacking!

Raising the Shields – Part 4: Encrypting E-Mails and How Search and My Smartphone Stand In the Way

On my way to putting some more privacy through encryption and self hosting between me and the rest of the world the next step was looking at email as that is certainly one of the main means of communication for me.

As I already use Thunderbird as my email client instead of a web mailer interface, getting PGP (Pretty Good Privacy) encryption to work is quite easy. The only thing that is required on my Linux notebook is the installation of the Enigmail plugin in Thunderbird, which is straight forward. On a Windows box, GPG (Gnu Privacy Guard) has to be installed in addition.

Once installed, the next step is to create a public/private encryption key pair of which the public key is then distributed to friends and colleagues so they can use it to encrypt email they want to send to me. The other end needs to do the same and once you have imported someone's public key into Enigmail's key repository, encryption works both way. Also, each end can digitally sign their emails so it can be verified that the email is not forged.

So much for the elevator pitch version, for detailed step by step instructions on how to get this working, have a look here.

Simplicity is Key

As I want to use email encryption to communicate with non-technical people one thing that is very important to me is that the Engimail plugin can be configured to automatically encrypt emails to addresses for which a public key has been imported. While not straight forward, this can be done by creating Enigmail encryption settings per email address. One can also configure Enigmail not to ask for a password to access the key store which makes encrypting and decrypting emails completely transparent to the user. Not quite ideal from a security point of view but probably the only option from a non-technical user usability point of view…

There is one big catch, however: Emails remain encrypted on the PC and searching the body text later on in Thunderbird is not possible as the decryption module is not hooked into search. I don't search my emails a lot but I need that function from time to time to find an important email I have sent or received ages ago. A pretty high price to pay for encrtyption if I can't search my email anymore. The obvious solution for this would be too hook decryption into the code that searches my email database. Another option would be, since my hard drive is encrypted anyway, to remove encryption from received and sent emails and only keep the sender's signature. This way, search would work again and emails would remain readable.

PGP on Mobile

I also need encryption and decryption of my emails to work on my Android smartphone. Again it turned out that I have the necessary stuff already in place since I already use K-9 mail instead of Google's native Android email program. While K-9 doesn't support PGP encryption out of the box there's an OpenPGP plugin called APG in Google's app store. K-9 needs to be reinstalled after APG is up and running but this is quite painless by exporting and importing K-9's configuration to a file.


Multipart-failUnfortunately, and that's another big catch for me, APG only supports simple emails.
Emails that come in multipart MIME format, e.g. because there's a file attachment, or because it has been setup up this way by the originator are not yet supported. When looking at the APG website and mailing list, it looks like there has been no real development since 2010. In other words, the project seems to have stalled.

Things That Are Never Encrypted

Despite encryption, the sender and receiver of an email are always sent as plaintext, so the metadata of whom I communicate with can still be recorded. Also the subject line of encrypted emails is also in the plain, something that one should also be aware of as well.

Summary

Being unable to search through stored emails that are encrypted and K-9's very limited PGP support, secure emailing becomes quite impractical for me for the moment. A typical
convenience trumps security decision. But these shortcomings are not inherent to the basic encryption process and could be fixed in furture software versions of Enigmail, Thunderbird and K-9.

The Presence Dilemma

Perhaps I'm old school but I have a presence dilemma. I'm referring of course to the presence status of many instant messaging applications that show all my contacts whether I'm currently online, offline or in a state in between.

For me the dilemma is that I feel that there is a difference between being online and having time or being in the mood to engage in a conversation. When I receive an instant message out of the blue and don't have time to respond I sometimes don't feel comfortable to reject the conversation as that might be seen by the other party as rude, especially if he or she is also 'old school'. Also I have to remember to 'text back' once I have time. Also not ideal.

I could of course set my client to 'invisible' but then I would forget later on to switch it back to 'available' when I am or feel reachable again. And no, I don't want to go fully offline with my instant messaging client as sometimes I still want to be reachable for a select audience.

Yes, human interaction is complicated (or perhaps it's just me?) and instant messaging presence is far from reflecting my reachability status.

New York Metro Wireless Coverage – First Stations Connected At Last

Ny-wirelessNext to the London tube, New York's underground transportation system is one of the few places I have noticed over the years that still lack wireless coverage on a broad scale. It looks like things are changing though as I was positively surprised to have coverage in one of New York's metro stations recently. Have a look at the picture on the left to see how the antennas look like. I had to smile a bit because the cables and antennas are significantly bigger than those in the Paris metro for example. Also one antenna in the Paris metro suffices for four networks while New York needs three. But then, everything seems to be a bit bigger in the US.

Anyway, I did a bit of background research to see how far the project has come so far. Looks like there are currently 36 stations covered but there is no talk of the tunnels in between the stations. For details see here. Better than nothing but that's lacking a bit of ambition. I am sure some will point to the fact that the New York metro is old and tunnels are narrow. That hasn't stopped in-tunnel coverage in Paris though where similar conditions can be found.

The article linked above has some interesting details concerning who pays for the deployment and how much it costs. It looks like a separate company called Transit Wireless was established to bundle all technical and financial matters:

Transit Wireless and the carriers are paying 100 percent of the cost of
the project, estimated at up to $200 million
[MS: for around 280 stations], including the cost of NYC
Transit forces that provide flagging, protection and other support
services. The MTA and Transit Wireless evenly split the revenues from
occupancy fees paid by the wireless carriers and other sub-licensees of
the network. Transit Wireless is paying MTA a minimum annual
compensation that will grow to $3.3 million once the full build out of
the network is complete.

When dividing the $200 million by 280 base stations and potentially 4 network operators (leaving the Wi-Fi coverage that is also part of the project out of the equation for the moment) the cost of covering one station is about $180k per network operator. I can imagine that this is more than the costs of setting up a base station site above ground but it still seems to be a reasonable sum to me, especially when compared to the tens of thousands of people that pass through a station daily that generate traffic and revenue.

The post above then also describes some technical details of how coverage is distributed to the underground stations:

Wireless carriers […] co-locate their Base Stations with Transit Wireless’ Optical distribution equipment at a Transit Wireless Base Station Hotel, which is a resilient, fault-tolerant commercial facility with redundant air-conditioning and power.

[…] These Base Stations connect to Transit Wireless’ Radio Interface and Optical Distribution System in the Base Station Hotel. Radio signals are combined, converted to optical signals and distributed on Transit Wireless’ fiber optic cable through ducts under city streets to subway stations where the optical cables connect to multi-band Remote Fiber Nodes.

Remote Fiber Nodes are located on every platform, mezzanine and at various points within public access passageways. Coaxial cable is connected to each Remote Fiber Node and extends signals to strategically located antennas throughout each subway station. Utilizing this approach, low-level radio signals are evenly distributed providing seamless coverage from above ground to underground stations.

According to the article, the deployment includes free Wi-Fi as well which is good news for international travelers that are reluctant to use cellular data services due to high roaming charges.

Raising the Shields – Part 3: PRISM Break

It's quite obvious that privacy and anonymity doesn't come built into most computing and online products today. I hope my 'Raising the Shields' posts are giving you some ideas and background information what is possible and what you might want to use yourself both while mobile and at home.

While doing some research I came across an interesting site called 'PRISM Break – Opt out of PRISM, the NSA's global data surveillance program'. Lots of great links there to programs that protect your privacy online in areas such as web browsing, email, search (ever head of Duck Duck go!?), maps, instant messaging, voice and video calling, cloud storage, etc. etc. etc.

I immediately found half a dozen tools I haven't come across so far and that I definitely want to try out in the weeks to come. So head over and have a closer look!

Learning How Computers Work vs. How To Work With Computers

Nostalgia post – part 2. During the revival of my electronic kits use from my teenage years about which I blogged previously I stumbled over a 30 year old computer advertisement conveniently put on the back of one of the instruction manuals. No, we are not talking about computers as we know them today. No, this was an advertisement for a 4-bit (!) experimental computer, the Busch electronic 2090 microcomputer.

Based on a TMS-1600 processor and designed less than a decade after Intel produced their first microprocessor (the 4004) it would have been a dream for that 13 year old boy. Unbelievable nowadays when kids use "real" computers today before they even go to school. So that was my object of desire and today it feels like I would have willingly forgone 5 years of pocket money to get one. But I never got one, partly due to me not having the money to buy one myself and partly because I guess my parents had no idea why in the world they should spend money on this. Different times. Out of interest I did a bit of research of how much that Busch 2090 cost in the mid 1980's. I didn't find anything on the net at first but then I remembered that I have a few computer magazines from the 1980's in my cabinet that might contain an advertisement. And indeed I found an advertisement in the first C't magazine ever published in December 1983 from the manufacturer where the price was given as 299 DM (Deutsche Mark). With inflation and salary increases included I estimate that the price would be equivalent to what 300 Euros are worth in 2013. The magazine is available as a PDF from the publisher here. Have a look at page 26.

As can be seen in the only video on Youtube that shows the device, there's no keyboard as we know it, no screen, just a hex-input block and a 6 digit 7-segment display, 4k ROM and around half a kilobyte of RAM. Almost unfathomably little today. But it did one thing very well then and would still do it today: It shows how computers work (and not how to work with computers).

The manual that can be downloaded from the history section of the manufacturer's website teaches on only 80 pages the very basics of a computer. How does a microprocessor work, what is a bus, what's binary, what's the hexadecimal system and why it is needed, boolean logic, input and output, how does a microprocessor calculate, etc. etc. On 80 pages (including the code) and written in a way understandable for teenagers with no previous knowledge about the topic. Amazing!

Unfortunately these devices have become very rare. They were probably already rare 30 years ago as most kids probably experienced the same difficulties getting one as I did. So I keep my eyes open on eBay, perhaps I will get lucky one day. In the meantime I was wondering if there are equivalent learner kits today. Raspberry Pis are great for learning how to work WITH a computer, how to program it and to build many cool things. But it runs a full operating system, so everything is abstracted to such a level that it's difficult to use it for learning HOW a computer works. Arduino's might be better for the purpose perhaps but the way I understand the goal of that platform is that the software that comes with it again abstracts the underlying hardware to give people easy access to a device that can interact with the real world. That's great of course but again it doesn't teach people of how computers work.

When searching on my favourite web store portals I equally came up empty handed. Can it really be that today there are no computing kits for kids in their teens (or to grown ups that don't aspire to get a bachelor in computing but still want to know how a computer works) so they can learn how a CPU works and how it interacts with memory, input output devices and all the other magic!? It seems not but please prove me wrong, I'd really like to hear about it.

In the meantime I keep musing about whether perhaps an Arduino with an input/output shield, a hex keyboard and a 7-segment display combined with a software similar to what ran on the Busch 2090 could do the trick today. Open source for the enjoyment of parents and kids!?

Raising the Shields – Part 2: Certificate Patrol

In the majority of cases, https provides privacy and security by encrypting and decrypting data traffic to and from a web server. The mechanism is based on web server SSL (Secure Socket Layer) certificates and public/private keys that are exchanged during connection establishment. Data sent to the other end is always encrypted using the public key of the recipient. Decryption is only possible with the corresponding private key on the other side. This kind of encryption works as the private keys are never exchanged and hence nobody intercepting the data on its way from source to destination can decrypt the information. There is one weakness, however, most people are not aware about.

How does a web browser know that the web server's public key was actually sent from the web server and not from someone that sits in between the web browser and the server? For this purpose the web server sends an SSL certificate during the https session establishment that is signed by a certificate authority the web browser trusts. To get such a signed certificate a web site owner has to register with a certificate authority that web browsers trust. Unfortunately, there are a huge number of certificate authorities today that are trusted by web browsers and many are operated by what some would consider less than trusted entities. And here lies the weakness.

If a man in the middle gets hold of such a certificate authority he can create certificates for any domain on the fly. As a web browser does not check if the certificate authority for a web site has changed since it was last visited this goes unnoticed and opens the door to anyone that is able to perform a man in the middle attack with traffic diversion.

This is where Certificate Patrol, a Firefox add-on comes in. It stores certificates it has previously seen and compares them against the certificate presented by a website it has come across before. If they don't match a warning is shown to the user with the details. There are valid reasons for websites to exchange their certificates such as for example once their validity time has expired. This is also checked and Certificate Patrol informs the user that the certificate change was likely o.k. due to this reason. I've been using the add-on for quite some time now and it has become quite refined these days. I haven't come across fraudulent certificates so far but it feels good to know that I would see it should it ever happen. What's missing at this point is something similar in Thunderbird for ensuring the certificates for POP3 and SMTP email communication are not tampered and a similar solution for my smartphone.

Agreed, creating certificates on the fly and inserting oneself in the
traffic stream is far from easy to do but I would not be surprised if
this was part of the toolkit of certain three-letter agencies.

Book Review: Voice over LTE (VoLTE)

Do you want to learn about VoLTE but you are not sure where to start? If so, here's a tip for you:

Volte-bookLearning how VoLTE works in a reasonable amount of time is not an easy task, there's just so many things to learn. Reading the 3GPP specifications to get up to speed as a first step is probably the last think one should do as there is just too much detail that confuses the uninitiated more than it helps. The get the very basics, my books probably serve the purpose. As they don't focus only on VoLTE however, that might be too little for people who want to focuson VoLTE. This is where Miikka's Poikselkä book on VoLTE comes in that he has written with others such as Harri Holma and Antti Toskala, who are also very well known in the wireless industry.

If you are involved in Voice over LTE, you have probably heard the name Miikka Poikselkä before. He must have been involved in IMS since the beginning as he's published a book on IMS already many years ago and he is also the maintainer of the GSMA specifications on VoLTE and other topics (e.g. GSMA IR.92). In other words, he's in the best position to give a picture of how VoLTE will look like in the real world vs. just a theoretical description.

I've spent a couple of quality time hours so far reading a number of different chapters of the book and found it very informative, learned quite a few new things and got a deeper understanding of how a number of things influence each other along the way. The topic of the book could have easily filled 500 pages but that would have looked a little overwhelming to many. But I am quite glad it wasn't that much and in my opinion the 240 pages of the book strike a very good balance between too much and too little detail.

The book is perhaps not for beginners as many concepts are only quickly introduced without going deeper, which, however, suited me just fine. In other words, you'll do fine if you have some prior knowledge in wireless networks. With my background I found the introduction chapters on deployment strategies and the VoLTE system architecture, that also dig down a bit to the general LTE network architecture to be just at the right level of detail for me to set things into context. This is then followed by the VoLTE functionality chapter that looks at radio access and core network functionalities required for VoLTE, IMS basics on fifty pages, IMS service provisioning on an equal level of detail and finally a short into to the MMTel (Multimedia Telephony) functionality. Afterward, there's a detailed discussion about VoLTE End-to-End signaling that describes IMS registration, voice call establishment and voice call continuity to a circuit switched bearer on 60 pages, again at the right level of detail for me. CS Fallback, although not really part of VoLTE is described as well. Other VoLTE topics discussed are emergency calls, messaging and radio performance.

In other words, a very good book the bring yourself up to speed on VoLTE if you have some prior experience in wireless and a good reference to refresh your memory later on. Very much recommended!

Raising the Shields – Part 1: Off-The-Record (OTR) Instant Messaging

OtrI use instant messaging between family members and friends quite a lot as it's a fast and efficient communication tool. But communication is easily intercepted as everything is transferred over a centralized server. That's not good as I like my conversations to be private. In a recent Security Now podcast, Steve Gibson has made me aware of an interesting solution called 'Off-The-Record' (OTR).

Not only does OTR provide perfect forward secrecy for message content for all kinds of IM systems (except unfortunately for Skype as it's proprietary) but it also has a built in mechanism for 'plausible deniability', i.e. it's not possible to prove later-on that a particular message has actually been sent by a particular person. A bit like talking in a sound proof room between two people: Nobody can hear what's said when it's said and its not possible to proof what was said later-on by anyone as there are no witnesses. To find out how exactly this is done I recommend to listen to the security now episode linked above.

On Ubuntu, the OTR plugin for Pidgin is already in the repository and installation is simple. For Windows and Mac it has to be installed separately via the author's web page. On Android, Xabber might have what I'm looking for but I haven't tried it so far and I also haven't checked out if the program itself comes from a trustworthy source.

While OTR protects the content of messages it can't of course protect the information of who communicates with whom as the centralized server is aware from and to which an encrypted message is transferred. This can only be fixed by using a non-public instant messaging server. So for family related IM I am strongly thinking about installing my own Jabber server at home on a Raspbery Pi. I haven't done that so far but it seems to be straight forward. More on this once I've tried.