.NET Framework Bookmark and Share   
 index > .NET Framework Networking and Communication > how to Send message to router and router send it to specific PC in network ???
 

how to Send message to router and router send it to specific PC in network ???

i want to send a message between form PC to another but the other PC is working in network so the router receive my message first then send it to the PC i want , how can i control this process from C# ? how can i send message to the external IP ( router ) including the MAC address for PC i want and the router understand me and send it to specific PC ?
and is ARP useful for delivering the message through the network ?

Kareem Mohamed Naguib
Kareem Mohamed
If I understand you correctly, your network peers are inside a private network, fronted by a NAT or a router. For this scenario to work, you will need to install .NET Framework v4.0. Earlier versions of the framework do not support it out of the box.

What you need to do is NAT traversal.

Here is the blog post describing the NAT traversal implemented in V4.0 of the .NET Framework.

http://blogs.msdn.com/ncl/archive/2009/07/27/end-to-end-connectivity-with-nat-traversal-.aspx

hope this helps.
feroze
--
My blog
Feroze Daud
Why do you want to control the process? IF the network is setup correctly, the routing layer in each node will make sure to send the packet on to the destination along a route it knows about.

Not sure what you are actually asking. You should be able to use TcpClient/Socket/UdpClient and just send a packet to the destination. Routing is controlled by software below the app, and also software running in nodes on the network. So, you shouldnt need to control anything for the routing part.

Maybe if you describe clearly what exactly you want to accomplish, we may be able to help you.

feroze
--
My blog
Feroze Daud
i want to control this process because i want to send a message to specific PC in network and i have the external IP for the router and MAC address of the PC i want , but TCPClient has only one destination IP which will be the external IP and when i send the message to the router it doesn't know where to send it in its network so i want to deliver the IP or MAC address of the PC i want to the router so that router know for which PC must receive the message

Kareem Mohamed Naguib
Kareem Mohamed
You don't have to give IPAddress of router, you have provide IPAddress of the computer you want to send the data.
Gaurav Khanna
Khanna Gaurav
If I understand you correctly, your network peers are inside a private network, fronted by a NAT or a router. For this scenario to work, you will need to install .NET Framework v4.0. Earlier versions of the framework do not support it out of the box.

What you need to do is NAT traversal.

Here is the blog post describing the NAT traversal implemented in V4.0 of the .NET Framework.

http://blogs.msdn.com/ncl/archive/2009/07/27/end-to-end-connectivity-with-nat-traversal-.aspx

hope this helps.
feroze
--
My blog
Feroze Daud
Feroze really i don't know how to thank u i search for these topics for 3 months without any result so really thank u , u help me a lot
but please if u know anything related to this problem and any solution to it in .net framework 3.5 or 3.0 forward it to me
and thanks again for your interest
Kareem Mohamed Naguib
Kareem Mohamed

You can use google to search for other answers

Custom Search

More Threads

• need help to pass values to array in vb.net
• Create your own firewall
• Network Stream vs SSL Stream?
• Writing a Network Scanner
• [NetworkStream] problem with BeginRead method
• Problem sending emails async
• Make BeginReceive trigger EndReceive until connection close or requested number of bytes read
• Downloading a file from an HTTPS server
• how to connect programatically to another workstation?
• Need direction on first Exchange 2007 request from asp.net