Monday, November 29, 2010

An Amateur's Analysis of Nifty 50



How to time the market

Is it a right time to enter market? is there a potential upside from here? If you ask these questions to value-investors, they would say look at P/E. If P/E is high, the stock is said to be expensive and if low, the stock is said to be cheap. Buy a stock when it is cheap and sell it when it is expensive. simple, right? But the problem is how to establish if a P/E number is 'high' or 'low'? Pundits would ask you to take a look at the industry in which the stock in question belong and compare it with its peers.

To me, any single stock is too much of a risk. Even if you are an employee in a company there is a high probability that you wont know what is going on 'in-side' the company. Remember Satyam/LIC HF/Enron? Nor I have time to construct and prune a portfolio. It is too much of an effort. So, I would put my money into index ETF, which i think is a simple investment strategy that would not drain my time at the same time, gets me decent returns by the virtue of equity exposure. My favourite vehicle Niftybees is quoting about 589,which would be 1/10th of index value (with tracking error of about 1%). I don't want to blindly buy niftybees to get just "Rupee cost averaging". I want to restraint from buying whenever market is too expensive (hence build up cash) and resume to do SIP when it is not. As on 29 Nov 2010, nifty is trading at 5830 with current year's P/E of 23.

So, the question is, Does it make sense to put more money into this ETF or should i wait on the sidelines? Let us see if we could analyse the nifty index and try to arrive some answers.

Before I start, Let me tell you I am going to treat nifty index as a stock. I have downloaded the Nifty Index P/E from www.nseindia.com site from Jan 2002 till today.

At first cut, I get following

Jan 2006 - today
Average: 18.1 Min:10.7 Max:28.3 Std Dev: 3.8
This shows that over a long term, P/E has moved between the band of 11 and 28. Very wide band indeed.

Jan - Dec 2008
Average: 18.7 Min: 10.7 Max: 28.3 Std Dev: 4

Jan - Dec 2009
Average:18.7 Min:13 Max:23.2 Std Dev:3.7

Jan 2010 - 26 Nov 2010
Average:22.8 Min:20 Max:26 Std Dev:1.5

This shows me that today's P/E of 23.3 is more than average p/e so market is expensive. This also tells me that overall, 2010 valuations are stretched comparing long term.

Let us drill deeper. I plotted p/e distribution across the time line.
Key Take-away 1: Over the period of last 3 years, the is progressively become more expensive.
Key take-away 2: In 2010, mostly PE of 23 is sustained.

Now, 23.3 is very expensive if i compare last 7-8 years. But, it is close to average for the year. So, what will i do? probably I will stay on cash, waiting for correction to kick-in. Or I can invest little and keep the remaining in cash, look for right P/E level to enter.

I would probably do the later.

Disclaimer:
* I am not a qualified financial advisor nor a money manager. I manage my own money.
* This is not an advert for Niftybees - I do own some Niftybees.
* Opinion expressed here are mine it could be out-right foolish OR extremely genius, depending on how much you know on this subject.
* Calculations shown here may be prone to errors (i call bugs), after all I am a software engineer. So, trust this at your own risk.
* Nifty is a benchmark index provided by Nationsal Stock Exchange (NSE), India. It comprises of top 50 stocks in terms of free float listed on NSE. These 50 stocks accounts for 50%+ in free float market capitalization.
* Used Openoffice's Calc tool to crunch the numbers.

Tuesday, October 19, 2010

MS Office is online now! Will it change Google Docs for better?

Disclaimer: I am a Linux programmer, user and evangelist. I use open office and MS Office for work related documentation. When I bought a PC for my home use, I was very reluctant to buy ms office for the personal use as it was too pricey. Office is more expensive than MS Win7 by almost 1.6x to 2x. So, I chose not to buy the MS Office.

The Google docs service is around for quite some time now. It is a useful tool for non-m$ users like me. I could open email attachments online convert one doc format to other. So, I do not need to spend money just to open my mail attachments.

But the usefulness stops there. I don't think anyone can do some serious 'office work' on Google docs. For example, how do you do simple function like 'save as'? You will have to do 'make a copy' of a doc. Then delete the prev copy. I feel it is just good enough for very basic document/spreadsheet editing.

Recently Google added realtime doc sharing which could probably compete with plethora of web meeting tools like teamviewer, cisco webex etc. This is probably one 'new' feature that got added in so long time.

Today, this news item drew my attention. If ms office is offered online, that will give good competition to g.docs. as a result it is reasonable to expect Google would spend more money on the project and get some useable software. So, welcome Microsoft...

Wednesday, September 29, 2010

How to Ratelimit Physical Port (L2)


If you have a LAN (PC or Network)and you want to restrict the amount of data rate the LAN receives/transmits, with tc (Traffic Control) command you can achieve this very easily. All you need is that you need to make sure entire traffic passes throug a Linux machine in Bridge configuration.

You might want to type in the following command at your terminal.

# tc qdisc add dev eth0 root tbf rate 0.5mbit burst 5kb latency 70ms minburst 1540

This implements a 512kbps 'pipe'. In other words, entire LAN segment shown in the diagram gets to share 512kbps.

This command also implements bucket size of 5KBytes.

Packets would wait for 70milli seconds before they get dropped.

