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

Chapter 5 - Network Layer

The document summarizes key concepts about the network layer, including its role in encapsulating segments from the transport layer into datagrams and delivering datagrams to the receiving host's transport layer. It describes the three main components of the Internet's network layer - the IP protocol, path determination protocols, and ICMP. It also provides details on the IP datagram format and IP addressing.

Uploaded by

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

Chapter 5 - Network Layer

The document summarizes key concepts about the network layer, including its role in encapsulating segments from the transport layer into datagrams and delivering datagrams to the receiving host's transport layer. It describes the three main components of the Internet's network layer - the IP protocol, path determination protocols, and ICMP. It also provides details on the IP datagram format and IP addressing.

Uploaded by

atuhaisederrick
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 87

Chapter 5

Network Layer

Computer
Networking: A Top
Down Approach
6th edition
Jim Kurose, Keith Ross
Addison-Wesley
March 2012

Network Layer 4-1


Chapter 5: Network layer
chapter goals:
 understand principles behind network layer services:
 network layer service models
 forwarding versus routing
 how a router works
 routing (path selection)

Network Layer 4-2


Network layer
 Role: transport segment from application
transport

sending to receiving host


network
data link
physical

 on sending side encapsulates network


network
data link
physical
network
data link
physical
segments into datagrams data link
physical network network
data link
on receiving side, delivers
data link
 physical physical

segments to transport layer network network


data link
data link
 Network layer protocols in physical
network
data link
physical

every host, router. The physical


application
network layer involves each network
data link network
transport
network

and every host and router in network


data link
physical data link
physical
data link
physical

the network. physical

 router examines header fields


in all IP datagrams passing
through it
Network Layer 4-3
Three key network-layer functions
 Forwarding/switching: move some network
packets from router’s input to architectures require
appropriate router output router call setup along
path before data flows
 routing: determine route
taken by packets from source analogy:
to dest. Algorithms that
calculate these paths are  routing: process of
called routing algorithms planning trip from
 Call setup: With TCP, 3-way source to dest
handshake is required before
data actually flows from
 forwarding: process of
sender to receiver. This getting through single
allows sender & receiver to interchange
set up needed state info. Network Layer 4-4
Interplay between routing and forwarding

routing algorithm routing algorithm determines


end-end-path through network

local forwarding table forwarding table determines


header value output link local forwarding at this router
0100 3
0101 2
0111 2
1001 1

value in arriving
packet’s header
0111 1

3 2

Network Layer 4-5


The Internet network layer
host, router network layer functions:

transport layer: TCP, UDP

routing protocols IP protocol


• path selection • addressing conventions
• RIP, OSPF, BGP • datagram format
network • packet handling conventions
layer forwarding
table
ICMP protocol
• error reporting
• router “signaling”

link layer

physical layer

Network Layer 4-6


 The network layer at the sending host receives a
segment from the transport layer,
 it encapsulates the segment within an IP datagram,
 writes the destination host address as well as other
fields in the datagram,
 Sends the datagram to the first router on the path
toward the destination host.
 The Internet’s network layer has three major
components:

Network Layer 4-7


Major components of network layer
 The Internet Protocol (IP Protocol – IPv4 & IPv6),
which defines network- layer addressing, the fields in the
datagram, and the actions taken by routers and end
systems on a datagram based on values in these fields.
 Second: Path determination component; it determines the
route a datagram follows from source to destination.
Examples of such components used in the Internet are
RIP, OSPF, BGP.
 The Internet's network- layer error and information
reporting protocol, ICMP, is a facility to report errors in
datagrams and respond to requests for certain network-
layer information.

Network Layer 4-8


IP Protocol
IP Connectionless
IP - Best Effort Delivery
IP - Media Independence
Encapsulating IP
IP datagram format
IP protocol version
number total datagram
length (bytes)
header length
(bytes)
for
“type” of data fragmentation/
reassembly
max number
remaining hops
(decremented at
each router)

upper layer protocol


to deliver payload to

how much overhead?


 20 bytes of TCP
 20 bytes of IP e.g. timestamp, record
 = 40 bytes + app route taken, specify list
