Hello everyone! Today something old… but anyway interesting.

We know since last century that we will not have enough IPv4 addresses to satisfiy all our needs. Therefore some guys proposed twenty years ago in RFC-3021 a way to conserve the amount of public addresses. Link to RFC-3021.

Lets see a comparison for better understanding and to realize the purpose of it.

Bit prefixesAmount of IP-AddressesAmount of hostAmount of subnet within /24
/304264
/3122128

We clearly see that using a /31 we will be able to double the amount of point-to-point links that we can create. This demonstrate the inefficiency of running PTP-Links using a /30-bit prefix. This is very important to consider if you have a limited amount of public IPv4 addresses.

In a common network a device that wants to communicate with all host within the subnet will set the destination for its packet to the address of the broadcast of the subnet. This is not possible for a Point-to-Point link using a/31-bit prefix. Therefore such a prefix eliminates the directed broadcast. Routing protocols are not affected from this, since they use multicast or unicast for communication.

Another intersting aspect is the fact that eliminating directed broadcast can slightly enhances the network security by avoiding certain DoS attacks, which use Broadcast to defeat services. I am not sure if such an attack like SMURF is still ongoing…

I’ve configured two routers with a point-to-point link configured within the network 172.16.16.0/31 and running OSPF over it. Lets see if this works.

Configuration on Router IOSV-1

iosv-1(config)#int g0/1
iosv-1(config-if)#ip add
iosv-1(config-if)#ip address 172.16.16.0 255.255.255.254
% Warning: use /31 mask on non point-to-point interface cautiously
iosv-1(config-if)#no shut
iosv-1(config-if)#int gig0/2
iosv-1(config-if)#ip address 192.168.1.1 255.255.255.0
iosv-1(config-if)#no shut
iosv-1(config-if)#exit
iosv-1(config)#router ospf 1
iosv-1(config-router)#
*May 11 19:37:12.688: %OSPF-4-NORTRID: OSPF process 1 failed to allocate unique router-id and cannot start
iosv-1(config-router)#router-id 1.1.1.1
iosv-1(config-router)#network 172.16.16.0 255.255.255.254 area 0
iosv-1(config-router)#redistribute connected
iosv-1(config-router)#network 192.168.1.0 255.255.255.0 area 0
*May 11 19:41:02.280: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on GigabitEthernet0/1 from LOADING to FULL, Loading Done

While configuring the interface gig0/1 its IP-Address we received a warning message. Please, be careful ;).

Configuration on router IOSV-2

iosv-2(config)#int gig0/2
iosv-2(config-if)#ip address 10.240.176.1 255.255.255.0
iosv-2(config-if)#no shut
iosv-2(config)#int gig0/1
iosv-2(config-if)#ip address 172.16.16.1 255.255.255.254
% Warning: use /31 mask on non point-to-point interface cautiously
iosv-2(config-if)#no shut
iosv-2(config-if)#
*May 11 19:39:44.872: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to up
*May 11 19:39:45.873: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
iosv-2(config-if)#exit
iosv-2(config)#router ospf 1
iosv-2(config-router)#router-id 2.2.2.2
iosv-2(config-router)#network 172.16.16.0 255.255.255.254 area 0
*May 11 19:41:01.917: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/1 from LOADING to FULL, Loading Don
iosv-2(config-router)#redistribute connected
iosv-2(config-router)#network 10.240.176.0 255.255.255.0 area 0
iosv-2(config-router)#exit
iosv-2(config)#exit
iosv-2#

Verification – Pinging from IOSV-1 to IOSV-2 and visceversa

iosv-1#ping 172.16.16.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.16.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/3/4 ms
iosv-1#

and now from IOSV-2

iosv-2#ping 172.16.16.0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.16.0, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/3/4 ms
iosv-2#

Lets have a look at the router IOSV-3 and its routing table and if we can ping the router IOSV-4. Since the configuration is slighltly a standard configuration, I did not show it, but we will asume they are correctly configured.

iosv-3#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback3
4.0.0.0/32 is subnetted, 1 subnets
O E2 4.4.4.4 [110/20] via 192.168.1.1, 00:00:08, GigabitEthernet0/1
10.0.0.0/24 is subnetted, 1 subnets
O 10.240.176.0 [110/3] via 192.168.1.1, 00:00:08, GigabitEthernet0/1
172.16.0.0/31 is subnetted, 1 subnets
O 172.16.16.0 [110/2] via 192.168.1.1, 00:00:08, GigabitEthernet0/1
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/1
L 192.168.1.2/32 is directly connected, GigabitEthernet0/1
iosv-3#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/5 ms
iosv-3#

Conclusion

At this precise date & time I do not think that we will save the internet by using /31-bit prefixes. Even if the first IPv6 RFC appeared in year 1995 I am pretty sure that we will use IPv4 public IP-Addresses for a long time

Anyway it was interesting to see if it works or not.

Thanks for reading and hopefully you enjoyed it.

See you on my next post.

Hinterlasse einen Kommentar

Diese Seite verwendet Akismet, um Spam zu reduzieren. Erfahre, wie deine Kommentardaten verarbeitet werden..