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

Unit 4

Uploaded by

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

Unit 4

Uploaded by

kabipip482
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 173

Unit 4

19.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Contents
 Switching, Logical addressing – IPV4 addressing,
subnet mask, classless Inter-domain routing (CIDR)
 IPV6
 Address mapping – ARP, RARP
 BOOTP and DHCP–Delivery, Forwarding, and
Unicast Routing
 Protocols—shortest path algorithm, flooding,
distance vector routing
 Algorithm, Bellman-ford algorithm, Dijkstra’s
algorithm, link state routing, RIP, Open shortest
path first protocol (OSPF).

19.2
Switching
 Switching techniques in computer networks
to connect devices and allow them to
communicate with each other.
 Additionally, we can utilize switching techniques to
transfer data from one device to another.
 Switching allows multiple devices to share the
same communication channel simultaneously.
 As a result, it improves the efficiency of the
network. Furthermore, switching also enables the
network to route data to its intended destination.
 Additionally, it provides a mechanism for
error checking and correction

19.3
Switching
 Switching techniques in computer networks
to connect devices and allow them to
communicate with each other.
 Additionally, we can utilize switching techniques to
transfer data from one device to another.
 Switching allows multiple devices to share the
same communication channel simultaneously.
 As a result, it improves the efficiency of the
network. Furthermore, switching also enables the
network to route data to its intended destination.
 Additionally, it provides a mechanism for
error checking and correction

19.4
Circuit Switching
 We mainly use circuit switching in traditional telephone
networks.
 When two devices want to communicate in a
circuit-switched network, they establish a
connection by setting up a dedicated path
between them.
 This path is reserved exclusively for the duration of the
communication. Hence, no other devices can use it
during that specific time.
 Once we establish the connection, we can transfer data
between devices over the dedicated path.
 This path typically comprises a series of interconnected
switches or nodes that route the data to its destination.

19.5
Circuit Switching

19.6
Circuit Switching
 Circuit switching isn’t commonly used in
computer networks, as it isn’t very efficient for
data transmission.
 We reserve the dedicated path for the entire
duration of the communication.
 Therefore, we waste a significant amount of
bandwidth during those times.
 Additionally, circuit switching is not well-suited for
networks with high traffic volumes.

19.7
Advantages
 Circuit switching provides a dedicated
communication path between two devices for the
duration of the communication. Hence, we
reserve the bandwidth for the entire
conversation. This results in guaranteed
bandwidth, which can be important for
applications that require a constant data rate.
 As we reserve the dedicated communication for
the entire conversation, there’s no packet loss.
Finally, circuit switching provides predictable
performance.

19.8
Disadvantages
 Circuit switching requires the dedicated communication
path to be reserved for the entire duration of the
communication.
 This results in an inefficient use of bandwidth, as the
dedicated path isn’t being utilized during these times.
 Circuit switching isn’t well-suited for networks with high
traffic volumes. This limits the scalability of circuit
switching in large networks.
 Finally, it requires dedicated resources, such as switches
or nodes, to establish the dedicated communication path.
 This can result in high costs for establishing and
maintaining circuit-switched networks

19.9
Packet Switching
 Packet switching is a method used to transmit data over a
network.
 We divide data into small packets and transmit them
over the network independently.
 Each packet contains the data and destination address
information required to route the packet to its destination.
 In packet switching, each packet travels separately through
the network and can take different paths to reach its
destination.
 This approach allows for more efficient use of network
resources because we can transmit multiple packets
simultaneously over the same network.

19.10
Packet Switching

19.11
Packet Switching
 Packet switching is the basis for the Internet,
which uses the
Transmission Control Protocol/Internet Protocol (T
CP/IP)
suite of protocols for communication between
devices.
 In this system, we transmit packets between
devices, and routers along the way use the
destination address information in each packet to
route it to the next hop until it reaches its
destination.

19.12
Packet Switching-Advantages

 Packet switching offers several


advantages over other data transmission
methods, such as circuit switching. Let’s
discuss some of the key benefits of packet
switching.
 It allows multiple packets to be
transmitted simultaneously over the
network, making more efficient use of
the available bandwidth.

19.13
Packet Switching-Advantages

 Packet switching is a robust and reliable


method of data transmission.
 If one packet is lost or delayed, it doesn’t affect
the transmission of other packets, as we route
packets independently through the network.
 Packet switching is highly flexible. It can easily
adapt to changing traffic patterns and network
conditions.

19.14
Packet Switching-Advantages

 Packet switching is a robust and reliable


method of data transmission.
 If one packet is lost or delayed, it doesn’t affect
the transmission of other packets, as we route
packets independently through the network.
 Packet switching is highly flexible. It can easily
adapt to changing traffic patterns and network
conditions.

19.15
Packet Switching-Disadvantages
 The process of breaking data into packets and
