Contents

축약 ex, Longest Match Rule

   Dec 13, 2022     1 min read

축약 Ex.


1

[ R1 ]
네트워크 축약
192.168.11(00001 011).1
192.168.12(00001 100).1
192.168.13(00001 101).1
= 255.255.11111 000.0
= 255.255.248.0/21

  • 축약된 Network 주소 = 192.168.248.0
  • 축약된 Broadcast 주소 = 192.168.255.255

GATEWAY 축약
192.168.11(00001 011).254
192.168.12(00001 100).254
192.168.13(00001 101).254
= 255.255.11111 000.0
= 255.255.248.0/21

[ R4 ]
193.255.1(000000 01).1
193.255.2(000000 10).1
193.255.3(000000 11).1
= 255.255.111111 00.0
= 255.255.252.0/22

  • 축약된 Network 주소 = 193.255.0.0
  • 축약된 Broadcast 주소 = 193.255.3.255

[ R3 ]
194.255.100(011 00100).1
194.255.110(011 01110).1
194.255.120(011 11000).1
= 255.255.111 00000.0
= 255.255.224.0/19

  • 축약된 Network 주소 = 194.255.96.0
  • 축약된 Broadcast 주소 = 194.255.31.255


Longest Match Rule



  • show ip route

    192.168.10.0/24 via 1.1.1.1

  • ping 192.168.10.1

  • 102.168.10.128/25 via 1.1.1.2 <- 이게 더 길게 매칭 되어 짐.
  • ping 192.168.10.129

  • 192.168.0.1/16 via 1.1.1.3
  • ping 192.168.20.2

중요) routing table은 항상 longest match rule을 따름.



  • 192.168.10.1/32 via 1.1.1.4
  • ping 192.168.10.1

  • 네트워크 주소가 가장 길게 매칭되는 것을 참조한다는 의미.

Ex.


  • ping 192.255.255.1 (via 1.1.1.1)
  • ping 192.168.255.1 (via 1.1.1.2)
  • ping 192.168.10.2 (via 1.1.1.3)
  • ping 192.168.10.1 (via 1.1.1.4)

  • show ip route

    192.0.0.0/8 via 1.1.1.1
    192.168.0.0/16 via 1.1.1.2
    192.168.10.0/24 via 1.1.1.3
    192.168.10.1/32 via 1.1.1.4