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

Lect 7 Internet Protocols

Chapter 4 outlines the concepts of routing algorithms, including distance vector and link state algorithms, and discusses the structure of routers and the Internet Protocol (IP). It differentiates between intra-AS and inter-AS routing, detailing the protocols used for each, such as OSPF and BGP. The chapter emphasizes the importance of hierarchical routing to manage the complexity of large networks and the challenges associated with routing information exchange.

Uploaded by

esha.srinika
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lect 7 Internet Protocols

Chapter 4 outlines the concepts of routing algorithms, including distance vector and link state algorithms, and discusses the structure of routers and the Internet Protocol (IP). It differentiates between intra-AS and inter-AS routing, detailing the protocols used for each, such as OSPF and BGP. The chapter emphasizes the importance of hierarchical routing to manage the complexity of large networks and the challenges associated with routing information exchange.

Uploaded by

esha.srinika
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 44

Chapter 4: outline

1. introduction 4.5 routing


2. virtual circuit algorithms
and datagram  link state
networks  distance vector
3. what’s inside a  hierarchical routing
router 4.6 routing
RIP in the
 OSP
4. IP: Internet Internet
F
Protocol
 datagram 4.7 broadcast
BGP and
format
multicast routing
 IPv4 addressing
 ICMP
 IPv6

Network 4-1
Layer
Distance vector
algorithm
Bellman-Ford equation (dynamic programming)

let
dx(y) := cost of least-cost path from
x to y then
dx(y) = mv in {c(x,v) + dv(y) }

cost from neighbor v to


destination y cost to neighbor v

min taken over all neighbors v of x


Network 4-2
Layer
Bellman-Ford
example
5
3
clearly, dv(z) = 5, dx(z) = 3,
v w 5 dw(z) = 3
2
u 2 1 z
3
1 2
B-F equation says:
x y
1 du(z) = min { c(u,v) + dv(z),
c(u,x) + dx(z),
c(u,w) + dw(z) }
= min {2 + 5,
1 + 3, = 4
5 + 3}
node achieving minimum is next
hop in shortest path, used in forwarding
table
Network 4-3
Layer
Distance vector algorithm
 Dx(y) = estimate of least cost from x to y
 x maintains distance vector D x = [Dx(y):
yєN ]
 node x:
 knows cost to each neighbor v: c(x,v)
 maintains its neighbors’ distance
vectors. For each neighbor v, x
maintains
D v = [Dv(y): y є N ]

Network 4-4
Layer
Distance vector algorithm
key idea:
 from time-to-time, each node sends
its own distance vector estimate to
neighbors
 when x receives new DV estimate from
neighbor, it updates its own DV using B-F
equation:
Dx(y) ← minv{c(x,v) + Dv(y)} for each
node y ∊ N
 under minor, natural conditions, the
estimate Dx(y) converge to the actual least
Network 4-5
Layer
Distance vector algorithm
iterative, each node:
asynchronous:
each local
iteration caused wait for (change in local
by: link cost or msg from
neighbor)
 local link cost
change
 DV update message recompute
from neighbor
distributed:
estimates if DV to
 each node notifies
neighbors only
when its DV any dest has
changes changed, notify
 neighbors then neighbors Network 4-6
notify their neighbors if Layer
DV Algorithm
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dx(z) = min{c(x,y) +
Dz(y)} Dy(z), c(x,z) +
= min{2+0 , 7+1} = 2 Dz(z)}
node x cost to cost to = min{2+1 , 7+0} =
table x y x y 3
z z
x 0 2 7
x 0 2 3

from
from

y ∞∞ y 2 0 1

z 7 1 0
node yz ∞cost
∞ to
table x y y
∞ 2 1
z
x ∞ ∞ x z
7
∞ 2 0
fro
m

1
y
∞∞
node z ∞cost to
z x y
table
z
x ∞∞
from

∞ ∞∞
y
∞ tim
7 1 0 e Network 4-8
Layer
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dx(z) = min{c(x,y) +
Dz(y)} Dy(z), c(x,z) +
= min{2+0 , 7+1} = 2 Dz(z)}
node x cost to cost to cost to = min{2+1 , 7+0} =
table x y x y x y 3
z z z
x 0 2 7 x 0 2 3
x 0 2 3

from
from

from
y ∞∞ y
y 2 0 1 2 0
∞ 1
z 7cost
1 to0
node yz ∞cost
∞ to z
table x y x y 3cost
1 to0 y
∞ x y 2 1
z z z
x 0 2 7
x ∞ ∞ x 0 2 x z
7
from

from

fro

y 2 0 1
m

