0% found this document useful (0 votes)
9 views45 pages

Lecture 2

Uploaded by

ori777ethio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views45 pages

Lecture 2

Uploaded by

ori777ethio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

1

Lecture 2

Routing Protocols

Computer network II
Network Layer
2

 Network layer is responsible for the source-to-


destination delivery of a packet, possibly across multiple
networks (links).
 Adds a header that includes the logical addresses of the

sender and receiver to the packet from the upper layer.

 The network layer must know the topology of the

subnet and choose appropriate paths through it.

Computer network II
Cont’
3 application
transport
network
 Network layer protocols in data link
physical
network network
every host, router examines network
data link
physical
data link
physical
data link
physical network network
header fields in all IP data link data link
physical
physical

datagrams passing through network network


data link data link
physical physical
it. network
data link
physical
application
network transport
data link network network
network physical data link data link
data link physical physical
physical

Computer network II
What is Routing?
4

 Routing is the process of selecting path for traffic across


networks.
 Routing decisions are not simply based upon destination
addresses alone. They must also take account of the
network topology and prevailing traffic conditions.
 Routers discover their network topology and then use
this topology to build routing tables containing the
best routes to destinations.

Computer network II
Cont’
5

 A route is a network-layer path from a network device to a

destination, and an IP routing table stores information


about routes.

 Several routing algorithms have been developed to address

routing and updating information difficulties.

 These algorithms allow the routers to learn about the

network and then make decisions based on that information.

Computer network II
How to determine “best” path?
6

Performance criteria/metrics used for selection of route:

 hop count, bandwidth, delay and cost

 The “minimum hop” can be generalized as “least

cost” routing.

 The route with the lowest metric is installed/stored in the

IP routing table.

Computer network II
Cont’
7

Fields on IP table
 Destination/Mask: indicates the destination network address
and mask of a specific route.
 Proto (Protocol): indicates the protocol type of the route, that
is, the protocol through which a router learns the route.
 Pre (Preference): Indicates the routing protocol preference of
the route.
 There may be multiple routes to the same destination,
which have different next hops and outbound interfaces.
 A router selects the route with the highest preference (with
the lowest preference value) as the optimal route.
Computer network II
Cont’
8

 Cost: indicates the cost of the route. When multiple


routes to the same destination have the same preference,
the route with the lowest cost is selected as the optimal
route
 NextHop: indicates the local router’s next-hop address
of the route to the destination network.
 Interface: indicates the outbound interface of the route.

 This field specifies the local interface through

which the local router forwards packets.


Computer network II
Graph theory
9

 A graph is a set of vertices (or nodes) linked by edges.

1
3

2 5
4
 Mathematically, we often write G = (V,E)
 V: set of vertices, so |V| = number of vertices
 E: set of edges, so |E| = number of edges

Computer network II
Cont’
10

 To present the relationships between different


objects/elements in a mathematical way
 Examples:
 Network connections

 Friendship

 Roads, Airline routes,

Computer network II
Real-time example- Graph application
11

3 Hospital
4
Maraki
1 5
Arada
College
5

Azezo
7 1

Mesgid

Question: Which road has least cost from Azezo to Arada?


Computer network II
Graph theory: for routing
12
12
Routing protocol
5
Goal: determine “good” path
(sequence of routers) through 3
v w
network from source to 2 5
destination.
u 2 1 z
 Graph abstraction for 3
1
2
routing algorithms: G(N,E) x y
1
 Graph nodes (set N) are
routers. “Best” path: minimum cost path.

 Graph edges (set E) are


physical links.
Computer network II
Routing Algorithms: Graph abstraction
13

5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y
Graph: G = (N,E)

♪ N = set of routers = { u, v, w, x, y, z }
♪ E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }

Computer network II
Graph abstraction: costs
14

5
 c(A,A’) = cost of link (A,A’)
3
v w 5
2
u Example: c(w,z) = 5
2
3
1 z
1 2
x 1
y

Cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp)

Question: What is the least-cost path between u and z ?

Routing algorithm: algorithm that finds least-cost path!

Computer network II
Routing protocols-classification
15

Routing protocols

Adaptive(dynamic) Non-Adaptive(static)

Interior Gateway Exterior Gateway


Protocol(IGP) Protocol(EGP)

Distance Vector Link State

Most Important !

Computer network II
Static vs Dynamic routing protocols
16

Static: Only a network administrator can change an information.

 Apply to small-scale or stable networks - Unable to adopt large scale

networks

 Manually configured and maintained - Unable to respond network

changes dynamically

Dynamic: Learn about changes in the network automatically.


Dynamic routing protocols use their own rules and metrics to build and
update routing tables.

Computer network II
Dynamic routing protocols
17

Static routing protocol is challenging task when the network is growing.

1. Exterior Routing Protocols (EGP): Used to exchange routing


information between multiple autonomous systems. Example: BGP

2. Interior Gateway Routing Protocols (IGP): Used for exchange


