First of all lets define a few terms since your usage of static is rather unique.
- Dynamic IP: The host broadcasts a DHCP request. If there is a DHCP server on the network then this DHCP server can answer, giving the asker an IP. (And optionally more, but lets keep it simple for now).
- Static IP: No DHCP is involved at all. You have a NIC and you configure an IP for it. That one is set and does not change. No questions are asked on the network.
- Reserved IP via DHCP: The DHCP server can be told to give a specific MAC a specific IP. Since MAC addresses are unique that computer will always get the same dynamic IP.
Note that a computer which does a DHCP req may ask for a specific IP. It is up to the DHCP server to honor that or not.
In my mind, static IP addresses are something that a device requests,
asking for a specific address.
That is not commonly the case, but your question is clear.
With that approach, what happens if 2 devices attempt to connect to a
network and request the same static IP address?
The first device does a DHCP req. The DHCP server receives the request, grants the DHCP lease by sending the needed information and marks the IP as in use.
The second device does a DHCP req. The DHCP server sees that the IP is already handed out and will return another IP.
Is it first come first served, and the 2nd device won't receive the address?
Does it (or can it) automatically get a different one?
Yes. First one get the IP. Second one get a different IP.
1
If your question pertains to Windows environments, this article explains it well.
– Vinayak – 2015-03-14T16:57:29.0632Also, static IPs are just that, static. You tell the NIC to choose that IP so if it's already taken, you get an error. You don't get a random IP you didn't ask for (that happens if DHCP is enabled and you've set the NIC to obtain IP address automatically). – Vinayak – 2015-03-14T17:03:20.220
@Vinayak, thanks! The article was definitely helpful! – John – 2015-03-14T18:26:14.863
It might be noteworthy that all modern operating systems check (via ARP) whether an address already exists on the network and will refuse to use it if that’s the case. – Daniel B – 2015-03-15T00:02:00.343
3World War 3, don't try it! – Moab – 2015-03-15T00:48:30.917
1@Vinayak, not so. The NIC doesn't know about IP; it is the OS that "claims" the IP address by choosing to respond to ARP requests from other computers ( they are broadcast ) asking "who has this IP address?" – psusi – 2015-07-21T22:21:53.177