0% found this document useful (0 votes)
129 views

Graduation Project

The document is a graduation project report that evaluates deploying a multi-layer network using dynamic routing protocols RIP, OSPF, and BGP. It includes an assessment rubric for the project, preface, guarantee, and table of contents sections. The project report will cover introducing static and dynamic routing, autonomous system theory, and explanations of how RIP, OSPF, and BGP work. The student aims to present their simulation results on implementing these dynamic routing protocols in a multi-layer network for their graduation assessment.

Uploaded by

Bảo Ngọc Lê
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
129 views

Graduation Project

The document is a graduation project report that evaluates deploying a multi-layer network using dynamic routing protocols RIP, OSPF, and BGP. It includes an assessment rubric for the project, preface, guarantee, and table of contents sections. The project report will cover introducing static and dynamic routing, autonomous system theory, and explanations of how RIP, OSPF, and BGP work. The student aims to present their simulation results on implementing these dynamic routing protocols in a multi-layer network for their graduation assessment.

Uploaded by

Bảo Ngọc Lê
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 122

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

SCHOOL OF ELECTRICAL-ELECTRONICS

BACHELOR’S GRADUTION PROJECT


Topic: Deploying a multi-layer network using dynamic
routing RIP, OSPF, BGP

Instructor: Dr. Dang Quang Hieu

Class: ET-E4 K63

Academic year: 2018-2022

Name: Le Bao Ngoc

MSSV: 20182930

Hanoi, August 2022


ASSESSMENT OF THE GRADUATION PROJECT
( Use give lecture tablets direction lead )

Name of Instructors:....................................................................................................
Name od student: .....................................................MSSV: 20182930 .....................
Name of project:..........................................................................................................
.....................................................................................................................................
Select the appropriate score for students to present according to criteria below:
Very poor (1); Poor (2); Pass (3); Good (4); Very good(5)
There is a combination of theory and practice (20)
State the urgency and importance of the topic, issues and hypotheses
1 (including purpose and relevance) as well as the scope of application 1 2 3 4 5
of the project.
2 Update the most recent research results (domestic/international) 1 2 3 4 5
3 Specify and detail the research/problem solving method 1 2 3 4 5
Have simulation/experimental results and clearly present the obtained
4 1 2 3 4 5
results
Ability to analyze and evaluate results (15)
A clear work plan including objectives and implementation methods
5 1 2 3 4 5
based on the results of theoretical research in a systematic way
The results are presented in a logical and easy to understand manner,
6 1 2 3 4 5
all results are analyzed and evaluated satisfactorily.
In the conclusion, the author points out the differences (if any)
7 between the achieved results and the initial goals set out and provides 1 2 3 4 5
arguments to suggest possible solutions in the future.
Project Report ‘s technical writing skills (10)
The project presents in accordance with the prescribed form with a
logical and beautiful structure of chapters (tables, clear images, with
8 1 2 3 4 5
titles)has a chapter introduction and chapter conclusion, a list of
referencescitations.
Excellent writing skills (standard sentence structure, scientific style,
9 logical and well-founded reasoning, appropriate vocabulary usage, 1 2 3 4 5
etc.)
Scientific research achievements (5) (choose 1 out of 3 cases)
Having a scientific article published or accepted for
1
publication/winner of 3rd prize at Institute level or higher/scientific
0 5
awards (international/domestic) from 3rd prize or higher/ Having
a
registered a patent
Reported at the Institute council in the conference of scientific
1
research students but did not win the 3rd prize or higher / Won the
0 2
consolation prize in other national and international competitions on
b
the subject such as TI contest.
1
0 No achivements of scientific research 0
c
Total points /50
Total points based on base 10

