2010년 4월 7일 수요일

[GNS3] Routing Information Protocol (RIP) 구현하기

 

1. RIP 이란?

 

RIP(Routing Information Protocol)은 로컬 및 광역 네트워크에서 사용되는 동적 라우팅 프로토콜이다. RIP는 RFC 1058[footnote]http://tools.ietf.org/html/rfc1058[/footnote]에 정의된 distance-vector routing algorithm[footnote]http://en.wikipedia.org/wiki/Distance-vector_routing_protocol[/footnote]을 채용하였다. RIP는 초기 버전이 개정되어 RIP Version 2(RFC 2453)[footnote]http://tools.ietf.org/html/rfc2453[/footnote]이 나왔으며 IPv6 네트워크 환경에서 사용될 수 있도록 개정된 RIPng(RIP next generation)[footnote]http://tools.ietf.org/html/rfc2080[/footnote]이 나와 있다.

 

위에서도 언급했듯이 RIP는 distance-vector routing protocol이며 라우팅 메트릭으로 hop을 채용하고 있다. 최대 hop 수로 15까지 허용하며 hop count 16은 무한대로 간주된다. 이 때문에 RIP을 사용한 네트워크는 그 사이즈에 있어서 제한된다.

 

기본적으로 매 30초마다 RIP 라우터는 전체 라우팅 테이블을 전송한다. 초창기 네트워크 크기가 소규모이었을 때 이는 큰 문제가 되지 않았다. 하지만 현대와 같이 네트워크 크기가 커지고 RIP 라우터끼리 교환하는 라우팅 테이블의 크기가 급격히 커져 사용자가 보내려는 데이터보다 라우터가 서로 교환하는 라우팅 테이블이 더 많아지는 현상도 발생하게 된다.

 

또한 RIP는 부정확한 라우팅 정보가 전달되는 것을 방지하기 위해 split horizon[footnote]http://en.wikipedia.org/wiki/Split_horizon[/footnote], route poisoning[footnote]http://en.wikipedia.org/wiki/Route_poisoning[/footnote], holddown mechanism[footnote]http://en.wikipedia.org/wiki/Holddown[/footnote] 등을 도입하였다. 하지만 현대에 와서는 RIP이 OSPF나 EIGRP로 대체되어가는 추세이다.

 

2. GNS3를 이용한 RIP 구현


본 포스트에 사용된 GNS3 Lab에서는 GNS3-labs.comGNS3 Generic Simple Ripv2 Lab을 약간 수정하여 사용하였다. 네트워크 구성은 아래와 같다.

 

라우터 이미지 : c2691-is-mz.123-22a.bin
PC 이미지 : c3640-ik903s-m.12.48a.bin

 

그리고 아래는 각 라우터의 Configuration이다. 참고로 라우터 3640을 이용하여 PC를 에뮬레이트 하였다. PC의 configuration 중에 ip route 0.0.0.0 0.0.0.0 x.x.x.x 부분은 PC에서 발생한 모든 트래픽을 x.x.x.x로 보내라는 뜻이다. 즉 x.x.x.x가 디폴트 게이트웨이임을 나타낸다.

 

R0

interface FastEthernet0/0
  ip address 10.1.1.17 255.255.255.248
  speed 100
  full-duplex
!
interface Serial0/0
  description Link to R1
  ip address 10.1.1.1 255.255.255.252
  clock rate 2000000

interface Serial0/1
  description Link to R2
  ip address 10.1.1.14 255.255.255.252
  clock rate 2000000
!
router rip
  version 2
  network 10.0.0.0

 R1

interface FastEthernet0/0
  ip address 10.1.1.25 255.255.255.248
  speed 100
  full-duplex
!
interface Serial0/0
  description Link to R0
  ip address 10.1.1.2 255.255.255.252
  clock rate 2000000
!
!
interface Serial0/1
  description Link to R3
  ip address 10.1.1.5 255.255.255.252
  clock rate 2000000
!
router rip
  version 2
  network 10.0.0.0

 R2

interface FastEthernet0/0
  ip address 10.1.1.33 255.255.255.248
  speed 100
  full-duplex
!
interface Serial0/0
  description Link to R1
  ip address 10.1.1.6 255.255.255.252
  clock rate 2000000
!
!
interface Serial0/1
  description Link to R2
  ip address 10.1.1.9 255.255.255.252
  clock rate 2000000
!
router rip
  version 2
  network 10.0.0.0

 R3

interface FastEthernet0/0
  ip address 10.1.1.41 255.255.255.248
  speed 100
  full-duplex
!
interface Serial0/0
  description Link to R3
  ip address 10.1.1.10 255.255.255.252
  clock rate 2000000
!
!
interface Serial0/1
  description Link to R0
  ip address 10.1.1.13 255.255.255.252
  clock rate 2000000
!
router rip
  version 2
  network 10.0.0.0
!

PC1

interface FastEthernet0/0
  ip address 10.1.1.18 255.255.255.248
  speed 100
  full-duplex
!
ip route 0.0.0.0 0.0.0.0 10.1.1.17
!

PC2

interface FastEthernet0/0
  ip address 10.1.1.26 255.255.255.248
  speed 100
  full-duplex
!
ip route 0.0.0.0 0.0.0.0 10.1.1.25
!

PC3

interface FastEthernet0/0
  ip address 10.1.1.34 255.255.255.248
  speed 100
  full-duplex
!
ip route 0.0.0.0 0.0.0.0 10.1.1.33
!

 PC4

interface FastEthernet0/0
  ip address 10.1.1.43 255.255.255.248
  speed 100
  full-duplex
!
ip route 0.0.0.0 0.0.0.0 10.1.1.41
!

 3. 연결 확인하기


위에서 구성한 Lab이 제대로 동작하는 지 간단히 ping과 traceroute를 이용하여 확인해보도록 하자. 아래 결과는 PC1에서 PC3로 보낸 ping과 traceroute의 결과 값이다.  traceroute의 결과값을 보면 패킷은 R0 (10.1.1.17)을 거쳐 R1 (10.1.1.2), R3 (10.1.1.6)을 통해 PC3에 도달하는 것을 볼 수 있다.


 PC1#ping 10.1.1.34

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.34, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/110/184 ms
PC1#traceroute 10.1.1.34

Type escape sequence to abort.
Tracing the route to 10.1.1.34

  1 10.1.1.17 20 msec 28 msec 20 msec
  2 10.1.1.2 52 msec 20 msec 12 msec
  3 10.1.1.6 68 msec 60 msec 68 msec
  4 10.1.1.34 144 msec 108 msec *
PC1#


댓글 없음:

댓글 쓰기