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
http://en.wikipedia.org/wiki/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.

IPv4
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 10.23.251.5 or 10.23.251.222 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 10.12.5.1 to 10.12.5.5 (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 187.213.123.44 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.
http://en.wikipedia.org/wiki/Subnetwork

DNS
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 http://188.117.35.8 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.

 TCP/UDP
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.

IMAP/POP3
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!
http://en.wikipedia.org/wiki/Internet_protocol_suite

Ei kommentteja:

Lähetä kommentti