27 Kasım 2020 Cuma

Link Local Adress - İşletim Sistemi Tarafından Atanan Private Adres

Giriş
Link Local Address kavramı hem IPv4 hem de IPv6'da var. Link Local adres işletim sistemi tarafından kendi kendine atanır. Amacı atanmış bir IP adresi alıncaya kadar bir adrese sahip olmaktır. Buna aynı zamanda APIPA (Automatic Private IP Addressing) de deniliyor

IPv6 Link Local Address
Açıklaması şöyle. Aslında tanım olarak fe80::/10 aralığında ancak 54 bit 0 olduğu için pratikte fe80::/64 aralığındadır.
2.5.6.  Link-Local IPv6 Unicast Addresses

   Link-Local addresses are for use on a single link.  Link-Local
   addresses have the following format:

   |   10     |
   |  bits    |         54 bits         |          64 bits           |
   +----------+-------------------------+----------------------------+
   |1111111010|           0             |       interface ID         |
   +----------+-------------------------+----------------------------+
54 bit şu anda 0 ile dolduruluyor. İleride link-local adreslerin özelleştirilmesi için kullanılabilir.
İlk ve son 64 bit için açıklama şöyle
First 64 bits are always fe80:: according to RFC 4291. Last 64 bits are interface ID. Interface ID is modified MAC address.
Link Local Adresi görmek için şöyle yaparız.
# ifconfig test.123
test.123: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
    inet6 fe80::a03a:a8ff:fe0c:d976  prefixlen 64  scopeid 0x20<link>
    ether a2:3a:a8:0c:d9:76  txqueuelen 1000  (Ethernet)
    RX packets 0  bytes 0 (0.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 0  bytes 0 (0.0 B)
    TX errors 0  dropped 5 overruns 0  carrier 0  collisions 0
IPv4
Bu adres IPv4 için 169.254.0.0/16. Yani 169.254.0.0 – 169.254.255.255 aralığında. Bu adres sadece tavsiye. Açıklaması şöyle
The purpose of these self-assigned link-local addresses is to facilitate communication with other hosts within the subnet even in the absence of external address configuration (via manual input or DHCP). Unlike in IPv6, implementation of IPv4 link-local addresses is recommended only in the absence of a normal, routable address. Hosts pseudo-randomly generate the last two octets of the address to mitigate address conflicts. Because of the broadcast nature of some local networking protocols (for example, Microsoft's NetBIOS), hosts may be able to detect one another even without any preexisting knowledge of the address scheme.
Client Side Conflict Resolution
İşletim sistemi kendisine bir adres seçtikten sonra, bu adresin hâlihazırda kullanılmadığını kontrol etmek zorundadır. Zaten bu yüzden Link Local Address tek bir adres değil de bir subnetten oluşuyor. Kontrol için ARP mesajları kullanılır. Açıklaması şöyle
It is almost impossible for two devices to choose the same IP for themselves.

Each device picks up an address and then tests to see if it is already in use, by broadcasting ARP Probe packets. All conflict cases are well covered, such as repeating requests when no answers arrive, ARP request for the same IP by another device, and others.

Finally the device announces itself to the network via ARP with its chosen IP, guaranteed by the algorithm to be unique (or almost guaranteed).

For details, see RFC 5227 that contains the standard that all ad-hoc networks must follow.

Link-local address is a variant of this algorithm, first implemented in MacOS 9 in 1998, where each device picks a random address as its first try. The standard here is RFC 3927.


Hiç yorum yok:

Yorum Gönder