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 St
Trang 1HANOI 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:
Class:
Academic year:
Name:
Trang 2ASSESSMENT 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)
1
State the urgency and importance of the topic, issues and hypotheses
(including purpose and relevance) as well as the scope of application
of the project
1 2 3 4 5
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
4 Have simulation/experimental results and clearly present the obtained
Ability to analyze and evaluate results (15)
5 A clear work plan including objectives and implementation methods
based on the results of theoretical research in a systematic way 1 2 3 4 5
6 The results are presented in a logical and easy to understand manner,
all results are analyzed and evaluated satisfactorily 1 2 3 4 5
7
In the conclusion, the author points out the differences (if any)
between the achieved results and the initial goals set out and provides
arguments to suggest possible solutions in the future
1 2 3 4 5
Project Report ‘s technical writing skills (10)
8
The project presents in accordance with the prescribed form with a
logical and beautiful structure of chapters (tables, clear images, with
titles)has a chapter introduction and chapter conclusion, a list of
referencescitations
1 2 3 4 5
9
Excellent writing skills (standard sentence structure, scientific style,
logical and well-founded reasoning, appropriate vocabulary usage,
etc.)
1 2 3 4 5
Scientific research achievements (5) (choose 1 out of 3 cases)
1
0
a
Having a scientific article published or accepted for
publication/winner of 3rd prize at Institute level or higher/scientific
awards (international/domestic) from 3rd prize or higher/ Having
registered a patent
5
1
0
b
Reported at the Institute council in the conference of scientific
research students but did not win the 3rd prize or higher / Won the
consolation prize in other national and international competitions on
the subject such as TI contest
2
1
0
c
Total points based on base 10
Trang 3Other comments (about students' attitudes and working spirit)
Date: … / … / 20…
Instructor
Trang 4PREFACE
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
Trang 5GUARANTEE
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
Trang 6TABLE 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
Trang 74 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
Trang 86.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
Trang 9
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
Trang 10LIST 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
Trang 11PROJECT 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
Trang 1211
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
Trang 1312
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
2.2.1 Static routing operation
Overview Of Static Route
Hi ̀nh 7:Overview Of Static Route
Overview Of Static Route
Trang 14Static 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
- 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 that data packets can be transmitted from one host to another based on that address structure There are two protocols that we need to pay attention to in dynamic routing: Internet Protocol (IP), Internetwork Packet Exchange (IPX)
3 THEORY
3.1 Autonomous System ( AS )
A collection of interconnections of 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
EGP and BGP between ASs
Hi ̀nh 8:EGP and BGP between ASs
EGP and BGP between ASs
Hi ̀nh 9: EGP và BGP giữa các AS
EGP and BGP between ASs
EGP and BGP between ASs
Hi ̀nh 10: EGP và BGP giữa các
AS
Trang 15then 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)
Typical examples of ASs are ISPs 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 is not necessary become 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
An AS needs to be uniquely identified by a value called the Autonomous System Number (ASN)
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
Internal route and external route
Hi ̀nh 11: Internal route and external route
Internal route and external route
Internal route and external route
Internal route and external route
Trang 163.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.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
Trang 17When 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)
Trang 18 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, …
Managed fiber optic cable length
Deutsche Telekom Global
GTT Communications, Inc America 3257 3 232,934
Liberty Global Older brother 6830 thirty
first 800,000 won
Telia Carrier Switzerland 1299 2 65,000 won
Trang 19Verizon Enterprise Solutions America 701 22 805,000 won
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
Calculating
selecting routes
The number of hops only to the destination
- Bandwidth inversion
-Typeof service(ToS) is rarely used
Diversity in route selection policy : -External or internal routes
-Number of hops -Autonomous system (AS) through nodes have passed
The different types of LSAs include different information:
-Connection and its status:
+ Connect to the network
Connect to another router
-IDs of the routers in the multi-access network
- Aggregate routes within a predefined network (send
by ABRs)
ASBR(autonomous.system border router), send using ABRs
-External route or default route for external traffic (send using ABRs)
Updates include: -New routes
-Withdrawn routes -Routes include AS through packets passed
-The set filter internal the set ready filter determined line but the set determined line advertising fox arrive
In a point-to-point network, neighboring routers exchange LSAs
communicate only with configured
Trang 20-Interfaces that receive a route broadcast are inaccessible -Passive interface receives the update but does not send it
In multi-access networks, every router sends LSAs to the DR and back-up DR(BDR) and receives LSAs from the DR
-ABRs summarize routes into stub areas
3.7 Advantages and disadvantages of routing protocols OSPF, BGP, BGP
RIP -Simple configuration
-RIP v2 can communicate with external network
-LANs -Simple WANs -Connect to external networks
-Do not use for dial-up connection
OSPF -Exact routes taking into
account link speed and cost
- Convergence happens quickly
-As low as RIP if the network is well designed
- Complex configuration
-Costs can be high
-OSPF cannot be used as
redistribution
-More extensive LAN and WAN networks -Not to be used over dial-up connections
BGP -ISPs use BGP
-BGP provides tight control over which routes are advertised and accepted
- Relatively low cost
- Complex configuration
-The network must also run IGP
-Connect to ISP -Not to be used over dial-up connections
3.8 Load Sharing
Trang 21Typically, 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
Trang 22field - set at 2, for bi Note that addresses in IPv4 format have a maximum of 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
Trang 23Router 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 with B being the 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 the metric advertised by Router A router B Router B also receives the route from Router A There is nothing in the update that Router B received from Router A indicating that this route eventually passed through Router B itself Router
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 this next custom smooth share Although of course , the question topic bouncing born if structure bamboo contact conclude replace change 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 1 with a metric of 16 to only out that it are not can access access okay
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
Network Don’t Use Split Horizon hoặc Poison Reverse
Hi ̀nh 12: Network Don’t Use Split Horizon hoặc Poison Reverse
Hi ̀nh 13: Network mà không sử dụng Split Horizon hoặc Poison Reverse
Network Don’t Use Split Horizon hoặc Poison Reverse
Hi ̀nh 14: Network mà không sử dụng Split Horizon hoặc Poison Reverse
Network Don’t Use Split Horizon hoặc Poison Reverse
Hi ̀nh 15: Network mà không sử dụng Split Horizon hoặc Poison Reverse
Network Don’t Use Split Horizon hoặc Poison Reverse
Hi ̀nh 16: Network mà không sử dụng Split Horizon hoặc Poison Reverse
Trang 24one enter metric ) Because conclude connect of the main it with Network 1 no Fort public , router B accepts take line road
Routers A and C now both have routes to 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 The next time the routers advertise the route,
it has a metric of 4 Eventually, this metric will reach 16 and the routers will determine that they cannot reach Network 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
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
destination Split Horizon also minimizes the number of packets sent during normal
operations
*RIP time interval:
Count to infinity
Hi ̀nh 17: Count to infinity
Count to infinity
Hi ̀nh 18: Count to infinity
Count to infinity
Count to infinity
Hi ̀nh 19: Count to infinity
Trang 25Interval Router Default
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
Trang 26is, 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:
Trang 27Stub Areas and Stub Routers: The stub 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
Backbone(Area 0): Network's backbone, or area 0, linking all stub areas As
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 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
NSSA: NSSA is an area that resembles a stub area in many ways It connects to
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
OSPF Areas
Hi ̀nh 20: OSPF Areas
OSPF Areas
Hi ̀nh 21: OSPF Areas
OSPF Areas
OSPF Areas
Hi ̀nh 22: OSPF Areas
Trang 2827
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
3.9.3 Configuration of BGP
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, sometimes competing organizations to communicate:
OSPF Network with Headquarters (HQ)- area 0
Hi ̀nh 23: OSPF Network with Headquarters (HQ)- area 0
Hi ̀nh 24: OSPF Network với Headquarters (HQ) là area 0
OSPF Network with Headquarters (HQ)- area 0
Hi ̀nh 25: OSPF Network với Headquarters (HQ) là area 0
OSPF Network with Headquarters (HQ)- area 0
Trang 29-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
Trang 30Load 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
Trang 31Configuration 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:
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
Trang 32 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
4.1.2 Compare RIPv1 and RIPv2
RIPv1 RIPv2
Simple configuration Simple configuration
Routing by address class Address classless routing
Do not send information about subnet
mask in routing information
Send information about subnet mask in routing information
Does not support VLSM Therefore all
networks in a RIPv1 system must have
the same subnet mask
VLSM support Networks in an IPv2 system can have different subnet mask lengths
No mechanism to verify routing
information
There is a mechanism to verify routing information
Topology diagram of RIP concentrate on R1 and R2
Hi ̀nh 28: Topology diagram of RIP concentrate on R1 and R2
Topology diagram of RIP concentrate on R1 and R2
Topology diagram of RIP concentrate on R1 and R2
Topology diagram of RIP concentrate on R1 and R2
Trang 33Send broadcasts at 255.255.255.255 Sending multicast to address 224.0.0.9
should be more efficient
4.2 OSPF’s lab model
4.2.1 Introduce
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
- 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 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
RIPv2 Model
Hi ̀nh 29: RIPv2 Model
RIPv2 Model
RIPv2 Model
RIPv2 Model
Trang 34
- 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 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
The following are the features of OSPF:
It is a link-state routing protocol
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
Large OSPF networks are decentralized and divided into many areas
Hi ̀nh 30: Large OSPF networks are decentralized and divided into many areas
Large OSPF networks are decentralized and divided into many areas
Large OSPF networks are decentralized and divided into many areas
Large OSPF networks are decentralized and divided into many areas
Trang 35- 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
- Database Description: This packet is used to select which router will be authorized
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
- 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
OSPF’s Packet
OSPF’s Packet
OSPF’s Packet
OSPF’s Packet
Trang 364.3 BGP’s lab model
4.3.1 Introduction to eBGP and iBGP
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 routers will 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 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
One-zone OSPF model
Hi ̀nh 31: One-zone OSPF model
One-zone OSPF model
One-zone OSPF model
One-zone OSPF model
Multi-zone OSPF model
Hi ̀nh 32: Multi-zone OSPF model
Multi-zone OSPF model
Multi-zone OSPF model
Multi-zone OSPF model
Trang 3736
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
Hi ̀nh 33: iBGP Peering ‘s Model
iBGP Peering ‘s Model
Hi ̀nh 34: Mô hình iBGP peering
iBGP Peering ‘s Model
Trang 38Because 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 peering together just need to make sure their 2 IP addresses can go to each other to be able to establish a TCP connection from building TCP peering However, this only 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 routers to build eBGP peering with IP addresses that are not directly connected to each other
4.3.2 Data sheets of BGP
Neighbor table: This table includes all routers that have established BGP
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
eBGP Peering ’s Model
Hi ̀nh 36: iBGP Peering ‘s Model
eBGP Peering ’s Model
Hi ̀nh 37: Mô hình eBGP peering
eBGP Peering ’s Model
eBGP Peering ’s Model
Hi ̀nh 38: Mô hình eBGP peering
Trang 39table 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
Router R has successfully peered with 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, when receiving routing updates from 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
Hi ̀nh 39: BGP routing information reception and filtering
BGP routing information reception and filtering
BGP routing information reception and filtering
Trang 4039
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
From the figure above, we consider the process of prefix 192.168.1.0 propagating from AS64520, through AS65500 and then to router B located on AS 65000 When router B displays information about 192.168.1.0 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
the next AS en route to the destination
Example Of AS-path
Hi ̀nh 40: Example Of path
AS-Hi ̀nh 41: Ví dụ về path
AS-Example Of AS-path
Hi ̀nh 42: Ví dụ về path
AS-Example Of AS-path
Hi ̀nh 43: Ví dụ về path
AS-Example Of AS-path
Hi ̀nh 44: Ví dụ về