adding header information to each packet can
introduce additional overhead and latency into
the transmission process. This can increase the
time required for packets to reach their destination.
Additionally, it can reduce the overall speed of data
transmission.
 It can be vulnerable to security threats such as
packet sniffing. This can compromise the privacy and
security of data transmitted over the network.
Furthermore, it can be complex to set up and manage,
particularly in larger or more complex networks.
 .

19.16
Datagram Packet Switching
 Datagram packet-switching is a packet switching
technology by which each packet, now called a
datagram, is treated as a separate entity.
 Each packet is routed independently through the
network.
 Therefore packets contain a header with the full
information about the destination.
 The intermediate nodes examine the header of a
packet and select an appropriate link to another node
which is nearer to the destination.
 In this system, the packets do not follow a pre-
established route, and the intermediate nodes do not
require prior knowledge of the routes that will be used.

19.17
Datagram Packet Switching
 The individual packets which form a data stream may
follow different paths between the source and the
destination. As a result, the packets may arrive at the
destination out of order.
 When this occurs, the packets will have to be
reassembled to form the original message.
 Because each packet is switched independently, there is
no need for connection setup and no need to dedicate
bandwidth in the form of a circuit.
 Datagram packet switches use a variety of techniques
to forward traffic; they are differentiated by how long it
takes the packet to pass through the switch and their
ability to filter out corrupted packets.

19.18
Virtual Circuit Switching
 Virtual circuit switching is a packet switching methodology whereby
a path is established between the source and the final destination
through which all the packets will be routed during a call.
 This path is called a virtual circuit because to the user, the
connection appears to be a dedicated physical circuit.
 However, other communications may also be sharing the parts of
the same path.
 Before the data transfer begins, the source and destination identify
a suitable path for the virtual circuit.
 All intermediate nodes between the two points put an entry of the
routing in their routing table for the call.
 Additional parameters, such as the maximum packet size, are also
exchanged between the source and the destination during call
setup.
 The virtual circuit is cleared after the data transfer is completed.

19.19
Virtual Circuit Switching
 Virtual circuit packet switching is connection orientated.
This is in contrast to datagram switching, which is a
connection less packet switching methodology.
Advantages of virtual circuit switching are:
 Packets are delivered in order,since they all take the
same route;
 The overhead in the packets is smaller,
since there is no need for each packet to contain the full
address;
 The connection is more reliable,network resources are
allocated at call setup so that even during times of
congestion, provided that a call has been setup, the
subsequent packets should get through;

19.20
Disadvantages
 The switching equipment needs to be more
powerful,since each switch needs to store details
of all the calls that are passing through it and to
allocate capacity for any traffic that each call
could generate;
 Resilience to the loss of a trunk is more
difficult,since if there is a failure all the calls must
be dynamically reestablished over a different
route.

19.21
Message Switching
 Message switching is a method of data transmission that was
popular in the early days of networking, before the development
of packet switching. In message switching, we divide a
message into fixed-length blocks or frames.
 Furthermore, we transmit each frame independently through the
network. Additionally, each intermediate node stores the frames
until the entire message is received. Finally, the nodes forward the
entire message to its destination.
 Unlike packet switching, message switching is a store-and-forward
method of data transmission.
 It means that each intermediate node stores the entire message
until it can be forwarded to the next node.
 This can result in longer transmission times compared to packet
switching. We can only transmit each message when an
intermediate node receives all the parts of the message.

19.22
Message Switching

19.23
Advantages
 While message switching is an older method of data transmission
that has largely been replaced by packet switching, it does offer
some advantages.
 Message switching is a highly reliable method of data
transmission. Each intermediate node stores the entire message
until it can be forwarded to the next node. This reduces the risk of
data loss or corruption, as we store each message at intermediate
nodes before forwarding them.
 It’s a simple method of data transmission that doesn’t require
complex routing algorithms or network management techniques.
This makes it easy to implement and manage, particularly in small
or low-bandwidth networks.
 Message switching has a lower overhead compared to
other methods of data transmission. This means that more
bandwidth is available for data transmission.

19.24
Dis-advantages
 Message switching has a higher latency compared to
other methods, such as packet switching. Additionally,
it can be inefficient in terms of network resource utilization
because each intermediate node must store the entire
message until it can be forwarded.
 Finally, it requires more network resources for each
message. This means that message-switching networks
may be unable to support large numbers of devices or high-
bandwidth applications.

19.25
19.26
IPv4 ADDRESSES

An IPv4 address is a 32-bit address that uniquely and


universally defines the connection of a device (for
example, a computer or a router) to the Internet.

Topics discussed in this section:


Address Space
Notations
Classful Addressing
Classless Addressing
Network Address Translation (NAT)

19.27
Note

An IPv4 address is 32 bits long.

19.28
Note

The IPv4 addresses are unique


and universal.

19.29
Note

The address space of IPv4 is


232 or 4,294,967,296.