Applications
1) This is useful in lab environments where a DUT is to be tested with restricted bandwidth. DUT could be a base station simulator or any other network element.
2) In case you want to simulate the congestion or choked bandwidth within LAN, this comes handy to simulate a smaller pipe.

Tuesday, May 25, 2010

Whats inside UTStarcom's BSNL Branded WA3002GA ADSL2+Router



I have a ADSL modem at my disposal at my office. I am going to test my learnings from my personal Broadcom Beetel router in my home.

This ADSL modem is supplied by BSNL. This device has got 4 LAN Ethernet ports and has a Wifi-AP built in. Wan side, it connects to a ADSL enabled POTS line.

I have logged into GUI. surprise surprise, I saw the exactly the same look and feel of my Airtel -supplied-beetel modem. Of course It shows some wifi menu, vpn config menu and more capable firewall menus. Apart from these same font, same color, same table everything same. I checked the bottom of device, it shows it is made by UTStarcom and manufactured in China. My home modem has No info though. It should be either Beetel modem is also manufactured by UTStarcom OR Broadcom chip vendor has supplied the same code base to these OEMs.

I ventured telent-ing into the box. I see 'some' difference here though. I see fixed menu showing. In my home modem, you have to press ? to get the list of commands supported. I typed 'sh' to get a unrestricted busybox shell -so that is same. Just like beetel modem this box's software bulid doesn't support 'ls' command so used 'echo *' to list the files. Software sports 2.6.8 kernel and gcc version 3.4.2, uClibc library. The software version of the box has 'bsnl' in it. It suggests me that code base for both BSNL and Beetel modems are same and separately built.

The Hardware is has got some more muscle

Wifi Chipset,
4 LAN ports
14MB RAM
3MB Flash

It makes sense as my office is using business class ADSL .

I have one more ADSL+everything kinda box with me. it is imported!! I am going to work on it and make it work with BSNL Line. Hope it works, Watch this space for updates.


Sunday, May 23, 2010

Tearing apart ADSL Router - Beetel 110BX1 ADSL Router

Looks like the bcm96338 based modems are widely used by Indian ISPs not just Airtel.Little bit more google helped me break into the box. Thanks to http://www.cyberciti.biz/tips/hacking-beetel-220x-adsl-router-broadcom-bcm6338.html for the tips.

I found 2 major flaws in the ADSL-router software.

Hack#1: In web browser, key in http://192.168.1.1/main.html Bingo! It opens the web interface No Login/Password asked!! Must be a developer's page, overlooked during release!!

Hack#2: After logging in to telnet, type 'sh' it opens helplessly a Busybox shell coming out of the fixed menu, revealing entire system. so much for 'hardening'!!

Tip: there is no ls.use echo * instead.

In the last post I had mentioned that I am going to find our CPU and Linux Info. Once you got the entire shell these are the least of the info you can find.

Just for the record, The system has IPTables and ebtables, runs linux 2.6.8, gcc version 3.4.2. Looks like the vendor has not been spending $$ on software lately.


Syaonara.

Sneak Peek into my ADSL Router - Beetel 110BX1 ADSL Router



I have been using Airtel's DSL connection for some time now. I always wanted to see what the are all the capabilities of my "Modem" sitting on my desktop. The Modem reads Beetel 110Bx1 ADSL2 + Router. Today finally I got down to the device and took a look at the beast.
It is a simple device is running (hardened) Linux.

Hardware
- 6MB RAM
- 1.4MB Flash (fully utilized)
- Broadcom chipset, revealed during telnet login.
BCM96338 ADSL Router
Login:

- Single core CPU
- one RJ45 for LAN and One RJ11 for ADSL input line.

Software
- Telnetd , Login:admin, pwd:password
- Httpd (microhttpd, which is very light weight) Login:admin, pwd:password
All config are possible thru web interface.
- No SSH
- Shell is hardened - exposes very limited set of commands.
- Linux contains bridge utilities(brctl is available) The device is actually 'Bridge'.
- Runs a NAT
- Runs simpler form of ACL on Firewall
- Being Linux, it has QoS which is marking of packets with DSCP Values for selected source/destination IP/Port combination.
- It Also has DMZ and D-NAT.
- DHCP and DynDNS client.
- My modem says it runs "3.12L.01.A2pB023k.d20k_rc2" version.
- NTP Client
- as i suspected it runs Busybox v1.0
- All these are packed in 21 processes! (plus my telnet process)



Considering the software functionality and corresponding hardware muscle, It means there's no flab in system. The developers have definitely done a good job. This box says, it is imported by Bharti Teletech Ltd. Too bad it doesn't show who is the original manufacturer even worse country of origin too.

Kudos, whoever developed this 'Router' which works just fine, doesn't use too much resources and still provides all needed s/w features.

What I do not know now is the CPU speed, make Linux version. Let me see if i can break in and find out this.

Tuesday, April 13, 2010

Average Ethernet Packet size

As on Y2000, the packet size distribution looked something like this...

Downstream Upstream
---------- -------------
0 - 64 14.68 58.49
65 - 127 13.87 29.73
128 - 255 7.25 1.72
256 - 511 6.44 3.98
512 - 1023 13.59 3.37
1024 - 1518 44.17 2.70

Reported by:
Steve Dispensa
Sr. Network Architect
Sprint Broadband Wireless Group