y 2 0 1 z y 2 0
7 1
1 cost to
node zz ∞cost to 0 cost to
∞ x y z x3 y1
table x y
∞ z x z0 2 x0 z0 2
x ∞∞
from

7 3
from
from

∞ ∞∞ y 2 0
y y 2 0 1 tim
∞ 1
7 1 0 z e Network 4-9
3 1 Layer
Distance vector: link cost
changes
link cost changes: 1
 node detects local link cost 4
y
1
change x z
 updates routing info, 50
recalculates distance vector
 if DV changes, notify

“gooneighbors
t0 : y detects link-cost change, updates its DV,
d informs its neighbors.
news t1 : z receives update from y, updates its table,
travel computes new least cost to x , sends its neighbors its
s DV.
fast” t2 : y receives z’s update, updates its distance table. y’s
least costs do not change, so y does not send a message to
z.

Network 4-10
Layer
Distance vector: link cost
changes
link cost changes: 60
 node detects local link cost 4
y
1
change x z
 bad news travels slow - 50
“count to infinity”
problem!
 44 iterations before
algorithm stabilizes: see
text
 Z tells Y its (Z’s) distance to X is infinite (so
poisoned reverse:
Y won’t route to X via Z)
 will
If Z this completely
routes through solve
Y to count to infinity
problem?
get to X :

Network 4-11
Layer
Comparison of LS and DV algorithms
message complexity robustness: what
 LS: with n nodes, E links, happens if router
msgs sent
O(nE) malfunctions?
 DV: exchange between LS:
neighbors only  node can advertise
 convergence time
incorrect
varies link cost
speed of DV  each node computes
 LS: O(n2 ) algorithm
only its
requires O(nE) msgs :
convergence

own table
may have
oscillations  DV node can
 DV: convergence time advertise incorrect
varies path cost
 may be routing loops  each node’s
 count-to-infinity table used by others
problem • error propagate
4-12
thru networkNetwork
Layer
Comparison
Chapter 4: outline
1. introduction 4.5 routing
2. virtual circuit algorithms
and datagram  link state
networks  distance vector
3. what’s inside a  hierarchical routing
router 4.6 routing
RIP in the
 OSP
4. IP: Internet Internet
F
Protocol
 datagram 4.7 broadcast
BGP and
format
multicast routing
 IPv4 addressing
 ICMP
 IPv6

Network 4-14
Layer
Hierarchical
routing
our routing study thus far -
idealization
 all routers identical
 network “flat”

… not true in practice


scale: with 600 administrative
million autonomy
 internet = network

destinations: of networks
 can’t store all dest’s  each network admin
in routing tables! may want to control
 routing table routing in its own
network
exchange would
swamp links!
Network 4-15
Layer
Hierarchical
routing
 aggregate routers gateway router:
into regions,  at “edge” of its own
“autonomous AS
systems” (AS)  has link to
 routers in same router in another
AS run same AS
routing
protocol
 “intra-AS”
routing
protocol
 routers in
different AS can
run different intra-
AS routing Network
Layer
4-16
Intra-AS (Intra-Autonomous
System):
Intra AS is refer to routing that occurs within a single Autonomous System (AS).
An Autonomous System is a collection of IP networks and routers under the
control of a single organization, which uses a common routing protocol.
Scope: Deals with the routing within the borders of a single AS.
Routing Protocols:
Uses Interior Gateway Protocols (IGPs), such as OSPF (Open Shortest
Path First), RIP (Routing Information Protocol), EIGRP (Enhanced Interior
Gateway Routing Protocol), or IS-IS (Intermediate System to Intermediate
System).
These protocols handle the distribution of routing information within a single
AS.
Example: A company's internal network where all routers and devices are
managed within a single organization.
Goal: To determine the best path for routing data within the AS.
Control: The organization or network administrator has full control over routing
decisions and policies.
Inter-AS (Inter-Autonomous System):
Definition: Refers to routing between different Autonomous Systems
(ASes).
It involves the communication and exchange of routing information
between two or more ASes.
Scope: Deals with routing between different ASes, usually over the internet.
Routing Protocols:
Uses Exterior Gateway Protocols (EGPs), such as BGP (Border
Gateway Protocol), which is the standard protocol for inter-AS routing.
BGP helps in determining the best path for data to travel between
different ASes.
Example: When data needs to travel from one company’s network (AS1) to
another company’s network (AS2), the routing decisions are made using
BGP.
Goal: To enable communication and data routing between different
organizations or networks.
Control: Different ASes are controlled by different entities (like ISPs,
organizations, or companies), so routing policies can vary from one AS to
another
Interconnected
ASes
3
c 3 2
3 a 2
AS3 c 2
b 1 a AS2
b
1 c 1
a 1 AS1
b  forwarding table
d configured by both
intra- and inter-AS
Intra-AS Inter-AS routing algorithm
Routing Routing
algorith algorith  intra-AS
m m
Forwarding
sets entries for
table internal dests
 inter-AS &
