SoftwareTipsandTricks Forum

Go Back   SoftwareTipsandTricks Forum > Operating Systems > Windows NT/2000/2003
User Name
Password


hows does an IP get associated

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes

  #1  
Old 09-14-2004, 04:38 PM
jnalpak Offline
Registered User
 
Join Date: Mar 2003
Location: New York City
Posts: 172
hows does an IP get associated

interested in this question can someone school me real quickly...

How does a workstation after its turned on receive an IP address...thanks
__________________
"I was raised by a cup of coffee" -Homsar
Reply With Quote

  #2  
Old 09-15-2004, 03:58 AM
patrickjb's Avatar
patrickjb Offline
Senior Member
 
Join Date: Sep 2004
Location: Stanton, California
Posts: 106
This is not really a short, quick topic.
IP addresses can be set either “Statically” or “Dynamically”. If the IP address is Static, it means you enter your IP address manually and it never changes, unless you change it. You would enter an IP address, subnet mask, and other TCP/IP details in a dialog box. Entering you IP address using this method takes more time and can cause some configuration headaches, but it allows a high degree of control over network addresses. If your IP address is set Dynamically you get your IP address from a DHCP server (Dynamic Host Configuration Protocol). This is the default configuration for Windows XP Pro and Home, as well as Windows 2000 Pro.
__________________
Patrick
Reply With Quote

  #3  
Old 09-15-2004, 05:17 AM
jnalpak Offline
Registered User
 
Join Date: Mar 2003
Location: New York City
Posts: 172
i know how to configure static/dhcp ip's...im interested in how it actually get an IP address from the dhcp server...
__________________
"I was raised by a cup of coffee" -Homsar
Reply With Quote

  #4  
Old 09-15-2004, 03:12 PM
snowmonkey's Avatar
snowmonkey Offline
Registered User
 
Join Date: Jun 2003
Location: Canada
Posts: 3,338
Send a message via MSN to snowmonkey
if you put any network sniffer on your network you will notice that there are all kinds of network traffic going on even thought if there is no one at their work station..... basically, your DHCP server sends out a broadcast package and announces to the network that which machine in MASTER Browser and it constantly request from the network that who has such and such IP (I'm not kidding, That's how it works) and every machine identifies itself with the certain IP address... now, when you turn a machine on, during the boot up process it will listen to see who it the Master Browser and then it will ask the DHCP server for an IP... at that point, if the MAC address of the client system is still under the DHCP server's lease time then that client system will get the same IP address as it had last time it was on line, and if the lease time was due, then the client system will get a new IP address.


cheers
__________________
Have you Googled today!
AMD Athlon 3200+ 2Gig RAM, OS: XP Pro
VMWare 6.xx, Guest OS: DOS622, 98SE, Windows 2K, Windows XP Home, FreeBDS 6.2, MEPIS, CenOS44, Windows 2003 Server SBS, Windows 2003 Server Enterprise, Windows Vista Ultimate
Reply With Quote

  #5  
Old 09-15-2004, 06:49 PM
patrickjb's Avatar
patrickjb Offline
Senior Member
 
Join Date: Sep 2004
Location: Stanton, California
Posts: 106
Oh, you want to know how the DHCP process works.
Well, the DHCP servers and DHCP clients communicate through a series of DHCP messages. To obtain a lease, the DHCP client initiates a conversation with a DHCP server using a series of these DHCP messages. You can watch the process with a network monitor.

DHCP Messages:
There are eight types of messages that can be sent between DHCP clients and servers.

DHCPDiscover - Broadcast by a DHCP client when it first attempts to connect to the network. The DHCPDiscover message requests IP address information from a DHCP server.

DHCPOffer - Broadcast by each DHCP server that receives the client DHCPDiscover message and has an IP address configuration to offer to the client. The DHCPOffer message contains an unleased IP address and additional TCP/IP configuration information, such as the subnet mask and default gateway. More than one DHCP server can respond with a DHCPOffer message. The client accepts the best offer, which for a Windows DHCP client is the first DHCPOffer message that it receives.

DHCPRequest - Broadcast by a DHCP client after it selects a DHCPOffer. The DHCPRequest message contains the IP address from the DHCPOffer that it selected. If the client is renewing or rebinding to a previous lease, this packet might be unicast directly to the server.

DHCPAck - Broadcast by a DHCP server to a DHCP client acknowledging the DHCPRequest message. At this time, the server also forwards any options. Upon receipt of the DHCPAck, the client can use the leased IP address to participate in the TCP/IP network and complete its system startup. This message is typically broadcast, because the DHCP client does not officially have an IP address that it can use at this point. If the DHCPAck is in response to a DHCPInform, then the message is unicast directly to the host that sent the DHCPInform message.

DHCPNack - Broadcast by a DHCP server to a DHCP client denying the client’s DHCPRequest message. This might occur if the requested address is incorrect because the client moved to a new subnet or because the DHCP client’s lease has expired and cannot be renewed.

DHCPDecline - Broadcast by a DHCP client to a DHCP server, informing the server that the offered IP address is declined because it appears to be in use by another computer.

DHCPRelease - Sent by a DHCP client to a DHCP server, relinquishing an IP address and canceling the remaining lease. This is unicast to the server that provided the lease.

DHCPInform - Sent from a DHCP client to a DHCP server, asking only for additional local configuration parameters; the client already has a configured IP address. This message type is also used by DHCP servers running Windows Server 2003 to detect unauthorized DHCP servers.

Here's the DHCP Lease Process:

