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

How to define sender IP address?

Hello everybody,

is there anybody who knows how to set a sender IP address in C#.
I want to send UDP packets to a server and simulate different computers
with different IP addresses. The server always expects a different IP
address in the UDP packet. So I need a possibility to set the sender
IP.
Hopefully anybody knows something about this topic.

Thanks a lot!
Greeting Marcel

Feb 7 '06 #1
14 4698
Hi,
"Marcel Bode" <mb*****@freenet.de> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hello everybody,

is there anybody who knows how to set a sender IP address in C#.
I want to send UDP packets to a server and simulate different computers
with different IP addresses. The server always expects a different IP
address in the UDP packet. So I need a possibility to set the sender
IP.
Hopefully anybody knows something about this topic.

You do realise thhat you will not get any response from the server right?

The response packages will be send to the machine with that IP address.

A better suggestion would be if you assign differents IPs to your local
computer and then select from these IPs when you create your local
IPEndPoint.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Feb 7 '06 #2
Hi,

I think your suggestion, is the correct way but I am trying to simulate
5000 different computer with 5000 different IP addresses.....hmmm I
think it's not easy

But thanks a lot!

Marcel

Feb 7 '06 #3
Hi,
"Marcel Bode" <mb*****@freenet.de> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hi,

I think your suggestion, is the correct way but I am trying to simulate
5000 different computer with 5000 different IP addresses.....hmmm I
think it's not easy


What is what you want to do in the first place?

Why you need 5K differents IPs?
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Feb 7 '06 #4
Hi,

okay it's a stress test! You know, I am trying to test a application on
a server. The server expects a logon from different devices or in this
case only one computer. Every device must have a unique IP address. To
see how the system handles maybe a logon from 5000 devices at the same
time, I want to programm a simulation application.
So all the logon information from the device must have different IP
addresses.
Hopefully now you know the main background.

bye Marcel

Feb 7 '06 #5
Hello, Marcel!