19.30
Figure 19.1 Dotted-decimal notation and binary notation for an IPv4 address

19.31
Example 19.1

Change the following IPv4 addresses from binary


notation to dotted-decimal notation.

Solution
We replace each group of 8 bits with its equivalent
decimal number and add dots for separation.

19.32
Example 19.2

Change the following IPv4 addresses from dotted-decimal


notation to binary notation.

Solution
We replace each decimal number with its binary
equivalent

19.33
Note

In classful addressing, the address


space is divided into five classes:
A, B, C, D, and E.

19.34
Figure 19.2 Finding the classes in binary and dotted-decimal notation

19.35
Example 19.4

Find the class of each address.


a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111

Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
19.36
Note

In classful addressing, a large part of


the available addresses were wasted.

19.38
Table 19.2 Default masks for classful addressing

19.39
Note

Classful addressing, which is almost


obsolete, is replaced with classless
addressing.

19.40
Note

In IPv4 addressing, a block of


addresses can be defined as
x.y.z.t /n
in which x.y.z.t defines one of the
addresses and the /n defines the mask.

19.41
Note

The first address in the block can be


found by setting the rightmost
32 − n bits to 0s.

19.42
Example 19.6

A block of addresses is granted to a small organization.


We know that one of the addresses is 205.16.37.39/28.
What is the first address in the block?

Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
205.16.37.32.
This is actually the block shown in Figure 19.3.
19.43
Note

The last address in the block can be


found by setting the rightmost
32 − n bits to 1s.

19.44
Example 19.7

Find the last address for the block in Example 19.6.

Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47
This is actually the block shown in Figure 19.3.

19.45
Note

The number of addresses in the block


can be found by using the formula
232−n.

19.46
Example 19.8

Find the number of addresses in Example 19.6.

Solution
The value of n is 28, which means that number
of addresses is 2 32−28 or 16.

19.47
Example 19.9

Another way to find the first address, the last address, and
the number of addresses is to represent the mask as a 32-
bit binary (or 8-digit hexadecimal) number. This is
particularly useful when we are writing a program to find
these pieces of information. In Example 19.5 the /28 can
be represented as
11111111 11111111 11111111 11110000
(twenty-eight 1s and four 0s).

Find
a. The first address
b. The last address
c. The number of addresses.
19.48
Example 19.9 (continued)

Solution
a. The first address can be found by ANDing the given
addresses with the mask. ANDing here is done bit by
bit. The result of ANDing 2 bits is 1 if both bits are 1s;
the result is 0 otherwise.

19.49
Example 19.9 (continued)

b. The last address can be found by ORing the given


addresses with the complement of the mask. ORing
here is done bit by bit. The result of ORing 2 bits is 0 if
both bits are 0s; the result is 1 otherwise. The
complement of a number is found by changing each 1
to 0 and each 0 to 1.

19.50
Figure 19.4 A network configuration for the block 205.16.37.32/28

19.51
Note

The first address in a block is


normally not assigned to any device;
it is used as the network address that
represents the organization
to the rest of the world.

19.52
Figure 19.6 IP Address Format

19.53
Note

Each address in the block can be


considered as a two-level
hierarchical structure:
the leftmost n bits (prefix) define
the network;
the rightmost 32 − n bits define
the host.

19.54
Figure 19.7 Configuration and addresses in a subnetted network

19.55
Figure 19.8 Three-level hierarchy in an IPv4 address

19.56
IPv4 Header - Review
 Total Length (16 bits)
 Indicates the total length of the IPv4 packet (IPv4 header + IPv4
payload) and does not include link layer framing.
 Identification (16 bits)

Identifies this specific IPv4 packet.
 The Identification field is selected by the originating source of the
IPv4 packet. If the IPv4 packet is fragmented, all of the fragments
retain the Identification field value so that the destination node
can group the fragments for reassembly.
 Flags (3 bits)

Identifies flags for the fragmentation process.
 There are two flags—one to indicate whether the IPv4 packet
might be fragmented and another to indicate whether more
fragments follow the current fragment.
 Fragment Offset (13 bits)
 Indicates the position of the fragment relative to the original IPv4
payload.
IPv4 Header - Review
 Time to Live ( 8 bits)
 Indicate the maximum number of links on which an IPv4 packet
can travel before being discarded.

Originally used as a time count with which an IPv4 router
determined the length of time required (in seconds) to forward the
IPv4 packet, decrementing the TTL accordingly. When the TTL
equals 0,an ICMP Time Expired-TTL Expired in Transit message is
sent to the source IPv4 address and the packet is discarded.
 Protocol (8 bits)

Identifies the upper layer protocol.
 For example, TCP uses a Protocol of 6, UDP uses a Protocol of 17,
and ICMP uses a Protocol of 1.
 The Protocol field is used to demultiplex an IPv4 packet to the
upper layer protocol.

