Multiple IPs

  • Thread starter Thread starter Fred
  • Start date Start date
F

Fred

Our server has 8 IPs with 121.232.21.1 as default (example).
I wrote a windows service that downloads podcasts (mp3s) off the net.
However every time this service runs it clogs down the entire server, even
though its not that bandwidth intensive. (30kps on a 100Mbps line)
Process resource at 20% max.
I would like to know if anyone knows what is causing this problem. What
command in c# can I use to assign the service a different IP to download ie
121.232.21.5 maybe that would help with the problem.

Fred
 
Fred,

It sounds strange that you would have eight NIC cards with the same IP
address. That's certainly going to cause some problems. Why do you have so
many? Adding extra NIC cards is not going to give you any edge in
downloading from the web, as the bottleneck is the actual network pipe.

As for changing the service to use a different IP to download (and it
sounds like you aren't downloading, but rather, serving up the mp3s), that's
dependent on the service itself. It might not offer a command line way to
change whatever IP address it's using.
 
Our server has 8 IPs with 121.232.21.1 as default (example).
I wrote a windows service that downloads podcasts (mp3s) off the net.
However every time this service runs it clogs down the entire server,
even though its not that bandwidth intensive. (30kps on a 100Mbps line)

Why do you think that the download is only 30kbps? Did you implement code
specifically to throttle your downloads?

If so, you should post the code that you think is not doing what you want
it to do. It's hard to answer the question without the code.

Of course, if you really have a 100Mbps Internet connection, one would not
expect a _single_ file download to saturate your bandwidth, since the
other end (the hosting server sending you the data) is highly unlikely to
be able to serve up the data that fast. But a) a 100Mbps Internet
connection is extremely unusual (so it seems unlikely that's what you
really have) and b) if you were to try to download many files at once,
that could in fact saturate even a 100Mbps connection.

Pete
 
sorry if i wasn't clear enough in the first post. the server has only 1 NIC
but has 8 ip addresses assigned to it.
actually it's not the service that uses the default ip it's everything. if i
use ie and go to a web page it uses 121.232.21.1.
How can I make my app aware of the multiple IPs and specify which one to
use?
As for changing the service to use a different IP to download (and it
sounds like you aren't downloading, but rather, serving up the mp3s),
that's dependent on the service itself. It might not offer a command line
way to change whatever IP address it's using.

I wrote the service myself so I have access to the source code. just need to
know the correct c# statement to use.

Fred

Nicholas Paldino said:
Fred,

It sounds strange that you would have eight NIC cards with the same IP
address. That's certainly going to cause some problems. Why do you have
so many? Adding extra NIC cards is not going to give you any edge in
downloading from the web, as the bottleneck is the actual network pipe.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Fred said:
Our server has 8 IPs with 121.232.21.1 as default (example).
I wrote a windows service that downloads podcasts (mp3s) off the net.
However every time this service runs it clogs down the entire server,
even though its not that bandwidth intensive. (30kps on a 100Mbps line)
Process resource at 20% max.
I would like to know if anyone knows what is causing this problem. What
command in c# can I use to assign the service a different IP to download
ie 121.232.21.5 maybe that would help with the problem.

Fred
 
no, thats the speed i get from the server that hosts the mp3s

the code uses TcpClient
TcpClient tcpClientC = new TcpClient ();

How can I tell it to use an ip of my choice?
 
I wish people would quote when they reply.

no, thats the speed i get from the server that hosts the mp3s

What's the speed you get from the server that hosts the mp3s? The 30kpbs?

If the server hosting the mp3s is only passing you the data at 30kpbs,
you're not going to download the data any faster than that. I certainly
don't see how your own network could get saturated under those conditions,
unless your Internet connection is only a 30kbps connection (56K modem on
a noisy phone line).
the code uses TcpClient TcpClient tcpClientC = new TcpClient ();

How can I tell it to use an ip of my choice?

I also don't understand what you mean when you say that you've got a
single NIC, but 8 IP addresses. I've never heard of such a thing. How do
you get your one NIC configured for 8 different IP addresses?

Beyond that, why do you think that using different IP addresses is going
to help, if it's your network adapter that's saturated, even if it _is_
possible to have multiple IP addresses assigned to a single network
adapter?

If you have multiple network adapters, you can use the IP address assigned
to each adapter as the address to which a Socket or Tcp/UdpClient is
bound, which will affect how and whether inbound data gets sent to the
Socket or ...Client. However, you can't control how your outbound data is
sent, including connection requests. The network driver looks at the
destination address and selects what it thinks is an appropriate route.
(There are, of course, really low level ways to affect the routing, but
this isn't accessible by .NET I don't think).

Pete
 
I also don't understand what you mean when you say that you've got a
single NIC, but 8 IP addresses. I've never heard of such a thing. How do
you get your one NIC configured for 8 different IP addresses?


Actually, this is quite common....my department has multiple ip addresses on
single NICS as well. :)

Mythran
 
Actually, this is quite common....my department has multiple ip
addresses on single NICS as well. :)

Okay, so how do you do that?

I'm got a computer with a single NIC. How do I assign multiple IP
addresses to it?

In any case, the real point here is that it's the hardware that determines
the bandwidth, not the number of logical addresses assigned to the
hardware. Using a different IP address on the same hardware isn't going
to help throughput.

Pete
 
