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

Socket Bind (Virtual Local EndPoint)

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 15 '06 #1
1 3989
Hello, Jonathan!

You have to bind to an existing IP address.
IMO you can do following:
- generate IP packets using raw sockets ( hard way )
- install virtual pc ( e.g. like VMWare ) and assign different IPs to these virtual PCs ( much easier way )

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Feb 15 '06 #2

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

Similar topics

1
by: Rolln_Thndr | last post by:
I'm vey new to network programing and have a few rather fundemental questions. I'm creating a very basic UDP proxy server and having a few issues regarding the sockets. Is it possible to change...
1
by: Joe | last post by:
Hi, I browsed the news and a few seem to have this problem too, but no solution ! I have a client server application where in case the connection gets bad (crashes or whatever) client or...
2
by: Rene Srensen | last post by:
We are 4 students working on a assignment, that our teacher gave use, normally we do this is C++, but the 4 of us, use C# more often that C++ so We made a small games called reversi, now our job...
7
by: Colin | last post by:
I'm writing a little console socket server but I'm having some difficulty. Can I ask your advice - where is the best place to get some help on that topic? It would be nice if some people who knew...
9
by: Macca | last post by:
Hi, I have a synchronous socket server which my app uses to read data from clients. To test this I have a simulated client that sends 100 byte packets. I have set up the socket server so...
2
by: Macca | last post by:
My app has an asynchronous socket server. It will have 20 clients connected to the server. Each client sends data every 500 millisecondsThe Connections once established will not be closed unless...
0
by: Macca | last post by:
Hi, I am writing an asychronous socket server to handle 20+ simulataneous connections. I have used the example in MSDN as a base. The code is shown at end of question. Each connection has a...
14
by: DaTurk | last post by:
I am makeing a Multicast server client setup and was wondering what the difference is between Socket.Connect, and Socket.Bind. It may be a stupid question, but I was just curious. Because I...
1
by: keksy | last post by:
Hi every1, I am writing a small client/server application and in it I want to send an image asynchronous from the client to the server through a TCP socket. I found an example code on the MSDN...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.