58
IPv4 Packet Format
IPv4 Header - Review
 Header Checksum (16 Bits)
 Provides a checksum on the IPv4 header only.

The IPv4 payload is not included in the checksum calculation as
the IPv4 payload and usually contains its own checksum..
 Source Address ( 32 bits)
 Stores the IPv4 address of the originating host.
 Destination Address (32 bits)
 Stores the IPv4 address of the destination host.
 Options (multiple of 32 bits)

Stores one or more IPv4 options.

59
IPv4 vs IPv6 Header

IPv6 Packet Format


IPv6 Header Fields
 Based on these rules, RFC 2460 defines the following IPv6 header
fields:

1. Version (4 bits)

4 bits are used to indicate the version of IP and is set to
6

 Traffic Class (8 bits)



same function as the Type of Service field in the IPv4
header.

1. Flow Label (20 bits)



identifies a flow and it is intended to enable the router to
identify packets that should be treated in a similar way
without the need for deep lookups within those packets.

set by the source and should not be changed by routers
along the path to destination.
IPv6 Header Fields
4. Payload Length (16 bits)

With the header length fixed at 40 bytes, it is enough to
indicate the length of the payload to determine the length of
the entire packet.

5. Next Header (8 bits)



Indicates either the first extension header (if present) or the
protocol in the upper layer PDU (such as TCP, UDP, or
ICMPv6).

6. Hop Limit (8 bits)



In IPv6, the IPv4 TTL was appropriately renamed Hop Limit
because it is a variable that is decremented at each hop, and
it does not have a temporal dimension.

62
IPv6 Header Fields
7. Source IPv6 Address (128 bits)
• Stores the IPv6 address of the originating host.
8. Destination IPv6 Address (128 bits)
 Stores the IPv6 address of the current destination
host.

63
DHCP
 BOOTP is not a dynamic configuration protocol.
 When a client requests its IP address, the BOOTP
server consults a table that matches the physical
address of the client with its IP address.
 This implies that the binding between the physical
address and the IP address of the client already
exists.

19.64
DHCP
 What if a host moves from one physical network to
another?
 What if a host wants a temporary IP address?
 BOOTP cannot handle these situations because the
binding between the physical and IP addresses is
static and fixed in a table until changed by the
administrator.
 BOOTP is a static configuration protocol.
 The Dynamic Host Configuration Protocol (DHCP)
has been devised to provide static and dynamic
address allocation that can be manual or
automatic.

19.65
DHCP
 Static Address Allocation:
 In this capacity DHCP acts as BOOTP
does.
 A DHCP server has a database that
statically binds physical addresses to
IP addresses.

19.66
DHCP
 Dynamic Address Allocation DHCP has a second database with
a pool of available IP addresses.
 This second database makes DHCP dynamic.
 When a DHCP client requests a temporary IP address, the DHCP
server goes to the pool of available (unused) IP addresses and
assigns an IP address for a negotiable period of time.
 When a DHCP client sends a request to a DHCP server, the
server first checks its static database. If an entry with the
requested physical address exists in the static database, the
permanent IP address of the client is returned.
 On the other hand, if the entry does not exist in the static
database, the server selects an IP address from the available
pool, assigns the address to the client, and adds the entry to
the dynamic database.

19.67
DHCP
 The dynamic aspect of DHCP is needed when a host moves
from network to network or is connected and disconnected
from a network (as is a subscriber to a service provider).
 DHCP provides temporary IP addresses for a limited time.
 The addresses assigned from the pool are temporary
addresses.
 The DHCP server issues a lease for a specific time.
 When the lease expires, the client must either stop using
the IP address or renew the lease.
 The server has the option to agree or disagree with the
renewal. If the server disagrees, the client stops using the
address

19.68
Routing Table
 A host or a router has a routing table with an
entry for each destination, or a combination of
destinations, to route IP packets.
 The routing table can be either static or dynamic.
 Static Routing Table

A static routing table contains information entered
manually. The administrator enters the route for each
destination into the table.

When a table is created, it cannot update automatically
when there is a change in the Internet.

The table must be manually altered by the administrator.

A static routing table can be used in a small internet that
does not change very often, or in an experimental
internet for troubleshooting.

It is poor strategy to use a static routing table in a big
internet such as the Internet.
19.69
Routing Table
 Dynamic Routing Table
 A dynamic routing table is updated periodically by using
one of the dynamic routing protocols such as RIP, OSPF,
or BGP.
 Whenever there is a change in the Internet, such as a
shutdown of a router or breaking of a link, the dynamic
routing protocols update all the tables in the routers
(and eventually in the host) automatically.
 The routers in a big internet such as the Internet need to
be updated dynamically for efficient delivery of the IP
packets

19.70
Format
 A routing table for classless addressing has a minimum of four
columns.
 However, some of today's routers have even more columns.
 We should be aware that the number of columns is vendor-
