Tuesday, October 19, 2010

Protocol and Network

While writing my first code for client server environment, I was quite amazed to see how it works. It was a thick client chat server and client code, written on Swings with Socket program in early 2000.
First thing I learned by this program was the term "Protocol". For me protocol is like a language grammar. While communicating, we need a mutually understandable language and a medium by which we can pass the expression.In same way protocol help two different entities to fix their grammar and communicate on network medium.
It is like a universal truth, any types of machines can communicate with each other if they have set protocol and communication medium.
Now a days, most popular medium is 'Internet' as many of us must be aware of that internet is also a network so any machine connected with a network can use network as medium.
Other used mediums are , Intranet, LAN(Local area Network) , WAN( Wide Area Network) etc.
Now in terms of Protocol, most popular and simpler is HTTP (Hyper Text Transfer Protocol).
HTTP is a grammar by which two machine can understand each other's messages.
Think about a letter you have received filled with 1's and 0's..you will definitely feel puzzled..isn't it?
but if you know binary number format, you will try to convert it to some meaningful number's..
but what after it.. will those number give you any clue for the message.. you may further try to decode it with some pattern..but what if you know the pattern?..life will be easy for you!!..
you can read the message now..
Protocols help machines to write data on network and recover it from network so that machine can understand it.
Some other popular protocols used now a days are.. FTP (for File Transfer), WAP( for wireless Access) SOAP(Simple Object Access Protocol for web services communication) .
One thing I would like to mention over here that, it is not necessary to use Standard protocol only for communication. If you know socket programming then you can create a socket and Server socket where socket can pass any message to your server socket in your defined protocol.
I have used it in my chat program, where multiple messages were sent via a delimiter(||).
I will post a code snippet of writing such program later.

No comments:

Post a Comment