Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: fixed some typo

...

Overview

IP addresses serve for a general host identification purposes in IP networks (RFC 791). Typical (IPv4) address consists of four octets. For proper addressing the router also needs the network mask value, id est which bits of the complete IP address refer to the address of the host, and which - to the address of the network. The network address value is calculated by binary AND operation from a network mask and IP address values. It's also possible to specify an IP address followed by a slash "/" and the amount number of bits that form the network address.

...

It is possible to add multiple IP addresses to an interface or to leave the interface without any addresses assigned to it. In case of bridging or PPPoE connection, the physical interface may not have any address assigned, yet be perfectly usable. Configuring an IP address to a physical interface included in a bridge would mean actually setting it on the bridge interface itself.

You can use /ip address print detail to see which interface the address belongs to.

...

IPv4 uses 4 byte addresses which is segmented in four 8-bit fields called octets. Each octet is converted to a decimal format and separated by a dot. For example:

Code Block
languagetextros
themeFadeToGrey
11000000 10101000 00000011 00011000 => 192.168.3.24

...

  • network address - a standard way to refer to an IPv4 address assigned to a network. For example, we could refer to the network 192.168.1.0 or 172.16.0.0 as a “Network Address.”
  • broadcast address - a special address for each network that allows communication to all the hosts in that network. The broadcast address uses the highest address in the network range. for example, broadcast address if 192.168.1.0/24 network will be 192.168.1.255
  • host address - any other address that is not network address and broadcast address can be used as a host address. For example, 192.168.1.2 - 254 host addresses can be used from 192.168.1.0/24 address range

...

  • unicast - normally refers to a single sender or a single receiver, and can be used for both sending and receiving. Usually, a unicast address is associated with a single device or host, but it is not a one-to-one correspondence.
  • broadcast - address to send data to all possible destinations ("all-hosts broadcast"), which permits the sender to send the data only once, and all receivers receive a copy of it. In the IPv4 protocol, the address 255.255.255.255 is used for local broadcast. In addition, a directed (limited) broadcast can be made by combining the network prefix with a host suffix composed entirely of binary 1s. For example, the destination address used for a directed broadcast to devices on the 192.0.2.0/24 network is 192.0.2.255
  • multicast - address associated with a group of interested receivers. In IPv4, addresses 224.0.0.0 through 239.255.255.255 are designated as multicast addresses. The sender sends a single datagram from its unicast address to the multicast group address and the intermediary routers take care of making copies and sending them to all receivers that have joined the corresponding multicast group.


Private address range

Following The following IP address ranges are reserved (RFC 6890) for private addressing. These addresses are not routed in the global routing table and should be translated to global address with network address translation (NAT):

...

Internet Protocol version 6 (IPv6) is the new version of the Internet Protocol (IP). It was initially expected to replace IPv4 in short enough time, but for now it seems that these two version versions will coexist in on the Internet in foreseeable future. Nevertheless, IPv6 becomes more important, as the date of unallocated IPv4 address pool's exhaustion approaches.

...

IPv6 addresses are represented a little bit different than IPv4 addresses. For IPv6, the 128-bit address is divided in into eight 16-bit blocks, and each 16-bit block is converted to a 4-digit hexadecimal number and separated by colons. The resulting representation is called colon-hexadecimal.

In the example above below IPv6 address in binary format is converted to a colon-hexadecimal representation

...

As you can see IPv6 addresses can have long sequences of zeros. These This contiguous sequence can be compressed to ::

...


IPv6 prefix is written in address/prefix-length format. Compared to IPv4 decimal representation of a network mask cannot be used. Prefix examples:

...

  • globally unique addresses and can be used to connect to addresses with global scope anywhere.
  • link-local addresses
  • site-local addresses (FEC0::/48) - deprecated
  • special purpose addresses
  • compatibility addresses


Global A global unicast address can be automatically assigned to the node by Stateless Address auto-configuration.

...

A link-local address is required on every IPv6-enabled interface, applications may rely on the existence of a link-local address even when there is no IPv6 routing, that is why the link-local address is generated automatically for every active interface using it's its interface identifier (calculated EUI-64 from MAC address if present). Address prefix is always FE80::/64 and IPv6 router never forwards link-local traffic beyond the link.

...

Info

If interface is set as bridge port, interface specific link-local address is removed leaving only bridge link-local address


Special Purpose Address

AddressDescription
Unspecified address (::/128)Never assigned to an interface or used as a destination address, used only to indicate the absence of an address. Equivalent to IPv4 0.0.0.0 address.
loopback address (::1/128)Used to identify a loopback interface, enabling a node to send packets to itself. It is equivalent to the IPv4 loopback address of 127.0.0.1.


Compatibility Address

AddressDescription
IPv4 compatible addressused by dual-stack nodes that are communicating with IPv6 over an IPv4 infrastructure. When the IPv4-compatible address is used as an IPv6 destination, IPv6 traffic is automatically encapsulated with an IPv4 header and sent to the destination by using the IPv4 infrastructure. Address is written in following format ::w.x.y.z, where w.x.y.z is the dotted decimal representation of a public IPv4 address.
IPv4 mapped addressused to represent an IPv4-only node to an IPv6 node. It is used only for internal representation. The IPv4-mapped address is never used as a source or destination address for an IPv6 packet. The IPv6 protocol does not support the use of IPv4-mapped addresses. Address is written in the following format: ::ffff:w.x.y.z, where w.x.y.z is the dotted-decimal representation of a public IPv4 address.
2002::/16This prefix is used for 6to4 addressing. Here, an address from the IPv4 network 192.88.99.0/24 is also used.


