The Use of Computer Simulation To Illustrate Dynamic Routing Algorithms in An Educational Setting
The Use of Computer Simulation To Illustrate Dynamic Routing Algorithms in An Educational Setting
1. Iintroduction
In engineering education, computer simulations are students’ usage of the system. Preliminary
used to represent the essential features of a real evaluation of the project indicate that the
system so that learners can test their analytical and simulation-based learning environment for complex
design skills in a convenient and safe environment. engineering concepts such as dynamic routing
For instance, in basic electrical engineering algorithms directly contributes towards the student
education, computer simulation provides a unique improved learning.
way of creating stimulation and challenge along
with an opportunity to work on realistic case studies
that could not be achieved otherwise. In 2. Course Structure
engineering education, a successful implementation
of a simulation-based teaching and learning The Faculty of Informatics and the School of
approach requires extensive course material and Electrical, Computer and Telecommunications
laboratory support documents development Engineering have cooperated together to offer a
accompanied by supplementary lecture material degree called the Bachelor of Internet Science and
including specially tailored assignments, tutorial Technology (BIST). Students who study under the
questions and assessment tasks. Technology strand are able in second year to
undertake a new subject called Internet Technology
During the academic year of 2001 a new subject 2. These students are required to participate in an
was offered for the first time in conjunction with advanced laboratory program that has lent heavily
the University of Wollongong new undergraduate upon simulation using a program called ARENA. It
program in Internet Technology program. This is a telecommunications based subject, studying
subject was called Internet Technology 2, and is a aspects of Internet Technology which include
core second year subject for students doing Dynamic Routing Algorithms. Associated with this
Bachelor of Internet Science and Technology subject was an advanced laboratory in which the
(BIST) and optional for students doing Computer second year undergraduate students were to
Science. participate. As this laboratory was primarily
concerned with reinforcing concepts encountered
This paper reports on design and implementation of within the subjects curriculum, part of the
a computer simulation-based learning environment laboratory program used simulation.
aiming to help students to understand Internet’s
dynamic routing algorithms in a visually rich The simulation package chosen was ARENA. This
environment. This paper also looks at the actual package has been used within the School of
64
Electrical Computer and Telecommunications may take many minutes before convergence is
Engineering to teach classical telecommunications achieved.
queueing theory at undergraduate and postgraduate • These algorithms are prone to routing loops
level [10]. The simulations in the previous subjects once convergence has been achieved. This
were trivial in scope compared to the simulations occurs because each router has absolutely no
undertaken for this subject. This paper outlines and knowledge about the surrounding network
gives examples of how ARENA was used to topology. When a link failure occurs it is
provide simulations of basic dynamic routing possible that loops can occur as outlined in
techniques. The ARENA simulations used will be [5][6].
explained and full (unabridged) copies of the
simulations have been provided to the conference The other dynamic routing algorithm is the link
organizers for inclusion with the proceedings and state algorithm. This is based on Dijkstra Shortest
are available at the first authors web page [4]. Path First (SPF) algorithm [7]. It requires that the
entire network topology be known, which in
practice is usually defined in terms of Areas or
3. Dynamic Routing Algorithms Autonomous Systems (Systems controlled by a
single organisation). The Internets main protocol
The Internet uses dynamic routing algorithms that for Interior Routing is OSPF. As indicated it
come under two classical types: separates the local network into Areas, with the
1. Distance Vector backbone network being designated Area 0. The
2. Link State link state algorithm works by sending out link state
Typical examples of Internet protocols which use messages (called LSA’s in OSPF) which contain all
Distance Vector are RIPv1 (Routing Information of the network subnets and interfaces known by the
Protocol), RIPv2 and BGPv4 (Border Gateway individual routers within a Area or domain. The
Protocol) [1]. Two examples of Internet protocols, individual routers then store the information from
which use the Link State algorithm, are OSPF various Link state messages into a topological
(Open Shortest Path First) and IS-IS (Intermediate database. From this database the Shortest path first
System to Intermediate System) protocols [1][2]. tree can be derived. The root of the tree is then
taken as the router that is forming the database and
Distance Vector algorithms work on the principle all branches are attached from this point to the form
that all paths have equal value. Here, each the shortest path tree as shown in Figure 3.
individual link from one router to another is called
a ‘hop’. The number of hops between a source Starting at the root of the tree, which in Figure 2 is
network or host and a destination network or host is Router A, each branch is revealed and the minimum
used as the statistic to determine the minimum hop cost path is chosen. For example in Figure 2, the
count. There are many deficiencies with the use of
the Distance Vector algorithm, such as:
• The minimum hop count may not be the most Advertiser Network Cost Neighbour
appropriate path through the Internet. For ID ID Of Route ID
example, choosing links which may have a A 1 2 E
lower bandwidth than another set of links with A 2 3 F
a larger hop count but much higher bandwidth A 10 1 B
for the intervening transmission links is not an B 10 4 A
optimal choice [1] B 12 2 C
• Each router has no knowledge of the interfaces C 12 5 B
that other routers are connected to. The only C 15 2 D
information that each router knows is the hop D 15 5 C
count of its neighbourhood routers from other D 61 3 E
reported networks. As a result, the Distance E 1 3 A
Vector algorithm is also known as routing by E 61 2 D
rumor. [3] F 2 2 A
• These algorithms are slow to converge, for F 22 3 -
example if using the legacy distance vector Figure 1: Example of a generic link state
protocol RIP, it uses 30 seconds between topological database
routing table updates and thus for a medium
sized network (one with about 100 routers), it
65
Figure 3: The Shortest Path Tree after applying the
Dijkstra algorithm and the resultant routing or
forwarding table.
4. ARENA in Modeling
Figure 2: The topological database in tree format Telecommunications systems
showing all possible linkages with Router A as the ARENA is a modeling package that will run on any
root. Windows based Personal Computer. It is a
graphical package which is based on the SIMAN’s
first minimum path is actually to Net 10, so it is modeling language [13][16][17]. ARENA comes
made permanent in the Shortest Path Tree and then with many predefined modules such as Arrive,
Router B is revealed. This process is continued, Depart and Server. The Arrive module allows an
always choosing the link that costs the less until the arrival process to be modeled. It is possible to use
Shortest Path Tree is formed and all networks in the many different built in random processes such as
Area have had a path found to them. Note that the exponential ( expo() ), uniform ( unif() ) or gaussian
cost to Router B is zero, as the cost going into any ( norm() ) distribution. The Server module allows a
Router using Dijkstra’s algorithm is always zero. entity (usually modeled in the routing algorithm as
Applying the algorithm in this case leads to the representing a message or datagram or packet) to be
routing or forwarding table and Shortest Path Tree queued and serviced given some random or fixed
shown in Figure 3, where the link between Net 15 distribution.
and Router D shown in Figure 2 has been removed.
[7] The ARENA simulation, like many other network
simulators (for example, OPNET [9] or ns-2 [8]),
These dynamic algorithms were modeled using can be run, stepped and paused. This allows
ARENA which allowed students to monitor the network wide variables such as routing tables to be
examined at different time epochs. This is not
normally possible with a physical network. One
difference between ARENA and these other
simulators is that it is more generic, and not
specifically aimed at simulating telecommunication
subsystems. It has to be modified to simulate
aspects of such systems.
66
simple hop count (which is implemented in the first
two ARENA simulations) which allows the student
to measure the hop count before and after the
routing algorithm has converged. Such illustrations
are difficult to achieve with a laboratory full of
routers and switches and even if these were
available, the cost would be much more than that
incurred by using the simulator.
67
showed the current number of hops to the routers (3). However, the sub-modules were
destination. In RIP a hop count greater than 15 dramatically re-designed so that all routers
indicates that the destination is unreachable. The connected to the sub-module could provide routing
simulator also uses this as an indication that the update messages to it. This would normally be the
destination is currently unreachable. The last set of case, but in RIPv1DV.doe only those routers in the
values indicates which interface should be used to forward (towards the destination) direction were
send out packets for particular destinations. In this able to feedback their routing tables.
case the values are set to zero and the built in
default paths are used. When the simulation runs Column 1 Column 2 Column
and actual routing paths are discovered, these will 3
Destination Hops Interface
change from zero to one , two or three to indicate Out
which outgoing interface is to be used. The concept Row {BRouteTable(1,1)} {BRouteTable(1,2)} {BRouteTab
le(1,3)}
of an interface could include an ethernet card or a 1 1 16
0
serial communications port depending on the Row {BRouteTable(2,1)} {BRouteTable(2,2)} {BRouteTab
le(2,3)}
underlying Data Link and Network layer protocols 2 2 16
0
being used in a real network. Row {BRouteTable(3,1)} {BRouteTable(3,2)} {BRouteTab
le(3,3)}
3 3 16
0
Figure 7 shows a section of the simulation. In it,
Table 1: Shows how routing table information was
there are connections going from the individual
assigned to arrays within the Arena simulation of
interior routers (Routers A and B are shown here).
the Distance Vector routing algorithm
Associated with each router is a sub-module which
(RIPv1DVc.doe)
has connection points connected to green paths.
These sub-modules generate and receive the
In the RIPv1DVLoop.doe simulation, the egress
individual routing messages generated every time
Router 5 (destination 2) sends a message to the
an update occurs. This is the only way that the
interior Router P that the link has ceased to work.
individual routing tables can be changed. Once
Router P adjusts its routing table accordingly,
these tables stop changing the dynamic routing
setting the entry for destination 2 from one hop to a
algorithm is said to have converged and the
hop count of sixteen, indicating it is unreachable.
destinations can be reached via a minimum number
The surrounding routers are notified of this at the
of hops.
next update, but one of them tells P that it can get to
destination 2 via another route. This route may be
Figure 8 shows a section of the sub-module
through Router Q, which has now been told its
associated with Router B. This code processes the
route is unreachable. The routing loop starts from
received routing message, comparing the contents
this point and the hop count continues to increase
of the neighbours routing table (which is encoded in
till the hop count gets to 16 in all routers by which
attributes inside the entity as would occur in a real
time the network knows there is a problem and
packet based network) with the routers current
packets destined for Destination 2 are disposed of at
routing table. If a quicker route to a particular
the ingress router. This is simulated by using the
destination is discovered this processing will update
hop count at Router P (which is a global variable)
Router B’s routing table before the routing message
and allowing packets destined for destination 2 to
is disposed of in the Dispose module at the end.
only proceed if this count is less than 16. The
laboratory instructions included tables which the
The students record the routing tables before the
students were expected to fill in by observing the
dynamic routing algorithm starts, and then every
routing tables at each update epoch.
routing update after this until they have identified
where the routing tables stop changing at which
This simulation also was modified slightly to allow
point the Distance Vector algorithm has converged.
similar operation to the Border Gateway Protocol
The simulator allows the time at which the
version 4 (BGPv4) such that when the link to
algorithm starts to be modified and also the time
Destination 2 was broken, Router P (acting as a
between routing messages may be varied.
BGP router) told all the other routers at exactly the
same time of this event and, of course, no routing
ARENA simulation RIPv1DVLoops.doe is based
loop occurred.
on RIPv1DVc.doe, using the same number of
interior routers (15), ingress routers (7) and egress
68
Figure 7: A snap shot of the simulator showing Routers A and B and the paths upon which packets and
routing messages will travel. The green lines are the paths followed by routing messages and the blue lines
are the paths followed by actual packets destined for one of the three destinations.
Figure 8: A section of the sub-module associated with Router B in the simulator RIPv1DVc.doe which
updates the routing table by carrying out a series of comparisons and assignments before the received
routing message is disposed of at the end of the routing messages processing.
69
to get a reference to the array cell r2_table(1,2)
6. Link State Algorithms required the code:
70
asked the students to record in tables the resultant per loop. The first section should always deal with
routing tables that were produced by the simulation routers (like R4) and the second section always
for a given metric cost configuration. The structure deals with networks (like Net4). Initially it was
of the resultant routing tables was similar to that found that sometimes, when link costs for a router
shown in Table 1, except it had four columns and network were the same the first section would
instead of three. The first column was the Network choose a Network link as the permanent path. This
destination identifier. For example, Net 1’s caused the code to never converge and it also
identifier was 11 (all the Network identifiers resulted in erroneous routing tables. To solve this
ranged from 11 through to 19, for Net 9 and the problem, the first section had extra code added
Routers ranged from 1 through to 7, Router 1’s which basically checks to see if there is a router
identifier was ‘1’ and Router 7’s identifier was ‘7’). with the same minimum cost as a network node,
The second column shows the metric cost from the and if so, the router path is made permanent instead
router it is in (example Router 1’s routing table). of the network nodes path.
The third column shows the interface number that
the packet should be forwarded to and the fourth 7. Observations
column shows the identification number of the next
router. These are shown in Table 2. The use of computer simulation was effective in
teaching and demonstrating the dynamic routing
The students were asked to verify that the algorithms for both Distance Vector and Link state
computer simulations results were the same as that routing. In the second laboratory (RIPv1DV.doe)
which the Dijastra algorithm would produce (as the students were asked to create the tables in their
they were). laboratory notebooks. While this was effective, in
the third and fourth laboratories an excel
spreadsheet was used as a template. This allowed
the students to concentrate on the material that was
being illustrated. The feedback directly received
from some of the students indicated that this was a
more effective laboratory session than the second
one had been because the structure was available.
In teaching theory this is called scaffolding [15]. In
the next incarnation of these demonstrations a excel
spreadsheet template will also be used for this
second laboratory demonstration.
8. Final Remarks
Computer Simulation is an effective way to educate
undergraduates in dynamic routing algorithms. Its
use allows concepts that may be difficult to explain
and show through measurement to be illustrated.
The computer Simulation ARENA which has been
developed primarily for process simulation can also
be used to model and illustrate telecommunications
sub-systems such as those associated with dynamic
Figure 10: The topological tree showing the routing. This was used in undergraduate teaching
meaning of the third column of the topological laboratories in spring session of 2001 within the
database, topo. Bachelor of Internet Science and Technology
teaching programme. It was found to be an
The use of Visual Basic was very appropriate for effective way to convey understanding of
implementing the Dijkstra algorithm. The underlying dynamic routing protocols and their
temporary database was placed in an array called operation.
Tentative and then each branch starting at the router
that the VBA module was located in with minimum REFERENCES
cost was made permanent. This cycle was repeated 1. Uyless Black, 2000, “IP Routing Protocols:
until all nodes (routers and networks) were RIP, OSPF, BGP, PNNI & Cisco Routing
accounted for. The code itself does this two times
71
Protocols”, Prentice Hall Series in Advanced 17. Deborah Sadowski, Vivek Bapat, Glenn Drake,
Communications Technologies “The ARENA Product family: Enterprise
2. Paul Cernick, Mark Degner, and Keith modeling solutions”, Proceedings of the 1998
Kruepke, 2000, “Cisco IP Routing Handbook”, Winter Simulation Conference
Professional Middleware, IDG books, pp 197-
198
3. Paul Cernick, Mark Degner, and Keith
Kruepke, 2000, “Cisco IP Routing Handbook”,
Professional Middleware, IDG books, pp 18-19
4. http://www.elec.uow.edu.au/people/staff/p.vial/
5. Paul Cernick, Mark Degner, and Keith
Kruepke, 2000, “Cisco IP Routing Handbook”,
Professional Middleware, IDG books, pp 20-21
6. Uyless Black, 2000, “IP Routing Protocols:
RIP, OSPF, BGP, PNNI & Cisco Routing
Protocols”, Prentice Hall Series in Advanced
Communications Technologies, pp. 112-113
7. Behrouz A Forouzan, 2000, “Data
Communications and Networking”, McGraw-
Hill, 2nd Edition pp. 633-640
8. “The Network Simulator ns-2”,
http://www.isi.edu/nsnam/ns/, visited October
2001
9. “OPNET”, http://www.mil3.com/, visited
October 2001
10. Mischa Schwartz, 1987, “Telecommunication
Networks: Protocols, Modeling and Analysis”,
Addison-Wesley, pp. 212-223
11. Two postgraduate sessional thesis projects in
the spring of 2001 were using ARENA to
model metering aspects of SNMPv3 (Simple
Network Management Protocol version 3) and
simple flow aspects of WDM (Wave Division
Multiplexing) Optical Routers. Both students
did these projects under Mr P J Vial (BE
(Hons 2 div 1) ME (Hons) DipEd Png )
supervision as part of their Master of
Engineering Studies program in Spring Session
2001, Mr Karthik Vilapakkam Nagarajan and
Mr Frank Nordhal on Optical Routing.
12. Uyless Black, 2000, “IP Routing Protocols:
RIP, OSPF, BGP, PNNI & Cisco Routing
Protocols”, Prentice Hall Series in Advanced
Communications Technologies, p. 104
13. W David Keltan, Randall P Sadowski, Deborah
A Sadowski, 1998, “Simulation with
ARENA”, McGraw Hill, covers ARENA 3.0
14. P.J.Vial, V W Smith, P J Vial, V J Gosbell & B
S Perera, “Database Design for Power Quality
Survey”, AUPEC 2001
15. M.D.Roblyer, Jack Edwards, Mary Anne
Havriluk, 1997, “Integrating Educational
Technology into Teaching”, Prentice Hall
16. David A Takus, David M Profozich, “ARENA
Software Tutorial”, Proceedings of the 1997
Winter Simulation Conference
72