routing information within an autonomous system. Example: RIP,
OSPF,IS_IS, EIGRP
Computer network II
Distance-Vector (DV) routing
18

 Bellman-Ford algorithm is used to perform routing.

 It is least cost algorithm.

 Each node knows the distance (cost) to its directly


connected neighbors.
 A node sends a list to its neighbors with the current
distances to all nodes.
 When a router receives information from another
router, it increments whatever metric it is using. This
process is called distance accumulation.
Computer network II
Cont’
19

 Routers using this method know the distance between any two points in

the network, but they do not know the exact topology of an internetwork.
Distance vector uses regular updates and sends the whole routing table
every time.
Basic idea: From time-to-time, each node sends its own distance vector estimate
to neighbors.
B-F equation:
Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N

• Dx(y) = Least cost path from x to y, min is taken over all


neighbors v of x
• Example: RIP,EIGRP
Computer network II
Example
20
5
Clearly, dv(z) = 5, dx(z) = 3,
dw(z) = 3 3
v w
2 5
u 2 1 z
3
B-F equation says: 1
2
x y
1
Cost between u&z
du(z)
= min { c(u,v) + dv(z), c(u,x) + dx(z), c(u,w) + dw(z) }
= min {2 + 5, 1 + 3, 5 + 3}
=4

 Node that achieves minimum is next hop in shortest path.

Computer network II
Link-State (LS) Routing
21

 The shortest paths can be compute with Dijkstra’s

algorithm. It is Least-cost routing algorithm.

 Measure the delay (cost) to its neighbors.

 The distance information (link state) is broadcast to all

nodes in the network.

 Each node calculates the routing tables independently.

Computer network II
Cont’
22

 Link-state routing provides better scaling than distance-

vector routing because it only sends updates when there is a


change in the network, and then it only sends information
specific to the change that occurred.

 It is designed to overcome the drawbacks of DV routing.

 When a router is initialized, it determines the link cost on

each of its network interfaces.

Computer network II
Cont’
23

 The router then advertises this set of link costs to all other

routers in the internet topology, not just neighboring routers.

Example

 Open Shortest Path First (OSPF)

 IS-IS

Dijkstra’s algorithm:

“Find the shortest path from a given source node to all other
nodes by developing the paths for increasing path length.”
Computer network II
How Link state Routing works?
24
1 Initialization:
2 N = {S}
3 for all nodes v
4 if v adjacent to S
5 then D(v) = c(S,v)
6 else D(v) = infinity
7
8 Loop
9 find w not in N such that D(w) is a minimum
10 add w to N
11 update D(v) for all v adjacent to w and not in N:
12 D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N

Computer network II
Example
25

Step start N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F)


0 A 2,A 5,A 1,A infinity infinity
1 AD 2,A 4,D 2,D infinity
2 ADE 2,A 3,E 4,E
3 ADEB 3,E 4,E
4 ADEBC 4,E
5 ADEBCF

5
3
B C 5
2
A 2 1 F
3
1 2
D E
1

Computer network II
Example…
26
Resulting shortest-path tree from A:

B C
A F

D E

Resulting forwarding table in A: Destination Link

B (A,B)
D (A,D)
C (A,D,E,C)
E (A,D,E)
F (A,D,E,F)

Computer network II
Comparisons
27

Distance vector routing Link State routing


 Bellman-Ford algorithm is used.  Dijsktra algorithm is used.

 The routers receive the topological  The router receive complete

information from the neighbor only. information on the network topology.

 Calculates the best route based on  Calculates the best route on the basis

the distance. of least cost.

 Updates full routing table.  Updates only the link state

 Simple to implement.  Complex to implement

 Less RAM/CPU  Faster convergence

 Slower convergence  more RAM/CPU

Computer network II
Routing Information Protocol(RIP)
28

 RIP is a distance-vector IGP and has a preference of 100


(Huawei standard).
 Compared with other routing protocols, RIP is simple and
easy to implement. RIP uses a hop count as the route cost.
 Hop count is number of routers through which a packet
passes to reach its destination.
 RIP sends the complete routing table out of all active
interfaces every 30 seconds.
Computer network II
Cont’
29

 R1 uses 1 hop to reach Network A, 2 hops to Network B, 3 hops


to Network C, and 4 hops to Network D. Metric is hop count.
 RIP defines as unreachable any route whose hop count is greater
than or equal to 16. Due to this hop limit, RIP is applicable only
to small-scale networks.

Computer network II
Open Shortest Path First (OSPF)
30

 OSPF is a typical link-state routing protocol and widely used


IGPs in the industry. OSPFv2, is designed for IPv4. OSPFv3, is
designed for IPv6. OSPF routers exchange link status
information, but not routes.
 Link status information is key for OSPF to perform topology and
route calculation. Routers are aware of the intra-area network
topology and be able to calculate loop-free paths.
 Each OSPF router uses the SPF algorithm to calculate the shortest
path to a specific destination.

