# 동적 라우팅 (Dynamic Routing)
- 라우팅 업데이트 : 상대방 라우터에게 경로 정보를 업데이트하는 동작
- 이때, 라우팅 업데이트는 동적 라우팅 프로토콜을 이용하여 실시한다.
- 동적 라우팅 프로토콜 : RIPv1, RIPv2, IGRP, EIGRP, OSPF, ISIS, BGPv4
# RIPv1
1. RIPv1 설정
Router(config)# router rip
Router(config-router)# network [로컬 네트워크] <- 클래스풀 형식
Router(config-router)# network A.0.0.0
Router(config-router)# network B.B.0.0
Router(config-router)# network C.C.0.0
Ex) R1
Lo 172 : 172.16.1.1/24 <- 172.16.1.0/24
Fa0/0 : 13.13.1.1/24 <- 13.13.1.0/24
S1/0 : 13.13.12.1/24 <- 13.13.12.0/24
router rip
network 172.16.0.0
network 13.0.0.0
R1(config)# router rip
R1(config-router)# network x.0.0.0
R1(config-router)# network 172.16.0.0
R2(config)# router rip
R2(config-router)# network x.0.0.0
R3(config)# router rip
R3(config-router)# network x.0.0.0
R3(config-router)# network 172.16.0.0
- R1,R2,R3에서 'show ip route'를 실시하여 RIP 경로(R)를 확인하여라.
- R1에서 '172.16.3.0/24' 경로가 확인되는가? <- 안보이는게 정상
- R3에서 '172.16.1.0/24' 경로가 확인되는가? <- 안보이는게 정상
- R2에서는 '172.16.1.0/24', '172.16.3.0/24' 경로가 어떻게 확인되는가? '172.16.0.0/16'
- R1에서 'ping 172.16.3.1'를 실시하여라. <- 실패 정상
- R3에서 'ping 172.16.1.1'를 실시하여라. <- 실패 정상
2. 클래스풀 라우팅 프로토콜 (Classful Routing Protocol)
- 네트워크 상에 모든 서브넷들은 동일한 서브넷 마스크를 사용해야 한다.
- 다양한 서브넷 마스크 구간에서는 라우팅 업데이트가 차단된다.
- VLSM X, CIDR X
- 라우팅 업데이트시 서브넷 마스크를 포함하지 않는다.
- 클래스 경계사이에서 자동 클래스풀 요약을 실시한다.
- 클래스가 단절된 비연속 서브넷 구간에서는 자동 클래스풀 요약때문에 라우팅 업데이
트가 차단되는 문제가 발생한다.
- RIPv1, IGRP
3. Distance Vector 알고리즘 사용
- 경로를 선출할때 속도 개념이 아니라, 거리 개념을 이용하여 선출한다.
- 이때, 거리는 출발지 라우터에서 목적지까지 도달하는데 필요한 라우터 개수라는
Hop Count를 사용한다.
- Update 주기를 이용하여 주기적인 전체 라우팅 업데이트를 실시한다. 이때 Update 주기 는 30초이며, 이러한 동작으로 인하여 상대방에게 라우팅 정보를 유지시켜준다.
- 이러한 동작은 장비 부하가 발생할 수 있는 요소가 될 수 있으며, 요즘같은 다양한
전송 속도가 보장되는 환경에서는 Hop을 이용한 경로 선출은 비효율적이다.
- RIPv1, RIPv2, IGRP
4. RIP 메트릭
- Hop Count : 출발지 라우터에서 목적지까지 도달하는데 필요한 라우터 개수
- Hop 범위 : 1~15
5. 라우팅 업데이트 전송 방식 : 브로드케스트 255.255.255.255
R1(config)# router rip
R1(config-router)# passive-interface fa0/0
R1(config-router)# passive-interface lo172
- Fa0/0, Lo172로 RIPv1 관련 브로드/멀티케스트가 나가는 것을 차단
즉, 30초마다 실시하는 브로드케스트 라우팅 업데이트가 나가는 것을 차단한다.
R1#debug ip rip <------------------- RIP 라우팅 업데이트 동작 확인
RIP protocol debugging is on
R1#
*Mar 1 04:09:35.790: RIP: received v1 update from 13.13.12.2 on Serial1/0
*Mar 1 04:09:35.794: 13.13.2.0 in 1 hops
*Mar 1 04:09:35.798: 13.13.3.0 in 2 hops
*Mar 1 04:09:35.798: 13.13.23.0 in 1 hops
R1#
*Mar 1 04:09:59.194: RIP: sending v1 update to 255.255.255.255 via Serial1/0 (13.13.12.1)
*Mar 1 04:09:59.198: RIP: build update entries
*Mar 1 04:09:59.198: subnet 13.13.1.0 metric 1
*Mar 1 04:09:59.202: network 172.16.0.0 metric 1
R1#no debug ip rip
RIP protocol debugging is off
R1#undebug all
All possible debugging has been turned off
1) 브로드케스트(255.255.255.255) 라우팅 업데이트 전송 확인
2) 라우팅 업데이트시 서브넷 마스크가 포함되지 않는다.
3) 라우팅 업데이트시 메트릭이 계산되어 전송된다.
4) 클래스 경계에서 자동 클래스풀 요약을 실시한다.
5) S1/0으로 수신한 라우팅 정보는 다시 S1/0으로 나가지 않는다.
(라우팅 루프 해결)
6) 30초마다 주기적인 전체 라우팅 업데이트를 실시한다.
6. Distance Vector 알고리즘상 발생하는 루프 현상 및 해결책
- 루프 발생 원인 : 주기적인 전체 라우팅 업데이트 동작
- 해결책 :
1) Hop Count Limit (1~15)
2) Split-Horizon ← 들어온 경로로 같인 데이터를 다시 전송하지 않는다
3) Route Poison ← 더이상 도달할수 없을때 대체 경로가 있는지 물어본다
4) Reverse Poison ← 대체 경로에 대한 대답을 주는 행위
5) Hold Down Timer
R1#show ip interface serial 1/0
Serial1/0 is up, line protocol is up
Internet address is 13.13.12.1/24
Broadcast address is 255.255.255.255
Address determined by setup command
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Multicast reserved groups joined: 224.0.0.9
Outgoing access list is not set
Inbound access list is not set
Proxy ARP is enabled
Local Proxy ARP is disabled
Security level is default
Split horizon is enabled
R1#debug ip rip <------------------- RIP 라우팅 업데이트 동작 확인
RIP protocol debugging is on
R1#
*Mar 1 04:09:35.790: RIP: received v1 update from 13.13.12.2 on Serial1/0
*Mar 1 04:09:35.794: 13.13.2.0 in 1 hops
*Mar 1 04:09:35.798: 13.13.3.0 in 2 hops
*Mar 1 04:09:35.798: 13.13.23.0 in 1 hops
R1#
*Mar 1 04:09:59.194: RIP: sending v1 update to 255.255.255.255 via Serial1/0 (13.13.12.1)
*Mar 1 04:09:59.198: RIP: build update entries
*Mar 1 04:09:59.198: subnet 13.13.1.0 metric 1
*Mar 1 04:09:59.202: network 172.16.0.0 metric 1
R1#debug ip rip
RIP protocol debugging is on
R1#
R3(config)# int fa0/0
R3(config-if)# shutdown <- x.x.3.0/24 네트워크 장애/삭제
R1#
*Mar 1 01:45:55.451: RIP: received v1 update from 13.13.12.2 on Serial1/0
*Mar 1 01:45:55.455: 13.13.3.0 in 16 hops (inaccessible) <- Route Poison
R1#
*Mar 1 01:45:57.459: RIP: sending v1 flash update to 255.255.255.255 via Serial1/0 (13.13.12.1)
*Mar 1 01:45:57.463: RIP: build flash update entries
*Mar 1 01:45:57.463: subnet 13.13.3.0 metric 16 <- Reverse Poison
R1#undebug all
All possible debugging has been turned off
R3(config)# int fa0/0
R3(config-if)# no shutdown
7. RIP 타이머
- RIP은 RIP 타이머를 이용하여 라우팅 정보 및 테이블 상태를 관리/갱신한다.
1) Update 타이머 (30초)
- 주기적인 전체 라우팅 업데이트를 실시할때 사용하는 타이머
- Update 타이머(30초)를 이용하여 주기적인 전체 라우팅 업데이트를 이용하여 상대방
에게 라우팅 정보를 유지시켜 준다.
- 상대방으로부터 라우팅 업데이트 정보를 수신하면 '0'초 리셋한다.
R1#show ip route rip
13.0.0.0/24 is subnetted, 5 subnets
R 13.13.2.0 [120/1] via 13.13.12.2, 00:00:27, Serial1/0
R 13.13.3.0 [120/2] via 13.13.12.2, 00:00:27, Serial1/0
R 13.13.23.0 [120/1] via 13.13.12.2, 00:00:27, Serial1/0
R1#show ip route rip
13.0.0.0/24 is subnetted, 5 subnets
R 13.13.2.0 [120/1] via 13.13.12.2, 00:00:00, Serial1/0
R 13.13.3.0 [120/2] via 13.13.12.2, 00:00:00, Serial1/0
R 13.13.23.0 [120/1] via 13.13.12.2, 00:00:00, Serial1/0
2) Invalid 타이머 (180초)
- Update 타이머(30초) 안에 라우팅 정보를 수신하지 못하면 시작하는 타이머
- 이 기간(180초) 동안에 라우팅 업데이트를 수신하면 update 타이머 '0'초로 다시 시작
- 만약, 라우팅 업데이트를 수신하지 못하면, 삭제 대기 상태로 전환한다.
- 즉, Invalid 타이머란 180초 기회를 제공하는 시간이다.
3) Hold Down 타이머 (180초)
- Invalid 타이머가 끝난 다음에 시작하는 삭제 대기 상태 타이머
- 이 시간 동안에는 라우팅 업데이트를 수신하지 않는다.
4) Flushed 타이머 (240초)
- Invalid 타이머와 동시에 시작되어 경로가 라우팅 테이블에서 삭제되는 타이머
Update 30초 Invalid 180초 Hold Down 180초
|──────|─────────────|─────────────|
0 30
Flushed 240초
|─────────────────|
Ex) 192.168.1.0/24 경로는 현재 Invalid 타이머가 종료된 상태이다. 그럼 몇 초 뒤에 라우팅
테이블에서 사라지는가? 60초
R2(config)# router rip
R2(config-router)# passive-interface s1/1
R1#show ip route rip [Update 타이머 30초 진행중]
13.0.0.0/24 is subnetted, 5 subnets
R 13.13.2.0 [120/1] via 13.13.12.2, 00:00:15, Serial1/0
R 13.13.3.0 [120/2] via 13.13.12.2, 00:00:15, Serial1/0
R 13.13.23.0 [120/1] via 13.13.12.2, 00:00:15, Serial1/0
R1#show ip route rip
13.0.0.0/24 is subnetted, 5 subnets [Invalid 타이머 180초 진행중]
R 13.13.2.0 [120/1] via 13.13.12.2, 00:00:45, Serial1/0
R 13.13.3.0 [120/2] via 13.13.12.2, 00:00:45, Serial1/0
R 13.13.23.0 [120/1] via 13.13.12.2, 00:00:45, Serial1/0
R1#show ip route rip [Hold Down 타이머 180초 진행중]
13.0.0.0/24 is subnetted, 5 subnets
R 13.13.2.0/24 is possibly down,
routing via 13.13.12.2, Serial1/0
R 13.13.3.0/24 is possibly down,
routing via 13.13.12.2, Serial1/0
R 13.13.23.0/24 is possibly down,
routing via 13.13.12.2, Serial1/0
R1#clear ip route * <---- 라우팅 테이블 재시작
R1#show ip route rip
R2(config)# router rip
R2(config-router)# no passive-interface s1/1
8. RIP 기본 신뢰도 (Administrative Distance) : 120
R3(config)# router rip
R3(config-router)# distance 60
R3#clear ip route *
R3#show ip route rip
13.0.0.0/24 is subnetted, 5 subnets
R 13.13.1.0 [60/2] via 13.13.23.2, 00:00:02, Serial1/1
R 13.13.2.0 [60/1] via 13.13.23.2, 00:00:02, Serial1/1
R 13.13.12.0 [60/1] via 13.13.23.2, 00:00:02, Serial1/1
9. 균등 로드 분산 기본 4개 ~ 최대 6개 지원
--------------------------------------------------------------------------------
R1#show ip protocols
Routing Protocol is "rip"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Sending updates every 30 seconds, next due in 27 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Redistributing: rip
Default version control: send version 1, receive any version
Interface Send Recv Triggered RIP Key-chain
Serial1/0 1 1 2
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
13.0.0.0
172.16.0.0
Passive Interface(s):
FastEthernet0/0
Loopback172
Routing Information Sources:
Gateway Distance Last Update
13.13.12.2 120 00:00:15
Distance: (default is 120)
R1#show ip route rip
13.0.0.0/24 is subnetted, 5 subnets
R 13.13.2.0 [120/1] via 13.13.12.2, 00:00:19, Serial1/0
R 13.13.3.0 [120/2] via 13.13.12.2, 00:00:19, Serial1/0
R 13.13.23.0 [120/1] via 13.13.12.2, 00:00:19, Serial1/0