A DHCP-enabled client obtains a lease for an IP address from a DHCP server. Before the lease expires, the DHCP client must renew the lease or obtain a new lease. Leases are retained in the DHCP server database for a period of time after expiration. By default, this period is four hours and cleanup occurs once an hour for a DHCP server running Windows Server 2003. This protects a client’s lease in case the client and server are in different time zones, the internal clocks of the client and server computers are not synchronized, or the client is off the network when the lease expires.

Obtaining a New Lease:

A DHCP client initiates a conversation with a DHCP server when it is seeking a new lease, renewing a lease, rebinding, or restarting. The DHCP conversation consists of a series of DHCP messages passed between the DHCP client and DHCP servers.
Here’s the DHCP process:

1. The DHCP client requests an IP address by broadcasting a DHCPDiscover message to the local subnet.

2. The client is offered an address when a DHCP server responds with a DHCPOffer message containing an IP address and configuration information for lease to the client. If no DHCP server responds to the client request, the client sends DHCPDiscover messages at intervals of 0, 4, 8, 16, and 32 seconds, plus a random interval of between -1 second and 1 second. If there is no response from a DHCP server after one minute, the client can proceed in one of two ways:

o If the client is using the Automatic Private IP Addressing (APIPA) alternate configuration, the client self-configures an IP address for its interface.
o If the client does not support alternate configuration, such as APIPA, or if IP auto-configuration has been disabled, the client network initialization fails.

In both cases, the client begins a new cycle of DHCPDiscover messages in the background every five minutes, using the same intervals as before (0, 4, 8, 16, and 32 seconds), until it receives a DHCPOffer message from a DHCP server.

3. The client indicates acceptance of the offer by selecting the offered address and broadcasting a DHCPRequest message in response.

4. The client is assigned the address and the DHCP server broadcasts a DHCPAck message in response, finalizing the terms of the lease.

When the client receives acknowledgment, it configures its TCP/IP properties by using the DHCP option information in the reply, and completes its initialization of TCP/IP.

In some rare cases, a DHCP server might return a negative acknowledgment to the client. This can happen if a client requests an invalid or duplicate address. If a client receives a negative acknowledgment (DHCPNack), the client must begin the entire lease process again.

When the DHCP client and the DHCP server are on the same IP broadcast subnet, the DHCPDiscover, DHCPOffer, DHCPRequest, and DHCPAck messages are sent to identify clients by means of IP-level broadcasts sent to the limited broadcast address and the media access control (MAC) broadcast address.

When the DHCP server and DHCP client are not on the same subnet either a router or a host on the DHCP client’s subnet must act as a DHCP relay agent to support the forwarding of DHCP messages between the DHCP client and the DHCP server.
Here’s what happens when it’s time to Renew a Lease:
The DHCP client first attempts to renew its lease when 50 percent of the original lease time, known as T1, has passed. At this point the DHCP client sends a unicast DHCPRequest message to the DHCP server that originally granted its lease. If the server is available, and the lease is still available, the server responds with a unicast DHCPAck message and the lease is renewed.
If the original DHCP server is available, but the client’s current lease is no longer available, the DHCP server responds with a DHCPNack message, and the client immediately starts the process to obtain a new lease. This can happen if the client has changed subnets or if the DHCP server cannot fulfill the lease request for some other reason.

If there is no response from the DHCP server, the client waits until 87.5 percent of the lease time has passed (known as T2). At T2, the client enters the rebinding state, and broadcasts a DHCPRequest message to attempt to renew the lease from any available DHCP server. If no DHCP server is available by the time the lease expires, the client immediately unbinds itself from the existing lease and starts the process to obtain a new lease, beginning with a DHCPDiscover message.

Hope this is more like what you were looking for.
__________________
Patrick
Reply With Quote

  #6  
Old 09-16-2004, 12:34 PM
snowmonkey's Avatar
snowmonkey Offline
Registered User
 
Join Date: Jun 2003
Location: Canada
Posts: 3,338
Send a message via MSN to snowmonkey
Well done Patrick (y)... You should get A+ for that explanation.


cheers
__________________
Have you Googled today!
AMD Athlon 3200+ 2Gig RAM, OS: XP Pro
VMWare 6.xx, Guest OS: DOS622, 98SE, Windows 2K, Windows XP Home, FreeBDS 6.2, MEPIS, CenOS44, Windows 2003 Server SBS, Windows 2003 Server Enterprise, Windows Vista Ultimate
Reply With Quote

  #7  
Old 02-16-2005, 01:47 PM
rmusser Offline
Registered User
 
Join Date: Feb 2005
Posts: 1
I have a general understanding of how DHCP works...but what I am looking to
do is lock things down. Essentially I do not want certain information passed
out unless the user has authenticated on the network. Currently if I log into
the local computer, I still get a full DHCP packet. I want to hold back the
gateway information from all those who have not authenticated on the network.

Bob
Reply With Quote

  #8  
Old 04-28-2005, 10:36 PM
gbeardjr Offline
Registered User
 
Join Date: Apr 2005
Posts: 1
Quote:
Originally Posted by rmusser
I have a general understanding of how DHCP works...but what I am looking to
do is lock things down. Essentially I do not want certain information passed
out unless the user has authenticated on the network. Currently if I log into
the local computer, I still get a full DHCP packet. I want to hold back the
gateway information from all those who have not authenticated on the network.

Bob


Easy do not have the DHCP server assign the default gateway, instead have that included in the login script eg. route add 0.0.0.0 mask 0.0.0.0 xxx.xxx.xxx.xxx where x is the gateway
Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -5. The time now is 01:43 PM.


Designed by eXtremepixels. Powered by vBulletin Version 3.5.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 2.3.2 © 2005, Crawlability, Inc.