1
Other comments (about students' attitudes and working spirit)
.....................................................................................................................................
.....................................................................................................................................
.....................................................................................................................................
.....................................................................................................................................
.....................................................................................................................................
.....................................................................................................................................

Date: … / … / 20…
Instructor

2
PREFACE
Before presenting the content of my project report, I would like to express my
sincere thanks to Dr. Dang Quang Hieu, who has directly guide and provide
documents for me during the project implementation.
Due to time constraints and limited knowledge, the report is not avoid making some
minor errors. Therefore, I look forward to receiving comments from teachers and
friends to improve the topic.
Hanoi, August 2022
Students present
Le Bao Ngoc

3
GUARANTEE
My name is Le Bao Ngoc, student number 2012930, student of Elitech Program’s
Electronic Class 01, course 63. The instructor is Dr. Dang Quang Hieu. I hereby
declare that all the content presented in the project "Deploying a multi-layer network
system using dynamic routing of RIP, OSPF, BGP" is the result of my research .
The data stated in the project is completely honest, reflecting the simulation results
achieved. All information cited is subject to intellectual property regulations; The
references are clearly listed. I take full responsibility for the content written in this
project.
Hanoi, August 2022
The guarantor
Le Bao Ngoc

4
TABLE OF CONTENTS

LIST OF SIGNS AND ABBREVIATIONS ............................................................... 9


PROJECT SUMMARY ............................................................................................. 10
1. INTRODUCTION .............................................................................................. 11
2. OVERVIEW OF STATIC ROUTE, DYNAMIC ROUTE ............................. 11
2.1 Introduce ......................................................................................................... 11
2.2 Static routing protocol overview ..................................................................... 12
2.2.1 Static routing operation ............................................................................ 12
2.2.2 Noticeable parameters of configuration ................................................... 13
2.3 Dynamic Routing Protocol Overview ............................................................. 13
3. THEORY ............................................................................................................. 13
3.1 Autonomous System ( AS ) ............................................................................ 13
3.2 RIP .................................................................................................................. 15
3.2.1 Concept..................................................................................................... 15
3.2.2 How it works ............................................................................................ 15
3.3 OSPF ............................................................................................................... 15
3.3.1 Concept..................................................................................................... 15
3.3.2 How it works ............................................................................................ 15
3.4 BGP ................................................................................................................. 16
3.4.1 Concept..................................................................................................... 16
3.4.2 How it works ............................................................................................ 16
3.4.3 Order of precedence in BGP .................................................................... 16
3.5 Multilayer network system ............................................................................. 17
3.5.1 Network Tier 1 ......................................................................................... 17
3.5.2 Network Tier 2 ......................................................................................... 18
3.6 Compare routing protocols OSPF, BGP, BGP ............................................... 18
3.7 Advantages and disadvantages of routing protocols OSPF, BGP, BGP ........ 19
3.8 Load Sharing ................................................................................................... 19
3.9 Configuration of RIP, OSPF, BGP ................................................................. 20
3.9.1 Configuration of RIP ................................................................................ 20
3.9.2 Configuration of OSPF ............................................................................ 24
3.9.3 Configuration of BGP .............................................................................. 27

5
4. LAB MODELS OF RIP, OSPF, BGP ............................................................... 30
4.1 RIP’s lab model ............................................................................................... 30
4.1.1 Process of RIP .......................................................................................... 30
4.1.2 Compare RIPv1 and RIPv2 ...................................................................... 31
4.2 OSPF’s lab model ........................................................................................... 32
4.2.1 Introduce................................................................................................... 32
4.2.2 How OSPF works ..................................................................................... 33
4.2.3 OSPF packet types ................................................................................... 34
4.3 BGP’s lab model ............................................................................................. 35
4.3.1 Introduction to eBGP and iBGP ............................................................... 35
4.3.2 Data sheets of BGP .................................................................................. 37
5. Emulate a Cisco router on GNS3 ...................................................................... 43
5.1 About GN3 ...................................................................................................... 43
5.2 NS3’s Configuration ....................................................................................... 43
5.3 Load IOS for router ......................................................................................... 44
5.4 Learn the basic router configurations (how to assign IPs to interfaces, check IP
parameters). .............................................................................................................. 44
6. INSTALLATION INSTALLATION ................................................................ 50
6 . FIrst Network model ............................................................................................ 50
6.2 General settings (using the Linux OS commandline) ........................................ 52
6.3 Deploying the top-of-the-line network model .................................................... 53
6.3.1 IP Configuration .......................................................................................... 53
6.3.2 Config of OSPF routers ............................................................................ 56
6.3.3 Operating the OSPF model on the top layer ................................................ 58
6.4 Deploy the middle and lower layer network model ........................................ 59
6.4.1 IP Configuration .......................................................................................... 59
6.4.2 Configuration RIP router.......................................................................... 62
6.4.3 RIP operation on middle and lower layer network model ....................... 64
6.5 Deploy top layer network model..................................................................... 66
6.5.1 IP Configuration .......................................................................................... 66
6.5.2 Config for OSPF routers .......................................................................... 68
6.5.3 Operating OSPF on top layer’s network model ....................................... 71
6.6 Configure BGP for routers .............................................................................. 73

6
6.6.1 IP Configuration .......................................................................................... 73
6.6.2 Operate BGP across the network model ...................................................... 74
7 SYSTEM OPERATION .................................................................................... 77
7.1 Check connection by ping and tracepath ........................................................... 77
7.2 OSPF responsiveness test with AS 1 ................................................................ 79
7.3 Check the responsiveness of RIP with AS 2 .................................................... 80
7.4 Steps to test the system by installing and connecting to DNS servers ........... 81
8. SIMULATION ON C ............................................................................................. 82
8.1 Simulation RIP .................................................................................................. 82
8.2 Simulate OSPF _ ............................................................................................... 88
8.3 Simulation BGP _ .............................................................................................. 99
9. EXPANDED : AODV AND OSPF COMPARISON ......................................... 117
9.1 About AODV .................................................................................................. 117
9.2 Evaluation of AODV and OSPF when operating in WiMAX ....................... 118
CONCLUSION ......................................................................................................... 120
REFERENCES ......................................................................................................... 121

7
LIST OF FIGURE

Hình 1: Overview Of Routing ...................................... Error! Bookmark not defined.


Hình 2: Overview Of Static Route ............................................................................. 122
Hình 3: EGP and BGP between ASs ......................................................................... 133
Hình 4: Internal route and external route .................................................................. 144
Hình 5: Network Don’t Use Split Horizon hoặc Poison Reverse .............................. 222
Hình 6: Count to infinity ............................................................................................ 233
Hình 7: OSPF Areas ................................................................................................... 266
Hình 8: OSPF Network with Headquarters (HQ)- area 0 ......................................... 277
Hình 9: Topology diagram of RIP concentrate on R1 and R2 ................................ 311
Hình 10: RIPv2 Model ............................................................................................... 322
Hình 11: Large OSPF networks are decentralized and divided into many areas ....... 333
Hình 12: One-zone OSPF model ................................................................................ 355
Hình 13: Multi-zone OSPF model .............................................................................. 355
Hình 13: iBGP Peering ‘s Model................................................................................ 366
Hình 14: eBGP Peering ‘s Model ............................................................................... 377
Hình 15: BGP routing information reception and filtering .......................................... 38
Hình 16: Example Of AS-path ..................................................................................... 39
Hình 17: Example Of Next-hop ................................................................................. 401
Hình 18: Example Of Local Preference ..................................................................... 411
Hình 19: Example Of MED ....................................................................................... 422
Hình 20: Example Of Weight ..................................................................................... 425
Hình 21: Router Config’s Mode ................................................................................... 46
Hình 22: Static route’s lab model ................................................................................. 49
Hình 23: Overview Of Network Model...................................................................... 500
Hình 24: Top layer‘s network model.......................................................................... 510
Hình 25: The middle and lower layer network model (1) .......................................... 511
Hình 26: The middle and lower layer network model (2) .......................................... 521
Hình 27: Throughput vs. speed of nodes ................................................................ 11817
Hình 28: NRL vs. speed of nodes ........................................................................... 11917
Hình 29: PDR vs. speed of nodes ............................................................................. 1198

8
LIST OF SIGNS AND ABBREVIATIONS

Letter write Turn off Cluster are from write full enough
OSPF Open Shortest Path First

BGP Border Gateway Protocol

RIP Routing Information Protocol

SR Static Route
DR Dynamic Route
AS Autonomous System

ASN Autonomous System Number

IGP Internal Gateway Protocols

EGP Exterior Gateway Protocols


EIGRP Enhanced Interior Gateway Routing Protocol
DVA Distance Vector Algorithms
IP Internet Protocol
LSDB Link State Database
IS -IS Intermediate System To Intermediate System
ToS Type of Service
LSA Link-State Advertisement
IETF Internet Engineering Task Force
ISP Internet Service Provider
IPX Internetwork Packet Exchange
ASBR Autonomous System Boundary Router
WAN Wide Area Network
AODV Ad Hoc On-Demand Distance Vector Routing
MED Multi Exit Discriminator
ABR Area Border Router
NSSA Not -So-Stubby Area
VLSM Varibale Length Subnet Masking
DNS Domain Name System

9
PROJECT SUMMARY
In this project, first of all, I thoroughly understand the theory of routing, then
learn the network model, learn its operating structure, then I deploy multilayer
network using RIP dynamic routing , OSPF, BGP on GNS3 to study the
accuracy and feasibility of deploying the system to operate network models
thanks to the above implementation on Linux OS and Windows. After
successfully deploying on GNS3, I tried to optimize the model, routes, IP
configuration for each route and the accuracy when doing work when doing
simulation operations on the network model.
After successful training on GNS3, that multilayer network, I also performed
simulation on C with technical requirements for multilayer network. From the
technical requirement, I build a test plan and follow it to verify the design. The
design has passed the specification when 100% functional coverage has been
achieved. In addition, I also build MANET network model, a single network
model with not too complicated configuration and can directly code separate
functions for each leg of the network and from there compare it with the multi-
layer network system that I have. I designed in this project and the feasibility of
using this system in practice.

10
1. INTRODUCTION
In the development of today's life, the Internet has become a tool for us to interact,
transact, look up information as well as store data. Therefore, understanding the
implementation as well as understanding the algorithms on routers that support routing
is extremely important for future engineers. Therefore, in the framework of this
exercise, I would like to show you how to set up and operate a 3-tier network:
- The top layer is the area for the routers of the network operator (ISP), in this
area, the routing algorithm used is BGP.
- The middle layer is the area of routers in the local area network, routed using
OSPF or RIP algorithms.
- The bottom layer is the personal computers, directly connected to the Routers.

2. OVERVIEW OF STATIC ROUTE, DYNAMIC ROUTE


2.1 Introduce

Overview Of Routing
Hình 1: Overview Of Routing
Routing is a process that routers Hi
perform to move a packet (Packet) from a source
̀ nh 2:Tổng quan về Routing
address to a destination address in the network. In this process, the router must rely
on the routing information to make decisions to forward the packet to the
predetermined destination address.
Hình 3:Tổng
11quan về Routing
The routing table contains a route to every destination network that a router knows
how to access. When you configure interfaces, they are listed as directly connected
interfaces in the routing table. You can manually advertise routes to this table to
specify the destination network. However, as the network becomes larger and more
complex, manually configuring every route on each router becomes infeasible. Even
if you use default routes and central routers to minimize the number of routes that
individual routers must know, configuring routes manually for network expansion
can be time consuming. time. Entering static routes is also error prone: it's easy to
press the wrong key and enter incorrect routes. Instead of configuring static routes,
you can use dynamic routing protocols, which allow routers to exchange routing
information with other routers in the network. Each router can then use this
information to build its routing table.
There are two basic types of routing, Static Route and Dynamic Route.
Network administrators when choosing a dynamic routing protocol need to consider
factors such as the size of the network system, the bandwidth of the transmission
lines, and the router's capabilities. Router type and router version, the protocols
running in the network.
2.2 Static routing protocol overview
For static routing, the route information must be entered by the network
administrator for the router. When the network structure has any changes, the
network administrator must delete or add routing information for the router. Such
paths are called fixed paths. For a large network, the maintenance of the router
network as above takes a lot of time. As for the small network operator system, there
is little change, this job is less laborious. Because static routing requires the network
administrator to configure all routing information for the router, there is no
flexibility like dynamic routing. In large networks, static routing is often combined
with dynamic routing protocols for some special purpose.
RTZ(config)#ip route 172.24.4.0 255.255.255.0 172.16.1.2

Overview Of Static Route


Hình 7:Overview Of Static Route

2.2.1 Static routing operation


Overview Of Static Route
12

Overview Of Static Route


Static routing can be divided into three specific steps:
 First, the network administrator configures fixed routes for the router
 The router installs these routes into the routing table
 Data packets are routed along these fixed paths
2.2.2 Noticeable parameters of configuration
 Destination-network: The network address to go to
 Subnet-mask: Subnet-mask of Destination-network
 Address: The ip address of the port on the router from which the packet will
go on the interface: the port of the router from which the packet will go
2.3 Dynamic Routing Protocol Overview
Routing protocols differ from routed protocols both in function and in mission.
Dynamic routing protocol is used to communicate between routers. The dynamic
routing protocol allows this router to share routing information it knows with other
routers. From there, the router can build and maintain its routing table.

EGP and BGP between ASs


Hình 8:EGP and BGP between
ASs
- A number of dynamic routing protocols: RIP, IGRP, EIGRP, OSPF, ... are used to
direct user data. A routing protocol will provide sufficient information about the
network layer address so thatEGPdataandpackets can be ASs
BGP between transmitted from one host to
another based on that address structure. There are two protocols that we need to pay
Hình 9: EGP và BGP giữa các AS
attention to in dynamic routing: Internet Protocol (IP), Internetwork Packet
Exchange (IPX)
EGP and BGP between ASs

3. THEORY
EGP
3.1 Autonomous System ( AS ) and BGP between ASs
̀Hinh 10: EGP và BGP giữa các
A collection of interconnectionsASof several managed IP networks routed by an
administrative entity. Each entity consists of many subunits. Each of these units
manages and operates the physical network system independently. These networks are
13
then interconnected and routed according to a common design defined by the entity. As
such, this entire internal system can be thought of as an AS autonomous system.
In this system, the network connection configuration and diagram can be clearly
defined. On the other hand, obviously, one AS will not be able to grasp the connection
diagram of another AS. This resulted in separate routing protocols defined for
implementation in and out of the AS, including:
- Internal Gateway Protocols (IGPs): are protocols that allow routers to route
within the AS. In this article, we will use 2 IGP protocols, including Routing
Information Protocol (RIP) and Open Shortest Path First (OSPF).
- Exterior Gateway Protocols (EGPs): are protocols that route connections
between ASs. In the article, we use EGP protocol is Border Gateway Protocol (BGP).

Internal route and external route


̀
Hinh 11: Internal route and external
Typical examples of ASs are routeISPs. Viettel, VNPT, FPT Telecom, ... are the ASs that
contribute to the creation of the global Internet. A normal business network can also
become an AS in some special cases, but in most of the cases that I have referred to,
a business network, a home network
Internal routeisand
notexternal
necessary.
routebecome an AS to be able to
connect to the Internet, but these networks only need to subscribe to a certain ISP to
be able to access the Internet.
Internal route and external route
An AS needs to be uniquely identified by a value called the Autonomous System
Number (ASN).
Internal route and external route
ASN has 2 formats: 2-byte or 4-byte
 With the 2-byte range, ASNs range from 0 to 65535.
 With the 4-byte range, ASNs are in the range 0 to 232 -1.
Example: Viettel network operator owns 2 ASN values, 7552 and 24086. All public
IPs of Viettel on the Internet belong to this AS.

14
3.2 RIP
3.2.1 Concept
RIP is an IGP routing protocol used for small ASs, not for large and complex
networks. The routing information protocol is a type of distance-vector routing
protocol, which uses a value to measure that is the number of hops (hop count) in the
path from the source to the destination. Each hop in the path from source to destination
is considered to have a value of 1 hop count. When a router receives a routing update
for a packet, it adds 1 to the measurement and updates the routing table.
3.2.2 How it works
RIP uses the Distance Vector Algorithms (DVA) routing algorithm. This is an
interoperable routing algorithm that computes the shortest path between pairs of nodes
in the network, based on a centralized method known as the Bellman-Ford algorithm.
Network nodes exchange information on the basis of destination address, next node,
and shortest path to the destination.
3.2.3 Limit
RIP right judge physical one number magic error _ prize muscle department cause
out. Head first , in transparent time " holddown " time later when the yes specified
information _ line bag replace change , if the router receives Okay updated information
_ Japan are from a smooth router Neighbors other but this information _ give know yes
Street arrive network X with pine number determined line good than the road that router
first there then it will ignore , no access Japan this information . _
Next follow to be error count enter term . Dinh line repeat yes can happen out when
the board determined line above routers yet ? Okay access Japanese do so submit
festival capacitor slow .

3.3 OSPF
3.3.1 Concept
OSPF is a typical IGP link-state routing protocol. This is a protocol widely used
in large enterprise networks. The OSPF protocol is standardized for routers to exchange
information and build link state databases. OSPF operates in only one AS region, so it
is classed as RIP.
3.3.2 How it works
Each router running the protocol sends its link states to all routers in the area.
After a period of exchange, the routers will identify the link state database table (Link
State Database - LSDB) with each other, each router will have a network map of the
whole area. From there, each router will run Dijkstra's algorithm to calculate a shortest
path tree (Shortest Path Tree) and based on this tree to build a routing table.

15
When a router runs OSPF, there must be a unique value that identifies the router
in the community of OSPF routers. This value is called Router-id. Router - The id on
the router running OSPF in the format of an IP address.
By default, the OSPF process on each router will automatically elect the router
value - id is the highest IP address in the active interfaces, giving priority to the loopback
port. To change the router - id of the process, you have to restart the router or remove
the OSPF process and reconfigure, then the router - id election process will be done
again with the existing interfaces on the router .
Another way to reset the router-id value is to use the “router-id” command to
manually set this value on the router.
Router (config) # router ospf 1
Router (config-router) # router-id ABCD
or set via config file with line
ospf router id ABCD

3.4 BGP
3.4.1 Concept
BGP is an important component of the Internet in routing routers between
different ASs. It works based on updating a table containing network addresses (prefix)
indicating the linkage between autonomous systems (autonomous systems), a collection
of network systems under the control of an administrator. network, usually an Internet
service provider, ISP. In addition to using BGP between ASs, BGP can also be used in
large-scale private networks because OSPF is not available. Another reason is to use
BGP to support multihome.
Most Internet users do not use BGP directly. Only Internet service providers use
BGP to exchange routes. BGP is one of the most important protocols for ensuring the
connectivity of the Internet.
3.4.2 How it works
Routers using BGP connect pairwise with each other by establishing a TCP
session over port 179. This connection is maintained by sending keep- alive 19 bytes
every 60 seconds (default).
There are four types of BGP messages: open (opening session), update (notifying
or withdrawing a path), notification (notifying error), keep-alive (maintaining the
connection).

3.4.3 Order of precedence in BGP


 Select the explicit path in the previous table (compared to the default path)
 Choose the path with the highest weight (Cisco router only)
16
 Choose the path with the highest local preference.
 Select the route set by the network administrator himself on the router (static
route, with origin attribute INCOMPLETE)
 Choose the path that goes through the least AS (the shortest AS path)
 Select the inner-origin path first (origin = IGP < EGP)
 Choose the path with the lowest near/far priority MED (Multi exit discriminator)
 Select the external path first.
 Choose the path with the lowest IGP metric to the next hop.
 Choose the path that exists in the table the longest (oldest one)
 Choose the path to the next router with the lowest BGP ID
3.5 Multilayer network system
Just like apps, the internet is also stratified into tiers. Tiers on the bottom layer
translate to the tier above. The tiers above pay to receive the services of the tiers below.
Currently, the model of the Internet is divided into several layers. The tier 1 networks
will be on the top tier, providing connectivity for the tier 2 networks on the bottom tier
to connect to each other. Tier 1 networks are large companies, as listed in the table
below, while tier 2 networks are national network service providers (ISPs), in Vietnam
such as: VNPT, FPT, Viettel, .. …
3.5.1 Network Tier 1
In the world, although there are many network providers ( Internet Service Provider
/ISP), however, to be able to become a global network (Tier 1 network), currently only
a few companies can achieve it. This is due to limited financial potential as well as geo-
political factors.
CAIDA Managed
Amount
Name Headquarters AS fiber optic
of AS
Ranking cable length
AT&T America 7018 23 660,000 won
Century Link America 3356 first 885.139
Deutsche Telekom Global
Virtue 3320 20 250,000 won
Carrier
GTT Communications, Inc. America 3257 3 232,934
thirty
Liberty Global Older brother 6830 800,000 won
first
NTT Ltd. Older brother 2914 5
Orange France 5511 18
PCCW Global Hong Kong 3491 9
Sprint Japan 1239 27 42,000 won
Tata Communications India 6453 6 700,000 won
Telecom Italia Sparkle IDEA 6762 8 560,000 won
Telxius Spain 12956 14 65,000 won
Telia Carrier Switzerland 1299 2 65,000 won

17
Verizon Enterprise Solutions America 701 22 805,000 won
Zayo Group America 6461 ten 196,339

3.5.2 Network Tier 2


The tier 2 and tier 3 are companies that use the cable service provided by Tier 1 to
provide services to the users we call ISPs.

3.6 Compare routing protocols OSPF, BGP, BGP

Options RIP OSPF BGP


Calculating The number of - Bandwidth inversion. Diversity in route
metrics andhops only to the -Typeof service(ToS) is selection policy :
selecting routes destination.. rarely used. -External or internal
routes.
-Number of hops.
-Autonomous system
(AS) through nodes
have passed.
-Weigth.
-Prefix length.
Information when Routers send the The different types of Updates include:
updating complete routing LSAs include different -New routes.
table of RIP information: -Withdrawn routes.
-Connection and its status: -Routes include AS
+ Connect to the network. through packets
Connect to another router. passed.
-IDs of the routers in the - The set filter internal
multi-access network. the set ready filter
- Aggregate routes within a determined line but
predefined network (send the set determined line
by ABRs). advertising fox arrive
-Routing to a neighbor .
ASBR(autonomous.system
border router), send using
ABRs.
-External route or default
route for external traffic
(send using ABRs).
Routers that send -All router In a point-to-point -BGP routers
and receive interfaces of RIP network, neighboring communicate only
updates networks. routers exchange LSAs. with configured
neighbor routers
18
-Interfaces that In multi-access networks,
receive a route every router sends LSAs to
broadcast are the DR and back-up
inaccessible DR(BDR) and receives
-Passive interface LSAs from the DR.
receives the -ABRs summarize routes
update but does into stub areas
not send it
3.7 Advantages and disadvantages of routing protocols OSPF, BGP, BGP

Protocol Benefit Disadvantage For users


RIP -Simple configuration. Relatively slow -LANs
-RIP v2 can communicate convergence. -Simple WANs
with external network. -Metric is based on hop -Connect to external
count only. networks
-If used to connect to ISP, -Do not use for dial-up
ISP must redistribute connection.
routes into BGP.

OSPF -Exact routes taking into - Complex configuration. -More extensive LAN
account link speed and -Costs can be high. and WAN networks.
cost. -OSPF cannot be used as -Not to be used over
- Convergence happens an EGP without dial-up connections.
quickly. redistribution.
-As low as RIP if the
network is well designed.

BGP -ISPs use BGP. - Complex configuration. -Connect to ISP.


-BGP provides tight -The network must also run -Not to be used over
control over which routes IGP. dial-up connections.
are advertised and
accepted.
- Relatively low cost.

3.8 Load Sharing

19
Typically, a routing table can only include one best route per destination. Even if a
router learns many equally good routes to the same destination, it must choose one.
Other routes cannot be used unless the selected route fails for some reason.
However, when configuring routers, implementing lab models of protocols, building
network models can also perform load sharing, allowing it to add multiple routes to
the same destination to its routing table. it. This option allows the router to use
redundant connections for the same remote site.
When you enable load sharing, a router can set up to six routes to the same
destination in its active routing table. It can learn these routes from any source,
meaning you can enter them manually or the router can learn them using a dynamic
routing protocol. However, keep in mind that load sharing allows the router to
choose the best multiple routes. Routes must have the same metric and
administrative distance; otherwise, only the route with the lowest value will be
selected. Because different routing protocols have different administrative distances,
multiple routes will generally be discovered using the same dynamic protocol.
another route. In this case, the traffic may not be properly balanced across multiple
connections, but the more sessions the router supports, the more balanced the traffic
will be. routing each time it routes a new packet to the destination network.
However, configuring the router for shared load in this way can cause packets to
arrive at their destination out of order and generally unappreciated.
3.9 Configuration of RIP, OSPF, BGP
3.9.1 Configuration of RIP
Before sending a RIP route, the Security Router checks the route's source or next
hop address. If the router is sending an update to a source for a particular route, it
will send an abnormal reverse instead of the normal route. Poison Reverse is a route
with a metric of 16 (which is infinite for RIP). Poison Reverse distinguishes a
legitimate backup route from one that the local router has received from a neighbor.
Basically, Poison Reverse notifies the neighbor that it cannot access the network in
question through the local router. This mechanism is called " Speeding
Convergence: Split Horizon, Poison Reverse, and Triggered Update" . Neighbors is
listed as the next address that will change the metric for the route. The router then
changes the metric for the route in its own table. to a new metric plus a new metric
Another neighbor advertises a route with a lower metric The router changes the route
to list this neighbor as the next step address and enters the metric new Router does
not receive route information for the entire length of the invalidation period Router
marks the route for deletion It sends unique updates to the route in two update cycles
update before removing the route completely from its routing table RIP update, v1
and v2RIP update packets contain different information, depending on whether the
RIP version is 1 or 2. A RIP v1 packet includes: one command field - indicates
whether the package is a request or a reply version field (set at 1), an address family

20
field - set at 2, for bi Note that addresses in IPv4 format have a maximum of 25
entries, each of which includes:
• Destination IP address
• A metric, which is the number of hops to the destination address from the router
sending the packet
When a router discovers a new or better route from a RIP v1 update, it assumes that
the neighbor from which it received the update is the next hop for the route. The
router adds one to the index for its own routing table entry. RIP v2 fixes some
shortcomings of RIP v1. RIP v2 provides route summary partitioning for class
networks and supports EGP. A RIP v2 packet includes: a command field —
indicating whether the packet is a request or a routing domain response version
fielda — identifying the routing daemon that generates the message, allowing a
device to run certain processes RIP at an address with the same address fielda family
routing tag (including AS number for use with EGP) up to 25 entries, each of which
includes:
• Destination IP address
• Subnet mask-provides support for variable length subnets
• Next step IP address
• A metric-number of hops to the destination address from the next hop address
When a router discovers a new or better route to the destination from a RIP v2
packet, it enters the route with the next hop IP address specified in the packet. If the
IP address field of the next hop is all zeros, the router will assume that the source of
the packet is the IP address of the next hop. (This assumption provides some
backward compatibility with RIP v1). RIP v1 interfaces broadcast their routing
updates to the entire subnet. RIP v2 routers join the pool for the RIP v2 multicast
address (224.0.0.9) and multilayer updates to this address. Therefore, the RIP v1 and
v2 interfaces may not receive each other's updates.
*Speeding Convergence: Split Horizon, Poison Reverse, and Triggered Update
One shortcoming of RIP is the relatively slow convergence in some network
environments. The router sends updates every 30 seconds. In a large network, a
router may not receive accurate and up-to-date information about a route for several
minutes. Another problem with slow convergence is that it can trigger an infinity of
network congestion when the connection fails. For example, examine the network
in the diagram below and consider the updates each router receives for Network 1
when the routers run simple RIP without Split Horizon or Poison Reverse.

21
Network Don’t Use Split Horizon hoặc Poison Reverse
Hình 12: Network Don’t Use Split Horizon hoặc Poison Reverse
Router B is directly connected to Network 1, so it advertises a route to it with index
1. Router A and C receive this route from Router B. Both host it route to Network 1
Hình 13: Network mà không sử dụng Split Horizon hoặc Poison
with B being theReverse
next hop address and metric 2. Routers A and C then start
advertising this route. Router C receives the route from Router A. It does not change
its routing table to indicate that Router A is the next hop , because metric (2) is
higher than theNetwork
metric Don’t
advertised by Router
Use Split HorizonA.hoặc
router B. Router
Poison ReverseB also receives the
route from Router A. There is nothing in the update that Router B received from
Hình 14: Network mà không sử dụng Split Horizon hoặc Poison
Router A indicating that this route eventually passed through Router B itself. Router
Reverse
B simply rejected the route for the same reason. the reason that Router C did: the
metric was higher than the route it took. Exempt to be network still is fine
determined , too submit
Network Don’t
thisUse
nextSplit
custom smooth
Horizon hoặc share
Poison. Reverse
Although of course , the
question topic bouncing
Hình 15: born if mà
Network structure
không sửbamboo
dụng Split contact conclude
Horizon hoặc Poison replace change .
Reverse
See review thing what will happen out when the contact conclude Between The set
determined line B and Network 1 no Fort public . Router B catches head advertising
fox one line arrive Network
Network Don’t1Use
withSplit
a metric of 16
Horizon to Poison
hoặc only out that it are not can access
Reverse
access okay .
Hình 16: Network mà không sử dụng Split Horizon hoặc Poison
Reverse
Routers A and C receive Okay copy access Japan this from router B and replace
change the metric, but are not before when the they already to send private routers
_ of the me give Network 1 with metric is 2. Router A receives determined line from
router C and router C receive same route from router A.
By Because the line Street this have metric short than _ _ line router line B, router
A and C save store the line Street this in board determined line of the them ( extra

22
one enter metric ) . Because conclude connect of the main it with Network 1 no Fort
public , router B accepts take line road .

Count to infinity
̀
Hinh 17: Count to
Routers A and C now both have routes infinityto Network 1 with a metric of 3, pointing to
each other. During the next update cycle, router A receives the route from router C.
It updates the route routing in its table with a metric of 4. Router C, receiving the
update from router A, does the same.
Count to The next time the routers advertise the route,
infinity
it has a metric of 4. Eventually, Hi this metric will reach 16 and the routers will
̀ nh 18: Count to
determine that they cannot reach Network
infinity 1 through each other. This process is
called “Count to infinity”, and it can slow down convergence considerably.
Split Horizon is one solution to the convergence problem Split Horizon specifies
Count to infinity
that an interface must not send updates about a route to the interface it received the
route from. In other words, routers assume that the router from which they received
a route to an original destination is more directly connected and update on that
Count to infinity
destination. Split Horizon also minimizes the number of packets sent during normal
Hình 19: Count to
operations. infinity

*RIP time interval:

23
Interval Router Default
Update 30 seconds
Timeout 180 seconds
Poision 60 seconds
Flush 240 seconds

3.9.2 Configuration of OSPF


OSPF was designed to deal with some of the shortcomings of RIP. For example,
OSPF provides faster convergence and more complex methods for calculating the
best routes. Instead of sending routing table entries, routers send link-state ads
(LSAs) allowing partners to build network topologies faster, more accurately, over
time.
Because OSPF routers send each other more messages than RIP routers send, OSPF
can consume more bandwidth. However, OSPF minimizes the number of packets a
router has to send in a number of ways. In a point-to-point network, only
neighboring routers fully exchange their databases. In a multicast network, only one
router (DR) floods the LSAs. Additionally, OSPF interfaces only send their own
link-state updates instead of sending all routes detected by the protocol, like RIP
interfaces do.
LSA
OSPF is a link state protocol; Routers send each other LSAs to distribute information
about their connections to the network and to other routers. LSA helps routers
synchronize their databases. All routers in an AS (or region) must use the same
database to generate correct routes. OSPF defines several types of LSAs. Some of
these LSAs are flooded to all routers or DRs in an area, and some are sent to routers
throughout the AS. Interfaces in the stub do not listen for certain LSAs. OSPF
defines specific rules for synchronizing databases with minimal traffic between
routers. Any two routers that have an interface on the same network as neighbors
are capable of sending LSAs to each other. However, not all neighbors establish full
proximity - that is, exchange LSAs. OSPF establishes protocols by which all routers
can synchronize their databases without exchanging LSAs.
Point-to-Point Versus Multi-Access Networks
In a point-to-point network, a router only establishes full contiguity with the routers
to which it is directly connected. Even Frame Relay networks are based on
permanent point-to-point virtual circuits (PVCs) connected through interfaces on
Frame Relay.
In a multi-access subnet, such as an Ethernet network, a router can become a
neighbor to all other routers on the subnet. To minimize OSPF packets, routers
choose one DR and one BDR so that all other routers establish full adjacency. That
24
is, routers only send LSAs to DR and BDR. Only DR broadcasts LSA. If the DR
fails to transmit an LSA within a certain period of time, the BDR assumes it has
failed and accepts as a new DR.
Areas
One of the most important tasks of an OSPF network administrator is to group
subnets together into areas so that routers don't need to maintain a large and complex
database in order to smoothly route traffic to their destination. its destination. An
area is a group of subnets in an OSPF network, each of which runs its own copy of
OSPF and has its own topology database. This means that routers in separate areas
do not need to know each other's topology or exchange LSAs. As a result, database
synchronization consumes less bandwidth. Less powerful routers and routers that
mainly route traffic internally no longer have to keep routing tables wider than they
really need to be.
-Areas must be identified to:
 All areas connect to the network backbone, or zone 0.
 A network backbone consists of routers that interface on multi-site networks,
or ABRs.
 Adjacent network backbone.
Traffic in OSPF networks is divided into three categories:
 Intra-area traffic
 Inter-area traffic
 External traffic
The Autonomous System Border Router (ASBR) supports external traffic
(within a WAN with a single zone or multiple zones.) The ASBR connects to the
external network and runs both OSPF and the network's routing protocol.
outside. It then injects the external route, or a default route for external traffic,
into the OSPF network. The ASBR is usually in the network backbone, but it can
also be in the stub connecting to a remote site. When a stub area connects to a
remote site, it is called a nonstub area (NSSA).

25
OSPF Areas
̀
Hinh 20: OSPF
Stub Areas and Stub Routers: The stub Areas network is the network in which the
traffic terminates. The network receives traffic destined for its servers, but it does
not forward any traffic to another network. A stub area is an extension of the idea
of a stub network. OSPF Areas
Backbone(Area 0): Network's backbone, orOSPF
Hình 21: area 0, linking all stub areas. As
Areas
discussed above, it includes ABRs. Through exchanges with other ABRs in the
backbone, all ABRs keep a topological database for the entire network. They
generate route summaries for each non-backbone area. They then send these
OSPF Areas
route summaries to each other and to the internal routers they serve. Obviously,
the ABR has to handle more routes than the primitive router and correspondingly
requires more power. OSPF Areas
NSSA: NSSA is an area that resembles Hìnah stub area in many ways. It connects to
22: OSPF
Areas
the network backbone and usually does not redirect traffic to other areas.
However, a router in NSSA also connects to a remote site or an ISP through the
ASBR. Normally, OSPF will not allow external routes to be delivered into the
stub. However, internal routers within an NSSA may receive LSAs specifically
defined for external routes.
Route Computation
Routers use the information they receive from the LSA to assemble the AS's
topology (or, if configured, region) database. This database includes:
- Routers belong to separate AS or area
- Networks belonging to a separate AS or area
- Connections belong to a separate AS or area
- Cost for links belonging to a separate AS or area
26
OSPF Configuration Concerns
-Role of each router:
• Internal Router
• ABR
• ASBR
-ID of each router
-OSPF zone for each directly connected network
A common topology for WANs is with Headquarters (HQ) , defined as area 0, which
connects to stub areas at one or more remote locations. In this topology, headquarters
routers that connect to remote sites are ABRs. Routers at remote points are internal
routers. If a router connects to another public or external network, such as an ISP,
it's ASBR.

OSPF Network with Headquarters (HQ)- area 0


Hình 23: OSPF Network with Headquarters (HQ)- area 0
3.9.3 Configuration Hi
of̀ nhBGP
24: OSPF Network với Headquarters (HQ) là area 0

BGP is an external protocol: it allows different autonomous systems to exchange


routes. BGP is the protocol most ISPs use, and it was designed to allow diverse,
OSPF Network with Headquarters (HQ)- area 0
sometimes competing organizations to communicate:
Hình 25: OSPF Network với Headquarters (HQ) là area 0

27
OSPF Network with Headquarters (HQ)- area 0
Hình 26: OSPF Network với Headquarters (HQ) là area 0
-BGP can filter both the routes it receives and those it sends by bit length, thus
minimizing the number of routes exchanged.
-BGP uses policies to determine the best routes instead of the number of hops per
hop, as RIP does, or link states, as OSPF does. Autonomous systems can set their
own policies.
-The router only communicates with manually configured neighbors.
-Configure different policies to exchange routes with different neighbors
BGP runs under External BGP (eBGP), which is the protocol used to communicate
between two autonomous systems, and Internal BGP (iBGP), which is the protocol
that the AS uses to synchronize its own routing tables.
Enable BGP
To enable BGP, you must set the local AS number, then enter the context of BGP
configuration
Local Network Promotion
Specify the local networks that remote sites can access. Users should only advertise
networks originating from their AS.
Set up the router's ID
The BGP interface identifies itself with its neighbors by its router ID. Usually this
ID is the IP address of the logical interface connecting to each neighbor. It can also
be the address of the repeater interface used as the update source.
Configuration for BGP Neighborhood
BGP differs from many routing protocols because it does not allow a router to
automatically search for peers from which to obtain routes. You must configure a
separate BGP neighbor for each router with which the local router can communicate.
For each neighbor, you can configure a policy to specify the routes that the BGP
interface sends to and accepts from the neighbor.
Set up ID for BGP Neighbor
BGP identifies a peer router by its IP address. You set the neighbor's ID when
creating the policy for it.
Distinguish Local and Remote AS
The router includes the local AS number in the BGP routes it receives from your
router and advertises it to another peer. Typically, ISPs forbid their routers to
advertise routes using your AS on the path to outside neighbors. The local AS should
be the same number, assigned to you by your ISP, that you configured when BGP
was enabled.

28
Load Balancing
Multi-tier BGP routers connect to more than one ISP or more than one ISP router.
Such a router can legitimately forward external traffic through more than one
connection. Load balancing ensures that one connection is not used to the exclusion
of another. There are many ways to balance loads, some of which are quite complex
and beyond the scope of this configuration guide. This section will only give you
some general tips on ways you can try to distribute external traffic via:
-Multiple connections to the same neighbor on the same router
-Connect with multiple neighbors on the same router
-Connect to multiple neighbors on multiple routers
Load Balancing on the connections of different neighbors
- Balancing outgoing traffic: In this situation, the BGP route selection algorithm
automatically balances outbound traffic.
- Inbound Traffic Balancing: Manually balance incoming traffic by letting the router
advertise certain networks to one neighbor and others to the other neighbor.
Prefix configuration example
Router A in AS 1 connects to the Internet. It uses a default route for regular Internet
traffic, but needs routes to private networks at a remote VPN site. Each site in the
VPN uses addresses in the 10.1.0.0/16 range. To minimize the number of routes
routers have to learn, the organization decided that each site should advertise the
range. your subnet as a 20-bit network. For example, the local site uses subnets in
the 10.1.0.0/20 range, Site 2 uses the subnets in the 10.1.16.0/20 range, etc.
Configure route maps
The route map applied to outgoing data determines how the router advertises routes
to its neighbors. You can configure this route map to perform tasks like:
Define routes the router can advertise to:
• network address or prefix length
• AS that traffic must go through
• community properties
• metric
Create route map entries
You can apply a route map for each neighbor for outgoing data and a map for
incoming data. You can configure multiple policies in a single route map by creating
entries with the same name but different sequence numbers.

29
Configuration for community list
To create a community list, switch to the global configuration mode context. From
this mode context, you can select one or more clearly defined community
relationships. You can also enter a value for a privately defined community.
Configuration for AS path list
You can use the AS path list to select routes for a policy according to the values in
the route's AS field.
Define routes that routers can advertise
You can control whether the BGP interface advertises the route to the neighbor by
route:
-Network address
-Prefix length
-AS path
-Community
-Metric
Filter incoming routes
We can control the routes that the local router advertises to a neighbor, we can also
control the routes the router accepts from a neighbor. You can filter incoming routes
by:
-Destination network address and prefix length
-Community
-AS path

4. LAB MODELS OF RIP, OSPF, BGP


4.1 RIP’s lab model
4.1.1 Process of RIP
- RIP was developed over many years starting from version 1(RIPv1), RIP is just
an address layer routing protocol until version 2(RIPv2).
- RIP is the address classless routing protocol. RIPv2 has more features as follows:
 Provides more routing information
 There is a verification mechanism between routers when updating to
secure the routing table

30
 Support for VLSM(Varibale Length Subnet Masking) masks of different
lengths).
- RIP avoids infinite count loop routing by limiting the maximum number of hops
allowed from the sender to the receiver, the maximum number of hops per path
is 15. For the paths the router receives from the throughput. update of the
neighboring router, the router will increase the hop count by 1 because the router
considers itself a hop in the path. If, after increasing the hop index to 1, this index
is greater than 15, the router will consider the destination network not
corresponding to this path, so it cannot be reached. In addition, RIP has similar
characteristics to other routing protocols : RIP also has a horizon and holddown
to avoid updating incorrect routing information.

