In most home and small business network setups, IP addresses are assigned automatically by DHCP service. When a new device joins a network it sends DHCPDISCOVER message to all devices in the network asking for a new IP address. The message is sent to an entire network since the device doesn’t know which computer is functioning as a DHCP server. Every computer in the network is going to receive this message but only the DHCP server will reply to it. Since the new computer doesn’t have an IP address assigned to it yet, DHCP server will respond to all computers in a network with DHCPOFFER message which will contain a proposed IP address for a new computer. If the new computer is ok with that IP address it will respond to DHCP server with DHCPREQUEST message confirming that it is ready for IP address assignment. As a final step DHCP server will respond to it with DHCPACK message acknowledging IP address assignment. After receiving DHCPACK message the computer will start using the new IP address assigned to it.
Typically dynamic IP address assignment via DHCP is everything that is needed for a network to function properly. But there are certain cases when static IP address assignment might be needed. For example, if one or multiple devices on the network need to communicate to a certain device regularly they will need a way of contacting it. If IP address of that device keeps changing it may not be possible or will require more complex programming. Port forwarding also requires target devices to have a static IP address.
Static IP address assignment is typically performed by changing network settings for a device. Every device will have an option to join the network with a static IP. When this option is chosen user will need to specify an exact IP which device will use to identify itself on the network.
When assigning static IP address it is important to make sure that this IP address is unique. If two devices use the same IP address then IP address collision will occur and only one of them will function properly.