Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Raw IP packets

Posted on 2002-06-12
5
Medium Priority
?
1,570 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

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

Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.
Make the most of your online learning experience.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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 …

688 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