sockets and dhcp?

  • Thread starter Thread starter TheMadHatter
  • Start date Start date
T

TheMadHatter

Quick q:

If I open a socket on my computer and eventualy
the dhcp changes the address of my computer, what happens?
Will it drop the connection?

Thanks in advance for any help on the topic.
 
If I open a socket on my computer and eventualy
the dhcp changes the address of my computer, what happens?
Will it drop the connection?

Not really a C# or .NET question. You'll get much better advice from an
actual network programming newsgroup.

That said, AFAIK you can't change the DHCP-assigned IP address without
resetting all of the network connections. Typically, if the computer is
actually up and running when the DHCP lease runs out, the lease is just
renewed. So the sitaution you're asking about should never happen unless
you do it explicitly (e.g. "ipconfig /release" at the command prompt).

If you _do_ do it explicitly, then yes...I believe none of your
already-created sockets will work.

Pete
 
TheMadHatter said:
Quick q:

If I open a socket on my computer and eventualy
the dhcp changes the address of my computer, what happens?
Will it drop the connection?

Thanks in advance for any help on the topic.


First, this isn't technically a dotNET question, but since it can impact NET
applications, here's the scoop on DHCP. If you have a single active DHCP
server on your network, it will _ALWAYS_ re-lease the same IP to a DHCP
client unless that IP address has been either specifically reservered for
another client or removed from the scope of leasable IPs since he last
lease. This is part of the DHCP specification.

If you have multiple DHCP servers, it depends on whether or not the DHCP
server that previously supplied the lease handles the renewal request. If
it doesn't, then you may drop your connection.

Mike Ober.
 
If you _do_ do it explicitly, then yes...I believe none of your  
already-created sockets will work.

Yes I think that is correct, the nice thing is DHCP-leases as long as
connected they renew before they release (somhwere in my head a thing
like when 2/3 of lease time has expired)
so theoretically if you have a really poor connection and want this to
be a non question for a process computer - use a static address.

I dont have a poor connection and still dont use DHCP, DNS lookup,
wins and whatever..., all static,
I put the server address in the startup file for clients connecting -
dont trust dhcp,dns and others to be up, they are from redmond...
//CY
 
If you _do_ do it explicitly, then yes...I believe none of your
already-created sockets will work.

Yes I think that is correct, the nice thing is DHCP-leases as long as
connected they renew before they release (somhwere in my head a thing
like when 2/3 of lease time has expired)
so theoretically if you have a really poor connection and want this to
be a non question for a process computer - use a static address.

I dont have a poor connection and still dont use DHCP, DNS lookup,
wins and whatever..., all static,
I put the server address in the startup file for clients connecting -
dont trust dhcp,dns and others to be up, they are from redmond...
//CY


Please don't apply for a network admin anywhere with a medium to large
network. DHCP/DNS are vital to large networks.

Mike.
 
TheMadHatter said:
Quick q:

If I open a socket on my computer and eventualy
the dhcp changes the address of my computer, what happens?
Will it drop the connection?

Of course it will. You can test this yourself by simply ensuring you
have a connection and then doing ipconfig /release to release your IP.
It will reset all connections because everything attached to them is
based on invalid addresses.

As Michael said though, you generally won't have this problem unless
you're talking about being on a broadband connection with a provider who
really likes to change your IP on you. On Home/Corporate networks this
generally isn't an issue at all.


Chris.
 
dont trust dhcp,dns and others to be up, they are from redmond...
//CY


Please don't apply for a network admin anywhere with a medium to large
network. DHCP/DNS are vital to large networks.

Also they are not from Microsoft, they are IETF standards. If the Microsoft
server implementation isn't reliable, then use another one.
 
Please don't apply for a network admin anywhere with a medium to large
Also they are not from Microsoft, they are IETF standards.  If the Microsoft
server implementation isn't reliable, then use another one.

Correct, but why use one at all when I am talking about 30
computers... static is not a problem here...

//CY
 

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