tiistai 17. syyskuuta 2013

Understanding binary codes

Binary that weird looking number line. It is actually very easy to understand how to calculate binaries. Normal binary consists of numbers one "1" and zero "0" and the number 1 means that the value is turned ON and if the number is 0 it means it is turned OFF.

We start from number one always multiplying it by two. We get numbers 1,2,4,8,16,32,64,128. Eight numbers. Then we make a table:


Remember, 0 is OFF. 1 is ON. Now the binary is 0 because every number is turned off. Lets turn something on.


Now two values are turned on, and guess what; just simply calculate the numbers together. Number two is ON so we have 2 and the number 8 is turned ON so we have numbers 2 and 8. 2 + 8 = 10. The binary value is ten. Simple as that.


And if we turn everything on we have 1+2+4+8+16+32+64+128 = 255. 

Now you should know how to calculate binary numbers. You can easily change IP address to binary form for example or vice versa.

maanantai 9. syyskuuta 2013

Internet Protocol Suite

In this post I'm trying to explain internet protocols. There are so many things related to internet protocols so it's not very easy to explain everything and I'm not even sure if I understand them.

About internet protocols
Every computer needs IP address if you want it to connect somewhere. Without IP your computer can't access to network. When you plug in a network cable it usually works out of the box or if you are setting up a home network it's just plug and play. It's whole different story when setting up a company network. Well lets start from what I know. When setting up a home network your computer gets an IP address usually from the service operator.  You can check your ip configuration in Windows environment by opening CMD window and typing ipconfig /all or in Linux by typing ifconfig to terminal window.  

Lets have a look at my ipconfig. In the description is the name of my network adapter.

Physical address means the same as MAC address. MAC address is your network adapter hardware number assigned in the factory. The number is unique and with MAC address your adapter can be identified in the network. For example if you want to boot 10 computers at the same time, you could get all the MAC numbers and then send a magic packet to the computers.

What is magic packet ? It means the same as Wake-On-Lan. Shortly it is a packet which is sent from computer to another in the network and when the other computer gets that packet it will turn on if it's powered off. This is useful for example if your server shuts down and you are far away, you could just send this packet and it would wake up.

DHCP - Dynamic Host Configuration Protocol

DHCP is guy who does everything for you in the home network. It means that your operator has set up an dhcp server which gives you automatically IP address for example. This is the basic task for dhcp. It could also give you the default gateway or dns address. Usually IP address from you operator is not a static and you only loan it. It means your IP can change. This is not very good if you want to host a server. Think that you want to buy food and your local food market changes address once a week. Not very funny to ask people where it has moved. But if you are not going to serve anything it doesn't matter if your computers IP change because no one need to find your computer. And because operators "loan" you the address it is just because they want to get free IP addresses to give to others. But do not worry they always give you a new address and you are back to online.

This is your computers IP address. If you look again the CMD window screen I posted, this is only my local address! It means all your computers that are connected in the same modem will get same address except the last three numbers. Your network adapter is normally set to get the address automatically and there is no way two computers could get the same address. If you however want to setup the address manually in this case I would put 10.23.251. and then something between 1 - 255. For example or make sure all your computers has unique address in the same network or you will get problems or internet just won't work. The first numbers in this address are somehow related to your modem. If you want to know how your IP address shows for other computers outside of your home network go to http://www.whatismyip.com/ If you would host a server this is the IP your friends should type in the browser window. If you want to play games in LAN - Local Area Network then the local ip address is enough and the external ip wouldn't even work if you are not hosting a server online. It is not very easy to explain IP address more reading from here: http://en.wikipedia.org/wiki/Internet_Protocol but basically you have an local IP address identified between 1-255 (last three numbers) and then it is translated to public network.

NAT - Network Address Translation
NAT were developed because engineers thought there would not be enough IP addresses in the future. For example you have one IP address and you want to connect 5 computers in the same address. All your computers have unique local IP address for example from to (1-5) If you open two computers and type to browser www.whatismyip.com it will show the same address for both computers for example and why is that ? The NAT translates the local address to the IP which is same for all the computers.  

Subnet mask
This is not very clear to me so I just post a link to wikipedia.

Domain name server or Domain name system. So all the computers operate with IP address. These addresses are very hard for human to remember. Just think about your cell phone. You have hundreds of phone numbers but you only remember the persons name you want to call. People like to name things. This is where DNS comes. It translates the computers IP address to a name that can be easily remembered. For example if I type into my browser www.vr.fi the dns sees that I'm trying to connect to an address and then forwards me to the server. Now to demonstrate this:

 Lets open the cmd window again. Type ping www.vr.fi and it shows you the server IP address ! Now if you type this address to the browser you connect to www.vr.fi. Awesome. It is the same thing as telephone book. You type a name and then DNS resolves the server number you are trying to reach.

If you ever need to configure network routers you will walk into these. TCP is a stateful protocol. If you send a picture to your friend with email it probably uses TCP. TCP traffic always checks if the packet is sent to the destination computer. If not it will send it again until it success. TCP is used more often than UDP.