layer overhead of routers to visit.
Network Layer 4-14
• Version – Version of IP used for data transfer, must be
accepted on the other side
• Header length – Ranges from 20 – 60 bytes
• Total length of datagram = Length of header + Data Length
• The Time to Live (TTL) field is used to specify the time for
which a datagram must be retained on the network.
• Protocol field is used to specify the protocol used to create
the data present in the Data field e.g., TCP, IP, ICMP
• Header Checksum field contains the checksum, which is
used by the destination to check for the integrity of the
transmitted data by applying an algorithm on the IP header.
Not the same, discard it

Network Layer 4-15


IP addressing: introduction
223.1.1.1
 IP address: 32-bit 223.1.2.1
identifier for host, router
interface 223.1.1.2
223.1.1.4 223.1.2.9
 interface: connection
between host/router and 223.1.3.27
physical link 223.1.1.3
223.1.2.2
 router’s typically have
multiple interfaces
 host typically has one or
two interfaces (e.g., wired 223.1.3.1 223.1.3.2

Ethernet, wireless 802.11)


 IP addresses are
associated with an 223.1.1.1 = 11011111 00000001 00000001 00000001
interface not a host
223 1 1 1

Network Layer 4-16


 When IP in the host wants to send a datagram, it
will do so over this link.
 The boundary between the host and the physical
link is called an interface.
 A router's job is to receive a datagram on an
"incoming" link and forward the datagram on
some "outgoing" link,
 thus a router has multiple interfaces, one for each
of its links.

Network Layer 4-17


IP addressing: introduction
223.1.1.1
Q: how are interfaces 223.1.2.1
actually connected?
A: we’ll learn about 223.1.1.2
223.1.1.4 223.1.2.9

that in chapter 5, 6.
223.1.3.27
223.1.1.3
223.1.2.2

A: wired Ethernet interfaces


connected by Ethernet switches
223.1.3.1 223.1.3.2

For now: don’t need to worry


about how one interface is
connected to another (with no
intervening router) A: wireless WiFi interfaces
connected by WiFi base station

Network Layer 4-18


Legacy Classful Addressing
Legacy Classful Addressing

An IPv4 address
usually has three
parts.
Subnets
223.1.1.0/24
 IP address: 223.1.2.0/24
223.1.1.1
 subnet part - high order bits
 host part - low order bits
223.1.1.2 223.1.2.1
 what’s a subnet ? 223.1.1.4 223.1.2.9

 subnet is a logical 223.1.2.2


subdivision of an IP 223.1.1.3 223.1.3.27
network. subnet
 Device interfaces with same
subnet part/network part of 223.1.3.2
223.1.3.1
IP address
 can physically reach each
other without intervening 223.1.3.0/24
router
Network consisting of 3 subnets
subnet mask: /24
Network Layer 4-21
Subnets 223.1.1.2

how many? 223.1.1.1 223.1.1.4

How many addresses 223.1.1.3

are being wasted


for each subnet? 223.1.9.2 223.1.7.2

223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.2

223.1.2.6 223.1.3.27

223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2

Network Layer 4-22


Reasons for Subnetting
 Subnetting is the process of segmenting a network
into multiple smaller network spaces called
subnetworks or subnets.
 Large networks must be segmented into smaller
subnetworks, creating smaller groups of devices and
services to:
• Control traffic by containing broadcast traffic within
each subnetwork.
• Reduce overall network traffic and improve network
performance.
Reasons for Subnetting
Communication Between Subnets
 A router is necessary for devices on different networks and
subnets to communicate.
 Each router interface must have an IPv4 host address that
belongs to the network or subnet to that the router
interface is connected.
 Devices on a network and subnet use the router interface
attached to their LAN as their default gateway.

Network Layer 4-24


IP addressing: Classless Interdomain Routing
 With CIDRized, network addresses, the network part
of an IP address can be any number of bits long,
rather than being constrained to 8, 16, or 24 bits.
 A CIDRized network address has the dotted-decimal
