views:

27

answers:

1

I'm writing a log on a server and want to include the ip address(es) of the machine. On windows 7 I get IPv6 addresses along with IPv4 ones but the v6 addresses have that % sign. From what I've pieced together about these addresses I'm still not sure if they are relevant for my log.

As I understand it they are self assigned and only used on my PC. Is that correct? Can I just filter out anything with a % sign to reduce clutter in the log or are there situations where I shouldn't?

+2  A: 

No, it’s not true that link-local addresses are only used on your PC, although they are self-assigned. The loopback address (::1), not link-local address, is what is only used on your PC.

Link-local addresses are used on your local network, and they can be used to communicate with other nodes. The are not routable, but are still quite useful. For one thing, they are completely ad-hoc. Unlike link-local in IPv4, which takes about 30 seconds for DHCP to time out before you get a link-local address, the moment you plug in your network cable, you will have a link-local address whether you also have a global address or not.

This is useful for a number of reasons. Perhaps the biggest of these is that local network services (including router advertisement, which advertises global subnets) can be done on link-local addresses, which means configuration is immediate, and if an application is built to take advantage of them (e.g. a local peer-to-peer application like Windows Meeting Space), no configuration is needed on the user’s part.

Link-local addresses are used already in practice. The core IPv6 services Neighbor Discovery/Solicitation, Router Advertisement/Solicitation, and DHCPv6 use link-local addresses for communication.

Link-local addresses are a feature, not a bug, and if used wisely, can help your application to “just work” in ad-hoc situations.

Jeremy Visser