intra-AS sets
entries for
external dests
Network
Layer
4-19
Inter-AS
tasks
suppose router in AS1
AS1 receives must:
1. learn which dests
datagram destined are reachable
outside of AS1: through AS2, which
 router should through AS3
forward packet to 2. propagate this
gateway router, reachability info to
but which one? job all routers in AS1
of inter-AS
routing!
3
c 3
3b
AS3a 1
2 other
2 c network
other 1 c a 2 s
network 1 AS2 b
s a 1 b
AS1 d
Network 4-20
Layer
Example: setting forwarding table in
router 1d
 suppose AS1 learns (via inter-AS protocol) that subnet
x
reachable via AS3 (gateway 1c), but not via AS2
 inter-AS protocol propagates reachability info
to all internal routers
 router 1d determines from intra-AS routing info
that its interface I is on the least cost path to
1c
 installs forwarding table entry (x,I)
3 … x
c 3
3b
AS3a 1
2 other
2 c network
other 1 c a 2 s
network 1 AS2 b
s a 1 b
AS1 d
Network 4-21
Layer
Example: choosing among multiple
ASes
 now suppose AS1 learns from inter-AS protocol
that subnet
x is reachable from AS3 and from AS2.
 to configure forwarding table, router 1d must
determine which gateway it should forward packets
towards for dest x
 this is also job of inter-AS routing protocol!

3 … x
c 3
3b
AS3a 1
2 other
2 c network
other 1 c a 2 s
network 1 AS2 b
s a 1 b
AS1 d?
Network 4-22
Layer
Chapter 4: outline
1. introduction 4.5 routing
2. virtual circuit algorithms
and datagram  link state
networks  distance vector
3. what’s inside a  hierarchical routing
router 4.6 routing
RIP in the
 OSP
4. IP: Internet Internet
F
Protocol
 datagram 4.7 broadcast
BGP and
format
multicast routing
 IPv4 addressing
 ICMP
 IPv6

Network 4-23
Layer
Intra-AS
Routing
 also known as interior gateway
protocols (IGP)
 most common intra-AS routing
protocols:
 RIP: Routing Information Protocol
 OSPF: Open Shortest Path First
 IGRP: Interior Gateway Routing
Protocol (Cisco proprietary)

Network 4-24
Layer
RIP
The RIP (Routing Information Protocol) is a simple routing algorithm used
in computer networks to determine the best path for data to travel across a
network.
It is one of the oldest distance-vector routing protocols, where routers share
their routing tables with neighboring routers at regular intervals.
Key Features of RIP:
Distance Vector Algorithm: RIP is based on the distance-vector algorithm.
It uses hop count as a metric to determine the best path. A "hop" is one step
from one router to the next.
Metric: The metric used by RIP is the hop count. The maximum allowed hop
count is 15. If the hop count exceeds 15, the destination is considered
unreachable.
Periodic Updates: RIP routers send updates every 30 seconds to share
information about the network's topology.
Routing Tables: Each router maintains a routing table, which lists the best
path to reach each destination network.
Working
•Initial State: Each router in the network knows how to reach its directly
connected neighbors.
•Periodic Updates: Every 30 seconds, each router sends a copy of its routing
table to its neighbors. This helps routers learn new paths or update existing ones.
•Hop Count: When a router learns about a new path, it adds the hop count to the
path. A hop count of 1 means a direct neighbor, 2 means one router away, and so
on.
•Counting to Infinity Problem: RIP has a limitation that if a router cannot reach
a destination, it considers the hop count as 16, which represents an unreachable
Example
I A Simple network with three routers: Router A, Router B, and Router C.
•Router A is directly connected to Router B.
•Router B is directly connected to both Router A and Router C.
•Router C is directly connected to Router B.
The initial routing tables
Router A's Table:
•Destination: Router B, Hop count: 1
•Destination: Router C, Hop count: ∞ (not reachable directly)
•Router B's Table:
•Destination: Router A, Hop count: 1
•Destination: Router C, Hop count: 1
•Router C's Table:
•Destination: Router B, Hop count: 1
•Destination: Router A, Hop count: ∞ (not reachable directly)
Now, after the periodic update, Router A learns from Router B that it can reach
Router C through Router B. So Router A updates its routing table to:
•Destination: Router C, Hop count: 2 (via Router B)
Similarly, Router C learns from Router B that it can reach Router A through
Router B, so Router C updates its table to:
•Destination: Router A, Hop count: 2 (via Router B)
Advantages of RIP:
Simple and easy to implement.
Well-suited for small networks.
Disadvantages of RIP:
• Limited to a maximum of 15 hops, which can make it
unsuitable for larger networks.
• Slow convergence (takes time to update routing tables after a
network change).
• Doesn't consider factors like bandwidth or latency, just hop
count.
RIP is widely used in smaller networks but has been largely
replaced by more advanced protocols like OSPF (Open Shortest
Path First) or EIGRP (Enhanced Interior Gateway Routing
Protocol) in larger, more complex networks.
RIP ( Routing Information
 Protocol)