UDP is stateless protocol and packets are not checked. This uses less network lane and is useful for example in online games. It is not very necessary to check if the packet ended up in the server because games usually work so fast that it would be too late to resend that packet. And the data sent is not very "important" I would describe.

These are the protocols for setting up email account. IMAP means that all the mails are kept in the server and loaded from there. It is usually handy to set up an IMAP mail account because then you can read your mails from multiple machines, for example laptop, mobile phone and from other computers.

POP3 means that all the mails are loaded from server to your local computer. Its advantage is that your mail server will never get full because all the mails are loaded to your computers hard drive. The disadvantage of this is that you can't read mails from other machines. Also if your hard drive somehow fails all your mails will be deleted with the drive.

To lean more about protocols see this very well written Wikipedia article!

keskiviikko 4. syyskuuta 2013

How To Build A Computer From Scratch (Mini-ITX)

Building computer from parts is not very hard task. I'm going to show how it is done. Maybe in the next article we are going to look what kind of parts you should choose.

You will need:
- screwdriver
- scissors
- cable ties

1. Start with opening all the packages. Keep screws in good order and case manual + motherboard manual near.

2. Open your computer case and insert motherboard inside. Notice that you may have to screw bolts under the motherboard. Check that from your manuals. Don't be afraid the components won't broke easily. I even used magnetized screwdriver which you should never use! Anyway it is good to grab the motherboard from sides and ports.

3. Step three installing processor. This may feel scary, but its not. In this case we have new Core I5 processor. Open the processor socket by pushing down the metal lever and then pull it to right, it will open.

4. Now it is open.

5. Then look from your motherboard manual how the cpu should be installed. This socket had two holes which had to be aligned. In other words you can't install the cpu wrong, because it only fits in right position. Hold the processor from sides. Don't touch the pins at bottom but don't worry too much. It won't break. Remove the plastic cover from motherboard.

6. When you have placed the processor its time to lock it back and insert some silicon. This motherboard had very tight lock and I thought it will break but it has to be closed so just close it.

7. Insert silicone a little bit and spread it with finger or something.

8. After silicone

 9. Use silicone which is for computers. Nothing else is suitable.

10.Next insert CPU cooler. Intel processors are very easy to insert. Just press it and it will make a sound "SNAP" when it's attached. If you turn the black things which has arrows the cooler will pop out. This was a mistake I did. Dont turn those, just press the cooler on.

11. Look port which says CPU FAN or look from the motherboard manual where that is located. Insert your cpu cooler cable to that port. It should fit only in one way.

12. Next we are going to insert RAM memory. RAM is installed into those two yellow bars. In modern computers ram memory works in dual channel so the ram slots are usually color coded. Install Your ram into ports which have the same color. For example you have 2 red and 2 yellow ports you should install 2 sticks into red or yellow. Not one in the yellow and one in the red. Same goes for ram port numbers if you have 4 slots which have the same color they are normally numbered.

13. Tilt the ram lock a bit backwards and it opens. 

14. RAM stick will only fit in one position so you cant install it wrong.

15. Push hard (not too hard) and it will "click" when it's installed.

16. Installing display card. Modern display card need two holes from the back or if it's not high end display card it may take only one slot. Open this kind of slots from the back of your computer. 

17. Push your display card into slot which says PCI-E 16x or something similar. Not only PCI...

18. Then look for hard drive bay. Usually modern cases have sleds for hard drives. Squeeze from the black things and pull the sled out.

19. Install your hard drive on to sled. and push it back to the case.

20. Install CD/DVD drive. Depending on your case either open the front panel and push the drive in or from back. 

21. You should have two SATA cables which look like this:

22. Attach one in the back of your hard drive and the other end into sata1 port in the motherboard. Do the same thing for CD drive but insert it into sata2 drive.

23. Now it will get a little narrow in this case so you can tie the cables in to the case with cable ties if possible.

24. Install your power supply in the back of the case. Best way how to do this is look  from your manual how it is installed but it should not be too hard. This case had four screws.

25. Then you have to look from the motherboard manual how to insert small cables from your case to the motherboard. Includes powerbutton, usb ports, sound ports etc. Things that also need power are your hard drive, CD drive, some display cards require power and usually the motherboard itself has two ports that need power.

26. Insert power cable, display, mouse and keyboard. Don't close the case in case it doesn't work yet. Power on the computer and check if all the fans are rotating.

27. If you see your computers post screen or at least something in the screen it's a good sign and you should be ready to install operating system. 

28. Example of a new modern bios screen. If you see this or something similar with usually blue background you can pat yourself on the shoulder.

29. Install operating system.

Fault conditions

Computer doesn't start.
- Check that motherboard light turns on when you put power cable in to the machine
- Check that your case powerswitch cable is connected to the right pin in motherboard
- Check that all power cables are connected to motherboard

If your monitor doesn't wake up or you don't see anything on the screen:
- Check that RAM memory is locked correctly
- Check that display card is connected correctly
- Check that your motherboard bios is correct for the CPU (motherboard bios should be in the manual and processors minimum bios version can be found from the internet)

Any other booting problems
- Start with minimum parts and try to boot. For example install just motherboard, power supply and processor. Then add display card, memory, hdd in order and see which part is not working.