Computer network II
OSPF-cost
31
 OSPF Cost values are the values, that shows the feasibility of a link.

OSPF cost value is calculated with a formula.

Cost = Reference BW/ link (interface)BW

Reference bw Default value is 100 000 000(100Mbps)

 According to the link cost that are calculated with this formula,

the best routes are determined by Shortest Path Frist Algorithm.

 Here, all the link cost are added and the total cost of the link through

the destination is determined. The way, that has the lowest cost value,
is elected as best path.

Computer network II
Cont’
32
Example

Computer network II
RIP vs OSPF
33
RIP OSPF
 DV routing protocol  LS routing protocol
 Metric is hop count  Metric is BW
 Update timer is 30 seconds  Update timer: Only
 Hop count limit: 15 changes made
 Slow convergence  Hop count limit: none
 Works on B-F Algorithm  Fast convergence
 Works on Dijkstra’s
algorithm

Computer network II
EIGRP(Enhanced Interior Gateway Routing
Protocol)
34

 This is the most used dynamic routing protocol as IGP.


Especially it is used for Routing purpose inside the
networks that is mostly consist of Cisco devices.
 It was developed by Cisco as an enhancement to IGRP
(Interior Gateway Routing Protocol).
 EIGRP uses DUAL (Diffusing Update Algorithm) for
routing calculations.
 Periodic Updates are not used but if a change occurs in the
network like up/down links, update messages are sent.
Computer network II
Cont’
35

 The most important characteristic of this routing protocol is


that, it is a fast converged routing protocol.
 Enhanced interior gateway routing protocol keeps the
“backup routes” beside the “best route” to a destination in
the topology table.
 So, during a failure, it does not need to calculate a new route.
instead, it uses the backup route towards the destination.
 Sometimes it is called as hybrid protocol (DV+LS)

Computer network II
BGP(Boarder Gateway Protocol)
36

 An exterior gateway protocol that enables the


exchange of routing and reachability information
between autonomous system on the internet.
Advantages:
o Maintaining routing information
o Selecting best path to send packets
o Redundancy in case of failure
o Detecting loops in routing paths
o Preventing routing attacks
o Providing security
Computer network II
Summary: Dynamic routing protocols
37

Computer network II
Cont’
38

IGP vs EGP

 Within Company A or company B: IGP


 Between Company A and Company B : EGP

Computer network II
Access Control List (ACL)
39

 An access control list is a list of rules that specifies


which systems are permitted or denied access to a
particular system/resource.
 ACL can be installed/configured on switch, router and
they act as filters to mange which IP traffic access the
network resources.
 ACL reduces the network attack and increase
performance.
 Two types of Access List: Standard and Extended

Computer network II
Standard vs Extended access list
40

Standard access list: This type of access list is developed


using source IP address only.
 It Permit or deny the entire protocol suite. They don’t
differentiate between IP traffic like UDP,TCP,HTTPS
 They use numbers from 1-99 or 1300-1999 for configuration.
 denies or permits source IP addresses
Extended access list: They uses both source & destination IP
addresses and ports to make sense of IP traffic.
 Differentiate IP traffic.
 They use the number 100-199 and 2000-2699 for
configuration.
 denies or permits source IP addresses
 denies or permits destination IP addresses
 denies or permits port(services)

Computer network II
ACL-Configuration
41

General Steps:
Step 1: Create access list(standard or extended)
Step 2: Apply the access list to the interface (inbound or
outbound)- outbound is coming out from the route.
Example:
 Static routes: ip route detn IP, mask, next hop ip
R1(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.3
R2(config)#ip route 192.168.2.0 255.255.255.0 10.0.0.2
Assume: ACL=R2 and interface =fa0/0 - outbound
Step 1.
R2(config)# access-list 1 deny 192.168.2.2
R2(config)#access-list 1 permit any
Step 2. R2(config)#int fa0/0
R2(config-if)#ip access-group 1 out
Computer network II
Cont’
42

Computer network II
Cont’
43

 access-list 1 means 1 is less than 99


 access-list 1, 2,3,….99 standard ACL
 access-list 100,101,…199  extended ACL
N.B
• More general statement should place at the top
• More specific statement should placed at the bottom
R0(config)# access-list 1 deny 192.168.2.2 0.0.0.0
Ro(config)#access-list 1 permit any
R0(config)# access-list 1 deny 192.168.2.3 0.0.0.0
The last one is not working…
Computer network II
Cont’
44

R2(config)# access-list 1 deny host 192.168.2.2


R2(config)# access-list 1 deny host 192.168.2.3
At the end of the statement,
R2(config)# access-list 1 deny any is implicitly there.
So, we have to write like the following:
R0(config)# access-list 1 deny host 192.168.2.2
R0(config)# access-list 1 deny host 192.168.2.3
R0(config)# access-list 1 permit any

Use R2(config)# no access-list 1  to remove access list


R2(config-if)#no ip access-group 1 out
R2# show run  to see the effects

Computer network II
45

Computer network II

You might also like