form a.b.c.d/x, where x indicates the number of
leading bits in the 32-bit quantity that constitutes the
network portion of the address.
 An organization with 2,000 hosts could be allocated a
block of only 2,048 host addresses of the form
a.b.c.d/21 since a class B (/16) network, which
supports up 65,634 hosts is too large yet
 A class C (/24) network could only accommodate up
to 2^8 - 2 = 254 hosts (two of the 28 = 256 addresses
are reserved for special use)--too small
Network Layer 4-25
IP addressing: CIDR
CIDR: Classless InterDomain Routing
 subnet portion of address of arbitrary length
 address format: a.b.c.d/x, where x is # bits in
subnet portion of address

subnet host
part part
11001000 00010111 00010000 00000000
200.23.16.0/24

Network Layer 4-26


Prefixes
32 bits

Prefix /27 Host


27 bits 5 bits

 A range of IP addresses is given as a prefix, e.g.


192.0.2.128/27
 In this example:
 How many addresses are available?
 What are the lowest and highest addresses?
Golden Rules for 192.0.2.128/27
 Lowest 192.0.2.128 = Network Address
 Highest 192.0.2.159 = Broadcast Address
 Usable: 192.0.2.129 to 192.0.2.158
 Number of usable addresses: 32 - 2 = 30
Netmask
 an alternative (old) way of writing the prefix
length
 A ‘1' for a prefix/subnet bit and '0' for a host bit
 Hence N x 1's followed by (32-N) x 0's

/27 =
11111111111111111111111111100000
255 . 255 . 255 . 224
Exercises
 Network 10.10.10.0/25
 How many addresses in total?
 How many usable addresses?
 What are the lowest and highest usable addresses?

 Network 10.10.20.0/22
 How many addresses in total?
 How many usable addresses?
 What the the lowest and highest usable addresses?
NAT: Network Address Translation
rest of local network
Internet (e.g., home network)
10.0.0/24 10.0.0.1

10.0.0.4
10.0.0.2
138.76.29.7

10.0.0.3

all datagrams leaving local


datagrams with source or
network have same single
destination in this network
source NAT IP address:
have 10.0.0/24 address for
138.76.29.7,different source
source, destination (as usual)
port numbers
Network Layer 4-31
 Where do home network computers get their addresses
and where does the router get its single IP address?
 The answer is – DHCP.
 The router gets its address from the ISP’s DHCP server,
 The router runs a DHCP server to provide addresses to
computers within the NAT-DHCP-router-controlled home
network’s address space.
 How does the router know the internal host to which it
should forward a given datagram?
 The trick is to use a NAT translation table at the NAT router,
 Also include port numbers as well as IP addresses in the table
entries.

Network Layer 4-32


NAT: Network Address Translation
motivation: local network uses just one IP address as far
as outside world is concerned:
 range of addresses not needed from ISP: just one IP
address for all devices
 can change addresses of devices in local network
without notifying outside world
 can change ISP without changing addresses of
devices in local network
 devices inside local net not explicitly addressable,
visible by outside world (a security plus)

Network Layer 4-33


Issues with NAT
 Port numbers are meant to be used for addressing processes,
not for addressing hosts. This is violated by NAT and can
indeed cause problems for servers running on the home
network.
 Routers are supposed to process packets only up to layer 3.
 The NAT protocol violates the end-to-end argument; i.e,
hosts should be talking directly with each other, without
interfering nodes modifying IP addresses and port numbers.
 NAT interferes with P2P apps, including P2P file-sharing
apps and P2P VoIP apps since in a P2P app, any participating
Peer A should be able to initiate a TCP connection to any
other participating Peer B. A peer behind a NAT can’t act as
a server to accept TCP connections.

Network Layer 4-34


IPv4 Unicast, Broadcast, and Multicast

Unicast Transmission
In an IPv4 network, hosts can communicate in one of three different ways:
Unicast, Broadcast, and Multicast

#1 Unicast – the
process of sending a
packet from one host to
an individual host.
IPv4 Unicast, Broadcast, and Multicast

