How would I go around doing this, i mean, using winsock as the base means to an end. I know about having to make my own encapsulation algorithms, but how could I make winsock use it instead of say, "TCP/IP" or UDP?
How would I go around doing this, i mean, using winsock as the base means to an end. I know about having to make my own encapsulation algorithms, but how could I make winsock use it instead of say, "TCP/IP" or UDP?
first of all you probably want to incorporate your protocol into TCP/IP
for example:
as an example. just sent the header over winsock in a normal send() call.Code:typedef struct{ char name[50]; int fd; int id char message[3000]; }protocol;
if what you want is really to avoid TCP and UDP you want to learn raw sockets. however windows (except 2000 and xp) do not support raw sockets.
how about linux then? could I program my own totally from scratch protocol?
>could I program my own totally from scratch protocol?
You could...but it would be virtually useless. For all of the work that goes into something like this, only the people using your protocol would be able to communicate with your programs unless you make them compatible with TCP/IP. If that is the case, why even bother with your own protocol in the first place?
My best code is written with the delete key.
making a semi secure network connection, after all, if only 2-3 people and computers have the protocol, i wouldnt have to worry about people reading it. Plus, it would provide a valuable learning experience.You could...but it would be virtually useless. For all of the work that goes into something like this, only the people using your protocol would be able to communicate with your programs unless you make them compatible with TCP/IP. If that is the case, why even bother with your own protocol in the first place?
>making a semi secure network connection
A decent encryption gives you the same effect.
>Plus, it would provide a valuable learning experience.
This is a better reason. My recommendation would be to study some simpler protocols out there and see how they do it, then try your hand at imitating them. Who knows, you may even be able to find a tutorial on google.
My best code is written with the delete key.
ok, thanks. I am at this point trying to learn how to do the lower level of stuff, as that will make be be able to see the whole picture of higher level stuff from the ground up. Plus, in the tutorials in the links, they never actually say how send and recv work. does send just write data to the port that you have set up on?
EDIT: hmm, did a search for network protocol making tutorials in several different phrases and got alot of microsoft sites just talking about winsock, and got sites talking about network protocol sniffers, but no tutorials or sample protocol code.
Last edited by EvBladeRunnervE; 08-21-2003 at 03:03 PM.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
yea, i program raw sockets on linux.Originally posted by EvBladeRunnervE
how about linux then? could I program my own totally from scratch protocol?
and to learn how the functions work download glibc. that has all the functions that are called standard from C in linux. you dont have to install it even if you dont feel like upgrading your glibc, just search around for functions in the folders.