Archive

Archive for the ‘Technical’ Category

ADSL in Jordan

August 3rd, 2011 No comments

I’ve heard various complaints from a few friends of mine about the status of Internet connectivity in Jordan, especially ADSL. So I’m writing this article to explain what is going on and why ADSL the way it is, but first, some history.

Back in pre-broadband times, people used dial-up modems to connect to the Internet. The name “modem” came from the fact that data was being modulated (Turned from digital to analog form) to be sent over the phone lines, and demodulated (Turned from analog to digital form) at the other end. This utilized the same frequencies used for regular phone conversations, this is why you could hear the weird sounds if you picked the phone up while being connected to the Internet. Given the relatively narrow frequency range used by phones this technology was limited to about 56Kbps, the best speed I got was back in 2003 which was about 5KB/s for my downloads, and that was considered fast at the time.

Then someone figured out they could fit a much bigger frequency range in existing phone lines. The ingenious thing about this idea was the ability to leverage existing infrastructure and allow phone companies and ISPs (Internet Service Providers) to sell much faster speeds with insignificant investments compared to having to switch the entire infrastructure to fiber optics, also allowing people to use the phone even while being on line.

ADSL stands for “Asymmetric Digital Subscriber Line”, which means the technology allowing digital transmission of data over the existing wires of the local telephone network. The “Asymmetric” part means the upload and the download streams are not of the same speed. Home users almost always care more about download speeds, so it only made sense that the technology utilized more frequencies for download. This meant we could now get download speeds of up to 2Mbps, depending on how far you are away from the exchange.

Now for some technical details. Back in the 70s landlines were the only means of telecommunication. Governments laid down huge telephone networks. This is how a telephone network typically looks like. Please note that this is a very simplified diagram.

ADSL is a “Last Mile” solution, meaning it only cares about connecting subscribers to the exchange, and not how the whole network operates, so this diagram is enough for our needs. The interconnections between the exchanges have no effect on ADSL so we’re leaving them out.

As you can see in the diagram, telephone companies run cable bundles from each exchange to street cabinets, then from those cabinets to each house or office. This method is used to organize how the cables are laid down. Each cable bundle can reach up to 5Km in length. Cable bundles (1,200 cable pairs) and cabinets look something like this

                 

 

As with every electrical signal traveling through a conductor, ADSL signals suffer from 2 electrical phenomena; Attenuation and crosstalk.

Attenuation is the gradual loss of signal intensity as it passes through a medium. Of course, the longer the distance the greater the attenuation. The greater the attenuation, the slower the final connection speed can be. Here is a graph detailing the relationship between cable length, attenuation, and final connection speed. Note that Orange uses both ADSL (Up to 8Mbps) and ADSL2+

Crosstalk is the phenomenon by which a signal traveling in one circuit creates an undesired effect on another circuit. It is usually caused by undesired capacitive, inductive, or conductive coupling of one circuit to another. What this means is when electrical signals pass through copper cables, they create interference for any adjacent cables. As you can see in the following diagram, all the cables around the victim cable are generating crosstalk which is affecting signal quality. Consequently, the more cables the more powerful crosstalk is.

Crosstalk generates noise, and attenuation lowers the original signal strength and makes it closer to that noise. The higher the speed, the more destructive the noise becomes. If a line is too noisy, the ADSL connection will become too slow or even drop.

To solve this issue, modems perform a sync operation with the exchange, they try to connect to the exchange at the maximum speed possible, then lower that speed to achieve an acceptable noise level, they also leave a noise margin to allow for fluctuations in noise throughout the day. This explains why most homes in Jordan cannot get anything faster than 2Mbps, with some of them getting as low as 128Kbps. This also explains why speeds go down during un-metered (A.K.A. free) download hours in some areas.