Broadcast Transmission
In an IPv4 network, hosts can communicate in one of three different ways:
Unicast, Broadcast, and Multicast.

#2 Broadcast – the
process of sending a
packet from one host to Directed broadcast
all hosts in the network. • Destination 172.16.4.255
• Hosts within the
NOTE: Routers do 172.16.4.0/24 network
not forward a
limited broadcast!

Directed broadcast
 Destination
172.16.4.255
 Hosts within the
172.16.4.0/24 network
IPv4 Unicast, Broadcast, and Multicast

Multicast Transmission
#3 Multicast – The process of sending a packet from one host to a selected
group of hosts, possibly in different networks.
 Reduces traffic
 Reserved for addressing multicast groups – 224.0.0.0 to 239.255.255.255.
 Link local – 224.0.0.0 to 224.0.0.255 (Example: routing information
exchanged by routing protocols)
 Globally scoped addresses – 224.0.1.0 to 238.255.255.255 (Example:
224.0.1.1 has been reserved for Network Time Protocol)
Types of IPv4 Address

Public and Private IPv4 Addresses


Private address blocks are:
 Hosts that do not require access to the Internet can use private addresses
 10.0.0.0 to 10.255.255.255 (10.0.0.0/8)
 172.16.0.0 to 172.31.255.255 (172.16.0.0/12)
 192.168.0.0 to 192.168.255.255 (192.168.0.0/16)

Shared address space addresses:


 Not globally routable
 Intended only for use in service provider networks
 Address block is 100.64.0.0/10
Types of IPv4 Address

Special Use IPv4 Addresses


 Network and Broadcast addresses – Within each network, the
first and last addresses cannot be assigned to hosts.
 Loopback addresses – 127.0.0.1 is a special address that hosts
use to direct traffic to themselves (addresses 127.0.0.0 to
127.255.255.255 are reserved).
 Link-local addresses – 169.254.0.0 to 169.254.255.255
(169.254.0.0/16) addresses can be automatically assigned to
the local host.
 TEST-NET addresses – 192.0.2.0 to 192.0.2.255 (192.0.2.0/24)
are set aside for teaching and learning purposes; used in
documentation and network examples.
 Experimental addresses – 240.0.0.0 to 255.255.255.254 are
listed as reserved.
Network Layer in Communication

IPv4 Limitations
 IP address depletion
 More and more IP-enabled devices are connecting
 Internet routing table expansion
 The Internet routing tables continue to grow which means
Internet core routers require more processing power, memory,
and overhead.
 Lack of true end-to-end model
 IPv4 networks typically use NAT as the solution to address
depletion.
 However, NAT hides the true source address of traffic, which
can cause other issues.
 Lack of end-to-end connectivity
Chapter 4: outline
4.5 routing
4.1 introduction
algorithms
4.2 virtual
link state
circuit and datagram networks
4.3 what’s
distance vector
inside a router
 hierarchical routing
4.4 IP: Internet Protocol
4.6 routing in the Internet
datagram format
 RIP
IPv4 addressing
 OSPF
ICMP
 BGP
IPv6
4.7 broadcast and multicast routing

Network Layer 4-41


ICMP: Internet Control Message Protocol

 used by hosts & routers to


Type Code description
communicate network-
0 0 echo reply (ping)
level information 3 0 dest. network unreachable
 error reporting: unreachable 3 1 dest host unreachable
host, network, port, 3 2 dest protocol unreachable
protocol 3 3 dest port unreachable
 echo request/reply (used by 3 6 dest network unknown
ping) 3 7 dest host unknown
 network-layer “above” IP: 4 0 source quench (congestion
 ICMP msgs carried in IP control - not used)
datagrams 8 0 echo request (ping)
9 0 route advertisement
 ICMP message: type, code
10 0 router discovery
plus first 8 bytes of IP 11 0 TTL expired
datagram causing error 12 0 bad IP header

Network Layer 4-42


 The most typical use of ICMP is for error reporting.
 ICMP is often considered part of IP, but architecturally