included in BSD-UNIX distribution in 1982
 distance vector algorithm
 distance metric: # hops (max = 15 hops), each link has cost
1
 DVs exchanged with neighbors every 30 sec in
response message (aka advertisement)
 each advertisement: list of up to 25 destination subnets
(in IP addressing sense)

from router A to destination


u v subnets: subnet hops
w u 1
A B
v 2
w 2
x x 3
z C D y 3
y z 2
Network 4-29
Layer
RIP:
example
z
w x y
A D B

C
routing table in
router D next router
destination subnet # hops to dest
w A 2
y B 2
z B 7
x -- 1
…. …. ....
Network 4-
Layer 108
RIP:
A-to-D
example dest
w
next
-
advertisement
hops
1
- 1
x C 4
z … z
… ...
w . x y
A D B

C
routing table in
router D next router
destination subnet # hops to dest
w A 2
y B 2
5
A
z B 7
x -- 1 Network 4-31
Layer
RIP: link failure,
recovery
if no advertisement heard after 180 sec -->
neighbor/ link declared dead
 routes via neighbor invalidated
 new advertisements sent to neighbors
 neighbors in turn send out new
advertisements (if tables changed)
 link failure info quickly (?) propagates to entire
net
 poison reverse used to prevent ping-pong
loops (infinite distance = 16 hops)

Network 4-32
Layer
RIP table processing (in UNIX)
 RIP routing tables managed by application-
level
process called route-d (daemon)
 advertisements sent in UDP packets,
periodically repeated

transpo transp
routed
rt rt
(UDP) (UDP
networ
networ forwarding forwarding
k (IP) routed
table table k)
link (IP)
link
physic physic
al al
Network 4-33
Layer
OSPF
OSPF (Open Shortest Path First) is a more advanced and efficient routing
protocol compared to RIP. It's a link-state routing protocol, meaning it focuses
on the state of the network links (connections between routers) to determine the
best path for data.
Key Features of OSPF:
Link-State Protocol: OSPF uses a link-state algorithm, unlike RIP's distance-
vector approach. Each router maintains a map of the network (called a link-state
database), which shows the status of all the network links (connections between
routers).
Metric: OSPF uses cost as its metric, rather than hop count. The cost is based on
bandwidth — lower-cost paths typically have higher bandwidth.
Dividing into Areas: In larger networks, OSPF can be divided into areas,
helping to scale efficiently. Area 0 is the backbone, and all other areas must
connect to it.
Hello Protocol: OSPF routers periodically send "hello" messages to each other
to check if they are still connected and can communicate.
Faster Convergence: OSPF converges faster than RIP. This means that when
there is a network change (like a router or link failure), OSPF will detect it and
Working:
• Initial State: When a router first starts, it doesn't know the network's layout, so
it sends out hello messages to discover other routers in the network.
• Link-State Advertisements (LSAs): After discovering other routers, each
router creates a Link-State Advertisement (LSA), which contains information
about its directly connected links. It sends this LSA to all other routers in the
network, so everyone knows about the state of the network links.
• Building the Link-State Database: Every router receives LSAs from all other
routers and builds a database of the entire network’s topology. This database
holds information about each router and the connections between them.
• Shortest Path First (SPF) Algorithm: After building the link-state database,
routers use the Dijkstra's SPF algorithm to calculate the shortest path to each
destination. This algorithm creates a tree of shortest paths, which is used to
update the router’s routing table.
• Routing Table Update: Based on the SPF calculation, each router updates its
routing table with the best paths to different destinations.
Advantages of OSPF:
Faster Convergence: OSPF reacts more quickly to network changes than RIP.
Scalability: OSPF is better suited for larger networks because it can be split into
areas.
Efficient Use of Resources: Since OSPF only sends updates when the network
topology changes (rather than periodically like RIP), it reduces the amount of
traffic used for updates.
Disadvantages of OSPF:
Complexity: OSPF is more complex to configure and manage compared to RIP.
Overhead: For very small networks, OSPF might be overkill because of its
complexity and resource requirements.
In summary, OSPF is a more efficient, faster, and scalable routing protocol
compared to RIP. It’s used in larger, more complex networks where quick updates
and detailed knowledge of the network topology are important.
OSPF (Open Shortest Path First)
 “open”: publicly available
 uses link state algorithm
 LS packet dissemination
 topology map at each node
 route computation using Dijkstra’s algorithm
 OSPF advertisement carries one entry per