Times change, technology matures, content become more rich, and more importantly, competitors arrive. With the clear change of the type of content showing on the Internet and with the rise of competing technologies, i.e. WiMAX, Orange had to start upgrading their network. People were no longer content with the speeds provided by the ancient network built by the government during the 80s, and some of them were bound to leave ADSL and switch to WiMAX, especially since WiMAX didn’t have the phone line overhead and users were no longer confined to the locations they bought the subscriptions for.

Given the number and distribution of users in Jordan, delivering fiber optic connections to each house was out of the question. Contractors charge 22-30JDs per meter for excavation, so connecting a house 300m away would cost 6000JDs in digging costs alone, which is highly unfeasible for a 50JD per month return. In countries like South Korea, population is so dense, each tower has at least 100 users, if you consider a 6000JD cost of laying down the cables compared to a 2000$ monthly return on investment (Assuming 20$ per month for each connection), it’s a very easy decision.

Orange chose a cheaper approach and went with Fiber To The Cabinet (FTTC). FTTC allows Orange to connect a single fiber cable to a digital cabinet close to the user premises, usually next to one of the older copper cabinets. This cabinet acts like a small exchange and contains the equipment to which modems connect. They then connect short cables from the new cabinet to the old one, which is connected to the cable reaching the customer premises. So now, the telephone network looks something like this

I showed a single FTTC cabinet in the figure because they are still not as common as their copper counterparts. FTTC cabinets look like this

How is this useful you might ask. Well, fiber optic cables have very little crosstalk, if any, and attenuation is an order of magnitude smaller than copper wires, especially for long distance. This effectively lowers the distance between the exchange and the modem from 5-6Km to only a few hundred meters, 1Km the most. It also reduces crosstalk between copper wires because those branch out from the cabinet and are not bundled together.

This allowed Orange to reach their current speeds of 24Mbps for some areas. Please note that when I say 24Mbps, I mean for those who live within 100m of a fiber cabinet, any further and the speed will drop. I currently live 500m away from the FTTC cabinet and my line speed is 21Mbps, further distances will get even less speeds.

I’m disappointed with the fact that these FTTC cabinets are not more common and densely distributed. Most areas in Jordan are still covered with copper cabinets, giving most users a best case speed of 4Mbps. Given the amount of money Orange makes, they should be upgrading their network much more rapidly. This is one of the reasons why a lot of areas are leaving ADSL in favor to wireless broadband, especially after the launch of Zain’s HSPA+ service.

I hope this erases some of the misconceptions about ADSL, and I do hope Orange executives become more diligent about their upgrades and have a maximum distance of 500m from any FTTC cabinet.

Categories: Technical Tags: , , , ,

First Thoughts of @ZainJo’s HSPA+ Service

April 5th, 2011 4 comments

Lately ISPs have been bombarding us with all sorts of Internet related ads, promising “high speeds” or “unlimited downloads”. Osama Hajjaj said it best with this comic:

I want to get a few things straight before we move on

  • Since what you’re paying for is essentially shared bandwidth, it can never be “unlimited”. ISPs need to make money as well, so they can’t let you hog their bandwidth, but in the case of ADSL, unlimited downloads during the night is possible because most users are asleep, and those few heavy downloaders won’t affect the mostly un-utilized ISP uplink
  • For the same reason as above, what ISPs are advertising is a best case scenario, so there are times when you will be facing slowdowns. Reasons for slowdowns differ for each technology used. With wired being superior to wireless.
  • A respectable ISP will minimize those slowdowns as much as possible. Zain failed in this respect with WiMAX, let’s hope the same doesn’t happen to their HSPA+ service
  • ISPs try to sell a lot of corporate bandwidth, which is very profitable, then try to use that bandwidth during the night for residential users to minimize costs.

A question raises itself, do we really need all this speed? The FCC defines “broadband” as having 4Mbps or more, looking at the Jordanian market, most people are below 1Mbps, so maybe 80% do not have broadband. Another question raises itself, does it really matter? No, for most people anyways.

Let’s look at how Jordanians use the Internet, most people only use it for browsing, email, the occasional photo sharing, and in rare cases, video streaming.