lies just above IP, as ICMP messages are carried inside
IP packets.
 That is, ICMP messages are carried as IP payload, just
as TCP or UDP segments are carried as IP payload.
 ICMP messages have a type and a code field
 The well-known ping program sends an ICMP type 8
code 0 message to the specified host.
 The destination host, seeing the echo request, sends
back a type 0 code 0 ICMP echo reply.
 Also Traceroute also uses ICMP messages.
 During Telnet, FTP, HTTP sessions, error messages like
“Destination network unreachable.” originate in ICMP.
Network Layer 4-43
Traceroute and ICMP
 source sends series of when ICMP message arrives,

UDP segments to dest source records RTTs


 first set has TTL =1 stopping criteria:
 second set has TTL=2, etc.  UDP segment eventually arrives at
 unlikely port number destination host
 when nth set of datagrams  destination returns ICMP “port
arrives to nth router: unreachable” message (type 3,
 router discards datagrams code 3)
 and sends source ICMP  source stops
messages (type 11, code 0)
 ICMP messages include
 Standard Traceroute program sends
name of router & IP address sets of 3 packets with same TTL;
thus the Traceroute output provides
three results for each TTL.

3 probes 3 probes

3 probes
Network Layer 4-44
IPv6: motivation
 initial motivation: 32-bit address space soon to be
completely allocated.
 additional motivation:
 header format helps speed processing/forwarding
 header changes to facilitate QoS

IPv6 datagram format:


 fixed-length 40 byte header
 no fragmentation allowed

Network Layer 4-45


Introducing IPv6
 Larger address space
 IPv6 addresses are 128 bits, compared to IPv4’s 32 bits.
• There are enough IPv6 addresses to allocate more than the
entire IPv4 Internet address space to everyone on the planet.
 Elimination of public-to-private NAT
 End-to-end communication traceability is possible.
 Elimination of broadcast addresses
 IPv6 now includes unicast, multicast, and anycast addresses.
 Support for mobility and security
 Helps ensure compliance with mobile IP and IPsec standards.
 Simplified header for improved router efficiency
IPv4 Header vs. IPv6 Header
• The IPv4 header has 20 octets containing • The IPv6 header has 40 octets containing
12 basic header fields. 8 fields.
• Three of these fields are identical in nature.
• Other fields serve similar functions as in IPv4.
• The remaining IPv4 fields no longer exist in IPv6.
IPv6 Address Specifics
 The 128-bit IPv6 address is written using
hexadecimal numbers.
 Specifically, it consists of 8, 16-bit segments separated
with colons between each set of four hex digits (16
bits).
 The format is x:x:x:x:x:x:x:x, where x is a
16-bit hexadecimal field therefore each x is
representing four hexadecimal digits.
 An example address is as follows:
• 2035:0001:2BC5:0000:0000:087C:0000:000A

Homework: Read about Abbreviating IPv6 Addresses


Is IPv4 Obsolete?
 IPv4 is in no danger of disappearing overnight.
 It will coexist with IPv6 and then gradually be
replaced.
 IPv6 provides many transition options including:
 Dual stack:
• Both IPv4 and IPv6 are configured and run
simultaneously on the interface.
 IPv6-to-IPv4 (6to4) tunneling and IPv4-
compatible tunneling.
 NAT protocol translation (NAT-PT)
between IPv6 and IPv4.
Transition from IPv4 to IPv6
 tunneling: IPv6 datagram carried as payload in
IPv4 datagram among IPv4 routers

IPv4 header fields IPv6 header fields


IPv4 payload
IPv4 source, dest addr IPv6 source dest addr
UDP/TCP payload

IPv6 datagram
IPv4 datagram
Network Layer 4-50
Tunneling
A B IPv4 tunnel E F
connecting IPv6 routers
logical view:
IPv6 IPv6 IPv6 IPv6

A B C D E F
physical view:
IPv6 IPv6 IPv4 IPv4 IPv6 IPv6

flow: X src:B src:B flow: X


src: A dest: E src: A
dest: F
dest: E
dest: F
Flow: X Flow: X
Src: A Src: A
data Dest: F Dest: F data

