|
-
Oct 19th, 2002, 12:14 AM
#1
Thread Starter
Hyperactive Member
Your own protocol?
Hi 
Does anyone know how are protocols created (TCP/IP, UDP)? How would you create your own protocol? Like your own winsock.dll?
-
Oct 19th, 2002, 05:58 AM
#2
Monday Morning Lunatic
A lot of protocols are "layered", for example they use other protocols in their own way. Take HTTP. It uses the HTTP protocol, which is on top of TCP (to hold up the connection) which is on top of IP (to actually route the packets). Similarly, UDP is also based on IP (datagrams).
But there's no reason why you can't design your own protocol. There should be an RFC for TCP/IP, and I expect there are design documents available for NetBEUI, IPX/SPX, whatever
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 19th, 2002, 07:21 AM
#3
Thread Starter
Hyperactive Member
Thanks for your reply Parksie 
I know that they are layered, but how would i send RAW data? Would i need to write a driver for that or something like that?
-
Oct 19th, 2002, 07:41 AM
#4
Monday Morning Lunatic
Yes. How, I have no idea (never tried writing a transport protocol)
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 19th, 2002, 10:27 AM
#5
Most new protocols are very high-level, based on top of either UDP or TCP. Lower protocols are far harder to work with: replace UDP or TCP and you'll have a hard time getting computers to accept it (you need to write low-level software that gets it) and firewalls letting it through. Replace IP and you probably need to adjust all nodes on the network connection to handle it, which means you can't use it on the internet but only on a local network.
7th layer protocols are created by many internet apps: DirectPlay has it's own, most games that don't use DirectPlay (like Blizzard Games Starcraft, Diablo 1/2, Warcraft, C&C1234, ...) have their own. Just don't expect them to get widely accepted.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 1st, 2002, 12:22 PM
#6
New Member
If you're looking to send out RAW data then you can try using windows RAW sockets. The problem with them is that they're not totally RAW.
It depends on what exactly you want to do... I wrote a program that bastardizes the ARP protocol which provides a mapping between IP addresses and MAC addresses to allow a win2k box to act as a switch/router.... more like a layer2/3 switch but anyway.... to do this I needed to send out ARP broadcast packets, which are NOT sent to ANY IP address, and are instead sent to the MAC address of ff:ff:ff:ff:ff:ff ... the RAW socket functionality that windows provides WILL NOT let you send a raw packet with no destination IP address (in other words, if the packet is not meant to go through a router then windows cannot send it).... The way to get around this is to use the pcap library. You get a handle to the interface and create a packet (containing nothing but 0x69 if you like....) and call
pcap_sendpacket( )
and it throws it on the wire.... .. . where it gets ignored by all the devices that won't understand it...
either way, check out
pcap library
-
Nov 1st, 2002, 12:25 PM
#7
Monday Morning Lunatic
You should never need raw sockets like that 
In fact, it's impossible to do as non-root on a Unix system...
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 3rd, 2002, 09:16 PM
#8
New Member
it depends, in our case we'd be taking something encapsulated in http and decapsulating it, and then sending it to its intended destination.... . . to do this, we can either maintain our own ARP tables, or use raw sockets and let the kernel handle the address resolution. We were basically creating an http tunnel, but getting the two windows 2000 boxen to automagically route traffic across the internet, and then make it appear as if it came from the local subnet....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|