dependent, and not all columns can be found in all routers.
 Common Fields

 Mask: This field defines the mask applied for the entry.
 Network address. This field defines the network address to which the
packet is finally delivered.
 Next-hop address. This field defines the address of the next-hop
router to which the packet is delivered.

19.71
Format
 Interface. This field shows the name of the interface.
 Flags. This field defines up to five flags. Flags are on/off switches that
signify either presence or absence. The five flags are U (up), G
(gateway), H (host-specific), D (added by redirection), and M (modified
by redirection).

U (up). The U flag indicates the router is up and running. If this flag is not present, it
means that the router is down. The packet cannot be forwarded and is discarded.

G (gateway). The G flag means that the destination is in another network. The packet
is delivered to the next-hop router for delivery (indirect delivery). When this flag is
missing, it means the destination is in this network (direct delivery).

H (host-specific). The H flag indicates that the entry in the network address field is a
host-specific address. When it is missing, it means that the address is only the network
address of the destination.

D (added by redirection). The D flag indicates that routing information for this
destination has been added to the host routing table by a redirection message from
ICMP.

M (modified by redirection). The M flag indicates that the routing information for
this destination has been modified by a redirection message from ICMP.

19.72
Format
 Reference count. This field gives the number of users of this route
at the moment. For example, if five people at the same time are
connecting to the same host from this router, the value of this
column is 5.
 Use. This field shows the number of packets transmitted through
this router for the corresponding destination

19.73
Routing Protocols
 A routing protocol is a combination of rules
and procedures that lets routers in the
internet inform each other of changes.
 It allows routers to share whatever they
know about the internet or their
neighborhood

19.74
Optimization
 A router receives a packet from a network and
passes it to another network.
 A router is usually attached to several networks.
 When it receives a packet, to which network
should it pass the packet?
 The decision is based on optimization: Which of
the available pathways is the optimum pathway?
 What is the definition of the term optimum?
 One approach is to assign a cost for passing
through a network.

19.75
Optimization
 We call this cost a metric.
 However, the metric assigned to each network
depends on the type of protocol.
 Some simple protocols, such as the Routing
Information Protocol (RIP), treat all networks as
equals.
 The cost of passing through a network is the
same; it is one hop count.
 So if a packet passes through 10 networks to
reach the destination, the total cost is 10 hop
counts.

19.76
Optimization
 Other protocols, such as Open Shortest Path First (OSPF),
allow the administrator to assign a cost for passing
through a network based on the type of service required.
 A route through a network can have different costs
(metrics).
 For example, if maximum throughput is the desired type
of service, a satellite link has a lower metric than a fiber-
optic line.
 On the other hand, if minimum delay is the desired type of
service, a fiber-optic line has a lower metric than a satellite
link.
 Routers use routing tables to help decide the best route.
OSPF protocol allows each router to have several routing
tables based on the required type of service.

19.77
Routing Information
Protocol
The Routing Information Protocol (RIP) is an intradomain
(interior) routing protocol used inside an autonomous
system.
 It is a very simple protocol based on distance vector
routing.
 RIP implements distance vector routing directly with
some considerations:

In an autonomous system, we are dealing with routers and
networks (links), what was described as a node.

The destination in a routing table is a network, which means the
first column defines a network address

The metric used by RIP is very simple; the distance is defined as
the number of links (networks) that have to be used to reach the
destination. For this reason, the metric in RIP is called a hop count

19.78
Routing Information
Protocol
Infinity is defined as 16, which means that any route in

an autonomous system.
 The next node column defines the address of the router
to which the packet is to be sent to reach its destination.

19.79
RIP Request Message
Format

19.80
RIP Request Message
Format
Command: This 8-bit field specifies the type of
message: request (1) or response (2).
 Version: This 8-bit field defines the version. RIP version
1 or RIP Version 2
 Family: This 16-bit field defines the family of the
protocol used. For TCP/IP the value is 2.
 Network address: The address field defines the address
of the destination network. RIP has allocated 14 bytes
for this field to be applicable to any protocol. However,
IP currently uses only 4 bytes. The rest of the address
is filled with 0s.
 Distance :This 32-bit field defines the hop count (cost)
from the advertising router to the destination network.

19.81
Requests and Responses:
 RIP has two types of messages:
request and response
 Request:

A request message is sent by a router that
has just come up or by a router that has
some time-out entries.

A request can ask about specific entries or
all entries

19.82
Request Message

19.83
Requests and Responses:
 RIP has two types of messages:
request and response
 Response:

A response can be either solicited or
unsolicited.

A solicited response is sent only in answer to
a request.

It contains information about the destination
specified in the corresponding request.

An unsolicited response, on the other hand, is
sent periodically, every 30 seconds or when
there is a change in the routing table.

The response is sometimes called an update
19.84 packet.
Different Types of Timers
 RIP uses three timers to support its operation.
 The periodic timer controls the sending of