Topology diagram of RIP concentrate on R1 and R2


Hình 28: Topology diagram of RIP concentrate on R1 and R2

4.1.2 Compare RIPv1 and RIPv2


Topology diagram of RIP concentrate
RIPv1 RIPv2 on R1 and R2
Simple configuration Simple configuration
Routing by address class Address classless routing
Topology diagram
Do not send information of RIP concentrate
about subnet on R1 and
Send information aboutR2subnet mask in
mask in routing information routing information
Does not support VLSM. Therefore all VLSM support. Networks in an IPv2
networks in a RIPv1 system
Topology must ofhave
diagram system canon
RIP concentrate have
R1 different
and R2 subnet mask
the same subnet mask lengths
No mechanism to verify routing There is a mechanism to verify routing
information information

31
Send broadcasts at 255.255.255.255 Sending multicast to address 224.0.0.9
should be more efficient

RIPv2 Model
Hình 29: RIPv2
Model
4.2 OSPF’s lab model
4.2.1 Introduce
RIPv2 Model
OSPF is a link-state routing protocol implemented based on open standards. OSPF
is described in many standards of IETF (Internet Engineering Task Force), Open
standard here means OSPF is completely open to the public, no read rights.
RIPv2 Model
- Compared with RIPv1 and v2, OSPF is a better IGP internal routing protocol
because of its scalability. RIP is limited to 15 hops, converges slowly, and
RIPv2 Model
sometimes chooses a slow path because when deciding to choose, it does not
consider other important factors such as bandwidth. OSPF overcomes the
disadvantages of RIP and it is a powerful, scalable routing protocol that is suitable
for modern networks. OSPF can be configured as a single-zone to use small
networks.

