Nov 22, 2009

How To Make A Protocol

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Networking

How To Make A Protocol

bobbybeeelan
Hi
I'm a programmer already but I want to know how to make a Network Protocal.
Any Answers?
Bye
P.S. It must be free forever rolleyes.gif

Comment/Reply (w/o sign-up)

wutske
Start with a piece of paper and start writing down everything you want in this protocol, maybe you can even put it in a diagram or something like that. Try to be clear tough because you'll need this information.
With this information you'll have to design the messages you want to send between server and client (and vice versa). These messages can be bytestreams, SOAP messages, ... But make sure they are a bit versatile (it's most efficient if all message headers have the same length).

Next thing on the list is writing a server and a client, the server listening on a port and the client sending your protocol messages to the server.

That the scenario in short wink.gif

Comment/Reply (w/o sign-up)

bobbybeeelan
Hi
That's a very good answer.
Now what do I do remeber all I did is put some info on a peice of paper.
Bye

Comment/Reply (w/o sign-up)

tansqrx
I’m getting the feeling that you are not very serious in your question but I will still do my best to answer it. The protocol will depend on what you are using it for. A typical application protocol will use many of the existing protocols such as TCP and IP. A fairly complex example of a protocol is the Yahoo! Messenger protocol or YMSG which I have a tutorial for at http://ycoderscookbook.com/tutorials/Yahoo...col_Part_1.html (shameless plug).

As I said before, it all depends on the application. Let’s say I need to communicate weather conditions between two points, over the Internet, and using standard PCs. I would first designate one of the computers as a server and the other as a client. Since we are using the Internet, I will use standard TCP/IP. On the server I will create a listening port (in .NET you can use TCPListener - http://msdn.microsoft.com/en-us/library/sy...plistener.aspx) and on the client I will initiate a connection (TCPClient - http://msdn.microsoft.com/en-us/library/sy...tcpclient.aspx). Once you issue each command, the operating system takes care of all the tedious work of getting the connection working. Now you have a connection where you can send anything you want until either end closes the connection.

In the weather example you may want to send temperature, humidity, and wind speed to the server. Additionally you may also want to identify the client by a unique identifier. All of these things are fairly straight forward so I would just create a string and separate each entry by a colon.

ClientID:Temp:Humidity:WindSpeed

The client then issues a send command on the string. The server then receives the string and splits it based on the colons. This is a very simple example but still a network protocol. As long as each field is defined and sent in a particular order, any server will be able to use the weather data that you sent.

I suggest you start with the networking objects in the language you are using and then work out from there.

 

 

 


Comment/Reply (w/o sign-up)

yordan
I would add two fields to this protocol : "from" and "to".
It would probably be useful to know which weather station sends the info, and which server is gathering the infos, so two extra fields are needed.

Comment/Reply (w/o sign-up)

bobbybeeelan
Hi
This is great thanks guys.
Bye

Comment/Reply (w/o sign-up)

tansqrx
This is a great example of tailoring your protocol to meet your needs. I was assuming that there is only one server so the “to” field is not needed. The ClientID should take care of your “from”. Of course this all doesn’t matter because it is a fictional system but it shows that you only need one thing for a protocol; knowledge on both ends of what is in the message and how it is ordered.

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Protocol


    Looking for How, To, Make, A, Protocol

See Also,

*SIMILAR VIDEOS*
Searching Video's for How, To, Make, A, Protocol
advertisement



How To Make A Protocol

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com