messages, the expiration timer governs the
validity of a route, and the garbage collection
timer advertises the failure of a route.
 RIP Timers

19.85
Periodic Timer
 The periodic timer controls the advertising of
regular update messages.
 Although the protocol specifies that this timer
must be set to 30 s, the working model uses a
random number between 25 and 35 s.
 This is to prevent any possible synchronization
and therefore overload on an internet if routers
update simultaneously.
 Each router has one periodic timer that is
randomly set to a number between 25 and 35.
 It counts down; when zero is reached, the update
message is sent, and the timer is randomly set
once again
19.86
Expiration Timer
 The expiration timer governs the validity of a route.
 When a router receives update information for a
route, the expiration timer is set to 180 s for that
particular route.
 Every time a new update for the route is received,
the timer is reset. In normal situations this occurs
every 30 s.
 However, if there is a problem on an internet and
no update is received within the allotted 180 s, the
route is considered expired and the hop count of
the route is set to 16, which means the destination
is unreachable.
 Every route has its own expiration timer.

19.87
Garbage Collection Timer
 When the information about a route becomes
invalid, the router does not immediately purge that
route from its table.
 Instead, it continues to advertise the route with a
metric value of 16.
 At the same time, a timer called the garbage
collection timer is set to 120 s for that route.
 When the count reaches zero, the route is purged
from the table.
 This timer allows neighbors to become aware of
the invalidity of a route prior to purging.

19.88
14.1 INTRA- AND INTERDOMAIN
ROUTING
Routing inside an autonomous system is referred to as intradomain
routing. Routing between autonomous systems is referred to as
interdomain routing.

TCP/IP Protocol Suite 89


Figure 14.1 Autonomous systems

TCP/IP Protocol Suite 90


Figure 14.2 Popular routing protocols

TCP/IP Protocol Suite 91


14.2 DISTANCE VECTOR ROUTING
In distance vector routing, the least cost route between any two nodes is
the route with minimum distance. In this protocol each node maintains a
vector (table) of minimum distances to every node

The topics discussed in this section include:

Initialization
Sharing
Updating
When to Share
Two-Node Loop Instability
Three-Node Instability

TCP/IP Protocol Suite 92


Figure 14.3 Distance vector routing tables

TCP/IP Protocol Suite 93


Figure 14.4 Initialization of tables in distance vector routing

TCP/IP Protocol Suite 94


Note:

In distance vector routing, each node


shares its routing table with its
immediate neighbors periodically and
when there is a change.

TCP/IP Protocol Suite 95


Figure 14.5 Updating in distance vector routing

TCP/IP Protocol Suite 96


Figure 14.6 Two-node instability

TCP/IP Protocol Suite 97


Figure 14.7 Three-node instability

TCP/IP Protocol Suite 98


14.3 RIP
The Routing Information Protocol (RIP) is an intradomain routing
protocol used inside an autonomous system. It is a very simple protocol
based on distance vector routing.

The topics discussed in this section include:

RIP Message Format


Requests and Responses
Timers in RIP
RIP Version 2
Encapsulation

TCP/IP Protocol Suite 99


Figure 14.8 Example of a domain using RIP

TCP/IP Protocol Suite 100


Figure 14.9 RIP message format

TCP/IP Protocol Suite 101


Figure 14.10 Request messages

TCP/IP Protocol Suite 102


Example 1

Figure 14.11 shows the update message sent from router R1 to


router R2 in Figure 14.8. The message is sent out of interface
130.10.0.2.
The message is prepared with the combination of split horizon
and poison reverse strategy in mind. Router R1 has obtained
information about networks 195.2.4.0, 195.2.5.0, and 195.2.6.0
from router R2. When R1 sends an update message to R2, it
replaces the actual value of the hop counts for these three
networks with 16 (infinity) to prevent any confusion for R2.
The figure also shows the table extracted from the message.
Router R2 uses the source address of the IP datagram carrying
the RIP message from R1 (130.10.02) as the next hop address.

See Next Slide


TCP/IP Protocol Suite 103
Figure 14.11 Solution to Example 1

TCP/IP Protocol Suite 104


Figure 14.12 RIP timers

TCP/IP Protocol Suite 105


Example 2

A routing table has 20 entries. It does not receive information


about five routes for 200 s. How many timers are running at
this time?

Solution
The 21 timers are listed below:
Periodic timer: 1
Expiration timer: 20 − 5 = 15
Garbage collection timer: 5

TCP/IP Protocol Suite 106


Figure 14.13 RIP version 2 format

TCP/IP Protocol Suite 107


Figure 14.14 Authentication

TCP/IP Protocol Suite 108


Note:

RIP uses the services of UDP on


well-known port 520.

TCP/IP Protocol Suite 109


14.4 LINK STATE ROUTING
In link state routing, if each node in the domain has the entire topology
of the domain, the node can use Dijkstra’s algorithm to build a routing
table.