32
Large OSPF networks are decentralized and divided into many areas
Hình 30: Large OSPF networks are decentralized and divided into many areas

- Large OSPF networks need to use a hierarchical design and divide into multiple zones.
These regions are all connected to the same partition 0, also known as the backbone
Large OSPF networks are decentralized and divided into many areas
area. This design allows for control over routing updates. Such partitioning reduces the
load of routing operations, speeds up convergence, limits the variability of the network
to each region, and increases operational efficiency.
Large OSPF networks are decentralized and divided into many areas
The following are the features of OSPF:
 It isLarge
a link-state routing protocol.
OSPF networks are decentralized and divided into many areas
 Used in RFC 2328.
 Use the SPF algorithm to calculate the best path.
 Update only when the network structure changes
4.2.2 How OSPF works
OSPF collects link state information from neighboring routers. Each OSPF router
advertises the status of its links and forwards the information it receives to all other
neighbors.
The router processes the information received to build a database of link state in an
area. All routers in the same OSPF zone will have this same database. Therefore, all
routers will have the same information about the state of the links and the neighbors
of the other routers. Each router applies the SPF algorithm and its database to
calculate the best path for the destination network. The SPF algorithm calculates the
cost of the link bandwidth. The path with the lowest cost is selected for inclusion in
the routing table .

33
- Each router keeps a list of intimate neighbors, this list is called the intimate
neighbor database. Neighbors that are called intimate are neighbors with which the
router has established a bidirectional relationship. A router can have many
neighbors, but not all neighbors have an intimate relationship. For each router the
intimate neighbor list will be different.
To reduce the amount of routing information exchanged with many neighboring
routers in the same network, OSPF routers elect a representative router called
Designate router (DR) and a redundant proxy router called Designated backup.
BDR) as the central point for routing information.
4.2.3 OSPF packet types
OSPF has 5 types of packets: Hello, Database Description, Link State Request, Link
State Update, and Link State Acknowledge.
Version Type Packet Length
Router ID
Area ID
Checksum Authentication Type
Authentication Data

OSPF’s Packet

- Hello: Hello packet is used to detect and exchange information about neighboring
OSPF’s Packet
routers.
- Database Description: This packet is used to select which router will be authorized
OSPF’s Packet
to exchange information first (master/slave).
Link State Request: This packet is used to specify the type of LSA to use during the
exchange of DBD packets.
OSPF’s Packet
- Link State Update: This packet is used to send LSA packets to the adjacent router
requesting this packet when it receives the Request message.
- Link State Acknowledge: This packet is used to signal that the Update packet has
been received

34
One-zone OSPF model
Hình 31: One-zone OSPF model

One-zone OSPF model

One-zone OSPF model

One-zone OSPF model

Multi-zone OSPF model


Hình 32: Multi-zone OSPF
model
4.3 BGP’s lab model
4.3.1 Introduction to eBGP and iBGP
Multi-zone OSPF model
Although BGP is designed to run routing between ASs, to run each of these
protocols we still have to configure each specific router. In an AS, a suitable number
of routers will be selected to run BGP. These
Multi-zone routers
OSPF modelwill shake hands and shake
hands with other AS routers to build a network of routers running BGP routing.
The handshake operation between routers running BGP is called BGP peering. In
Multi-zone OSPF model
this operation, two routers running BGP together will send each other BGP packets
to build a neighbor relationship; Once the neighbor relationship is successfully built,
the two routers can start exchanging routing information with each other.
The BGP routing protocol uses TCP as a transport method. BGP packets will be
encapsulated into TCP segments for exchange between the two routers. Therefore,
in order to build a BGP peering between two routers, first, a TCP connection must
be established between these two routers, the router that initiates the TCP connection
will use a random port greater than or equal to 1024 and the router receives

35
Receiving a connection must open port 179 for TCP. We say that BGP runs on TCP,
using port 179. Administrators need to understand to properly configure data control
devices (eg Firewall), control devices need to let through flows. TCP with port 179.
Another point worth noting when BGP uses TCP for transmission is that TCP does
not support sending data in groups, so the establishment of neighbor relationship
between two routers completely uses unicast method. That is, the administrator It
is mandatory to explicitly declare the IP address of each neighbor that the router is
considering to establish peering. Neighbors in BGP must in principle be declared
manually. BGP does not support automatic multicast neighbor setup as with internal
routing protocols.
A BGP neighbor relationship (or BGP peering) can be established between routers
belonging to the same AS or between routers located on two different ASs:
 The first case is called iBGP peering (internal BGP).
 The latter case is called eBGP peering (external BGP).

iBGP Peering ‘s Model


Hình 33: iBGP Peering ‘s
Model

iBGP Peering ‘s Model


Hình 34: Mô hình iBGP
peering

iBGP Peering ‘s Model


36

iBGP Peering ‘s Model


Hình 35: Mô hình iBGP
eBGP Peering ’s Model
Hình 36: iBGP Peering ‘s Model

