18

I could find some information on the Internet but it is hard for me to understand this information because of the use of technical words. Could somebody please help me with that.

Did I correctly understand what I read?

Firstly, is a link-local address always an IP address? Moreover, is the link-local address always in the range from 169.254.1.0 to 169.254.1.0?

Secondly, the link-local address is always assigned to a device by itself. In more detail, the device chooses an IP address (from a specified range) and sends this IP address to other devices in the network. If this IP address is not occupied by other devices, it will be taken by the considered device. Is this right?

TafT
  • 223
  • 2
  • 12
Roman
  • 2,439
  • 9
  • 32
  • 32
  • For clarity I think you should update the question summary to "What is a link-local IP address?" if Internet Protocol is the one you are interested in. Link-Local Address can be a generic term that spans many protocols. – TafT Jun 02 '16 at 06:58
  • link-local address as far as I understand it is a device that has an IPv6 ip assigned to that nic and normally starts with FE80::. This ip is used only for your single-link network scope and should at all purposes avoid routing it. Have you heard of EUI-64? this is another local-link form you can use. Basically, this form uses your MAC address of the physical interface and inserts FFFE in the middle of your MAC or 3 and 4 bytes. In Hex decimal F=15 so FFFE is 15 15 15 14. Hope this helps... Alberto – user400453 Feb 14 '17 at 21:28

2 Answers2

17

Link local addresses allow machines to automatically have an IP address on a network if they haven't been manually configured or automatically configured by a special server on the network (DHCP). Before an address is chosen from that range, the machine sends out a special message (using ARP which stands for address resolution protocol) to the machines on the network around it (assuming that they also haven't been assigned an address manually or automatically) to find out if 169.254.1.1 is free. If it is, then the machine assigns that address to its network card. If that address is already in use by another machine on the same network, then it tries the next IP 169.254.1.2 and so on, until it finds a free address.

vikram2784
  • 103
  • 2
  • 1
    Is any machine able to send out a request using ARP (printers, PC, laptops)? How it starts? I mean, network appears when 2 machines get connected. They will send ARP request to each other? What if they send a request simultaneously? They both get 169.254.1.1? – Roman Mar 02 '10 at 15:37
  • Yes, any machine capable of TCP/IP network communication uses ARP. Networking is composed of seven layers, with the seventh layer (the application layer) being the one that most people are familiar with. ARP sits at layer 2 which is known as the data link layer. It's just above layer 1 which is the physical layer (the actual hardware). I'm not a networking expert, but I think that ARP happens before any IP addresses are assigned. Which means that all the communication at that point is done via MAC address. – George H. Lenzer Mar 02 '10 at 15:49
  • ARP requests can and are sent by anyone. In fact, they're a normal part of an ethernet network. And they aren't sent 'to' anyone. They are broadcast. It's essentially a way of shouting "Who has this IP?" to the entire network. – Christopher Karel Mar 02 '10 at 15:50
  • If you use a sniffer to watch network traffic go by on your network and look for ARP traffic, you'll see lots of messages that basically say, "Who has IP address 169.254.1.1" and is a machine does you'll see a response stating that machine's MAC address. This is how you keep from having two machines that take 169.254.1.1. No matter if they send messages simultaneously, one is always going to arrive before the other resulting in one machine taking the IP address before the other. I believe they also announce when they have an IP. Someone correct me if I'm wrong. – George H. Lenzer Mar 02 '10 at 15:52
  • 4
    Link-local addresses are _never_ chosen sequentially. They are either random or based on the hardware address. – user1686 Mar 02 '10 at 16:30
  • @grawity is right. The addresses are randomly chosen with IPv4. and based on MAC with IPv6. [Source](https://en.wikipedia.org/wiki/Link-local_address) – Jeter-work Mar 02 '17 at 19:24
7

It is a special class of address. Usually referring to an IPv4 or IPv6 address but it can be a reference to other protocols. The general idea is that the address is only valid and usable for the local link or local network segment. The exact meanings of these terms vary by protocol.

Firs, link-local address is alway an IP address.

Not always, most commonly people do mean a link-local IP addresses when they use the term. When they mean this the addresses are always IP addresses, either IPv4 or IPv6. It is valid in some circumstances to refer to a MAC address as a link-local address but it is a less common use of the term.

Moreover, it is always in the range from 169.254.1.0 to 169.254.1.0.

Close, the range for IPv4 is 169.254.0.0/16 (169.254.0.1 to 169.254.255.254), with 169.254.0.0 and 169.254.255.255 reserved as network/broadcast addresses. IPv6 has fe80::/10 reserved for Link-Local addresses with most automatically assigned ones being in the fe80::/64 range.

Second, the link-local address is alway assigned to a device by itself.

No. A link-local IP address is no more unique than a regular IP address, at least not in general terms. The link-local IP address must be unique within its network segment. The rough guide to this is that Routers will not forward any traffic using an address in the link-local IP address range but Hubs and Switches will behave as normal. In a domestic setting this means they are unlikely to get used much outside automated assignments, in larger networks it becomes more relevant.

The process a device assigning an address to itself is a common use for Link-local IP addresses but it is not the only way they are used. In stateless address autoconfiguration the device should check that an address it wants to try and use is available and then use it. There is nothing to stop you manually assigning the same link-local IP address to two devices you administer.

In more details, device chooses an IP address (from a specified range) and send this IP to other devices in the network. If this IP address is not occupied by other devices, it will be taken by the considered device. Is it right?

You are describing a form of stateless address autoconfiguration. Although this is one of the most common sources for link-local IP addresses it is not the only one and is a separate process.

If you are going to start looking at IPv6 then every physical network port on a device has a link-local IPv6 address which is mainly used exclusively by the low-level protocol operations. These are either automatically generated in a manner similar to the one you describe or they are handed out by a central system, as DHCP commonly does for normal IPv4 addresses.

If you are going to look at the Ethernet level rather than the IP, it seems that MAC addresses also count as link-local addresses. The term probably applies to other addressable networking protocols too but I would expect IP and Ethernet are the two most commonly found uses for everyday with IP being the prevailing on for domestic equipment.

For more information, you might get lucky with Wikipedia's article on Link-Local Addresses. It currently has an OK explanation on it although you are required to know what the differences between hubs, switches and routers are in IP networks.

TafT
  • 223
  • 2
  • 12
  • @robbat2 https://tools.ietf.org/html/rfc3927 suggests that range I used was correct. Where is the wider range stated? I'd also prefer to give ranges in the style presented in the question. Not everyone can read subnet notations well enough to calculate ranges correctly. Maybe state both? – TafT May 30 '17 at 08:22
  • Ah wait, you are correct in the range: "The first 256 and last 256 addresses in the 169.254/16 prefix are reserved for future use and MUST NOT be selected by a host using this dynamic configuration mechanism." I was being too specific about dynamically assigned stuff. – TafT May 30 '17 at 08:24
  • 1
    Yes, the spec says those two /24's MUST NOT be used via dynamic configuration, but they are acceptable to use for static configuration. It's not uncommon to see them used eg to have a gateway on 169.254.0.1 or 169.254.255.254, to support clients that look for a gateway the first or last non-network address of a netblock. – robbat2 May 30 '17 at 16:04