Even for the pickiest of users, the difference in speed is only noticeable up to the 2Mbps mark, the above uses will not change the experience for anybody. Most websites are not properly built so they’re slow, and video streaming (for standard definition) will buffer faster than playback speed, so it won’t be of any benefit to the user. Even for those who use the lower speeds, they don’t really care.

Why then, you ask, do we need “proper” high speed Internet? The answer is simple, downloads. If you’ve ever waited on a file you need for work to finish downloading, you’ll realize why high speed is nice to have. I personally download a lot of ISO images to test numerous system configurations, I also download the actual programs to perform the required testing. Having to wait 15 minutes for a 70MB file is never good. I had to switch from FreeBSD to Ubuntu Linux for my prototyping needs because Ubuntu requires much less downloading. If I had 8Mbps (Been 3 weeks since I paid Orange for an 8Mbps account, which I’m still waiting for) instead of my current 1Mbps the download would take about 2 minutes, which is OK by all standards. If you download TV shows or movies, the problem becomes even worse; A 20 minute HD video is about 650MB, that’s a 3 hour download on a 1Mbps connection, with 8Mbps, that’s 20 minutes, a BIG difference.

Up until recently, there were no cheap Internet connectivity options. Or let me rephrase, no cheap “decent” connectivity options. 13JDs for a 128Kbps is not considered cheap, for an option to be considered cheap in Jordan, it’ll have to cost around 5-10JDs a month and it definitely has to be faster than 128Kbps to allow the occasional Youtube streaming without having to buffer for 15 minutes. For those who only used 2GB a month (yes, those people exist), they had to pay 30+JDs for 10-15GB which they never used.

After the introduction of WiMAX back in 2007, prices went down, but not much. Orange still had dominance over the market for 2 reasons; They were the only company that bought bandwidth from international ISPs, and their networks were far superior to WiMAX given the fact it’s wired, so the others were unable to match Orange on terms of speed. Not to mention that Orange’s network has been here for ages, which allowed them to upgrade it while still making money, which cannot be said about the others.

Now comes the primary reason for this post, Zain’s HSPA+. Now that Zain has come with a somewhat reasonable alternative, which had various options depending on your usage levels. Starting from 6JD for 1GB up to 49JDs for 30GB. Those should suffice the needs of about 97% of Jordanians.

I was given a 1 month subscription along with a 21Mbps dongle, the Huawei E367, which was surprisingly Linux compatible. Zain gets extra points for this particular selection.

The frequency used by HSPA+ is higher than GSM, which means GSM has better signal penetration. In my house, I can barely make voice calls. So when my phone barely picked up the signal I wasn’t surprised. I thought the dongle would have better reception than the phone, sadly that wasn’t the case. But if you look at any wireless technology, those don’t really work with the buildings we have in Jordan. If you have heat insulation you will most probably not get any good signal indoors.

When Zain first released the service I faced a lot of dropped calls and broken messages, but I haven’t faced them as much lately, I guess this comes with being an early adapter. I do however keep my phone on GSM most of the time to make the battery last longer, and to make use of GSM’s better coverage.

To do some testing, I took the laptop to the roof and tried to connect, sadly I only got 2 bars, very disappointing, but that gave me about 4Mbps download (no screenshot for this one folks, sorry).

Then I went to a coffee shop in Swiefeyyeh to try it out, 2 bars as well. I also assume this is because the network isn’t a 100% ready, so hopefully it’ll be better in a month or 2., but this time I gotGood, but still not as good as the advertised 21Mbps, I assume this is because Zain’s network is still new, and you’ll need to have a full signal to at least have a chance of getting the full speed. Downloading from a dedicated server gave me about 900-950KB/s, very good.

Then on the way home I bought a USB extension cable, upon arriving to my desk, I connected the dongle to my laptop using the cable, and thew the dongle out of the window, this time I got 2 bars, and the following speed:

This was OK. Download speed from the dedicated server got to about 300KB/s, good.

