OPNET Computer Network Simulation Experiment 12 - Using OSPF for Routing

OPNET Engineering: Homework 12_ Routing with OSPF icon-default.png?t=M0H8https://download.csdn.net/download/Cx2008Lxl/79506040

  In this lab assignment, the behavior of the OSPF routing protocol will be studied in detail. In particular, a model of a network with OSPF routing will be developed, the routes used will be observed, and the load-balancing features of IP will be studied. Additionally, divide network domains into hierarchical regions and study how this separation affects routing in the network.

  Difficulties in this section: Questions 2 and 4. It is necessary to master the viewing methods of link state database and routing table.

Table of contents

steps and results

1. Create a simulation model

2. Create a network topology.

3. Configure the link cost of the link between routers

4. Configure the flow requirements in Figure 6.1

5. Configure the simulation output IP address assignment

6. Configure all routers to output their routing tables and link-state databases at the end of the simulation

7. Disable OSPF emulation efficiency mode

8. Execute the simulation for 10 minutes and collect the simulation results.

9. OSPF with packet-based load balancing option.

Questions and Answers

Summarize

references


 

  • steps and results

1. Create a simulation model

  Create a new project and an empty scene called OSPF Flat.

2. Create a network topology.

  Figure 6.1. And deploy IPv4 addresses on all active interfaces in the network (Protocols->IP->Addressing->Auto – Assign IPv4 Addresses). Then configure OSPF as a routing protocol on all interfaces in the network (Protocols->IP->Routing->Configure Routing Protocols).

Figure 6.1 Network topology

3. Configure the link cost of the link between routers

  Such as table 6.1.

Table 6.1 Link cost configuration

link name

cost

Router 1 – Router 3

Router 1 – Router 2

Router2 – Router 3

20

Router 1 – Router 4

Router 4 – Router 5

Router 5 – Router 3

Router 4 – Router 6

Router 5 – Router 7

5

Router 6 – Router 7

Router 6 – Router 8

Router 7 – Router 8

10

4. Configure the flow requirements in Figure 6.1

  Figure 6.2.

Figure 6.2 Traffic demand configuration (taking Host A -> Host C as an example)

5. Configure the simulation output IP address assignment

  Set the global simulation property IP...IP Interface Addressing Mode to Auto Addressed/Export, and configure the simulation output IP address assignment.

6. Configure all routers to output their routing tables and link-state databases at the end of the simulation

  Set the properties Reports...OSPF Routing Table and Reports...OSPF Link State Database to Export at End of Simulation, and configure all routers to export their routing tables and link state databases at the end of the simulation, as shown in Figure 3.

Figure 6.3 Router configuration (taking Router1 as an example)

7. Disable OSPF emulation efficiency mode

  Set the value of the global property Simulation Efficiency...OSPF Sim Efficiency to Disabled to disable the OSPF simulation efficiency mode, as shown in Figure 6.4.

Figure 6.4 Global simulation property configuration

8. Execute the simulation for 10 minutes and collect the simulation results.

9. OSPF with packet-based load balancing option.

  1) Duplicate the scenario OSPF Flat, and name the new scenario OSPF with packet – based load balancing.

  2) Change the configuration of Router 2 to use the packet-based load balancing option, as shown in Figure 6.5.

Figure 6.5 Router2 attribute configuration

  3) Run the simulation for 10 minutes and collect the simulation results.

  • Questions and Answers

1. Study in detail the IP address assignment in the network by examining the file with the output IP addresses (created by the simulation).

  Check the output IP address assignment GDF file (Assignment12-OSPF Flat-DES-1-ip_addresses.gdf) in the OSPF Flat scenario. The IP address table is shown in Table 6.2.

Table 6.2 IP allocation table in OSPF Flat scenario

node

interface

IP

connection link

node

interface

IP

connection link

HostA

IF0

192.0.12.1/24

HostA <-> Router1

Router4

IF4

192.0.6.2/24

Router4 <-> Router5

HostB

IF0

192.0.13.1/24

HostB <-> Router2

IF10

192.0.4.1/24

Router1 <-> Router4

HostC

IF0

192.0.14.1/24

Router3 <-> HostC

IF11

192.0.7.2/24

Router4 <-> Router6

HostD

IF0

192.0.15.1/24