data data

A-to-B: E-to-F:
IPv6 B-to-C: B-to-C: IPv6
IPv6 inside IPv6 inside
IPv4 IPv4 Network Layer 4-51
Chapter 4: outline
4.5 routing
4.1 introduction
algorithms
4.2 virtual
link state
circuit and datagram networks
4.3 what’s
distance vectora router
inside
 hierarchical routing
4.4 IP: Internet Protocol
4.6 routing
datagramin format
the Internet
 RIP
IPv4 addressing
 OSPF
ICMP
 BGP
IPv6
4.7 broadcast and multicast routing

Network Layer 4-52


Forwarding and Routing
 Forwarding is receiving packets on an interface
and re-sending them out on another interface
 Routing is deciding on the best path to reach any
given destination
 These are two different concepts!
 Forwarding is done in hardware
 Routing is a software function
Outline forwarding operation
 Receive a datagram
 Is it for us (Destination IP = ours)? Accept
 Look up the destination IP address in forwarding table
(FIB) to find the next hop
• if not found, discard the datagram
 Re-send to next hop
RIBs and FIBs
 FIB (Forwarding Information Base) is the Forwarding
Table
 It contains destinations and the interfaces to get to those
destinations
 Used by the router to figure out where to send the packet
 RIB (Routing Information Base) is the Routing Table
 It contains a list of all the destinations and the various next
hops used to get to those destinations – and lots of other
information too!
 One destination can have lots of possible next-hops only the
best next-hop goes into the FIB
Forwarding
 The best way to reach a given prefix is stored in
the Forwarding Table
 Each packet's destination address is looked up to
decide where to send it next (the next hop)

Destination Prefix Next Hop


10.10.0.0/16 1.2.3.3
10.10.1.0/24 1.2.3.4
10.10.2.0/24 1.2.3.5
Longest Prefix Rule
 If the destination matches multiple prefixes, the
longest prefix wins
 Example: packet destination 10.10.1.1

Destination Prefix Next Hop


10.10.0.0/16 1.2.3.3 MATCH!
Longest
10.10.1.0/24 1.2.3.4 MATCH! Prefix
10.10.2.0/24 1.2.3.5 no match
Longest Prefix Rule #another example
Default route
Sometimes referred to as gateway of last
resort
 Destination 0.0.0.0/0 or ::/0
 Matches every IP address
 But only when there is no better match (longer
prefix) for that destination
Routing
 Deciding the best path to any given
destination
 Two types:
 Configured manually: static routing
 Learned automatically: dynamic routing
Path Determination
 Best path is selected based on a metric
 A metric is the value used to measure the distance to a
given network.
 Best path is the path with the lowest metric.
 Examples
 Routing Information Protocol (RIP) - Hop count
 Open Shortest Path First (OSPF) - Cost based on
cumulative bandwidth from source to destination
 Enhanced Interior Gateway Routing Protocol
(EIGRP) - Bandwidth, delay, load, reliability
Load Balancing
 When a router has two or more paths to a
destination with equal cost metrics, then the router
forwards the packets using both paths equally:
 Equal cost load balancing can improve network
performance.
 Equal cost load balancing can be configured to use both
dynamic routing protocols and static routes.
• Homework: Which Routing protocols support
Equal load balancing
Static Routes
 Static routes are manually configured
 They define an explicit path between two networking
devices.
 Static routes must be manually updated if the topology
changes.
 Their benefits include improved security and control of
resources.
 A default static route is used when the routing table does
not contain a path for a destination network.
Dynamic Routing
 Dynamic routing is used by routers to share
information about the reachability and status of
remote networks.
 It performs network discovery and maintains
routing tables.
Dynamic Routing Protocols
 Routing Protocols are used to facilitate the exchange
of routing information between routers.
 The purpose of dynamic routing protocols includes:
 Discovery of remote networks
 Maintaining up-to-date routing information
 Choosing the best path to destination networks
 Ability to find a new best path if the current path is no