( http://mixter.void.ru/rawip.html ) - says how custom UDP packets can be created.
There is source code for TCP packet generation. UDP header is smaller thus simpler to generate.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Feb 7 '06 #6
Hi,
"Marcel Bode" <mb*****@freenet.de> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi,

okay it's a stress test! You know, I am trying to test a application on
a server. The server expects a logon from different devices or in this
case only one computer. Every device must have a unique IP address. To
see how the system handles maybe a logon from 5000 devices at the same
time, I want to programm a simulation application.
So all the logon information from the device must have different IP
addresses.
Hopefully now you know the main background.


In this case I would generate a fake ip in the server side, each time a new
session start you , instead of getting the source IP (most probably using
Page.UserHostIP ) you generate a new IP:

// string sourceIP = Page.UserHostIP ;
string sourceIP = GenerateRandomIP();

and then you can do your stress test from one computer only

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Feb 7 '06 #7
Change the server to temp remove the logic and checks for dup IPs, then you
can stress. After, uncomment the logic and test it again with fewer source
IPs.

--
William Stacey [MVP]

"Marcel Bode" <mb*****@freenet.de> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
| Hi,
|
| okay it's a stress test! You know, I am trying to test a application on
| a server. The server expects a logon from different devices or in this
| case only one computer. Every device must have a unique IP address. To
| see how the system handles maybe a logon from 5000 devices at the same
| time, I want to programm a simulation application.
| So all the logon information from the device must have different IP
| addresses.
| Hopefully now you know the main background.
|
| bye Marcel
|
Feb 7 '06 #8
Hello, Ignacio!

IMN> In this case I would generate a fake ip in the server side, each time
IMN> a new session start you , instead of getting the source IP (most
IMN> probably using Page.UserHostIP ) you generate a new IP:

IMN> // string sourceIP = Page.UserHostIP ;
IMN> string sourceIP = GenerateRandomIP();

IMN> and then you can do your stress test from one computer only

IMO OP didn't state that this is web app, so we can have no Page class.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Feb 8 '06 #9
Hello, Marcel!

MB> okay it's a stress test! You know, I am trying to test a application on
MB> a server. The server expects a logon from different devices or in this
MB> case only one computer. Every device must have a unique IP address. To
MB> see how the system handles maybe a logon from 5000 devices at the same
MB> time, I want to programm a simulation application.
MB> So all the logon information from the device must have different IP
MB> addresses.
MB> Hopefully now you know the main background.

What kind of application it is? Is it hosted on IIS. Does the application determine IPs duplication?

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Feb 8 '06 #10
Hi Vadym,

it's no web server or something like that. The server side is a Java
application with connecting to a database. It is effectively the
central for all existing devices. When a device wants to join the
system it must logon and then it can use the services and the central
application you can observe the devices. I don't want to change the
server side, because maybe then I also change the results of the
simulation. And I don't have access to the source code of the central
side. I can only change the client/device side. That's it!

Now I am trying some hacking tools. They are very powerful and when I
install such a tool on the server side, it maybe can filter the
outgoing and incoming udp packets and change the IP. Maybe it's quite
easier then searching for a solution in C#.

But hey, I thank all of you! If you still have some suggestions, let me
know!

Bye Marcel

Feb 8 '06 #11
Hi,

"Vadym Stetsyak" <va*****@ukr.net> wrote in message
news:Oi**************@TK2MSFTNGP14.phx.gbl...
Hello, Ignacio!

IMN> In this case I would generate a fake ip in the server side, each time
IMN> a new session start you , instead of getting the source IP (most
IMN> probably using Page.UserHostIP ) you generate a new IP:

IMN> // string sourceIP = Page.UserHostIP ;
IMN> string sourceIP = GenerateRandomIP();

IMN> and then you can do your stress test from one computer only

IMO OP didn't state that this is web app, so we can have no Page class.


You are right, my mistake, but the same apply to any platform , just change
the line from where you are getting the remote IP and use a generated IP.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Feb 8 '06 #12
Hi,

And why is so important the IP?

Are you doing any validation/auth based on that?

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Feb 8 '06 #13
Hello, Marcel!

Relying on the fact that only different IPs can send data will cut off user that are behind NAT or proxies.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Feb 8 '06 #14
hi,

the different IP makes sure that the logon information is coming from
different devices.
So yes, it's a kind of validation!

bye

Feb 8 '06 #15

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

Similar topics

6
by: Mark | last post by:
Is there anyway I can set up a personal 'remailer' type of thing on my domain ? I can not email a friend at his workplace because his company have put a 'block' on emails from my work address...
3
by: theotyflos | last post by:
Hi all, I have the following: /*--- SNIP ---*/ typedef struct Argument_s { char *address; int type;
18
by: MakisGR | last post by:
I'm having trouble understanding what the following define does. Can anyone provide some assistance? #define SetBits(bits,pos) (((bits)) |= (1 << ((pos) & 7))) -- comp.lang.c.moderated -...
5
by: Stuart Norris | last post by:
Dear Readers, I am attempting to define an array of IPAddress-es in C#. I wish to have a array of address so I can try in order to connect to them in a loop to handle unavailable hosts. ...
18
by: **Developer** | last post by:
I always define events with the parameters ByVal sender As Object, ByVal e As EventArgs Even if they are not used. Seems I read someplace that's the thing to do. So I then do:
3
by: Richard Martino | last post by:
Dear Experts: I am using the new Microsoft Web Services Enhancements (WSE) to send SOAP messages from a client to a web service. How can I get identifying information of the sender (aka...
2
by: SharpSmith | last post by:
hi all i have a very specific question regarding emails sending and googling doesn't help me is a way exists to send email using .NET framework (System.Web.Mail or something else) and have the...
4
by: yancheng.cheok | last post by:
Recently, I try to replace #define with const in header file. However, there are concerns on, multiple const object will be created, if the header file is included in multiple cpp files. For...
5
by: MoslyChang | last post by:
Hi, All When I look at effective c++,item2 and item3. I have some basic questions , Does anyone be familar with this topic? it suggests const is perfer to #define, then I think how to replace...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
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
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...

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.