HostD <-> Router6

Router5

IF4

192.0.6.1/24

Router4 <-> Router5

Cough

IF0

192.0.16.1/24

Router8 <-> HostE

IF10

192.0.8.2/24

Router7 <-> Router5

HostF

IF0

192.0.17.1/24

Router8 <-> HostF

IF11

192.0.5.1/24

Router5 <-> Router3

Router1

IF0

192.0.12.2/24

HostA <-> Router1

Router6

IF0

192.0.15.2/24

HostD <-> Router6

IF4

192.0.3.2/24

Router1 <-> Router3

IF4

192.0.9.2/24

Router6 <-> Router7

IF10

192.0.1.2/24

Router2 <-> Router1

IF10

192.0.7.1/24

Router4 <-> Router6

IF11

192.0.4.2/24

Router1 <-> Router4

IF11

192.0.11.2/24

Router6 <-> Router8

Router2

IF0

192.0.13.2/24

HostB <-> Router2

Router7

IF4

192.0.9.1/24

Router6 <-> Router7

IF10

192.0.1.1/24

Router2 <-> Router1

IF10

192.0.10.2/24

Router8 <-> Router7

IF11

192.0.2.2/24

Router3 <-> Router2

IF11

192.0.8.1/24

Router7 <-> Router5

Router3

IF0

192.0.14.2/24

Router3 <-> HostC

Router8

IF0

192.0.17.2/24

Router8 <-> HostF

IF4

192.0.3.1/24

Router1 <-> Router3

IF1

192.0.16.2/24

Router8 <-> HostE

IF10

192.0.5.2/24

Router5 <-> Router3

IF10

192.0.11.1/24

Router6 <-> Router8

IF11

192.0.2.1/24

Router3 <-> Router2

IF11

192.0.10.1/24

Router8 <-> Router7

2. 仔细检查任何一台路由器节点上链路状态数据库,并确保所有链路成本是要配置的那样,那么应该纠正它们,并重新运行场景。在链路状态数据库,用于主机和路由器之间链路所用的成本是多少?

  查看Router1仿真结束时的链路状态数据库,如表6.3。

  1)验证链路成本配置的正确性:

  以链路Router6 – Router7为例。由表6.2可知,Router6的Link State ID为192.0.15.2,因此表6.3中,22行至28行为Router6发送的链路状态消息。由表6.2可知,Router7 <-> Router6的网络号为192.0.9.0,因此查看表6.3中24行的子网类型链路Link Cost列,可知该链路的成本为10。

  用同样的方法验证剩余链路成本的正确性。经验证,所有链路成本配置正确。

  2)查看主机和路由器之间的链路成本:以Router1<->HostA为例,查看表6.3第44行,可知其成本为1。经查看,其余主机与其各自路由器的成本也均为1。

表6.3 Router1链路状态数据库

 

3. 在链路状态数据库中,识别Router 3和Router 6的表项。对于这些表项,为表中所示的每个链路ID,识别邻接路由器的名字。

  由表6.2可知,Router3广播的链路状态数据Link State ID为192.0.14.2,对应表6.3第36~42行。Router6为192.0.15.2,对应表6.3第22~28行。

  1)Router3邻接路由器名:由表6.3第37、39、41行可知,其邻接路由器的另一个端口IP为:192.0.12.2、192.0.8.2、192.0.13.2,查表6.2可知,其对应的路由器分别为:Router1、Router2、Router5。

  2)Router6邻接路由器名:由表6.3第23、25、27行可知,其邻接路由器的另一个端口IP为:192.0.10.2、192.0.7.2、192.0.17.2,查表6.2可知,其对应的路由器分别为:Router4、Router7、Router8。

4. 详细研究各路由器的路由表项,为从Host A到Host C和从Host C到Host D的流量确定路由。为这些路由,列出每一跳的接口号和路由器名、每跳的链路成本和该路由的总成本。

  查看各路由器的路由表(节选),如表6.4(1)~6.4(5)。

表6.4(1) Router1路由表(节选)

表6.4(2) Router3路由表(节选)

表6.4(3) Router4路由表(节选)

表6.4(4) Router5路由表(节选)

