Results 1 to 8 of 8

Thread: Your own protocol?

  1. #1

    Thread Starter
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394

    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?
    VS.NET 2003

    Need to email me?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  3. #3

    Thread Starter
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394

    Wink

    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?
    VS.NET 2003

    Need to email me?

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  6. #6
    New Member
    Join Date
    Nov 2002
    Location
    Petawawa Ontario
    Posts
    5
    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

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  8. #8
    New Member
    Join Date
    Nov 2002
    Location
    Petawawa Ontario
    Posts
    5
    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
  •  



Click Here to Expand Forum to Full Width