Because BGP runs on top of TCP, two peer-to-peer BGP routers do not necessarily
connect directly to each other like internal routing protocols do. 2 routers that want to
eBGP
peering together just need to make Peering ’s Model
sure their 2 IP addresses can go to each other to be
able to establish a TCP connection
Hình 37: from
Mô hìnhbuilding TCP peering. However, this only
eBGP peering
applies to iBGP peering; With eBGP peering, the two routers still use direct IP
connections to establish peering with each other. We can configure the routers to
change, allowing two routerseBGPto Peering
build eBGP’s Model
peering with IP addresses that are not
directly connected to each other.
4.3.2 Data sheets of BGP
eBGP Peering ’s Model
 Neighbor table: ThisHìnhtable
38: Môincludes
hình eBGP all routers that have established BGP
peering
peering with the router under consideration. The information will list the IP
address of the neighbor router, the status of the peering relationship with this
neighbor, and many other related issues.

 BGP table: Neighbor routers that have successfully established peering with
the router in question will send all IP prefixes along with the best set of
parameters they can calculate to this router. The router under consideration
will put all received information into a repository called "BGP table". As a
mostly distance-vector-based protocol, a BGP router only advertises to its
neighbors the best "routes" it has. Thus, a router's BGP table is the repository
of the best routes provided by its neighbors.

 Routing table: The BGP router will use a process called BGP path selection
process (BGP path selection process) to scan the entire BGP table mentioned
above. This process selects the best routes out of the routes stored in the BGP

37
table to enter the routing table to use as the official route to the destination
networks, and the BGP router will continue to advertise the best routers.
select to the next neighbors. As mentioned, the BGP table already contains
the best routes advertised by neighbors for the router in question, so the BGP
routing table is where the "best of the best" routes are stored by the routing
process of the router. BGP.

* Distance-vector method: routers advertise routing information as IP prefixes in


the routing table with optimal metric values to reach these IP prefixes (broadcast
routes in routing). Each router running the distance-vector protocol has no
knowledge of the network topology but only sees no further than the neighbor
routers directly connected to it. Every routing decision that a router makes is based
entirely on the routing information provided by its neighbor, and the router will
choose the direction along which neighbor provides the information with the best
metric value. In order for the error to occur because a router cannot see the top of
the network, but relies entirely on neighbors for routing, distance-vector protocols
must have built-in anti-loop mechanisms to avoid decision-making situations.
Routing can cause loops in data transport.

*BGP route selection process

BGP routing information reception and filtering

 Router R hasHisuccessfully
̀ nh 39: BGP routing information
peered withreception and filtering
neighbors R1,R2,R3. Routers R1, R2,
R3 will send out BGP routing updates to advertise the best BGP routers they
have previously selected.
 Router R, whenBGP receiving
routing information receptionfrom
routing updates and filtering
neighbors, will aggregate
them all into a route "repository" called the BGP table. Thus, a router's BGP
table is the collection of all routing information it receives from its neighbors
BGP routing information reception and filtering

38
BGP routing information reception and filtering
 Next, router R will perform a "selection" from the "route store" in BGP to
find the best routes for each destination network. This selection follows a set
of rules that compare the path attributes of the routes to choose the optimal
route called the BGP Path Selection Process.
 The best routes selected above will be updated by router R into the routing
table for official use for data routing, and also advertised to the next neighbor
router. 1 router Path-vector or distance vector only advertises advertise the
neighbor to the best routes it has.
 Some common path attributes:
 AS-path: A character string that lists the ASNs of the ASs that an IP
prefix has propagated through to reach the router in question.

Example Of AS-path
Hình 40: Example Of AS-
From the figure above, we consider the process
path of prefix 192.168.1.0 propagating
from AS64520, through AS65500 and then to router B located on AS 65000. When
Hình 41: Ví dụ về AS-
router B displays information about 192.168.1.0
path that it received from BGP, 1 An
accompanying string of characters will appear indicating which AS this prefix has
passed before reaching router B. This string represents the ASN in order from closest
to furthest to router B: “65500 64250”.
 Next-hop: Similar to distance-vector
Example Of AS-path protocols, the next-hop is the
address of the neighbor router
Hình that
42: Víhas broadcast
dụ về AS- routing information
path
to the router in question , the next router to pass in its route to a certain
destination network. However, in handling routing information
advertised back and forth between ASs, since BGP is an external
routing protocol, the next-hop is treated as the inbound IP address of
the next AS en route toExample
the destination.
Of AS-path
Hình 43: Ví dụ về AS-
path

Example
39 Of AS-path
Hình 44: Ví dụ về AS-
path
Example Of Next-hop
̀
Hinh 45: Example Of
From the figure above, router A (AS 64520) advertises prefix 172.16.0.0 to router B via
Next-hop
an eBGP session with the next-hop in routing set to "10.10.10.3". In turn, router B
continues to advertise this prefix to router C. If like normal IGP protocols, B will
advertise the next-hop address for C as "172.20.10.1" - its own IP but since this is a
BGP-an external routing protocol, router B will still leave the next-hop "10.10.10.3" for
network 172.16.0.0 but broadcast Example
to router OfC. AsLocal
a result, C will receive routing updates
Preference
The route for prefix 172.16.0.0 has a next-hop of 10.10.10.3, and if C was not previously
routed to reach 10.10.10.3, C will
Hiǹ hnot 46:beVí
abledụtovềuse this routing update, henceforth
Unable to route data to networkLocal
172.16.0.0.
PreferenceExample
 Origin: There are many ways for a router to initially advertise IP
Of Next-hop
prefixes to the BGP network. The method used is to use the "network"
command to look up and advertise the IP prefix that is previously
present in the router's routing table to BGP.
There are three origin codesExample
that can appear in the Origin property:
Of Local
 “i”-“IGP”: This codePreference
indicates that the prefix in question is advertised by the
original router into BGP Hìnwith
h 47: Vía dụcommand.
về Local “network” or by the address
Preference
summary operation.
 “e”-“EGP”: This code indicates that the prefix under consideration is
advertised by the original router into BGP by redistributed routes of another
external routing protocol, EGP. EGP is an old external routing protocol, BGP
is almost the only external
Example routing
Of protocol
Local used, so unless the administrator
of the original routerPreference
intentionally sets the origin code to "e", we rarely see
origin codes. this in the BGP table.
 “?”-“Incomplete”: This̀ code indicates that the IP prefix was entered into
Hinh 48: Ví dụ về
Local
BGP by the original router by an unknown method.
PreferenceExample
Of Next-hop
40
 Local preference : A BGP base is established towards an IP prefix.
The principle that a BGP router chooses a path on the Local
Preference attribute comparison is: in many directions to the same
destination, the path with the highest value attached to Local
preference is considered the best and will be chosen as the best route.
official direction to the destination under consideration.

Example Of Local Preference


Hình 50: Example Of Local
From the above figure, we see thatPreference
inside AS64520 going to network 172.16.0.0 needs
to go out by gateway A and gateway
Hình B
51:just
Ví dụ for backup,
về Local the administrator will perform
Preference
configuration so that when A receives network 172.16.0.0, it will set the Local
Preference value to 200 for the prefix and then broadcast this network to the internal
routers, and router B will only set the Local Preference to 100 for the prefix when
broadcasting the received network to the internal routers. As a result, internal routers
Example
see that the direction to network Of Localthrough
172.16.0.0 Preference gateway A has a higher Local
Preference than gateway B will prioritize
Hình 52: Vígateway
dụ về LocalA's direction to route data to network
Preference
172.16.0.0, meeting the requirements. demand set.
 MED(Multi Exit Discriminator): Also called the metric attribute of
BGP. We need to distinguish from the concept of metric in IGPs
Example
because metric Of Local
(or MED) withPreference
BGP is only one attribute among many
different attributes
Hình used tovềevaluate
53: Ví dụ the optimality of a path.
Local Preference

Example Of Local Preference


Hình 54: Ví dụ về Local Preference

41
Example Of MED
Router A of AS 65000 performs network
Hình 55:advertisement
Example Of 172.16.0.0 to routers B and
MED
C of AS 65000. AS 65000 policy (router A side) wants that AS neighbor 65500
when sending data to network 172.16.0.0
Hình 56: needs
Ví dụ vềto go. to AS 65000 via the link
MED
between A and B, while the link between A and C is only for redundancy. If the
administrator of AS 65000 sets the MED attribute for network 172.16.0.0 to 150
when broadcasting to router B and 200 to router C. The internal routers of AS 65500
when considering two directions to network 172.16.0.0 through 2 gateways B and
Example
C will see that the direction through B OfhasMED
MED smaller than the MED of the
direction through C(150<200), so will
Hìnhchoose thevề direction through B to drive the
57: Ví dụ
data to 172.16.0.0. MED

 Weight: is an attribute that is only valid within a router, and is not


advertised with prefixes to other BGP peers. Another notable feature,
Weight is a BGP attribute given by Cisco and only appears on Cisco
Example
devices, BGP versions Of MED
of other brands do not have this attribute.
Hình 58: Ví dụ về
MED

Example Of MED
Hình 59: Ví dụ về
MED

Example Of Weight
Hình 60: Example Of
Weight
In the above example, router A receives routing updates to reach network 172.20.0.0
of AS 65520 from two directions, Hìnhvia
61: router
Ví dụ vềB and router C. In this case, the
MED
administrator wants router A to always choose the direction through B to go to
network 172.20.0.0, direction through C just for redundancy regardless of the
attributes on these two paths. By default, a BGP router will assign the value

42
Example Of Weight
Hình 62: Ví dụ về
MED
Weight=0 to all prefixes received from other routers and assign Weight=32768 to
prefixes that enter BGP itself (often called local routes). For the example under
consideration, router A will assign the value Weight=200 to prefix 172.20.0.0 when
receiving this prefix from router B and assign Weight = 150 to the same prefix when
receiving it from router C, from then on, router A will always choose direction B to
go to 172.20.0.0 and direction C just for backup.

5. Emulate a Cisco router on GNS3


5.1 About GN3
- GNS3 is a software used to emulate cisco router written by Cristophe Fillot,
it is similar to VMWare. However it uses real Cisco IOS to emulate the router.
- This software is written to:
+ Help people familiarize themselves with Cisco equipment.
+ Test and test features in IOS.
+ Test the network models before entering reality.

5.2 NS3’s Configuration

- Check the path to Dynamic and the working directory


- Select the path to the Dynamips folder and press Test to test and click
OK!

43
5.3 Load IOS for router
1. Go to Edit IOS images and hypervisor/IOS images.
2. Next, click on Router C3725, hold and drag and drop it into the box next to it.
Now we will see the Topology Summary tab, the router will be red, which means
the router is in turn off mode.
3. Turn up by right-clicking on the router, select start, you will see R1 green.
4. When you start, go to Task Manager and you will see that the CPU is 100%.
5. Using the Idle PC feature
6. Select the item marked with an asterisk
7. CPU has decreased significantly, now we proceed to configure the router
5.4 Learn the basic router configurations (how to assign IPs to interfaces,
check IP parameters).
5.4.1 Router config modes
Cisco routers have many modes (modes) when configuring, each mode has its own
characteristics, providing a number of features to configure the router.
- User mode or User EXEC Mode :
This is the first mode when starting a session with the router (via Console or
Telnet). In this mode we can only perform some common router commands
. These commands have the same effect as the show command or the clear
command for some counters of the router or interface. These commands will
not be written to the router's config file and therefore will not affect the
router's subsequent reboots.
- Privileged EXEC Mode:
To enter Privileged EXEC Mode, from User EXEC mode type enable and
password (if necessary), Privileged EXEC Mode provides important
commands to monitor router activity, access config files, IOS, set password..
Prvileged EXEC Mode is the key to enter Configuration Mode, which allows
you to configure all router functions.
- Configuration Mode:
As mentioned above, configuration mode allows configuring all Cisco router
functions including interfaces, routing protocols, console lines, vty(telnet),
tty (async connection). Commands in configuration mode will directly affect
the current configuration of the router contained in RAM (running-
configuration). If this configuration is written back to NVRAM, these
commands will take effect on subsequent reboots of the router.
+ Configuration Mode has many modes with many small modes, the first is
global configuration mode, then interface configuration mode, line configuration
mode,, routing configuration mode.

44
+ ROM Mode: ROM Mode is used for specialized tasks, directly interfering
with the router's hardware such as Recovery password, maintainance>
Usually in addition to the command lines that force the router into ROM
mode, the router will automatically Switch to ROM mode if the IOS file is
not found or the IOS file is damaged during the boot process.

45
Router Config’s Mode
Hình 65: Router Config’s
Mode

5.4.2 Basic configuration for router


Hình 66: Một số mode
5.4.2.1 Configure router namingconfig của router

- First, when configuring the router, we should name the router:

Router Config’s Mode

- ̀ nh Enter
Immediately after pressingHithe 67: Một
key số to
mode
execute the command, the prompt
config của router
changes from the default name to the newly set Router name.

5.4.2.2 Configure a password for the router

- Router
Change the password for Config’s Mode
the console:

Hình 68: Một số mode


config của router

46
Router Config’s Mode
- We also need to set a password for 1 or more vty to control users to remotely
access the router and telnet. Normally cisco router will have 5 vty lines with
the order from 0 to 4. We usually use 1 password for all vty lines, but
sometimes we should put a separate password for every line to backup both
The other 4 lines are all in use. Following are the commands that need to be
used to set the password for the vty lines:

- The enable and enable secret passwords are used to restrict access to
privileged EXEC mode. The eneable password is only used when we set the
enable secret password because this password is encrypted and the enable
password is not. The following are the commands used to set the enable secret
password:

- Sometimes we will find it unsafe when the password is clearly displayed


when using the show running-config or show startup-config command. To
avoid this we should encrypt all passwords displayed on the router's
configuration file:

5.4.2.3 Interface port configuration


- We can configure the interface port using the console or vty lines. Each port
must have an IP address and a subnet mask so that they can route IP packets.
To configure the IP, we use the command:

- By default, the communication ports on the router are closed. If we want to


open or start these commands, we must use the no shutdown command. If
you want to close the port for maintenance or troubleshooting, use the
shutdown command :

47
- Have Many show commands are used to check the contents of files on the
router and to find problems. In both privileged EXEC and user EXEC modes,
typing <<show?>> will show a list of show commands. Of course, there are
more show commands available in privileged EXEC mode than in user
EXEC mode.
- Show interface - displays the status of all communication ports on the router.
To see the status of a certain port, we add the name and ordinal number of
that port after the show interface command. Eg:

- There are also other show commands:


+ Display configuration file on RAM:

+ Show running configuration file:

+ Show routing table:

+ Display basic information about interfaces:

+ Show dynamic address resolution method:

+ Displays the global status and status of the communication ports that have
been configured with the Layer 3 protocol:

5.4.2.4 Static route lab model

48
Static route’s lab model
Hình 70: Static route’s lab model

Hình 71: Mô hình lab static route


- Set ip for interface ports on router R1.

Overview Of Network
Model Static route’s lab
model
Hình 72: Mô hình lab static route

- Configure the static route to be able to forward a packet from a source address
Overview Of Network
to a destination address inModel
the network.

- Checking the routing table of router NgocR1 we see that the router has
learned the network route 192.169.1.0/24
Top layer‘s network
model

Hiǹ h 73: Mô hình mạng


tầng trên cùngOverview Of
Network Model Static
- Set ip for interface ports on router R2.
route’s lab model
Hình 74: Mô hình lab static route

Overview Of Network
Model Static route’s lab
model
Hình 75: Mô hình lab static route
49
- Configure the static route to be able to forward a packet from a source address
to a destination address in the network.

- Check the routing table of router NgocR2.

6. INSTALLATION INSTALLATION
6 . FIrst Network model

Overview Of Network Model


Hình 76: Overview Of Network Model

50
Top layer‘s network model
Hình 77: Mô hình mạng tầng trên
cùngOverview Of Network Model
Top layer‘s network model
Hình 81: Top layer‘s network model

Hình 82: Mô hình mạng tầng trên cùng

Top layer‘s network model


Hình 83: Mô hình mạng tầng trên cùng

Top layer‘s network model

ngocle.vn Hình 84: Mô hình mạng tầng trên cùng

ngocle.vn

Top layer‘s network model


ngocle.vn
HìnNgocLe.vn
h 85: Mô hình mạng tầng trên cùng

ngocle.vn
NgocLe.vn

The middle and lower layer network model (1)


Hình 86: The middle and lower layer network model (1)
NgocLe.vn

Hình 87: Mô hình mạng tầng giữa và tầng dưới (1)

NgocLe.vn

The middle and lower layer network model (1)


Hình 88: Mô hình mạng tầng giữa và tầng dưới (1)
51
The middle and lower layer network model (2)
Hình 91: The middle and lower layer network model (2)
In my model, Error! Reference source not found., Error! Reference source not
Hình 92: Mô hình mạng tầng giữa và tầng dưới (2
found.are models using OSPF, Error! Reference source not found.will use RIP for
routing. )

6.2 General settings (using the Linux OS commandline)


