Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Raw IP packets

Posted on 2002-06-12
5
Medium Priority
?
1,590 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 672 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 664 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 664 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

885 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