How does a computer know what its IP configuration is?
- Most likely, a computer received its IP configuration from a DHCP (Dynamic Host Configuration Protocol) server.
- Not only did the server give the PC an IP address, but it also told the PC where the default gateway was and more than likely how to find a DNS server.
- A computer will receive its IP configuration in one of two ways, statically (manually set) or dynamically (through a service like DHCP).
- Static address assignment works fine for very small and stable networks, but quickly becomes unwieldy and error prone as the network grows
Default Gateway
- A default gateway is the node in a computer network using the Internet protocol suite that serves as the forwarding host (router) to other networks when no other route specification matches the destination IP address of a packet.
Static IP addressing
- The administrator assigns an IP number and subnet mask to each host in the network.
- Each network interface that is going to be available to connect to the network requires this information.
- The administrator assigns a default gateway location and DNS server location to each host in the network
- These are required if access outside of the network is going to be allowed (default gateway) and human friendly naming conventions are allowed to find network resources (DNS server).
- Each time a change is made (e.g., a new default gateway is established) each IP configuration on each host must be updated.
Dynamic IP addressing
- The administrator configures a DHCP server to handie the assigning process, which automates the process.
- The DHCP server listens on a specific port for IP information requests.
- Once it receives a request, the DHCP server responds with the required information
How DHCP works
- Upon boot up, a PC that is configured to request an IP configuration sends a DHCP discovery packet
- The discovery packet is sent to the broadcast address:
255.255.255 255 67 (UDP port 67). - The DHCP server receives the discovery packet and responds with an offer packet
- The offer packet is sent to the MAC address of the computer using UDP port 68.
- The computer receives the offer packet from the DHCP server and returns a request packet (requesting the proper IP configuration) to the DHCP server.
- Once the DHCP server receives the request packet, it sends back an acknowledgement packet, which contains the required IP configuration information.
- Upon receipt of the acknowledgement packet, the PC changes its IP configuration to reflect the information received
What is a broadcast address?
- A broadcast address is an IP address that is used to target all systems on a specific subnet network instead of single hosts. In other words broadcast address allows information to be sent to all machines on a given subnet rather than to a specific machine.
Components and Processes of DHCP
Ports Used
- PC sends discovery packet to 255.255 255 255.67.
- DHCP sends offer packet to the PCโs MAC address on port 68.
Address Scope
- Administrator configures the IP address range with one that is available to be handed out.
Address Reservations
- Administrator reserves specific IP addresses to be handed out to specific MAC addresses. These are used for devices that should always have the same IP address (eg., servers and routers).
- Allows for these addresses to be changed from a central location instead of having to log in to each device separately.
Leases
- Configuration parameters are only good for a specified amount of time.
- Leases are configured by the administrator.
Options
- Default gateway location
- DNS server addresses (there can be more than one).
- Time server addresses.
Preferred IP configuration
- A PC can have a preferred IP address.
- The administrator can configure the DHCP server to either honor the preference or ignore it.
Do DHCP servers need to reside on the same network segment?
- Broadcast transmissions cannot pass through a router. If there is not a DHCP server on the local network segment, the router can be configured to be a DHCP relay.
- When a DHCP relay (which can also be called an IP helper) receives a discovery packet from a node, it will forward that packet to the network segment on which the DHCP server resides.
- This allows for fewer DHCP servers on any given network, reducing maintenance that administrators need to perform.
