RIP x OSPF
Neste teste vamos comparar a convergência de cada protocolo utilizado.
Como já foi dito anteriormente, o protocolo OSPF é indicado para redes maiores com um
número grande de
roteadores, pois possui uma convergência mais rápida que o RIP. Isso se deve ao fato do OSPF
trocar informações sobre a tabela instantaneamente e não de uma forma periódica (como o RIP,
que troca suas tabelas de rota num tempo previamente determinado).
É importante lembrar que, para o OSPF, o custo na interface é inversamente proporcional à largura de banda.
Isso permite um custo menor em uma largura de banda maior.
Será fácil observar, também, que a rota de cada protocolo tem um custo diferente e nem sempre o menor caminho
é o "melhor caminho".
Comandos para os roteadores 4000, cisco1 e cisco2 Os comandos para essa nova configuração são praticamente os mesmos que já foram utilizadosa para os protocolos RIP e OSPF, levando em conta o IP das novas interfaces. Porém, dois outros comandos surgirão quando estivermos trabalhando com o OSPF: - ip ospf network point-to-multipoint: permite que tenhamos somente uma rota para o destino, quando existirem várias rotas iguais para a mesma rede. - bandwidth: especifica a banda da interface. É um parâmetro puramente descritivo, uma vez que não limita efetivamente a capacidade em kbits/s. Contudo, é um comando importante para o OSPF, pois força que a interface seja vista como se possuísse a banda configurada. Ambos os comandos devem ser aplicados em todas as interfaces que fizerem parte do OSPF. <4000># <4000>#conf t Enter configuration commands, one per line. End with CNTL/Z. <4000>(config)#int s1 <4000>(config-if)#ip ospf network point-to-multipoint <4000>(config-if)# <4000># <4000>#conf t Enter configuration commands, one per line. End with CNTL/Z. <4000>(config)#int s1 <4000>(config-if)#bandwidth 1000 <4000>(config-if)#
SHOW RUNNING-CONFIG
Este comando é utilizado para verificar a configuração do roteador.
Observar se a interface está UP/DOWN, quais os IPs de cada interface
e quais redes são anunciadas por RIP ou OSPF.
Para o RIP:
Resultados 4000
<4000>#
<4000>#show running-config
Building configuration...
Current configuration:
!
version 11.3
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname <4000>
!
!
!
!
!
interface Loopback0
ip address 200.20.6.1 255.255.255.0
!
interface Ethernet0
no ip address
shutdown
!
interface Ethernet1
no ip address
shutdown
!
interface Serial0
no ip address
no ip mroute-cache
shutdown
no fair-queue
!
interface Serial1
ip address 200.20.5.1 255.255.255.0
clockrate 800000
!
interface Serial2
ip address 200.20.4.2 255.255.255.0
shutdown
clockrate 800000
!
interface Serial3
no ip address
shutdown
!
router rip
network 200.20.4.0
network 200.20.5.0
network 200.20.6.0
!
ip classless
!
!
!
line con 0
line aux 0
line vty 0 4
login
!
end
<4000>#
Resultados cisco1
cisco1#
cisco1#show running-config
Building configuration...
Current configuration:
!
version 11.2
service timestamps debug uptime
service timestamps log uptime
service password-encryption
no service udp-small-servers
no service tcp-small-servers
!
hostname cisco1
!
enable password 7 06100E324F41
!
ip subnet-zero
no ip source-route
no ip domain-lookup
!
interface Loopback0
ip address 200.156.10.1 255.255.255.0
!
interface Ethernet0
ip address 200.20.94.81 255.255.255.0
!
interface Serial0
ip address 200.20.5.2 255.255.255.0
!
interface Serial1
no ip address
shutdown
!
router rip
network 200.20.5.0
network 200.156.10.0
network 200.20.94.0
!
ip classless
!
!
line con 0
exec-timeout 0 0
password 7 060C0E2F494208
login
line aux 0
line vty 0 4
password 7 000E120801570A
login
!
end
cisco1#
Resultados cisco2
cisco2#
cisco2#show running-config
Building configuration...
Current configuration:
!
version 11.2
service password-encryption
no service udp-small-servers
no service tcp-small-servers
!
hostname cisco2
!
enable secret 5 $1$jibr$cTHEQancHt3LUqhsNxGXG0
!
no ip domain-lookup
!
interface Loopback0
ip address 200.20.3.1 255.255.255.0
!
interface Ethernet0
ip address 200.20.94.1 255.255.255.0
no ip directed-broadcast
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 200.20.4.1 255.255.255.0
no ip directed-broadcast
!
router rip
network 200.20.94.0
network 200.20.3.0
network 200.20.4.0
!
ip classless
!
!
line con 0
password 7 0501070124404F
line aux 0
password 7 0501070124404F
line vty 0 1
password 7 0501070124404F
login
line vty 2
password 7 082B4D400C1504
login
line vty 3 4
password 7 044904131B245E
login
!
end
cisco2#
Para o OSPF: - checar se bandwidth aparece no show ruunnn e onde é o network multipoint
Resultados 4000
<4000>#
<4000>#show running-config
Building configuration...
Current configuration:
!
version 11.3
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname <4000>
!
!
!
!
!
interface Loopback0
ip address 200.20.6.1 255.255.255.0
!
interface Ethernet0
no ip address
shutdown
!
interface Ethernet1
no ip address
shutdown
!
interface Serial0
no ip address
no ip mroute-cache
shutdown
no fair-queue
!
interface Serial1
ip address 200.20.5.1 255.255.255.0
clockrate 800000
!
interface Serial2
ip address 200.20.4.2 255.255.255.0
shutdown
clockrate 800000
!
interface Serial3
no ip address
shutdown
!
router ospf 1
network 200.20.4.0 0.0.0.255 area 0
network 200.20.5.0 0.0.0.255 area 0
network 200.20.6.0 0.0.0.255 area 0
!
ip classless
!
!
!
line con 0
line aux 0
line vty 0 4
login
!
end
<4000>#
Resultados cisco1
cisco1#
cisco1#show running-config
Building configuration...
Current configuration:
!
version 11.2
service timestamps debug uptime
service timestamps log uptime
service password-encryption
no service udp-small-servers
no service tcp-small-servers
!
hostname cisco1
!
enable password 7 06100E324F41
!
ip subnet-zero
no ip source-route
no ip domain-lookup
!
interface Loopback0
ip address 200.156.10.1 255.255.255.0
!
interface Ethernet0
ip address 200.20.94.81 255.255.255.0
!
interface Serial0
ip address 200.20.5.2 255.255.255.0
!
interface Serial1
no ip address
shutdown
!
router ospf 1
network 200.20.94.0 0.0.0.255 area 0
network 200.156.10.0 0.0.0.255 area 0
network 200.20.5.0 0.0.0.255 area 0
!
ip classless
!
!
line con 0
exec-timeout 0 0
password 7 060C0E2F494208
login
line aux 0
line vty 0 4
password 7 000E120801570A
login
!
end
cisco1#
Resultados cisco2
cisco2#
cisco2#show running-config
Building configuration...
Current configuration:
!
version 11.2
service password-encryption
no service udp-small-servers
no service tcp-small-servers
!
hostname cisco2
!
enable secret 5 $1$jibr$cTHEQancHt3LUqhsNxGXG0
!
no ip domain-lookup
!
interface Loopback0
ip address 200.20.3.1 255.255.255.0
!
interface Ethernet0
ip address 200.20.94.1 255.255.255.0
no ip directed-broadcast
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 200.20.4.1 255.255.255.0
no ip directed-broadcast
!
router ospf 1
network 200.20.94.0 0.0.0.255 area 0
network 200.20.3.0 0.0.0.255 area 0
network 200.20.4.0 0.0.0.255 area 0
!
ip classless
!
!
line con 0
password 7 0501070124404F
line aux 0
password 7 0501070124404F
line vty 0 1
password 7 0501070124404F
login
line vty 2
password 7 082B4D400C1504
login
line vty 3 4
password 7 044904131B245E
login
!
end
cisco2#
Para verificarmos a banda configurada em cada interface utilizamos o comando show interface:
cisco1#
cisco1#sh interface serial0
Serial0 is up, line protocol is up
Hardware is HD64570
Internet address is 200.20.5.2/24
MTU 1500 bytes, BW 1 Kbit, DLY 20000 usec, rely 255/255, load 255/255
Encapsulation HDLC, loopback not set, keepalive set (10 sec)
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/64/0 (size/threshold/drops)
Conversations 0/1 (active/max active)
Reserved Conversations 0/0 (allocated/max allocated)
5 minute input rate 0 bits/sec, 1 packets/sec
5 minute output rate 1000 bits/sec, 2 packets/sec
582 packets input, 25971 bytes, 0 no buffer
Received 248 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
616 packets output, 41523 bytes, 0 underruns
0 output errors, 0 collisions, 2 interface resets
0 output buffer failures, 0 output buffers swapped out
10 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up
cisco1#
Para o cisco 4000 usando o RIP:
<4000>#
<4000>#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
C 200.20.4.0/24 is directly connected, Serial2
C 200.20.5.0/24 is directly connected, Serial1
C 200.20.6.0/24 is directly connected, Loopback0
R 200.20.3.0/24 [120/1] via 200.20.4.1, 00:00:16, Serial2
R 200.156.10.0/24 [120/1] via 200.20.5.2, 00:00:00, Serial1
R 200.20.94.0/24 [120/1] via 200.20.4.1, 00:00:16, Serial2
[120/1] via 200.20.5.2, 00:00:00, Serial1
<4000>#
Para o cisco 4000 usando o OSPF:
<4000>#
<4000>#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
200.20.4.0/24 is variably subnetted, 2 subnets, 2 masks
C 200.20.4.0/24 is directly connected, Serial2
O 200.20.4.1/32 [110/50] via 200.20.4.1, 00:13:32, Serial2
200.20.5.0/24 is variably subnetted, 2 subnets, 2 masks
C 200.20.5.0/24 is directly connected, Serial1
O 200.20.5.2/32 [110/60] via 200.20.4.1, 00:13:32, Serial2
C 200.20.6.0/24 is directly connected, Loopback0
200.20.3.0/32 is subnetted, 1 subnets
O 200.20.3.1 [110/51] via 200.20.4.1, 00:13:32, Serial2
200.156.10.0/32 is subnetted, 1 subnets
O 200.156.10.1 [110/61] via 200.20.4.1, 00:13:32, Serial2
200.20.94.0/32 is subnetted, 2 subnets
O 200.20.94.1 [110/50] via 200.20.4.1, 00:13:32, Serial2
O 200.20.94.81 [110/60] via 200.20.4.1, 00:13:32, Serial2
<4000>#
Para o cisco1 usando o RIP:
cisco1#
cisco1#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
C 200.156.10.0/24 is directly connected, Loopback0
C 200.20.94.0/24 is directly connected, Ethernet0
R 200.20.4.0/24 [120/1] via 200.20.94.1, 00:00:05, Ethernet0
[120/1] via 200.20.5.1, 00:00:00, Serial0
C 200.20.5.0/24 is directly connected, Serial0
R 200.20.6.0/24 [120/1] via 200.20.5.1, 00:00:00, Serial0
R 200.20.3.0/24 [120/1] via 200.20.94.1, 00:00:05, Ethernet0
cisco1#
Para o cisco1 usando o OSPF:
cisco1#
cisco1#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
C 200.156.10.0/24 is directly connected, Loopback0
200.20.94.0/24 is variably subnetted, 2 subnets, 2 masks
C 200.20.94.0/24 is directly connected, Ethernet0
O 200.20.94.1/32 [110/10] via 200.20.94.1, 00:12:38, Ethernet0
200.20.4.0/32 is subnetted, 2 subnets
O 200.20.4.1 [110/10] via 200.20.94.1, 00:12:38, Ethernet0
O 200.20.4.2 [110/60] via 200.20.94.1, 00:12:38, Ethernet0
200.20.5.0/24 is variably subnetted, 2 subnets, 2 masks
O 200.20.5.1/32 [110/60] via 200.20.94.1, 00:12:38, Ethernet0
C 200.20.5.0/24 is directly connected, Serial0
200.20.6.0/32 is subnetted, 1 subnets
O 200.20.6.1 [110/61] via 200.20.94.1, 00:12:38, Ethernet0
200.20.3.0/32 is subnetted, 1 subnets
O 200.20.3.1 [110/11] via 200.20.94.1, 00:12:38, Ethernet0
cisco1#
Para o cisco2 usando o RIP:
cisco2#
cisco2#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
R 200.156.10.0/24 [120/1] via 200.20.94.81, 00:00:00, Ethernet0
C 200.20.94.0/24 is directly connected, Ethernet0
C 200.20.4.0/24 is directly connected, Serial1
R 200.20.5.0/24 [120/1] via 200.20.94.81, 00:00:00, Ethernet0
[120/1] via 200.20.4.2, 00:00:04, Serial1
R 200.20.6.0/24 [120/1] via 200.20.4.2, 00:00:04, Serial1
C 200.20.3.0/24 is directly connected, Loopback0
cisco2#
Para o cisco2 usando o OSPF:
cisco2#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
200.156.10.0/32 is subnetted, 1 subnets
O 200.156.10.1 [110/11] via 200.20.94.81, 00:13:16, Ethernet0
200.20.94.0/24 is variably subnetted, 2 subnets, 2 masks
C 200.20.94.0/24 is directly connected, Ethernet0
O 200.20.94.81/32 [110/10] via 200.20.94.81, 00:13:16, Ethernet0
200.20.4.0/24 is variably subnetted, 2 subnets, 2 masks
C 200.20.4.0/24 is directly connected, Serial1
O 200.20.4.2/32 [110/50] via 200.20.4.2, 00:13:16, Serial1
200.20.5.0/32 is subnetted, 2 subnets
O 200.20.5.1 [110/50] via 200.20.4.2, 00:13:16, Serial1
O 200.20.5.2 [110/10] via 200.20.94.81, 00:13:16, Ethernet0
200.20.6.0/32 is subnetted, 1 subnets
O 200.20.6.1 [110/51] via 200.20.4.2, 00:13:16, Serial1
C 200.20.3.0/24 is directly connected, Loopback0
cisco2#
Neste ítem será mostrada a comparação entre os dois protocolos por meio do comando
show ip route.
A partir disso, podemos concluir que quando temos larguras de banda diferentes, o OSPF
escolhe o melhor caminho de acordo com a banda disponível, enquanto o RIP continua
escolhendo o menor caminho, mesmo que este seja o de menor banda.
As linhas sublinhadas representam as diferenças entre as tabelas do RIP e do OSPF.
Página principal