Solved

Raw IP packets

Posted on 2002-06-12
5
1,521 Views
Last Modified: 2013-12-07
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
Comment
Question by:calius
5 Comments
 
LVL 63

Accepted Solution

by:
SysExpert earned 168 total points
ID: 7073463
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
 
LVL 63

Expert Comment

by:SysExpert
ID: 7073469
In addition, I would post a link to this question in the Programming section of EE.

I hope this helps !
0
 
LVL 3

Assisted Solution

by:cincin77
cincin77 earned 166 total points
ID: 7075235
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
 
LVL 11

Assisted Solution

by:geoffryn
geoffryn earned 166 total points
ID: 7075761
0
 

Expert Comment

by:CleanupPing
ID: 9155606
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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is an article about my experiences with remote access to my clients (so that I may serve them) and eventually to my home office system via Radmin Remote Control. I have been using remote access for over 10 years and have been improving my metho…
Let’s list some of the technologies that enable smooth teleworking. 
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now