Getting a bit OT but, to get multiple IP's on a box, you need to add
multiple network cards.
 
Getting a bit OT but, to get multiple IP's on a box, you need to add
multiple network cards.

Two people have already claimed that's not true.

I am curious to hear how they accomplish it.
 
Peter Duniho said:
Two people have already claimed that's not true.

I am curious to hear how they accomplish it.

On the machine sending this post, I have 4 IP's associated with the
computer, 1 NIC. It's not really dependant on the hardware, but the actual
drivers and software the monitors the hardware that respond to specific
events. In my case, on my development machine, I have VMWare adapters
(virtual) that all use the same network card as everything else, and they
have different IP addresses specified for them. If you go to another
computer on the network and connect to any of those IP addresses (or ping)
you will get a response from my computer.

Now, I haven't been in school in years nor do I work with customizing
hardware or driver software on a day-to-day basis, so take it with a grain
of salt ... as you already have been doin' anyways :)

Mythran
 
[...] In my case, on my development machine, I have VMWare adapters
(virtual) that all use the same network card as everything else, and
they have different IP addresses specified for them. If you go to
another computer on the network and connect to any of those IP addresses
(or ping) you will get a response from my computer.

Ah. Okay. I guess somehow the virtual machine software has managed to
map the same MAC address to multiple IP addresses. I wasn't aware that
was possible (though since I'm using virtual machine software myself, I
suppose I could run into that one day myself :) ).

Even so, the OP isn't going to change his bandwidth capacity by using
different IP addresses.

Thanks,
Pete
 
Peter said:
Okay, so how do you do that?

I'm got a computer with a single NIC. How do I assign multiple IP
addresses to it?
In the advanced properties of the NIC. If you are using DHCP, you can
add fixed IP addresses.

Cheers,

Cliff
 
Ged said:
Getting a bit OT but, to get multiple IP's on a box, you need to add
multiple network cards.
This is not true. If your NIC is already configured for fixed IP
addresses you can add extra IP address in the Advanced section of the IP
properties for the NIC.

Cheers,

Cliff
 
Peter said:
[...] In my case, on my development machine, I have VMWare adapters
(virtual) that all use the same network card as everything else, and
they have different IP addresses specified for them. If you go to
another computer on the network and connect to any of those IP
addresses (or ping) you will get a response from my computer.

Ah. Okay. I guess somehow the virtual machine software has managed to
map the same MAC address to multiple IP addresses. I wasn't aware that
was possible (though since I'm using virtual machine software myself, I
suppose I could run into that one day myself :) ).
It doesn't need to be virtualised to have multiple IP addresses. You can
do it by just configuring the Advanced properties of the NIC.
Even so, the OP isn't going to change his bandwidth capacity by using
different IP addresses.
This is true, I think.

Cheers,

Cliff
 
So can C# access an alternative IP?

Enkidu said:
In the advanced properties of the NIC. If you are using DHCP, you can add
fixed IP addresses.

Cheers,

Cliff
 
What do you mean, Fred? I've not done much socket programming and I was
talking about how you define extra IP addresses to the OS.

I'm not sure how the IP address that the traffic appears to the receiver
to be from is determined. It pretty much *has* to be able to be
programmatically determined otherwise you would not be able to set up
IIS (which is a program after all!) to respond to requests to multiple
IP addresses and I know it can do that!

How you do it in C#, I don't know. Probably by binding to one of the IP
addresses somehow. A quick Google came up with a Java example, so I find
it hard to believe that it can't be achieved in C#.

Cheers,

Cliff
 
[...]
How you do it in C#, I don't know. Probably by binding to one of the IP
addresses somehow. A quick Google came up with a Java example, so I find
it hard to believe that it can't be achieved in C#.

As I already did point out in this thread, if you do have multiple IP
addresses, you can bind the socket to a specific IP address if you only
want to receive data on a specific IP address. However, this only affects
incoming data. You can't reliably control what IP address is used to send
data via this method, as the network driver will route the traffic
according to its own rules.
 
It doesn't need to be virtualised to have multiple IP addresses. You can
do it by just configuring the Advanced properties of the NIC.

Ahhh...so simple. I've configured so many network adapters in my
lifetime, and I've never paid any attention to that part of the settings.
Amazing. :)

I wonder if this sort of thing is easy to get to on other operating
systems.
This is true, I think.

It had better be. If my network card has extra bandwidth that's it's
reserving instead of letting me use it even when I'm not actually using
one of the extra IP addresses, that's a network card I want in the trash.

Thanks,
Pete
 
Peter said:
Ahhh...so simple. I've configured so many network adapters in my
lifetime, and I've never paid any attention to that part of the
settings. Amazing. :)
If you'd used IIS with multiple IP addresses, you would have known this,
I think! I guess it come under the heading of "Things you don't know
because you've never had to consider them"!!
I wonder if this sort of thing is easy to get to on other operating
systems.
If you are thinking of the L-word or the U-word my experience is that it
is just as easy.
It had better be. If my network card has extra bandwidth that's it's
reserving instead of letting me use it even when I'm not actually using
one of the extra IP addresses, that's a network card I want in the trash.
I'm not sure what you are saying here. If your NIC has multiple IP
addresses, you aren't going to get extra bandwidth out of it. If it is a
100Mbps card it is never going to transfer data faster than that,
compression aside.

Cheers,

Cliff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top