• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1671
  • Last Modified:

Raw IP packets

Hi all

I need to send and receive RAW IP packets on a Win2K/XP box. That is: I want a specific process in the system (which I write, of course) to have a different IP than that of the computer's. This process will be sending RAW IP packets, and will receive packets directed to "it's" IP address.

How do I go about this?

I thought about some fiddling with RAS, creating a "dial connection" to a PPP server which will give me my IP, but for that I need a programmable PPP client linked in my process. Does anyone know of such a thing?

I've also thought about adding another "virtual" interface onto my ethernet card, with a different IP, use it only from this process, and then opening a RAW-IP-mode winsock socket on that interface and IP. However, is this allowed? What about ARP on other machines in the network? How do I do this, anyhow? How do I *receive* packets, before windows "Eats" them?

I understand this is a hard one, and calls for real Gurus, so I've graded it accordingly...
0
calius
Asked:
calius
3 Solutions
 
SysExpertCommented:
AFAIK, only XP supports RAW sockets

Windows XP raw sockets

http://techupdate.zdnet.com/techupdate/stories/main/0,14179,2819030,00.html             

I hope this helps !
0
 
SysExpertCommented:
In addition, I would post a link to this question in the Programming section of EE.

I hope this helps !
0
 
cincin77Commented:
First of all raw socket was always there in windows.:))
But before W2K the raw socket could reach until network layer, not until the core as it is in the Unix and Linux OSes. After W2K, raw sockets can reach the core so you can prepare IP packets with fake addresses and so on.

In socket programming there are 3 kinds of sockets; Stream, Datagram and Raw. When you make your 'socket' call(the very first call), you type in the socket type which should be a raw socket for your case. You prepare all the IP and (TCP/UDP/ICMP) headers by yourself.

In order to receive packets(if it is a TCP or UDP packet by setting the protocol field in IP header, it is then a normal TCP/UDP packet in the network), you must read at the data link layer. That is for the ethernet, you should set your card into promiscuous mode in order to receive packets that are not destined to you. In PPP connections there is no such concept as there are only two peers.:))

The questions you will ask will reshape my comments.

 
0
 
geoffrynCommented:
0
 
CleanupPingCommented:
calius:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now