Multicast Address

Most important multicast aspects are:

  • traffic is sent to a single address but is processed by multiple hosts;
  • group membership is dynamic, allowing hosts to join and leave the group at any time;
  • in IPv6, Multicast Listener Discovery (MLD) messages are used to determine group membership on a network segment, also known as a link or subnet;
  • a host can send traffic to the group's address without belonging to the corresponding group.

...

Multicast address consists of the following parts:

  • The first 8 bits in the multicast address is are always 1111 1111 (which is FF in hexadecimal format).
  • Flag uses the 9th to 12th bit and shows if this multicast address is predefined (well-known) or not. If it is well-known, all bits are 0s.
  • Scope ID indicates to which scope multicast address belongs, for example, Scope ID=2 is link-local scope.
  • Group ID is used to specify a multicast group. There are predefined group IDs, such as Group ID=1 - all nodes. Therefore, if multicast address is ff02::1, that means Scope ID=2 and Group ID=1, indicating all nodes in link-local scope. This is analogous to broadcast in IPv4.

...

Here is the table of reserved IPV6 addresses for multicast:

AddressDescription
FF02::1The all-nodes address used to reach all nodes on the same link.
FF02::2The all-routers address used to reach all routers on the same link.
FF02::5The all-Open Shortest Path First (OSPF) routers address used to reach all OSPF routers on the same link.
FF02::6The all-OSPF designated routers address used to reach all OSPF designated routers on the same link.
FF02::1:FFXX:XXXXThe solicited-node address used in the address resolution process to resolve the IPv6 address of a link-local node to its link-layer address. The last 24 bits (XX:XXXX) of the solicited-node address are the last 24 bits of an IPv6 unicast address.



The following table is a partial list of IPv6 multicast addresses that are reserved for IPv6 multicasting and registered with the Internet Assigned Numbers Authority (IANA). For complete list of assigned addresses read IANA document.

...

Code Block
languagetext
themeFadeToGrey
mrz@bumba:/media/aaa/ver$ ping6 ff02::2%eth0
PING ff02::2%eth0(ff02::2) 56 data bytes
64 bytes from fe80::20c:42ff:fe28:7945: icmp_seq=1 ttl=64 time=0.672 ms
64 bytes from fe80::20c:42ff:fe0d:2c38: icmp_seq=1 ttl=64 time=1.44 ms (DUP!)


Anycast Address

Anycast An anycast address is a new type of address incorporated in IPv6.

Anycasting is a new networking paradigm supporting service–oriented service-oriented Addresses where an identical address can be assigned to multiple nodes providing a specific service. An anycast packet (i.e., one with an anycast destination address) is delivered to one of these nodes with the same anycast address.

Anycast An anycast address is not assigned a specific address range. It is assigned from the unicast address range.

Interface Identifier

...

IEEE EUI-64 is a new standard for network interface addressingaddress. The company ID is still 24-bits in length, but the extension ID is 40 bits, creating a much larger address space for a network adapters.

To create an a EUI-64 address from the interface MAC address:

  • 0xFFFE is inserted into the MAC address between the manufacturer ID and the board ID.
  • seventh bit of the first byte is reversed.


Lets Let's make an example with following MAC address 00:0C:42:28:79:45.

Image The image above illustrates conversation the conversion process. When the result is converted to colon-hexadecimal notation, we get the interface identifier 20C:42FF:FE28:7945. As the a result, corresponds link-local address is

Code Block
languagetext
themeFadeToGrey
FE80::20C:42FF:FE28:7945/64

In RouterOS, if the euiEUI-64 parameter of an address is configured, the last 64 bits of that address will be automatically generated and updated using interface identifier. The last bits must be configured to be zero for this case. Example:

...

Code Block
languageros
/ipv6 address
add address=2001:DB8::2/64 interface=ether1 advertise=no

Check address list:

Code Block
themelanguageFadeToGreyros
[admin@R1] /ipv6 address> print
Flags: X - disabled, I - invalid, D - dynamic, G - global, L - link-local
#    ADDRESS                                     FROM-POOL INTERFACE     ADVERTISE
0  G 2001:db8::1/64                                        ether1        no
3 DL fe80::219:d1ff:fe39:3535/64                           ether1        no

...

Notice that our added address has G flag indicated that this address can be globally routed. We also have a link-local address on the interface which is created automatically for every IPv6 capable interface.

Test connectivity:

Code Block
languagetextthemeFadeToGreyros
[admin@R1] /ipv6 address> /ping 2001:DB8::2
HOST                                     SIZE TTL TIME  STATUS
2001:db8::2                 56  64 12ms  echo reply
2001:db8::2                 56  64 0ms   echo reply
    sent=2 received=2 packet-loss=0% min-rtt=0ms avg-rtt=6ms max-rtt=12ms

...