longer available
The Role of Dynamic Routing Protocols
 Advantages of dynamic routing include:
 Automatically share information about remote
networks
 Determine the best path to each network and add this
information to their routing tables
 require less administrative overhead
 Disadvantages of dynamic routing include:
 Part of a router’s resources are dedicated for protocol
operation, including CPU time and network link
bandwidth
 Times when static routing is more appropriate
Using Static Routing
 Networks typically use a combination of both static and
dynamic routing.
 Static routing has several primary uses:
 Providing ease of routing table maintenance in smaller
networks that are not expected to grow significantly.
 Routing to and from a stub network (pocket network).
 Accessing a single default router. This is used to represent a
path to any network that does not have a match in the routing
table.
 NB: Stub Network is a casual term describing a computer
network with no knowledge of other networks, that will
typically send much or all of its non-local traffic out via a
single path, with the network aware only of a default route to
non-local destinations.
Using Static Routing (cont.)
Dynamic verses Static Routing
Static Routing Scorecard
Dynamic verses Static Routing
Dynamic Routing Scorecard
Types of Routing Protocols
Classifying Routing Protocols
Types of Routing Protocols
Distance Vector Routing Protocols

Distance vector IPv4 IGPs:


 RIPv1 - First generation
legacy protocol
 RIPv2 - Simple
distance vector routing
protocol

For R1, 172.16.3.0/24 is one hop


away (distance). It can be reached
through R2 (vector).
Types of Routing Protocols
Distance Vector or Link-State Routing Protocols

Distance vector protocols use


routers as sign posts along the
path to the final destination.

 A link-state routing protocol is like having a complete map


of the network topology.
 The sign posts along the way from source to destination
are not necessary, because all link-state routers are
using an identical map of the network.
 A link-state router uses the link-state information to create
a topology map and to select the best path to all
destination networks in the topology.
Types of Routing Protocols
Link-State Routing Protocols

Link-state IPv4 IGPs:


 OSPF - Popular
standards based
routing protocol
 IS-IS - Popular in
provider networks.
Distance Vector Routing Protocol Operation
Distance Vector Technologies

Distance vector routing protocols:


 Share updates between neighbors
 Not aware of the network topology
 Some send periodic updates to broadcast
IP 255.255.255.255 even if topology has
not changed
 Updates consume bandwidth and network
device CPU resources
Distance Vector Routing Protocol Operation
Distance Vector Algorithm

RIP uses the Bellman-Ford algorithm as its routing algorithm.


Link-State Routing Protocol Operation
Shortest Path First Protocols
Link-State Updates
Link-State Routing Process
Link-State Routing Protocol Operation
Dijkstra’s Algorithm
Why Use Link-State Routing Protocols
Protocols that Use Link-State

There are only two link-state routing protocols:

 Open Shortest Path First (OSPF) most popular


• began in 1987
• two current versions
• OSPFv2 - OSPF for IPv4 networks
• OSPFv3 - OSPF for IPv6 networks

 IS-IS was designed by International Organization for Standardization (ISO )


Types of Routing Protocols
IGP and EGP Routing Protocols

Interior Gateway
Protocols (IGP) -
 Used for routing
within an AS
 Include RIP, EIGRP,
OSPF, and IS-IS
Exterior Gateway
Protocols (EGP) -
 Used for routing
between AS
 Official routing
protocol used by the
Internet
Interior gateway protocols
 most common routing protocols:
 RIP: Routing Information Protocol
 OSPF: Open Shortest Path First

Network Layer 4-82


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 subnets:


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

z
w x y
A D B

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

C
routing table in router D
destination subnet next router # hops to dest
w A 2
y B 2
A 5
z B 7
x -- 1
…. …. ....
Network Layer 4-85
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)
 In a computer network that uses RIP or other distance
vector routing protocols, a poison reverse is a way in
which a gateway node tells its neighbor gateways that one
of the gateways is no longer connected.

Network Layer 4-86


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

transport transprt
(UDP) (UDP)
network forwarding forwarding network
(IP) table table (IP)
link link
physical physical

Network Layer 4-87

You might also like