The topics discussed in this section include:

Building Routing Tables

TCP/IP Protocol Suite 110


Figure 14.15 Concept of link state routing

TCP/IP Protocol Suite 111


Figure 14.16 Link state knowledge

TCP/IP Protocol Suite 112


Figure 14.17 Dijkstra algorithm

TCP/IP Protocol Suite 113


Figure 14.18 Example of formation of shortest path tree

TCP/IP Protocol Suite 114


Table 14.1 Routing table for node A

TCP/IP Protocol Suite 115


14.5 OSPF
The Open Shortest Path First (OSPF) protocol is an intradomain
routing protocol based on link state routing. Its domain is also an
autonomous system.

The topics discussed in this section include:


Areas
Metric
Types of Links
Graphical Representation
OSPF Packets
Link State Update Packet
Other Packets
Encapsulation

TCP/IP Protocol Suite 116


Figure 14.19 Areas in an autonomous system

TCP/IP Protocol Suite 117


Figure 14.20 Types of links

TCP/IP Protocol Suite 118


Figure 14.21 Point-to-point link

TCP/IP Protocol Suite 119


Figure 14.22 Transient link

TCP/IP Protocol Suite 120


Figure 14.23 Stub link

TCP/IP Protocol Suite 121


Figure 14.24 Example of an AS and its graphical representation in OSPF

TCP/IP Protocol Suite 122


Figure 14.25 Types of OSPF packets

TCP/IP Protocol Suite 123


Figure 14.26 OSPF common header

TCP/IP Protocol Suite 124


Figure 14.27 Link state update packet

TCP/IP Protocol Suite 125


Figure 14.28 LSA general header

TCP/IP Protocol Suite 126


Figure 14.29 Router link

TCP/IP Protocol Suite 127


Figure 14.30 Router link LSA

TCP/IP Protocol Suite 128


Table 14.2 Link types, link identification, and link data

TCP/IP Protocol Suite 129


Example 3

Give the router link LSA sent by router 10.24.7.9 in


Figure 14.31.
See Next Slide

Solution
This router has three links: two of type 1 (point-to-
point) and one of type 3 (stub network). Figure 14.32
shows the router link LSA.
See Figure 14.32

TCP/IP Protocol Suite 130


Figure 14.31 Example 3

TCP/IP Protocol Suite 131


Figure 14.32 Solution to Example 3

TCP/IP Protocol Suite 132


Figure 14.33 Network link

TCP/IP Protocol Suite 133


Figure 14.34 Network link advertisement format

TCP/IP Protocol Suite 134


Example 4

Give the network link LSA in Figure 14.35.

See Next Slide

Solution.

See Figure 14.36

TCP/IP Protocol Suite 135


Figure 14.35 Example 4

TCP/IP Protocol Suite 136


Figure 14.36 Solution to Example 4

TCP/IP Protocol Suite 137


Example 5

In Figure 14.37, which router(s) sends out router link LSAs?

See Next Slide

Solution
All routers advertise router link LSAs.
a. R1 has two links, N1 and N2.
b. R2 has one link, N1.
c. R3 has two links, N2 and N3.

TCP/IP Protocol Suite 138


Figure 14.37 Example 5 and Example 6

TCP/IP Protocol Suite 139


Example 6

In Figure 14.37, which router(s) sends out the network link


LSAs?

Solution
All three network must advertise network links:
a. Advertisement for N1 is done by R1 because it is the only
attached router and therefore the designated router.
b. Advertisement for N2 can be done by either R1, R2, or R3,
depending on which one is chosen as the designated router.
c. Advertisement for N3 is done by R3 because it is the only
attached router and therefore the designated router.
TCP/IP Protocol Suite 140
Figure 14.38 Summary link to network

TCP/IP Protocol Suite 141


Figure 14.39 Summary link to network LSA

TCP/IP Protocol Suite 142


Figure 14.40 Summary link to AS boundary router

TCP/IP Protocol Suite 143


Figure 14.41 Summary link to AS boundary router LSA

TCP/IP Protocol Suite 144


Figure 14.42 External link

TCP/IP Protocol Suite 145


Figure 14.43 External link LSA

TCP/IP Protocol Suite 146


Figure 14.44 Hello packet

TCP/IP Protocol Suite 147


Figure 14.45 Database description packet

TCP/IP Protocol Suite 148


Figure 14.46 Link state request packet

TCP/IP Protocol Suite 149


Figure 14.47 Link state acknowledgment packet

TCP/IP Protocol Suite 150


Note:

OSPF packets are encapsulated in IP


datagrams.

TCP/IP Protocol Suite 151


14.6 PATH VECTOR ROUTING
Path vector routing is similar to distance vector routing. There is at least
one node, called the speaker node, in each AS that creates a routing
table and advertises it to speaker nodes in the neighboring ASs..

The topics discussed in this section include:

Initialization
Sharing
Updating

