Difference between networks and /31 mask?

Hello, I see that in Mikrotik with 7.18 added /31 ​​mask, I hope it works as it should,

Let me ask two questions,

  1. What exactly happens when I use

/ip address
add address=10.0.0.0 interface=ether1 network=10.0.0.1

This is some simplification for point-to-point connection, where two /32 addresses are designated, which can be any(address=10.0.0.1 network=12.34.56.78)?

  1. What is the difference see above, addresses specified via networks, from addresses with /31 mask?

Maybe the difference is that in addresses with networks, we do not have broadcast or we are not tied to consecutive pairs, wildcard?

We normally use /31 to conserved public ip because /31 is a point to point ip address without network and broadcast while /30 consume 4 ip address space and you are right on point #1 on point #2 i haven’t done that :slight_smile:

AFAICT a /31 is a network with only two (consecutive) addresses, the first (lower) address should actually be also broadcast, but of course broadcasting very little:
https://www.calculator.net/ip-subnet-calculator.html?cclass=any&csubnet=31&cip=192.168.1.1&ctype=ipv4&x=Calculate

The common (till now) /32 Mikrotik workaround of using a /32 with the “other” IP set as network is (IMHO) more “flexible” (as the “other” IP can be in any subnet), but likely - not being “standard” - it may cause issues in particularly complex networks and/or when other manufacturers hardware is involved.

On the other hand - as I see it - the usual warning “Do not use /30 because you are wasting two addresses!” should not scare most people (I know that there can be setups where IP addresses are scarce and wasting 2 of them on each PtP link can be an issue, but from what I understand they are rare).

So, again as I see it:

  1. If you can, use a /30 for PtP ← this is “fully standard”.
  2. If you really need not to waste two IP’s, use a /31 ← this is “standard” but being “new” (in Mikrotik) might still have some quirks.
  3. Unless there isn’t a valid reason against it, ignore the above and use a /32 like it was done till now. ← this is definitely “non-standard” but it works just fine in most cases.

Yes jaclaz is right /30 still the standard for most point-to-point link between router, /31 otoh though fairly new in Mikrotik is working fine afaics, In Asia it’s common now a days you see /31 due to v4 depletion / scarcity everyone here really want to conserved IP, but I always ask them not to handover me 0 or 255 because there were scenarios that it didn’t work I just forget what it was

use of /31 masks can be caused by the user’s desire to get away from the functionality of broadcast addresses, to halve the overhead costs, for example, when using topology as “PPP” connections, to provide the user with a simpler and more understandable environment for working with addresses

any way, question about the difference between /31 masks, not about the reasons for using /30

I’m more interested in the difference between

/interface/wireguard/peers
add interface=wireguard1 allowed-address=10.255.255.1/32
/ip/address
add address=10.255.255.1/30 interface=wireguard1

and

/ip/address
add address=10.255.255.1 network=10.255.255.0 interface=wireguard1

Because the /32 solution (vs. a /31) is not standardized, you’ll come across odd and intermittent issues when using it.

OSPF is the most notable. It causes issues with neighbor stability that happen over a very long time which makes it hard to detect.

hmm
https://datatracker.ietf.org/doc/html/rfc3021

I also always thought that protocols such as OSPF, IS-IS, EIGRP, BGP, etc. using multicast or unicast will not work in /31 and this is obvious

It may have been more problematic with bugs and other issues 25 years ago when that RFC was written, but even then, the RFC clearly says in 2.3, it’s a non issue.

2.3. Impact on Current Routing Protocols

   Networks with 31-bit prefixes have no impact on current routing
   protocols.  Most of the currently deployed routing protocols have
   been designed to provide classless routing.  Furthermore, the
   communication between peers is done using multicast, limited
   broadcast or unicast addresses (all on the local network), none of
   which are affected with the use of 31-bit subnet masks.