473,320 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to send data to a physical address (SOCKET)

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
2 10096
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Quarco | last post by:
Hi, Quick & simple question: I have to send the next data to a socket in order to make a popup visible on a windows machine.. TITLE Title of popup TEXT Text in popup POPUP
0
by: Gregory Hassett | last post by:
Hello, I want to periodically send a TCP packet to a peer, always from the same source port. That is, each packet will come from my local ip address, port 8801, and go to the peer's ip address,...
3
by: BuddyWork | last post by:
Hello, Could someone please explain why the Socket.Send is slow to send to the same process it sending from. Eg. Process1 calls Socket.Send which sends to the same IP address and port, the...
0
by: Buddy Home | last post by:
There is two examples of code. Example 1. Send and Receive within the same process. Put this code in a console app called SendAndReceive and run the code. using System; using...
3
by: Jason | last post by:
Hello I've got some test code that I've found on the web that is a TCP server and a TCP client. The server sends data to the client on the port i specify. I know because get the port number...
1
by: danfolkes | last post by:
Hey Everyone, I am trying to send repeated messages from a "Node" to a "Server". It works the first time I send the from the Node to Server, but after that it either errors, or does not do...
3
by: danfolkes | last post by:
Why does the message send only once? The node sends once, then fails after that. <code> import socket import thread import time def Node(nodeAddress):
9
by: iceman | last post by:
Hi, I am having a varible in a structure as uint8_t eg struct eg { uint8_t a; uint16_t b; } I send this I use htons for uint16 to align it .I left uint8_as it is.But, when I sent it through...
0
by: Xionbox | last post by:
Hello everybody, The error I have seems very easy to solve, but for some odd reason I can't seem to solve it. Anyways, here's my "setup". I created a server running on localhost:1200 (telnet...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.