TCP/IP Protocol Suite 152


Figure 14.48 Initial routing tables in path vector routing

TCP/IP Protocol Suite 153


Figure 14.49 Stabilized tables for four autonomous systems

TCP/IP Protocol Suite 154


14.7 BGP
Border Gateway Protocol (BGP) is an interdomain routing protocol
using path vector routing. It first appeared in 1989 and has gone
through four versions.

The topics discussed in this section include:


Types of Autonomous Systems
Path Attributes
BGP Sessions
External and Internal BGP
Types of Packets
Packet Format
Encapsulation

TCP/IP Protocol Suite 155


Figure 14.50 Internal and external BGP sessions

TCP/IP Protocol Suite 156


Figure 14.51 Types of BGP messages

TCP/IP Protocol Suite 157


Figure 14.52 BGP packet header

TCP/IP Protocol Suite 158


Figure 14.53 Open message

TCP/IP Protocol Suite 159


Figure 14.54 Update message

TCP/IP Protocol Suite 160


Note:

BGP supports classless addressing and


CIDR.

TCP/IP Protocol Suite 161


Figure 14.55 Keepalive message

TCP/IP Protocol Suite 162


Figure 14.56 Notification message

TCP/IP Protocol Suite 163


Table 14.3 Error codes

TCP/IP Protocol Suite 164


Count to Infinity
 A problem with distance vector routing is that any
decrease in cost (good news) propagates quickly,
but any increase in cost (bad news) propagates
slowly.
 For a routing protocol to work properly, if a link is
broken (cost becomes infinity), every other router
should be aware of it immediately, but in distance
vector routing, this takes some time.
 The problem is referred to as count to infinity. It
takes several updates before the cost for a
broken link is recorded as infinity by all routers.

19.165
Two – node instability
 One example of count to infinity is
the two-node loop problem.

19.166
Remedies for Two-node Instability

19.167
Distance Vector Routing
 In distance vector routing, a router need not
know the entire path to every network segment;
it only requires to know the direction or vector in
which to send the packet.
 The technique determines the direction (vector)
and distance (hop count) to any network in the
internetwork.
 Distance vector routing algorithms periodically
send all or parts of their routing table to their
adjacent neighbours.

19.168
Distance Vector Routing
 The routers running a distance vector routing
protocol will automatically send periodic updates
even if there are no changes in the network.
 A router can verify all the known routes and alters
its local routing table on the basis of the updated
information received from neighboring routing.
 This process is referred to as “routing by rumour”
because the routing information that a router has of
the network topology is based on the perspective of
the routing table of the neighbor router.
 RIP and IGRP is a commonly used distance vector
protocol that uses hop counts or its routing metrics.

19.169
Link State Routing
 In link-state routing, each router attempt to
construct its own internal map of the network
topology.
 At the initial stage of start-up, when a router
becomes active, it sends the messages into the
network and collects the information from the
routers to which it is directly connected.
 It also provides information about whether the link
to reach the router is active or not.
 This information is used by other routers to build a
map of network topology. Then the router uses the
map to choose the best path.

19.170
Link State Routing
 The link state routing protocols respond swiftly to the
network changes.
 It sends triggered updates when a network change

occurs and sends periodic updates at long time


intervals such as 30 minutes.
 If the link alters state, the device detected the

alteration generates and propagate an update message


regarding that link to all routers. Then each router
takes a copy of the update message and update its
routing table and forwards the message to all
neighbouring router.
 This flooding of the update message is needed to

ensure that all routers update their database before


creating an update routing table that reflects the new
technology.
19.171
 OSPF protocol is the example link state routing.
Key Differences Between Distance
Vector Routing and Link State Routing
 Bellman-Ford algorithm is used for performing
distance vector routing whereas Dijsktra is used
for performing the link state routing.
 In distance vector routing the routers receive the
topological information from the neighbour point
of view. On the contrary, in link state routing the
router receive complete information on the
network topology.
 Distance vector routing calculates the best route
based on the distance (fewest number of hops).
As against, Link state routing calculates the best
route on the basis of least cost.

19.172
Key Differences Between Distance
Vector Routing and Link State
Routing
Link state routing updates only the link state while
Distance vector routing updates full routing table.
 The frequency of update in both routing technique
is different distance vector update periodically
whereas link state update frequency employs
triggered updates.
 The utilization of CPU and memory in distance
vector routing is lower than the link state routing.
 The distance vector routing is simple to
implement and manage. In contrast, the link state
routing is complex and requires trained network
administrator.
19.173
Key Differences Between Distance Vector
Routing and Link State Routing

 The convergence time in distance vector routing


is slow, and it usually suffers from count to
infinity problem. Conversely, the convergence
time in link state routing is fast, and it is more
reliable.
 Distance vector doesn’t have hierarchical
structure while in link state routing the nodes can
have a hierarchical structure.

19.174

You might also like