Now for the most important usage of this connection, browsing. To be honest, I was very disappointed at first, because page load times were not that of connections that get the speeds above. After a few minutes I changed the DNS settings on my connection to Google’s 8.8.8.8 servers and browsing was much better afterwards.

I’ve noticed that Zains’ DNS servers have been slow ever since WiMAX, they use BIND which is one of the most popular DNS servers on the Internet, I assume they’re running it on some Linux distribution. I’m not a big fan of that particular setup. If someone at Zain reads this, please try using NSD for authoritative servers and Unbound for your caching servers, also try installing them on FreeBSD, which has a much better TCP/IP stack implementation.

Youtube was slower than I expected, but still fast enough, although I didn’t try watching HD video, so your mileage may vary. I also noticed the dongle becomes warm after some time, wasn’t very impressed with that.

OK, to the conclusion, is this worth buying? For me, it was a bit underwhelming, but for a lot of people, they’ll find it does the job. I would stay away from it if there a is commitment involved, but if you can cancel your contract if Zain starts messing up then by all means try it. No commitment means Zain has to keep the service working well to keep the customers.

For people like me who download a lot, I say stick with DSL, it’s still a better option. Given the fact it’s not very good indoors, at least in my house, I wouldn’t bother with it for anything other than a secondary connection when at clients, if it actually works.

My personal experience with Zain is that the service will be great at the beginning, but then the network will get congested and they won’t bother upgrading. Let’s hope the same doesn’t happen with HSPA+. Note however that their network is very young, and they have built it in record time. So facing these issues at this time is normal, let’s hope they make it better, not worse.

Oh, and if you get it, make sure you don’t deplete your download quota, and check it frequently. If you end up using a lot it will be VERY expensive.

Using the @ZainJo HSPA Dongle With Ubuntu Linux

April 4th, 2011 No comments

After my experience with Zain’s WiMAX, I didn’t think I’d be using their service again. But Zain gave me a 21Mbps dongle (The Huawei E367) for free as to see how much better the new service is and I thought I might as well try it. I’ll be writing on my experience with the service in a separate post inshalla.

I’m a big Ubuntu fan and been using it as my primary desktop since 2007, and Linux compatibility has always been absent in the mobile Internet world. I wasn’t gonna switch my primary OS just to use a USB dongle.

After plugging it in nothing happened, didn’t see a notice on the screen, no pop-pups or anything to show that something happened. After a quick lsusb I found this:

Bus 002 Device 005: ID 12d1:14ac Huawei Technologies Co., Ltd.

Kudos Huawei on showing us Linux users some love. Zain gets extra points for this choice.

Ok let’s get this bad boy configured. I got the settings from Zain’s Windows application. The following was done on Ubuntu 10.10, other distributions might vary.

1) If the dongle was unplugged when you booted your computer, restart Network Manager (sudo service network-manager restart), wait a few seconds, then right click the Network Manager icon and choose “Edit Connections…”

2) Go to the “Mobile Broadband” tab and click “Add” (You will not see “Zain Jordan” on your screen)
3) The following screen will show up, if you didn’t restart Network Manager you will not see the Huawei modem, click “Forward”
4) Choose “United States” then click “Forward”, don’t bother looking for Jordan, you won’t find it
5) Choose “I can’t find my provider and I wish to enter it manually”, then enter any name you desire, I chose “Zain Jordan”
6) Choose “My plan is not listed…” and for “Selected plan APN (Access Point Name)” enter “zain”, all lower case letters, without the quotes, then click “Forward”
7) Click “Apply”
8 ) The following window appears, don’t change anything except “Username” and “Password”, set them to “Zain”, all lower case except for the Z, then click on “Apply”
9) You’re all set, to connect, left click on your Network Manager icon and choose your connection name
If you face any issues, just remove the dongle, reconnect, then restart Network Manager.

Categories: Linux, Technical Tags: , , , ,

Ubuntu 10.04