表6.4(5) Router6路由表(节选)

  Host A(192.0.12.1/24)-> Host C(192.0.14.1/24),即目的地网络号为192.0.14.0/24,第一跳路由器网络号为192.0.12.0/24,即Router1。查询表6.4(1)~6.4(5),易知Host A -> Host C的路由信息,如表6.5。

表6.5 Host A -> Host C的路由信息

跳数

路由器名

转发接口

链路成本

总成本

1

Router1

IF11

-

15

2

Router4

IF4

5

3

Router5

IF11

5

4

Router3

IF0

5

  Host C(192.0.14.1/24)-> Host D(192.0.15.1/24),即目的地网络号为192.0.15.0/24,第一跳路由器网络号为192.0.14.0/24,即Router3。查询表6.4(1)~6.4(5),易知Host C -> Host D的路由信息,如表6.6。

表6.6 Host C -> Host D的各跳信息

跳数

路由器名

转发接口

链路成本

总成本

1

Router3

IF10

-

15

2

Router5

IF4

5

3

Router4

IF11

5

4

Router6

IF0

5

5. 对以前配置的四个需求之报文穿越的路由可视化。一次查看一个需求的路由,一般而言是有用的,即在Route Report for IP Traffic Flows窗口中倒换(toggle)属性字段Display的值。同样,确保在关闭之前,关闭路由显示。为需求Host A到Host C和Host C到Host D可视化的路由与在问题Q4中计算的是相同还是不同?

  Host A -> Host C的可视化路由,如图6.6。路由为:Router1 -> Router4 -> Router5 -> Router3,显然,与表6.5的结果是一致的。

图6.6 Host A -> Host C的可视化路由

  Host C -> Host D的可视化路由,如图6.7。路由为:Router3 -> Router5 -> Router4 -> Router6,显然,与表6.6的结果是一致的。

图6.7 Host C -> Host D的可视化路由

6. 列出为从Host B到Host E、Host B到Host F、Host E到Host B以及Host F到Host B的流量可视化各路由。

表6.7 可视化路由

源设备

目的设备

可视化路由

Host B

Host E

Router2 – Router1 – Router4 – Router6 – Router8

Host B

Host F

Router2 – Router1 – Router4 – Router6 – Router8

Host E

Host B

Router8 – Router6 – Router4 – Router1 – Router2

Host F

Host B

Router8 – Router6 – Router4 – Router1 – Router2

7. 在OSPF with packet – based load balancing场景中,可视化各种需求采用的路由。列出观察到的从Host B到Host E、Host B到Host F、Host E到Host B以及Host F到Host B的流量所经的路由。就这些路由而言,解释您认为最重要的是什么。这些路由与场景OSPF Flat中的相应路由有何区别?

Table 6.8 Visual routing of OSPF with packet – based load balancing scenario

source device

destination device

visual routing

Host B

Host E

Route 1: Router2 - Router1 - Router4 - Router6 - Router8

Route 2: Router2 - Router3 - Router5 - Router7 - Router8

Host B

Host F

Route 1: Router2 - Router1 - Router4 - Router6 - Router8

Route 2: Router2 - Router3 - Router5 - Router7 - Router8

Host E

Host B

Router8 – Router6 – Router4 – Router1 – Router2

Host F

Host B

Router8 – Router6 – Router4 – Router1 – Router2

  Difference: After Router2 is configured with packet-based load balancing, when the routing cost is the same, it no longer uses a single route to reach the destination, but different packets choose different routes to reach the destination.

9. Based on understanding of load balancing options, discuss whether observations of these routes are consistent with how load balancing works.

  unanimous. Different packets choose different routes to reach their destinations, which reduces the link utilization (that is, the load level) on a single route and increases the packet transmission speed.

  • Summarize

  This experiment simulates the OSPF protocol. By viewing the link state database of the router, we can intuitively see the working process of the OSPF protocol, and understand that OSPF works based on the distributed link state protocol. By analyzing the routing table items, it is realized that OSPF can select the shortest path according to the link cost.

references

[US] Adarshpal S. Sethi, Vasil Y.Hnatyshin. A Practical Guide to Computer Network Simulation OPNET [M]. Wang Lingfang, Mu Jingqin, translated. Beijing: Machinery Industry Press, 2014.

Guess you like

Origin blog.csdn.net/Cx2008Lxl/article/details/122802793