By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,338 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,338 IT Pros & Developers. It's quick & easy.

How to send data to a physical address (SOCKET)

P: n/a
Hi... is it possible to send data from a socket to at physical address (MAC)
on f.x another PC or Router ???
I have a IP header with information about another client, and this cannot be
altered, so I want to send the whole IP package to the server / router using
OSI layer 2 (datalink), but is it possible in C#, or do i have to write a
lowlevel driver.

Thanks
/Søren
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Søren,

You might want to try and create a Socket with a SocketType of
SocketType.Raw. This will allow you to have access to the underlying
protocol, which will give you the responsibility of reading/writing the
headers, etc, etc.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"SWJust" <sw********************@it.dk> wrote in message
news:be***********@news.cybercity.dk...
Hi... is it possible to send data from a socket to at physical address (MAC) on f.x another PC or Router ???
I have a IP header with information about another client, and this cannot be altered, so I want to send the whole IP package to the server / router using OSI layer 2 (datalink), but is it possible in C#, or do i have to write a
lowlevel driver.

Thanks
/Søren

Nov 13 '05 #2

P: n/a
Yes this was also my plan, but can I keep my existing IP header, and alter
the destination MAC address, and send it ? as I can understand Socket.Raw is
only at IP level, or am I wrong?


It has to work as a router, because it is going to interact with an Intel
router.


My idea was to create at Raw socket, read the header and determine on which
network interface card it has to be send out on, or which other router /
computer it should be send to, and the it is the next routers job to deliver
the package to the final destination.

I puzzled with the idea of using SendTo and specify an IPendPoint, but I
haven't tested it yet, but I think it could result in a failure, because of
my packaged header, and the new one sendTo tries to use. So my question was
is it possible to forward traffic to another Mac address.

/Søren


"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> skrev
i en meddelelse news:%2****************@TK2MSFTNGP12.phx.gbl...
Søren,

You might want to try and create a Socket with a SocketType of
SocketType.Raw. This will allow you to have access to the underlying
protocol, which will give you the responsibility of reading/writing the
headers, etc, etc.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"SWJust" <sw********************@it.dk> wrote in message
news:be***********@news.cybercity.dk...
Hi... is it possible to send data from a socket to at physical address (MAC)
on f.x another PC or Router ???
I have a IP header with information about another client, and this cannot be
altered, so I want to send the whole IP package to the server / router

using
OSI layer 2 (datalink), but is it possible in C#, or do i have to write

a lowlevel driver.

Thanks
/Søren


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.