- Install set quagga:
Throughput vs. speed of nodes
Hình 93: Tốc độ của các nút so với thông lượng với hai định
tuyến AODV và OSPFThe middle and lower layer
network model (2)
Hình 94: Mô hình mạng tầng giữa và tầng dưới (2

- Install set telnet:

Throughput vs. speed of nodes


Hình 95: Tốc độ của các nút so với thông lượng với hai định
tuyến AODV và OSPFThe middle and lower layer
network model (2)
- Hìnpermission
Set create sysctl give ip_forwarding
h 96: Mô hình mạng todưới
tầng giữa và tầng Turn(2 your PC into a router:

52
Throughput vs. speed of nodes
Hình 97: Tốc độ của các nút so với thông lượng với hai định
tuyến AODV và OSPFThe middle and lower layer
6.3 Deploying the top-of-the-line network model
6.3.1 IP Configuration
- Configure router R3:
+ enp0s3 (128.123.1.2/16):

+ enp0s8 (192.168.2.1/24):

+ enp0s9 (192.168.1.1/24):

53
- Configure router R4 :
+ enp0s3 (192.168.2.2/24):

+ enp0s8 (192.168.3.1/24):

+ enp0s9 (192.168.4.1/24):

- Configure router R5 :
+ enp0s3 (192.168.1.2/24):

+ enp0s8 (192.168.3.2/24):

54
+ enp0s9 (192.168.5.1/24):

- Config PC1 (192.168.4.10/24):

- Config PC2 (192.168.5.10/24):

55
- Config router R9
+ enp0s3
+ enp0s8
- Config router R10
+ enp0s3
+ enp0s8

6.3.2 Config of OSPF routers


- Config for R3:
+ Configure zebra.conf :

+ Config ospfd.conf :

“default-information originate always” information helps other routers in AS set


default gateway through R6.

- Config for R4:


+ Configure zebra.conf :

56
+ Config ospfd.conf :

- Config for R5:


+ Configure zebra.conf :

+ Config ospfd.conf :

- Config for R10:


+ Configure zebra.conf :

57
+ Config ospfd.conf :

6.3.3 Operating the OSPF model on the top layer


Note : All routers have iptables turned off.
 Start dynamic ospf on router R3

 Start dynamic ospf on router R4

 Check on routers, see that the addresses have been updated in the routing table
+R3:

58
+R4:

+R5:

6.4 Deploy the middle and lower layer network model


6.4.1 IP Configuration
- Configure router R6:

59
+ enp0s3 (119.118.1.2/16):

+ enp0s8 (192.169.2.1/24):

+ enp0s9 (192.169.1.1/24):

- Configure router R7:


+ enp0s3 (192.169.2.2/24):

+ enp0s8 (192.169.3.1/24):

60
+ enp0s9 (192.169.4.1/24):

- Configure router R8:


+ enp0s3 (192.169.1.2/24):

+ enp0s8 (192.169.3.2/24):

+ enp0s9 (192.169.5.1/24):

- Config PC3 (192.169.4.10/24):

61
- Config PC4 (192.169.5.10/24):

6.4.2 Configuration RIP router


- Configure router R6 :
+ Config zebra.conf :

+ Config ripd.conf :

62
“default- information originate” information helps other routers in AS set default
gateway through R6 .

- Configure router R7 :
+ Config zebra.conf :

+ Config ripd.conf :

63
- Configure router R8 :
+ Config zebra.conf :

+ Config ripd.conf :

6.4.3 RIP operation on middle and lower layer network model


Note : All routers have iptables turned off
 Start rip on router R6 :

64
 Start rip on router R7:

 Start rip on router R8:

 Checking on routers, the addresses have been updated to the routing table:
+R6:

+R7:

65
+R8:

6.5 Deploy top layer network model


6.5.1 IP Configuration
- Configure router R0:
+ enp0s3 (12.1.1.1/8):

+ eth6 (10.1.2.1/8):

66
- Configure router R0:
+ enp0s3 (12.2.1.1/8):

+ enp0s8 (11.1.1.1/8):

+ enp0s9 (128.123.1.1/16):

- Configure router R2:


+ enp0s3 (10.1.3.1/8):

+ enp0s8 (11.2.1.1/8):

67
+ enp0s9 (129.118.18.1/16):

6.5.2 Config for OSPF routers


- Configure router R0:
+ Configure zebra.conf :

+ Config ospfd.conf :

68
- Configure router R1:
+ Configure zebra.conf :

+ Config ospfd.conf :

69
- Configure router R2:
+ Configure zebra.conf :

+ Config ospfd.conf :

70
6.5.3 Operating OSPF on top layer’s network model
Note : All routers have iptables turned off
 Start OSPF dynamics on router R0:

 Start OSPF dynamics on router R1:

 Start OSPF dynamic on router R2:

71
 Checking on routers, the addresses have been updated to the routing table:
+ Router R0:

+ Router R1:

+ Router R2:

72
6.6 Configure BGP for routers
6.6.1 IP Configuration
In the model, BGP routers need to be configured including routers: R1, R2, R3, R6
- Config R1:

- Config R2:

- Config R3:

73
- Config R6:

- Config R9:

6.6.2 Operate BGP across the network model


- Config R1:

- Config R2:

- Config R3:

- Config R6:

74
- Check the routing table on BGP routers:
+ R1:

+ R2:

75
+ R3:

+ R6:

76
+ R9:

7 SYSTEM OPERATION
7.1 Check connection by ping and tracepath
- Ping from PC1 to PC2:

77
- Ping from PC1 to PC3:

- Ping from PC3 to PC1:

78
- Ping from PC3 to PC4:

7.2 OSPF responsiveness test with AS 1


On router R3, based on the routing table, we see that the path to the networks
192.168.4.0 and 192.168.3.0 goes through 192.168.2.2.

We proceed to disconnect enp0s8 of router R3 to check the ability to change OSPF.


Checking the routing table again, we see that the route has changed.

Thus, the system can respond well to changes in the network (e.g. enp0s8 is
disconnected when the wire breaks).
• Performing a test ping from R3 to PC1 (192.168.4.10/24) is still successful:
79
 Performing a test ping from PC1 to PC3 (192.169.4.10/24) is still successful:

7.3 Check the responsiveness of RIP with AS 2


On router R7, based on the routing table, we see that the path to the networks
192.169.2.0 and 129.18.0.0 goes through 192.169.2.2 (eth5).

80
We proceed to disconnect enp0s3 of router R7 to check the ability to change RIP.

Checking the routing table again, we see that the route has changed.
.

Try pinging PC3 to PC4 (192.169.5.10) and PC3 to PC1 (192.168.4.10) is still
successful:

7.4 Steps to test the system by installing and connecting to DNS servers
- Install DNS mydomain.vn and configure file name.domain.vn
- Install DNS NgocLe.vn on PC1
 Configure file named.conf
 Configure file named.NgocLe.vn
- Install DNS ngocle.vn on PC0
 Configure file named.conf
 Configure file named.ngocle.vn
- Check the connection to the DNS server with the dig and nslookup
commands
- Send mail from DNS servers
81
 Send email from NgocLe.vn to mydomain.vn
 Config file named.NgocLe.vn on PC1
 Send email from NgocLe.vn to mydomain.vn
 Received on mydomain.vn from NgocLe.vn
 Send mail from ngocle.vn to mydomain.vn
 Config named.ngocle.vn on PC0
 Send email from ngocle.vn to mydomain.vn
 Received email on mydomain.vn from ngocle.vn

8. SIMULATION ON C
8.1 Simulation RIP
- struct definition for ripd:
static struct option longopts[] =
{
{ "daemon", no_argument, NULL, 'd'},
{ "config_file", required_argument, NULL, 'f'},
{ "pid_file", required_argument, NULL, 'i'},
{ "help", no_argument, NULL, 'h'},
{ "dryrun", no_argument, NULL, 'C'},
{ "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'},
{ "retain", no_argument, NULL, 'r'},
{ "user", required_argument, NULL, 'u'},
{ "group", required_argument, NULL, 'g'},
{ "version", no_argument, NULL, 'v'},
{0}
};

- ripd's priviledges:
zebra_capabilities_t _caps_p [] =
{
ZCAP_NET_RAW,
ZCAP_BIND
};

struct zebra_privs_t ripd_privs =


{
#if defined(QUAGGA_USER)
.user = QUAGGA_USER,
82
#endif
#if defined QUAGGA_GROUP
.group = QUAGGA_GROUP,
#endif
#ifdef VTY_GROUP
.vty_group = VTY_GROUP,
#endif
.caps_p = _caps_p,
.cap_num_p = 2,
.cap_num_i = 0
};

- Configure files and libraries:


char config_default[] = SYSCONFDIR RIPD_DEFAULT_CONFIG;
char *config_file = NULL;

- The name of the program that runs the ripd simulation, first declare the rein
mode of the route:
int retain_mode = 0;

- Declare rip vty(virtual teletype):


char *vty_addr = NULL;

- Declare the connection port of rip vty:


int vty_port = RIP_VTY_PORT;

- Declare the path structure:


struct thread_master *master;

- Declare the ID of the process used by the input system:


const char *pid_file = PATH_RIPD_PID;

- Show information:
static void
usage (char *progname, int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n", progname);
else
{
printf("Usage : %s [OPTION...]\n\
Daemon which manages RIP versions 1 and 2.\n\n\
-d, --daemon Runs in daemon mode\n\

83
-f, --config_file Set configuration file name\n\
-i, --pid_file Set process identifier file name\n\
-A, --vty_addr Set vty's bind address\n\
-P, --vty_port Set vty's port number\n\
-C, --dryrun Check configuration for validity and exit\n\
-r, --retain When program terminates, retain added route by ripd.\n\
-u, --user User to run as\n\
-g, --group Group to run as\n\
-v, --version Print program version\n\
-h, --help Display this help and exit\n\
\n\
Report bugs to %s\n", progname, ZEBRA_BUG_ADDRESS);
}

exit (status);
}

- SIGNUP handlers:
static void
sighup (void)
{
zlog_info ("SIGHUP received");
rip_clean();
rip_reset();
zlog_info ("ripd restarting!");

/* Reload configuration file. */


vty_read_config (config_file, config_default);

/* Create sockets for VTY*/


vty_serv_sock (vty_addr, vty_port, RIP_VTYSH_PATH);
}

- SIGINT handler:
static void
sign (void)
{
zlog_notice ("Terminate on signal");

if (! retain_mode)
rip_clean();

exit (0);

84
}

- SIGUSR1 handler:
static void
sigusr1 (void)
{
zlog_rotate(NULL);
}

static struct quagga_signal_t ripd_signals[] =


{
{
.signal = SIGHUP,
.handler = &sighup,
},
{
.signal = SIGUSR1,
.handler = &sigusr1,
},
{
.signal = SIGINT,
.handler = &signit,
},
{
.signal = SIGTERM,
.handler = &signit,
},
};

- ripd's main route:


int
main(int argc, char **argv)
{
char *p;
int daemon_mode = 0;
int dryrun = 0;
char *progname;
struct thread thread;

/* Initialize umask before entering security*/


umask (0027);

/* Get program name. */

85
progname = ((p = strrchr (argv[0], '/')) ? ++p : argv[0]);

/* First need to log init. */


zlog_default = openzlog(progname, ZLOG_RIP,
LOG_CONS|LOG_NDELAY|LOG_PID,
LOG_DAEMON);

/* Command line option parse. */


while (1)
{
int opt;

opt = getopt_long(argc, argv, "df:i:hA:P:u:g:rvC", longopts, 0);

if (opt == EOF)
break;

switch (opt)
{
case 0:
break;
case 'd':
daemon_mode = 1;
break;
case 'f':
config_file = optarg;
break;
case 'A':
vty_addr = optarg;
break;
case 'i':
pid_file = optarg;
break;
case 'P':
/* Deal with atoi() returning 0 on failure, and ripd not
listening on rip port... */
if (strcmp(optarg, "0") == 0)
{
vty_port = 0;
break;
}
vty_port = atoi(optarg);
if (vty_port <= 0 || vty_port > 0xffff)

86
vty_port = RIP_VTY_PORT;
break;
case 'r':
retain_mode = 1;
break;
case 'C':
dryrun = 1;
break;
case 'u':
ripd_privs.user = optarg;
break;
case 'g':
ripd_privs.group = optarg;
break;
case 'v':
print_version(progname);
exit (0);
break;
case 'h':
usage(progname, 0);
break;
default:
usage(progname, 1);
break;
}
}

/* Prepare master thread. */


master = thread_master_create();

/* Initialize the library . */


zprivs_init (&ripd_privs);
signal_init (master, Q_SIGC(ripd_signals), ripd_signals);
cmd_init (1);
vty_init (master);
memory_init();
keychain_init();

/* RIP related initialization. */


rip_init();
rip_if_init();
rip_zclient_init();
rip_peer_init();

87
/* Sort all connection statements */
sort_node();

/* Get configuration file */


vty_read_config (config_file, config_default);

/* Start execution only if not in dry-run mode */


if(dryrun)
return (0);

/* Change program to run demon*/


if (daemon_mode && daemon(0, 0) < 0)
{
zlog_err("RIPd daemon failed: %s", strerror(errno));
exit (1);
}

/* Pid file create. */


pid_output(pid_file);

/* Create sockets for VTY*/


vty_serv_sock (vty_addr, vty_port, RIP_VTYSH_PATH);

/* Print banners. */
zlog_notice ("RIPd %s starting: vty@%d", QUAGGA_VERSION,
vty_port);

/* Execute thread. */
while (thread_fetch (master, &thread))
thread_call (&thread);

/* Inaccessible. */
return (0);
}

8.2 Simulate OSPF _


- Set privileges for ospfd:
zebra_capabilities_t _ caps_p [] =
{

88
ZCAP_NET_RAW,
ZCAP_BIND,
ZCAP_NET_ADMIN,
};

struct zebra_privs_t ospfd_privs =


{
#if defined( QUAGGA_USER) && defined(QUAGGA_GROUP)
.user = QUAGGA_USER,
.group = QUAGGA_GROUP,
# endif
#if defined( VTY_GROUP)
. vty _group = VTY_GROUP,
# endif
. caps _p = _ caps_p ,
. cap_num_p = sizeof (_ caps_p )/ sizeof (_ caps_ p [ 0]),
. cap_num_i = 0
};

- Configure filename and library:


char config_ default [ ] = SYSCONFDIR OSPF_DEFAULT_CONFIG;

- Select ospfd:
struct option longopts [ ] =
{
{ " daemon", no_argument , NULL, 'd'},
{ " config_file ", required_argument , NULL, 'f'},
{ " pid_file ", required_argument , NULL, ' i '},
{ " dryrun ", no_argument , NULL, 'C'},

89
{ " help", no_argument , NULL, 'h'},
{ " vty_addr ", required_argument , NULL, 'A'},
{ " vty_port ", required_argument , NULL, 'P'},
{ " user", required_argument , NULL, 'u'},
{ " group", required_argument , NULL, 'g'},
{ " apiserver ", no_argument , NULL, 'a'},
{ " version", no_argument , NULL, 'v'},
{0}
};
- Name of program running osfd simulation, declare master thread:
struct thread_master *master;

- Declare the ID of the process used by the input system:


const char * pid_file = PATH_OSPFD_PID;

# ifdef SUPPORT_OSPF_API
extern int ospf_apiserver_enable ;
#endif /* SUPPORT_OSPF_API */

- Show information:
static void __attribute__ (( noreturn ))
usage (char * progname , int status)
{
if ( status ! = 0)
fprintf (stderr, "Try `%s --help' for more information.\n", progname );
else
{
printf (" Usage : %s [OPTION...]\n\
Daemon which manages OSPF.\n\n\

90
-d, --daemon Runs in daemon mode\n\
-f, -- config_ file Set configuration file name\n\
- i , -- pid_file Set process identifier file name\n\
-A, -- vty_addr Set vty's bind address\n\
-P, -- vty_port Set vty's port number\n\
-u, --user User to run as\n\
-g, --group Group to run as\n\
-a. -- apiserver Enable OSPF apiserver \n\
-v, --version Print program version\n\
-C, -- dryrun Check configuration for validity and exit\n\
-h, --help Display this help and exit\n\
\n\
Report bugs to %s\n", progname , ZEBRA_BUG_ADDRESS);
}
exit (status);
}

91
- SIGHUP handler :
static void sighup (void)
{
zlog (NULL, LOG_INFO, "SIGHUP received");
}

/* SIGINT / SIGTERM handler. */


static void
sign (void)
{
zlog_notice ("Terminate on signal");
ospf_terminate ();
}

- SIGUSR1 handler :
static void sigusr1 (void)
{
zlog_rotate (NULL);
}

struct quagga_signal_t ospf_ signals [ ] =


{
{
.signal = SIGHUP,
.handler = & sighup ,
},
{
.signal = SIGUSR1,
.handler = &sigusr1,

92
},
{
.signal = SIGINT,
.handler = & sigint ,
},
{
.signal = SIGTERM,
.handler = & sigint ,
},
};

93
- ripd :
int main (int argc , char ** argv )
{
char *p;
char * vty_addr = NULL;
int vty_port = OSPF_VTY_PORT;
int daemon_mode = 0;
char * config_file = NULL;
char * progname ;
struct thread thread ;
int dryrun = 0;

/* Start create umask before security */


umask (0027);

/* get program name */


progname = ((p = strrchr ( argv [ 0], '/')) ? ++ p : argv [0]);

/* Call the function by authorized user */


if ( geteuid ( ) ! = 0)
{
errno = EPERM;
perror ( progname );
exit (1);
}

zlog_default = openzlog ( progname , ZLOG_OSPF,


LOG_CONS|LOG_NDELAY|LOG_PID, LOG_DAEMON);

94
/* OSPF master init. */
ospf_master_init ();

# ifdef SUPPORT_OSPF_API
/* OSPF apiserver is disabled by default. */
ospf_apiserver_enable = 0;
#endif /* SUPPORT_OSPF_API */

while (1)
{
int opt;

opt = getopt_long ( argc , argv , " df:i :hA:P:u:g:avC ", longopts , 0);

if (opt == EOF)
break;

switch (opt)
{
case 0:
break;
case 'd':
daemon_mode = 1;
break;
case 'f':
config_file = optarg ;
break;
case 'A':
vty_addr = optarg ;

95
break;
case ' i ':
pid_file = optarg ;
break;
case 'P':
/* Deal with atoi ( ) returning 0 on failure, and ospfd not
listening on ospfd port... */
if ( strcmp ( optarg , "0") == 0)
{
vty_port = 0;
break;
}
vty_port = atoi ( optarg );
if ( vty_port <= 0 || vty_port > 0xffff)
vty_port = OSPF_VTY_PORT;
break;
case 'u':
ospfd_privs.user = optarg ;
break;
case 'g':
ospfd_ privs.group = optarg ;
break;
# ifdef SUPPORT_OSPF_API
case 'a':
ospf_apiserver_enable = 1;
break;
#endif /* SUPPORT_OSPF_API */
case 'v':
print_version ( progname );

96
exit (0);
break;
case 'C':
dryrun = 1;
break;
case 'h':
usage ( progname , 0);
break;
default:
usage ( progname , 1);
break;
}
}

/ * Initialize . */
master = om->master;

/* Initialize library . */
zprivs_init (& ospfd_privs );
signal_init (master, Q_ SIGC( ospf_signals ), ospf_signals );
cmd_init (1);
debug_init ();
vty_init (master);
memory_init ();

access_list_init ();
prefix_list_init ();

/* OSPFd inits . */

97
ospf_if_init ();
ospf_zebra_init ();

/* OSPF vty inits . */


ospf_vty_init ();
ospf_vty_show_init ();

ospf_route_map_init ();
# ifdef HAVE_SNMP
ospf_snmp_init ();
#endif /* HAVE_SNMP */
# ifdef HAVE_OPAQUE_LSA
ospf_opaque_init ();
#endif /* HAVE_OPAQUE_LSA */

sort_node ();

/* Get configuration file . * /


vty_read_config ( config_file , config_default );

/* Start execution only if not in dry-run mode */


if ( dryrun )
return( 0);

/* Change daemon program . */


if ( daemon_mode && daemon(0, 0) < 0)
{
zlog_ err ( " OSPFd daemon failed: %s", strerror ( errno ));
exit (1);

98
}

/* Process id file create. */


pid_output ( pid_file );

/* Create socket for VTY */


vty_serv_sock ( vty_addr , vty_port , OSPF_VTYSH_PATH);

/* Print banners. */
zlog_notice (" OSPFd %s starting: vty @%d", QUAGGA_VERSION, vty_port );

/* Fetch the next active thread . */


while ( thread_fetch (master, &thread))
thread_call (&thread);

/* Not reached. */
return (0);
}

8.3 Simulation BGP _

- Select BGP, use GNU get opt library :

static const struct option longopts [ ] =

{ " daemon", no_argument , NULL, 'd'},

{ " config_file ", required_argument , NULL, 'f'},

{ " pid_file ", required_argument , NULL, ' i '},

99
{ " bgp_port ", required_argument , NULL, 'p'},

{ " listenon ", required_argument , NULL, 'l'},

{ " vty_addr ", required_argument , NULL, 'A'},

{ " vty_port ", required_argument , NULL, 'P'},

{ " retain", no_argument , NULL, 'r'},

{ " no_kernel ", no_argument , NULL, 'n'},

{ " user", required_argument , NULL, 'u'},

{ " group", required_argument , NULL, 'g'},

{ " version", no_argument , NULL, 'v'},

{ " dryrun ", no_argument , NULL, 'C'},

{ " help", no_argument , NULL, 'h'},

{ " import-check", no_argument , NULL, 'I'},

{0}

};

- Signal definition :

void sighup (void);

void sign (void);

void sigusr1 (void);

static void bgp_exit (int);

static struct quagga_signal_t bgp_ signals [ ] =

100
{

.signal = SIGHUP,

.handler = & sighup ,

},

.signal = SIGUSR1,

.handler = &sigusr1,

},

.signal = SIGINT,

.handler = & sigint ,

},

.signal = SIGTERM,

.handler = & sigint ,

},

};

- Configure files and libraries:

char config_ default [ ] = SYSCONFDIR BGP_DEFAULT_CONFIG;

- Declare the route's retain mode:

static int retain_mode = 0;

101
/* Master of threads. */