When Ubuntu 9.10 came out I was very eager to try it, but sadly I was very disappointed. So when I was downloading 10.04 I wasn’t really expecting anything. I’m glad I was wrong.

So far it appears the sound and flash issues have been fixed. Empathy seems to have gotten some improvements. Most noticeable are the fact it now saves the window position of the contact list, and gives you an indication when the person you’re chatting with on Google Talk is typing something on the keyboard.

If you hate the new window button placement, like I do, here’s how to fix it:

  1. Open gconf-editor
  2. Got to /apps/metacity/general
  3. Change “button_layout” to “menu:minimize,maximize,close”
Categories: Linux, Technical Tags: ,

Delete all Messages from a POP3 Account

April 21st, 2010 1 comment

Here at the office, we host a few domains with Verio. Not my choice, and I’m not happy with it. We also host some mailboxes for one of those domains with Verio. I got a message from Verio support saying the mailboxes for that domain are occupying around 1GB of space, and that we need to delete some of them.

Turns out the mailboxes were neglected for months, and one of those mailboxes got around 55,000 messages.

Simple enough, I said, let’s log in to web mail, keep recent relevant messages and delete the rest. But the web mail interface kept timing out, and I couldn’t access any of the accounts. Seems they built their own web mail interface, which tries to load everything in your mailbox. This makes it time out when a mailbox has this huge number of messages.

After contacting Verio’s support they gave me an IP address to use as an IMAP server, which, surprisingly (well, not really, I expected it) wouldn’t connect. After a few days of deliberation the department in charge of the accounts decided to delete all messages in all accounts.

At first I configured Evolution to download all messages from POP3, which thankfully worked (Thanks Dovecot), but that took too long, and downloading 50K messages would overload our uplink. A simple solution would be as follows:


#!/usr/bin/python

import poplib

server = 'server'
user = 'user'
password = 'password'

whenToQuit = 500
loop = 0
totalMessages = 0 

while 1:
        M = poplib.POP3(server)
        M.user(user)
        M.pass_(password)
        numMessages = len(M.list()[1])
        if totalMessages == 0: totalMessages = numMessages
        i = 0
        for i in range(numMessages):
                print 'Deleted %d out of %d messages' % (loop * whenToQuit + i + 1, totalMessages)
                M.dele(i+1)
                if i == whenToQuit - 1:
                        M.quit()
                        loop = loop + 1
                        break

        if i != whenToQuit - 1:
                M.quit()
                break

Since the actual deletion of messages happens when a client “quit”s, I wrote this to do a quit after 500 message, this will enable you to quit the script after some time without having to lose all the progress.

Hope this helps.

Categories: Technical Tags: , , , , , ,

Speeding up Firefox under Ubuntu

February 14th, 2010 No comments

Ever wonder why browsing under Ubuntu is slower than Windows even on the same network? Well, it has to do with Ubuntu enabling IPv6 by default. This means Ubuntu will try IPv4 only after IPv6 times out. Also, Firefox comes built with Pango by default which makes it slower than it should be. I’ve fixed that on Karmic Koala, other versions should be similar. Here’s how to do it:

Disable IPv6 globally:

sudo vi /etc/default/grub

then find

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

and replace it with

GRUB_CMDLINE_LINUX_DEFAULT=”ipv6.disable=1 quiet splash”

Then update grub from the command line

sudo update-grub

Tell Firefox not to load Pango:

vi ~/.bashrc

and add

MOZ_DISABLE_PANGO=1

at the end

Tweak Firefox’s about:config settings:

network.http.pipelining -> True
- network.http.pipelining.maxrequests -> 8 or 10
- network.http.proxy.pipelining -> True
- network.dns.disableIPv6 -> True

Enjoy

Cleaning up your boot partition with Ubuntu

December 25th, 2009 No comments

If you haven’t reinstalled Ubuntu in a while, the /boot partition will eventually fill up with all the updated kernels, and you’ll get an error when trying update.