neighbor
 advertisements flooded to entire AS
 carried in OSPF messages directly over IP
(rather than TCP or UDP
 IS-IS routing protocol: nearly identical to
OSPF
Network 4-37
Layer
OSPF “advanced” features (not in
RIP)
 security: all OSPF messages authenticated (to
prevent malicious intrusion)
 multiple same-cost paths allowed (only one
path in RIP)
 for each link, multiple cost metrics for
different TOS (e.g., satellite link cost set “low”
for best effort ToS; high for real time ToS)
 integrated uni- and multicast support:
 Multicast OSPF (MOSPF) uses same
topology data base as OSPF
 hierarchical OSPF in large domains.

Network 4-38
Layer
Hierarchical OSPF
boundary router
backbone
router
backbon
e
area
borde
r
router
s area
3

intern
al
area router
1 area s
2
Network 4-39
Layer
Hierarchical
OSPF
 two-level hierarchy: local area, backbone.

 link-state advertisements only in area


 each nodes has detailed area
topology; only know direction (shortest
path) to nets in other areas.
 area border routers: “summarize” distances
to nets in own area, advertise to other Area
Border routers.
 backbone routers: run OSPF routing
limited to backbone.
 boundary routers: connect to other
AS’s.
Network 4-40
Layer
Network Layer (Control Plane and data Plane)

Control Plane:
The control plane is responsible for making decisions about how data should
be forwarded. It’s where the routing and signaling decisions are made.
The control plane uses routing protocols (such as OSPF, RIP, BGP) to
exchange information between routers and create the routing table, which
determines the best paths for data.
It involves network-wide decision-making and topology management.
This plane is where the network's "brain" operates.
Key Functions:
Routing: Determines the best path for data to take through the network
(e.g., using OSPF, BGP).
Network Topology: Collects and stores information about the network's
structure (e.g., what routers are connected and how they communicate).
Signaling: Establishes paths and routes for data transmission.
Updates: Sends updates to routing tables based on network changes
(e.g., link failures, new connections).
Data Plane:
The data plane (also called the forwarding plane) is responsible for actually
forwarding data packets to their destination based on the decisions made by
the control plane.
This plane operates on a per-packet basis and handles the transmission of
data between devices in the network (e.g., routers, switches).
It follows the routing table and uses forwarding information to send data
from one device to another.
Key Functions:
Forwarding: Sends data packets from the input to the output interface
on the router or switch, according to the routing table created by the
control plane.
Packet Processing: Examines each incoming packet’s destination and
forwards it to the appropriate next hop.
Encapsulation and Decapsulation: Packs data into frames for
transmission and extracts the data at the receiving end.
Queueing: Handles the buffering of data if needed, especially when
network congestion occurs.
Differences
Aspect Control Plane Data Plane
Forwards the data packets
Makes decisions about how to
Purpose based on control plane
route packets.
decisions.
Routing protocols, building and Actual packet forwarding and
Responsibilities
updating routing tables. delivery to the next hop.
Involves network-wide
Operates on a per-packet basis,
Operations decision-making, routing, and
forwarding data.
signaling.
Path selection, network
Forwarding packets,
Functions topology management, route
encapsulation/decapsulation.
updates.
Communicates with other
Receives and sends packets
Communication routers to exchange routing
based on routing table entries.
info (e.g., BGP, OSPF).

Determines how data flows Actually moves the data


Impact on Data Flow
through the network. through the network.
OSPF, BGP, RIP, ARP for Router packet forwarding,
Examples
network discovery. switch frame forwarding.
Simple Analogy:
•Control Plane: of the control plane as a traffic manager who decides the
best routes for cars (data) to take across the city (network).
•Data Plane: The data plane is like the actual cars that drive through the
routes the traffic manager has set.

Summary:
•The control plane is about decision-making and routing (it decides how
packets should travel), while the data plane is about forwarding and
transmitting those packets along the best path (based on the control plane’s
decisions).

You might also like