struct thread_master *master;

- Separate classification of configuration files:

char * config_file = NULL;

- Declare the ID of the process used by the input system:

static const char * pid_file = PATH_BGPD_PID;

- Port and address of VTY:

int vty_port = BGP_VTY_PORT;

char * vty_addr = NULL;

- Authorization :

static zebra_capabilities_t _ caps_p [] =

ZCAP_BIND,

ZCAP_NET_RAW,

ZCAP_NET_ADMIN,

};

struct zebra_privs_t bgpd_privs =

#if defined( QUAGGA_USER) && defined(QUAGGA_GROUP)

.user = QUAGGA_USER,

102
.group = QUAGGA_GROUP,

# endif

# ifdef VTY_GROUP

. vty _group = VTY_GROUP,

# endif

. caps _p = _ caps_p ,

. cap_num_p = sizeof (_ caps_p )/ sizeof (_ caps_ p [ 0]),

. cap_num_i = 0,

};

- Show information:

static void usage (char * progname , int status)

if ( status ! = 0)

fprintf (stderr, "Try `%s --help' for more information.\n", progname );

else

printf (" Usage : %s [OPTION...]\n\n\

Daemon which manages kernel routing table management and \

redistribution between different routing protocols.\n\n\

-d, --daemon Runs in daemon mode\n\

-f, -- config_ file Set configuration file name\n\

- i , -- pid_file Set process identifier file name\n\

-p, -- bgp_port Set bgp protocol's port number\n\

103
-l, -- listenon Listen on specified address (implies - n)\n\

-A, -- vty_addr Set vty's bind address\n\

-P, -- vty_port Set vty's port number\n\

-r, --retain When program terminates, retain added route by bgpd .\n\

-n, -- no_kernel Do not install route to kernel.\n\

-u, --user User to run as\n\

-g, --group Group to run as\n\

-v, --version Print program version\n\

-C, -- dryrun Check configuration for validity and exit\n\

-h, --help Display this help and exit\n\

\n\

Report bugs to %s\n", progname , ZEBRA_BUG_ADDRESS);

exit (status);

104
- SIGHUP handler

void

sighup (void)

zlog (NULL, LOG_INFO, "SIGHUP received");

/* Terminate all threads. */

bgp_terminate ();

bgp_reset ();

zlog_info (" bgpd restarting!");

/* Reload the configuration file . */

vty_read_config ( config_file , config_default );

/* Create VTY sockets */

vty_serv_sock ( vty_addr , vty_port , BGP_VTYSH_PATH);

/* Try to return to normal operation. */

- SIGINT handler :

void

sign (void)

105
zlog_notice ("Terminate on signal");

if (! retain_mode )

bgp_terminate ();

zprivs_terminate (& bgpd_privs );

bgp_exit (0);

- SIGUSR1 handler :

void

sigusr1 (void)

zlog_rotate (NULL);

/*

Try to free up allocations we know about so that diagnostic tools such as

valgrind are able to better illuminate leaks.

Zebra route removal and protocol teardown are not meant to be done here.

For example, " retain_mode " may be set.

*/

static void bgp_exit (int status)

106
{

struct bgp * bgp ;

struct listnode *node, * nnode ;

int *socket;

struct interface * ifp ;

extern struct zclient * zclient ;

extern struct zclient * zlookup ;

/* clan exit */

assert(status == 0);

/* reverse bgp_master_init */

for (ALL_LIST_ELEMENTS (bm-> bgp , node, nnode , bgp ))

bgp_delete ( bgp );

list_free (bm-> bgp );

/* reverse bgp_master_init */

for (ALL_LIST_ELEMENTS_ RO( bm-> listen_sockets , node, socket))

if (close ((int)(long)socket) == -1)

zlog_err ("close (%d): %s", (int)(long)socket, safe_strerror ( errno ));

list_delete (bm-> listen_sockets );

107
/* reverse bgp_zebra_init / if_init */

if ( retain_mode )

if_add_hook (IF_DELETE_HOOK, NULL);

for (ALL_LIST_ELEMENTS ( iflist , node, nnode , ifp ))

struct listnode * c_node , * c_nnode ;

struct connected *c;

for (ALL_LIST_ELEMENTS ( ifp ->connected, c_node , c_nnode , c))

bgp_connected_delete (c);

if_delete ( ifp );

list_free ( iflist );

/* reverse bgp_attr_init */

bgp_attr_finish ();

/* reverse bgp_dump_init */

bgp_dump_finish ();

/* reverse bgp_route_init */

bgp_route_finish ();

108
/* reverse bgp_route_map_init / route_map_init */

route_map_finish ();

/* reverse bgp_scan_init */

bgp_scan_finish ();

/* reverse access_list_init */

access_list_add_hook (NULL);

access_list_delete_hook (NULL);

access_list_reset ();

/* reverse bgp_filter_init */

as_list_add_hook (NULL);

as_list_delete_hook (NULL);

bgp_filter_reset ();

/* reverse prefix_list_init */

prefix_list_add_hook (NULL);

prefix_list_delete_hook (NULL);

prefix_list_reset ();

/* reverse community_list_init */

community_list_terminate ( bgp_clist );

109
cmd_terminate ();

vty_terminate ();

if ( zclient )

zclient_free ( zclient );

if ( zlookup )

zclient_free ( zlookup );

if ( bgp_nexthop_buf )

stream_free ( bgp_nexthop_buf );

/* reverse bgp_master_init */

if (master)

thread_master_free (master);

if ( zlog_default )

closezlog ( zlog_default );

if (CONF_BGP_DEBUG (normal, NORMAL))

log_memstats_stderr (" bgpd ");

exit (status);

110
- bgpd :

int

main (int argc , char ** argv )

char *p;

int opt;

int daemon_mode = 0;

int dryrun = 0;

char * progname ;

struct thread thread ;

int tmp_port ;

/* Set umask before anything for security */

umask (0027);

/* Preserve name of myself. */

progname = ((p = strrchr ( argv [ 0], '/')) ? ++ p : argv [0]);

zlog_default = openzlog ( progname , ZLOG_BGP,

LOG_CONS|LOG_NDELAY|LOG_PID, LOG_DAEMON);

/* BGP master init. */

bgp_master_init ();

111
/* Command line argument treatment. */

while (1)

opt = getopt_long ( argc , argv , " df:i :hp:l:A:P:rnu:g:vCI ", longopts , 0);

if (opt == EOF)

break;

switch (opt)

case 0:

break;

case 'd':

daemon_mode = 1;

break;

case 'f':

config_file = optarg ;

break;

case ' i ':

pid_file = optarg ;

break;

case 'p':

tmp_port = atoi ( optarg );

if ( tmp_port <= 0 || tmp_port > 0xffff)

112
bm->port = BGP_PORT_DEFAULT;

else

bm->port = tmp_port ;

break;

case 'A':

vty_addr = optarg ;

break;

case 'P':

/* Deal with atoi ( ) returning 0 on failure, and bgpd not

listening on bgp port... */

if ( strcmp ( optarg , "0") == 0)

vty_port = 0;

break;

vty_port = atoi ( optarg );

if ( vty_port <= 0 || vty_port > 0xffff)

vty_port = BGP_VTY_PORT;

break;

case 'r':

retain_mode = 1;

break;

case 'l':

bm->address = optarg ;

113
/* listenon implies -n */

case 'n':

bgp_option_set (BGP_OPT_NO_FIB);

break;

case 'u':

bgpd_privs.user = optarg ;

break;

case 'g':

bgpd_ privs.group = optarg ;

break;

case 'v':

print_version ( progname );

exit (0);

break;

case 'C':

dryrun = 1;

break;

case 'I':

bgp_option_set (BGP_OPT_IMPORT_CHECK);

break;

case 'h':

usage ( progname , 0);

break;

default:

114
usage ( progname , 1);

break;

/* Make thread master. */

master = bm->master;

/* Initializations. */

srand (time(NULL));

signal_init (master, Q_ SIGC( bgp_signals ), bgp_signals );

zprivs_init (& bgpd_privs );

cmd_init (1);

vty_init (master);

memory_init ();

/* BGP related initialization. */

bgp_init ();

/* Sort CLI commands. */

sort_node ();

/* Parse config file. */

vty_read_config ( config_file , config_default );

115
/* Start execution only if not in dry-run mode */

if( dryrun )

return( 0);

/* Turn into daemon if daemon_mode is set. */

if ( daemon_mode && daemon(0, 0) < 0)

zlog_ err ( " BGPd daemon failed: %s", strerror ( errno ));

return (1);

/* Process ID file creation. */

pid_output ( pid_file );

/* Make bgp vty socket. */

vty_serv_sock ( vty_addr , vty_port , BGP_VTYSH_PATH);

/* Print banners. */

zlog_notice (" BGPd %s starting: vty @%d, bgp @% s:% d", QUAGGA_VERSION,

vty_port ,

(bm-> address ? bm->address : "<all>"),

bm->port);

116
/* Start finite state machine, here we go! */

while ( thread_fetch (master, &thread))

thread_call (&thread);

/* Not reached. */

return (0);

9. EXPANDED : AODV AND OSPF COMPARISON


9.1 About AODV
-In AODV, reply route back on reverse path (intermediate record node, from which
first replica was received), so intermediate nodes update table later, old entries timed
out
-AODV only supports symmetric links. If a source node moves, it must restart the
route request. If an intermediate node moves, all upstream nodes broadcast a failed
link with their upstream neighbors until the source node is reached. But this protocol
has a drawback: Intermediate nodes can send more updates but remain state-routing.
- Example of AODV:

+Node 1 sends route request to 2,3,4 .


+Node 2 sends route request to 5.7 .

117
+Node 3 has 3-5-8-9-10 .
+Node 4 has 4-6-8-9-10 .
+ Node 4 reponds .

9.2 Evaluation of AODV and OSPF when operating in WiMAX

WiMax is Worldwide Interoperability for Microwave Access - a long-range wireless


networking technology standard for both mobile and fixed connections. Although
WiMAX was once considered a leading form of Internet communication as an
alternative to cable and DSL, its adoption is still limited. Node speed and throghput
(throughput) of two different routing protocols with different node densities 10, 20…
.60. The graph below shows the throughput for the two routing protocols for the
WIMAX network and the effect of the rate variations for ADOV and OSPF. From
here, we see that OSPF works as well (217 kbps to 227 kbps) as 10 m/s compared to
AODV. OSPF performs well as well as speeds beyond 0 m/s when compared to
AODV. But ADOV also has average performance increase in node mobility with
increasing routing load since AODV uses MANET for a mobile network and OSPF
stops for multilayer networks. In addition OSPF operates unchanged beyond 20 m/s
and AODV exceeds 20 m/s and before 40 m/s starts to decrease due to network
congestion.

Throughput vs. speed of nodes


Hình 99: Throughput vs. speed of
nodes

Hình 100: Tốc độ của các nút so với


thông lượng với hai định tuyến
AODV và OSPF

giao thức định tuyến


118
NRL vs. speed of nodes
Hình 101: NRL vs. speed of
nodes

PDR vs. speed of nodes


Hình 102: PDR vs. speed of nodes

119
CONCLUSION
In this report, I presented the most basic problems of multilayer network along with
OSLR, BGP, RIP routing. From deploying multilayer network on GN3, the results
have been successfully deployed and the test operation is also high. This design is
applicable to real-world networks, but has not yet created great commercial value
because the model is not optimal and small, although it was a period of time that I
learned. much about multi-layer networking as well as working and operating
systems on Linux as well as Windows Server. It was also a time for me to improve
my skills in using C language and my ability to work on Linux.
Despite achieving the set goal, but due to time constraints, the project has not yet
fully developed the features of a multi-layer network, specifically, just deployed
basic information such as sending mail. , user information, images are simple, but
perfecting and optimizing the system takes time. In the future, if I have the
opportunity, I will continue to research and develop various types of network
systems and study more deeply about network routing and computer network
structure.

120
REFERENCES

[1] S. T. Kent, “Securing the Border Gateway Protocol: A Status Update,”


Lecture Notes in Computer Science (including subseries Lecture Notes in
Artificial Intelligence and Lecture Notes in Bioinformatics), tâ ̣p 2828, pp.
40-53, 2003.
[2] T. T. H. Nhung, “VnPro,” 2017. https://vnpro.vn/thu-vien/cau-hinh-dinh-
tuyen-dong-ospf-2351.html.
[3] P. H. Hoàng, Thiết kế mạng Intranet, NXB Bách Khoa Hà Nội, 2017.
[4] P. T. Thái, “Viblo,” 2016. https://viblo.asia/p/tim-hieu-giao-thuc-rip-
DbmemoWPvAg.
[5] A. Baba Ali, Mujahid Tabassum, Kuruvilla Mathew, March 2016, “A
Comparative Study of IGP and EGP Routing Protocols, Performance
Evaluation along Load Balancing and Redundancy across Different AS,”
International Multi Conference of Engineers and Computer Scientists , Vol.
II, IMECS 2016, Hong Kong
[6] Chapter 11: Configuring Static Routes of the Basic Management and
Configuration Guide.

121

You might also like