473,387 Members | 1,859 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,387 software developers and data experts.

Socket Bind(localEndPoint) <-- Virtual IP

Hi there,

Please find file for illustrating infrastructure -->
http://test.thipparath.com/GPRS/GPRS.jpg . Gateway receives packets
from Trucks for processing Route/GPS position. When Truck and Gateway
communicate in leased line, Gateway identifies different IP sent by
different truck. Where communicate over internet, NAT Server is used
for sending packets from different Trucks. Here is come to a problem
that Gateway unable to create individual Truck Session for tracking for

each truck GPS position because every packet received from internet is
Same IP address.
Hence, I would like to simulate NAT reverse translation function
(separate source IP in Packets to different IP according to data in
Packet). I decided to develop C# sockets offered in .NET framework. My
application will play 2 roles – 1) Act Server to listen inbound
packet from internet, 2) Act Client to forward captured packet to
Gateway with different IP as the following flows:
1) Create Asynchronous Socket for Listening
2) Reading data by Accepted Socket instance, analyze data ( data
contain SIM No for key ), Lookup Table in Database or Generate virtual
IP
3) Forward data with Different virtual IP
Problem Section (Sending data to Gateway)
// I want to generate virtual IP
IPAddress ipHostAddress = IPAddress.Parse(“192.XX.XX.XXX”);
IPEndPoint localEndPoint = new IPEndPoint(ipHostAddress,0);
Socket sender = new Socket(AddressFamily.InterNetwork,
SocketType.Stream,
ProtocolType.Tcp);
sender.Bind(localEndPoint); //  I can’t bind virtual IP
// ( Requsted address invalid in it context ) Socket Exception thrown
sender.Connect(remoteEndPoint);
I sincerely would like to know yours idea in the scenario like this. Is

there any other ways? Thanks in advance.

Feb 16 '06 #1
0 2131

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Thomas Zangl | last post by:
Hi! I have a class hierachie like this: // interface, abstract only class ISession { } // implements common parts of ISession
2
by: Thomas Zangl | last post by:
Hi! First - thanks for your previous replies! After fixing the c'tor everything went fine until ... I added one more class in the hierachie. I have a class hierachie like this: //...
1
by: Jonathan Woods | last post by:
Hi there, Please find file for illustrating infrastructure --> http://test.thipparath.com/GPRS/GPRS.jpg . Gateway receives packets from Trucks for processing Route/GPS position. When Truck and...
0
by: Jonathan Woods | last post by:
Hi there, Please find file for illustrating infrastructure --> http://test.thipparath.com/GPRS/GPRS.jpg . Gateway receives packets from Trucks for processing Route/GPS position. When Truck and...
6
by: kikapu | last post by:
Hi to all, i have the following simple Socket Server code and a vb client that send to it some data using WinHttp. (very simple code, just open and send) The string is succesfully sent to the...
1
by: RSecor | last post by:
# sysctl -a | grep somaxconn kern.ipc.somaxconn: 1024 # perl -MSocket -e'print SOMAXCONN; print "\n";' 128 Anyone have any ideas why one would be 1024 and the other only 128?
4
by: O.B. | last post by:
I have a socket configured as TCP and running as a listener. When I close socket, it doesn't always free up the port immediately. Even when no connections have been made to it. So when I open...
6
by: Gert Kok | last post by:
When fgets() reads a string that ands with <<<EOT, the string is truncated after << and a lot of following input is discarded. When <<<EOT is changed to <<< EOT, behaviour is as I expect it. ...
1
Airslash
by: Airslash | last post by:
Hello, The problem is that my server is not receiving data. The code below are the various classes I designed around sockets. It will be big... I have run the code with the debugger, and I see...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.