At first I used to uninstall the old kernels manually but being lazy I think it’s too much work. When you get the error with update-manager or Synaptic try this:


sudo aptitude search linux -w 160 | egrep '(image|headers|restricted)' | egrep '^i' | grep -v 'KERNEL_VERSION' | grep -v -P '[^d]-generic' | grep -v linux-restricted-modules-common | sed 's/i A/i  /' | awk '{print $2}' | xargs sudo aptitude remove

Replace “KERNEL_VERSION” with your currently running kernel.

This might break your grub configuration but update-manager will fix that for you so no need to worry. Just make sure you run this BEFORE update-manager does the update.

To be honest I didn’t try this without “grep -v ‘KERNEL_VERSION’” so I’m not sure if removing it would break something. Just leave it there to be safe.

Categories: Linux, Technical Tags:

My Experience with the Motorola CPEo 400 Wimax CPE

November 10th, 2009 22 comments

Where I live we have no proper DSL (512Kbps max), GSM signals are weak. Sometimes I have to stick my head out of the window just to be able to make a call. Even when I got my Wimax account the indoor CPE kept disconnecting every few minutes. I finally managed to get my hands on an Outdoor CPE which made things much better. Typical for someone living at the edge of the world (West Amman).

The Motorola CPEs act as network gateways, they connect to the Wimax network and do NATing for you. That’s nice for a home network, less stuff to configure and less clutter.

The indoor CPE worked well when it had coverage, but when I switched to the CPEo 400 I started running into all sorts of problems; DHCP and DNS stopped working, Connection drops, signal losses, and CPE restarts for no apparent reason.

Calling customer care for a week didn’t help, as you know it’s useless if your problem is a bit different. Oh believe me, Orange’s customer care is much worse, at least with Zain they tell you if they’re experiencing technical issues, with Orange it’s always your indoor wiring.

Turns out there are some bugs in the OS running on the CPE, I’m assuming it’s some sort of Linux distribution gone horribly wrong (Software version 02.01.90-02/11/2009). If you turn on UPnP all Hell breaks loose. I thought I should share this because of the lack of documentation and support for this particular unit.

You have 2 solutions, choose whichever fits your technical skills and/or your time.

Solution 1 (simple): This was the first one I went with, just connect the CPE to the WAN port of your aDSL router. Configure a static IP address and DNS on the router so it won’t use the CPE and use that IP as the DMZ. This will have the CPE forward all traffic to the router and have the router handle all the UPnP issues. This, however, you’d end up with double NATing, something not everybody likes.

Solution 2 (A bit technical): Install dd-wrt on your aDSL router and have it take of DHCP and DNS, then configure the default gateway as your CPE. You won’t have UPnP here but you can set up port forwarding on the CPE which should work fine.

Categories: Technical Tags: , , ,

VMware remote console Firefox plug-in and arrow keys

June 30th, 2009 3 comments

VMware remote console was working properly for me when I was using Ubuntu Hardy. After upgrading to Jaunty the arrow keys stopped working inside the remote console. Seems some people face this problem even under windows.

A search got me to this:

echo xkeymap.nokeycodeMap="TRUE" > ~/.vmware/config

Just close any open remote consoles and open up again and you’re in business.

Categories: Technical Tags:

Lighttpd, Joomla, and clean URLs

June 22nd, 2009 No comments

So I’m working on a new web server but I don’t want to use Apache since it’s a virtual machine. Had some trouble with the rewirte rules but I think I got them

From this forum post


$HTTP["url"] !~ ".(gif|png|css|jpg|jpeg|js)$" {
   server.error-handler-404 = "/index.php"
}

But I thought of a different approach and it seems to work so far, and maybe causes less error messages in the logs:


url.rewrite-once = ("^/(.*.html)$" => "/index.php?page=$1", "^/(.*.html?.*)" => "/index.php?page=$1", "^/(.*/?.*)" => "/index.php?page=$1")

Have a good one

Categories: Technical Tags: