Network Layer Switching Techniques Explained
Network Layer Switching Techniques Explained
Network Layer:
Switching Techniques: Circuit Switching, Packet Switching, and
Message Switching.
Logical addressing: IPv4 and IPv6 Address schemes, Classes and
subnetting
Network Layer Protocols: ARP, RARP, BOOTP and DHCP
Routing Techniques: Interdomain and Intradomain routing with
Examples
PART1
Switching Techniques
The switching technique is used to connect the systems for making one-to-one communication.
Circuit Switching
o Circuit establishment
o Data transfer
o Circuit Disconnect
o Crossbar Switch
o Multistage Switch
Crossbar Switch
The Crossbar switch is a switch that has n input lines and n output lines. The crossbar switch
has n2 intersection points known as crosspoints.
Multistage Switch
o Multistage Switch is made by splitting the crossbar switch into the smaller units and
then interconnecting them.
o It reduces the number of crosspoints.
o If one path fails, then there will be an availability of another path.
o Once the dedicated path is established, the only delay occurs in the speed of data
transmission.
o It takes a long time to establish a connection approx 10 seconds during which no data
can be transmitted.
o It is more expensive than other switching techniques as a dedicated path is required for
each connection.
o It is inefficient to use because once the path is established and no data is transferred,
then the capacity of the path is wasted.
o In this case, the connection is dedicated therefore no other data can be transferred even
if the channel is free.
The incoming and outgoing signals when received and re-transmitted in a different time
slot, is called Time Division Switching. The digitized speech information is sliced into
a sequence of time intervals or slots. Additional voice circuit slots, corresponding to
other users are inserted into this bit stream of data. Hence, the data is sent in time
frames.
The two popular methods of TDM are TSI (Time and Slot Interchange) and TDM bus.
2)Message Switching
o Message Switching is a switching technique in which a message is transferred as a
complete unit and routed through intermediate nodes at which it is stored and
forwarded.
o In Message Switching technique, there is no establishment of a dedicated path between
the sender and receiver.
o The destination address is appended to the message. Message Switching provides a
dynamic routing as the message is routed through the intermediate nodes based on the
information available in the message.
o Message switches are programmed in such a way so that they can provide the most
efficient routes.
o Each and every node stores the entire message and then forward it to the next node.
This type of network is known as store and forward network.
o Message switching treats each message as an independent entity.
antanes a f a
Ms nesaSwiachite
o Data channels are shared among the communicating devices that improve the efficiency
of using available bandwidth.
o Traffic congestion can be reduced because the message is temporarily stored in the
nodes.
o Message priority can be used to manage the network.
o The size of the message which is sent over the network can be varied. Therefore, it
supports the data of unlimited size.
o The message switches must be equipped with sufficient storage to enable them to store
the messages until the message is forwarded.
o The Long delay can occur due to the storing and forwarding facility provided by the
message switching technique.
Packet Switching
o The packet switching is a switching technique in which the message is sent in one go,
but it is divided into smaller pieces, and they are sent individually.
o The message splits into smaller pieces known as packets and packets are given a unique
number to identify their order at the receiving end.
o Every packet contains some information in its headers such as source address,
destination address and sequence number.
o Packets will travel across the network, taking the shortest path as possible.
o All the packets are reassembled at the receiving end in correct order.
o If any packet is missing or corrupted, then the message will be sent to resend the
message.
o If the correct order of the packets is reached, then the acknowledgment message will be
sent.
Approaches of Packet Switching:
Node takes routing decisions to forward the Node does not take any routing decision.
packets.
Congestion cannot occur as all the packets Congestion can occur when the node is busy, and it does
travel in different directions. not allow other packets to pass through.
PART_2
An IP address is assigned to each device connected to a network. Each device uses an IP address
for communication. It also behaves as an identifier as this address is used to identify the device
on a network. It defines the technical format of the packets. Mainly, both the networks, i.e., IP
and TCP, are combined together, so together, they are referred to as a TCP/IP. It creates a
virtual connection between the source and the destination.
We can also define an IP address as a numeric address assigned to each device on a network.
An IP address is assigned to each device so that the device on a network can be identified
uniquely. To facilitate the routing of packets, TCP/IP protocol uses a 32-bit logical address
known as IPv4(Internet Protocol version 4).
CLASSFULL ADDRESSING
In the IPv4 IP address space, there are five classes: A, B, C, D and E. Each class has a specific
range of IP addresses (and ultimately dictates the number of devices you can have on your
network). Primarily, class A, B, and C are used by the majority of devices on the Internet. Class
D and class E are for special uses.
In every IP address class, all host-number bits are specified by a power of 2 that indicates the
total numbers of the host's address that can create for a particular network address. Class A
address can contain the maximum number of 224 (16,777,216) host numbers. Class B addresses
contain the maximum number of 216 (65, 536) host numbers. And class C contains a maximum
number of 28 (256) host numbers.
CLASS A
Public IP Range: [Link] to [Link]
First octet value range from 1 to 127
Subnet Mask: [Link] (8 bits)
Number of Networks: 126
Number of Hosts per Network: 16,777,214 (2 to the power 24-2)
CLASS B
Public IP Range: [Link] to [Link]
First octet value range from 128 to 191
Subnet Mask: [Link] (16 bits)
Number of Networks: 16,382
Number of Hosts per Network: 65,534
CLASS C
Public IP Range: [Link] to [Link]
First octet value ranges from 192 to 223
Special IP Range: [Link] to [Link] (See Special IP Addresses below for more
information)
Subnet Mask: [Link] (24 bits)
Number of Networks: 2,097,150
Number of Hosts per Network: 254
Class D
Identify the Class, Network IP Address, Direct broadcast address and Limited broadcast
address of each IP Address.
Answer:
(1)
(2)
5.
6.
7.
8.
An IP address consists of two parts, i.e., the first one is a network address, and the other one is
a host address.
1)IPv4
2)IPv6
IPv4 is a version 4 of IP. It is a current version and the most commonly used IP address. It is a
32-bit address written in four numbers separated by 'dot', i.e., periods. This address is unique
for each device.
Drawback of IPv4
Currently, the population of the world is 7.6 billion. Every user is having more than one device
connected with the internet, and private companies also rely on the internet. As we know that
IPv4 produces 4 billion addresses, which are not enough for each device connected to the
internet on a planet. Although the various techniques were invented, such as variable-length
mask, network address translation, port address translation, classes, and inter-domain
translation, to conserve the bandwidth of IP addresses and slow down the depletion of an IP
address. In these techniques, public IP is converted into a private IP due to which the user
having public IP can also use the internet. But still, this was not so efficient, so it gave rise to
the development of the next generation of IP addresses, i.e., IPv6.
IPv6
IPv6 is the next generation of IP addresses. The main difference between IPv4 and IPv6 is the
address size of IP addresses. The IPv4 is a 32-bit address, whereas IPv6 is a 128-bit
hexadecimal address. IPv6 provides a large address space, and it contains a simple header as
compared to IPv4.
It provides transition strategies that convert IPv4 into IPv6, and these strategies are as follows:
o Dual stacking: It allows us to have both versions, i.e., IPv4 and IPv6, on the same
device.
o Tunneling: In this approach, all the users have IPv6 communicates with an IPv4
network to reach IPv6.
o Network Address Translation: The translation allows communication between the
hosts having a different version of IP.
This hexadecimal address contains both numbers and alphabets. Due to the usage of both the
numbers and alphabets, IPv6 is capable of producing over 340 undecillion (3.4*1038) addresses.
IPv6 is a 128-bit hexadecimal address made up of 8 sets of 16 bits each, and these 8 sets are
separated by a colon. In IPv6, each hexadecimal character represents 4 bits. So, we need to
convert 4 bits to a hexadecimal number at a time
Address format
The above diagram shows the address format of IPv4 and IPv6. An IPv4 is a 32-bit decimal
address. It contains 4 octets or fields separated by 'dot', and each field is 8-bit in size. The
number that each field contains should be in the range of 0-255. Whereas an IPv6 is a 128-bit
hexadecimal address. It contains 8 fields separated by a colon, and each field is 16-bit in size.
Differences between IPv4 and IPv6
Fields IPv4 is a numeric address that consists of 4 IPv6 is an alphanumeric address that
fields which are separated by dot (.). consists of 8 fields, which are
separated by colon.
Classes IPv4 has 5 different classes of IP address IPv6 does not contain classes of IP
that includes Class A, Class B, Class C, addresses.
Class D, and Class E.
Number of IP IPv4 has a limited number of IP addresses. IPv6 has a large number of IP
address addresses.
VLSM It supports VLSM (Virtual Length Subnet It does not support VLSM.
Mask). Here, VLSM means that Ipv4
converts IP addresses into a subnet of
different sizes.
Address space It generates 4 billion unique addresses It generates 340 undecillion unique
addresses.
Security features In IPv4, security depends on the In IPv6, IPSEC is developed for
application. This IP address is not security purposes.
developed in keeping the security feature in
mind.
Packet flow It does not provide any mechanism for It uses flow label field in the header
identification packet flow identification. for the packet flow identification.
Checksum field The checksum field is available in IPv4. The checksum field is not available
in IPv6.
Subnetting
Subnetting is the process of dividing a large network into smaller networks called subnets. Each subnet provides its own
space for devices to communicate, improving network performance, security, and management.
Example: In a company, different departments (Sales, HR, IT) can have their own subnets, keeping their traffic separate
and organized.
Why Subnetting is Important
Let's consider a company that follows classful addressing, it has a Class C network ([Link]/24) with 256 IP
addresses. It has three departments:
Without subnetting, all departments share the same network, and all 256 IP addresses are available to everyone, which
leads to:
IP Waste: Only 80 devices used out of 256 addresses i.e 176 wasted.
Performance Issues: All traffic floods the same network, slowing communication.
Security Risks: Devices from different departments can access each other freely.
With Subnetting, we split the network into three subnets, allocating just enough IP addresses for each department:
Sales 20 32 ( [Link]/27 )
HR 10 16 ( [Link]/28)
IT 50 64 ( [Link]/26)
By subnetting, we:
Efficient IP usage: Only 112 addresses used, leaving space for growth.
Better performance: Traffic stays within each subnet.
Improved security: Each department is isolated.
IP Addressing
An IP address is made up of different parts, each serving a specific purpose in identifying a device on a network. An IPv4
address consists of four parts called "octets," separated by dots (e.g., [Link]). It has two main sections:
Network Portion: Identifies the network the device belongs to.
Host Portion: Uniquely identifies a device within the network.
IPv4 addresses are divided into classes based on the length of the network and host portions:
Class A: 8-bit network ID, 24-bit host ID.
Class B: 16-bit network ID, 16-bit host ID.
Class C: 24-bit network ID, 8-bit host ID.
Classful Addressing
A subnet mask is a 32-bit number used in IP addressing to separate the network portion of an IP address from the host
portion. It helps computers and devices determine which part of an IP address refers to the network they are present, and
which part refers to their specific location or address within that network.
Subnet mask
Instead of using a long subnet mask (e.g., [Link]), CIDR uses a simple format like /24. The number after the slash
(/n) represents the number of bits used for the network portion of the IP address.
How Subnetting Works?
The working of subnets starts in such a way that firstly it divides the subnets into smaller subnets. For communicating
between subnets, routers are used. Each subnet allows its linked devices to communicate with each other. Subnetting for a
network should be done in such a way that it does not affect the network bits.
In class C the first 3 octets are network bits so it remains as it is.
For Subnet-1: The first bit which is chosen from the host id part is zero and the range will be from
(193.1.2.00000000 till you get all 1's in the host ID part i.e, 193.1.2.01111111) except for the first bit which is chosen
zero for subnet id part.
Thus, the range of subnet 1 is: [Link] to [Link]
Subnet id of Subnet 1 is: [Link]
The direct Broadcast id of Subnet-1 is: [Link]
The total number of hosts possible is: 126 (Out of 128, 2 id's are used for Subnet id & Direct
Broadcast id)
The subnet mask of Subnet- 1 is: [Link]
For Subnet-2: The first bit chosen from the host id part is one and the range will be from (193.1.2.100000000 till you
get all 1's in the host ID part i.e, 193.1.2.11111111).
Thus, the range of subnet-2 is: [Link] to [Link]
Subnet id of Subnet 2 is : [Link]
The direct Broadcast id of Subnet-2 is: [Link]
The total number of hosts possible is: 126 (Out of 128, 2 id's are used for Subnet id & Direct
Broadcast id)
The subnet mask of Subnet- 2 is: [Link]
The best way to find out the subnet mask of a subnet is to set the fixed bit of host-id to 1 and the rest
to 0.
Finally, after using the subnetting the total number of usable hosts is reduced from 254 to 252.
Note:
1. To divide a network into four (2 2 ) parts you need to choose two bits from the host id part for each subnet i.e, (00, 01,
10, 11).
2. To divide a network into eight (2 3 ) parts you need to choose three bits from the host id part for each subnet i.e, (000,
001, 010, 011, 100, 101, 110, 111) and so on.
3. We can say that if the total number of subnets in a network increases the total number of usable hosts decreases.
The network can be divided into two parts: To divide a network into two parts, you need to choose one bit for each
Subnet from the host ID part.
Subnet
Disadvantages of Subnetting
Extra Overhead: Each subnet wastes 2 IP addresses (network ID and broadcast address).
Higher Cost: Subnetting often requires additional devices like routers and switches, increasing expenses.
More Complexity: Compared to a single flat network,subnetting adds extra steps in communication and requires
careful planning.
PART -3
RARP
o RARP stands for Reverse Address Resolution Protocol.
o If the host wants to know its IP address, then it broadcast the RARP query packet that
contains its physical address to the entire network. A RARP server on the network
recognizes the RARP packet and responds back with the host IP address.
o The protocol which is used to obtain the IP address from a server is known as Reverse
Address Resolution Protocol.
o The message format of the RARP protocol is similar to the ARP protocol.
o Like ARP frame, RARP frame is sent from one machine to another encapsulated in the
data portion of a frame.
BOOTP:
Bootstrap Protocol (BOOTP) is a basic protocol that automatically provides each participant
in a network connection with a unique IP address for identification and authentication as soon
as it connects to the network. This helps the server to speed up data transfers and connection
requests.
BOOTP uses a unique IP address algorithm to provide each system on the network with a
completely different IP address in a fraction of a second.
BOOTP uses a combination of TFTP (Trivial File Transfer Protocol) and UDP (User Datagram
Protocol) to request and receive requests from various network-connected participants and to
handle their responses.
In a BOOTP connection, the server and client just need an IP address and a gateway address to
establish a successful connection.
Typically, in a BOOTP network, the server and client share the same LAN, and the routers
used in the network must support BOOTP bridging.
A great example of a network with a TCP / IP configuration is the Bootstrap Protocol network.
Whenever a computer on the network asks for a specific request to the server, BOOTP uses its
unique IP address to quickly resolve them.
How Bootstrap Protocol differs from DHCP:
DHCP network servers have much broader use than a BOOTP network server. It may be used
for the purpose when a user gives request to the server for a particular IP address and it gives
the response of that particular IP address only, hence, time is not wasted for monitoring other
addresses. BOOTP uses UDP (User Datagram Protocol) through an IPv4 address connection
to identify and authenticate each network user.
DHCP
DHCP stands for Dynamic Host Configuration Protocol. It is the critical feature on which the
users of an enterprise network communicate. DHCP helps enterprises to smoothly manage the
allocation of IP addresses to the end-user clients’ devices such as desktops, laptops, cellphones,
etc.
DHCP helps in managing the entire process automatically and centrally. DHCP helps in
maintaining a unique IP Address for a host using the server. DHCP servers maintain
information on TCP/IP configuration and provide configuration of address to DHCP-enabled
clients in the form of a lease offer.
BOOTP DHCP
BOOTP stands for Bootstrap Protocol. While DHCP stands for Dynamic host configuration protocol.
BOOTP does not support DHCP clients. While it support BOOTP clients.
BOOTP does not support mobile machines. Whereas DHCP supports mobile machines.
The passage of network packets from one network interface to another is known as packet
forwarding. Routers, gateways, and other network hardware devices are common intermediate
nodes.
Based on the interaction of domains, the routing protocols can be either InterDomain or
IntraDomain. Read through this article to find out how these two routing protocols are different
from each other.
Intradomain Routing
All routers inside a domain utilize an intradomain routing protocol to share routing information
about the destinations that are accessible within the domain.
There are a number of intradomain routing protocols to choose from. A distance-vector
protocol called RIP is used by several domains. Other domains utilize OSPF or IS-IS, which
are link-state routing protocols. Finally, some domains utilize proprietary protocols like IGRP
or EIGRP or use static routing.
Intradomain routing methods often have two goals. They begin by disseminating routing
information that corresponds to the shortest path between two domain routers. Second, they
must enable routers to recover rapidly from link and router failures.
Interdomain Routing
The following table highlights the major differences between interdomain and intradomain
routing protocols.
In distance vector routing, the least-cost route between any two nodes is the route
with minimum distance. In this protocol, as the name implies, each node maintains a
vector (table) of minimum distances to every node. The table at each node also guides
the packets to the desired node by showing the next stop in the route (next-hop routing).
We can think of nodes as the cities in an area and the lines as the roads connecting
them. A table can show a tourist the minimum distance between cities.
Sharing
The whole idea of distance vector routing is the sharing of information between neighbors.
Although node A does not know about node E, node C does. So if node C shares
its routing table with A, node A can also know how to reach node E. On the other hand,
node C does not know how to reach node D, but node A does. If node A shares its routing
table with node C, node C also knows how to reach node D. In other words, nodes
A and C, as immediate neighbors, can improve their routing tables if they help each
other.
There is only one problem. How much of the table must be shared with each
neighbor? A node is not aware of a neighbor's table. The best solution for each node
is to send its entire table to the neighbor and let the neighbor decide what part to
use and what part to discard. However, the third column of a table (next stop) is not
useful for the neighbor. When the neighbor receives a table, this column needs to
be replaced with the sender's name. If any of the rows can be used, the next node is
the sender of the table. A node therefore can send only the first two columns of its
table to any neighbor. In other words, sharing here means sharing only the first two
columns.
Updating
When a node receives a two-column table from a neighbor, it needs to update its routing
table. Updating takes three steps:
1. The receiving node needs to add the cost between itself and the sending node
to each value in the second column. The logic is clear. If node C claims that its
distance to a destination is x mi, and the distance between A and C is y mi, then the
distance between A and that destination, via C, is x + y mi.
2. The receiving node needs to add the name of the sending node to each row as the
third column if the receiving node uses information from any row. The sending
node is the next node in the route.
3. The receiving node needs to compare each row of its old table with the corresponding
row of the modified version of the received table.
a. If the next-node entry is different, the receiving node chooses the row with the
smaller cost. If there is a tie, the old one is kept.
b. If the next-node entry is the same, the receiving node chooses the new row. For
example, suppose node C has previously advertised a route to node X with distance
3. Suppose that now there is no path between C and X; node C now advertises
this route with a distance of infinity. Node A must not ignore this value
even though its old entry is smaller. The old route does not exist any more. The
new route has a distance of infinity.
Figure 3 shows how all nodes updates its routing table after receiving the partial table from
other nodes as per shortest path.
Each node can update its table by using the tables received from other nodes. In a
short time, if there is no change in the network itself, such as a failure in a link, each
node reaches a stable condition in which the contents of its table remains the same.
When to Share
The question now is, When does a node send its partial routing table (only two columns)
to all its immediate neighbors? The table is sent both periodically and when there is a
change in the table.
Periodic Update A node sends its routing table, normally every 30 s, in a periodic
update. The period depends on the protocol that is using distance vector routing.
Triggered Update A node sends its two-column routing table to its neighbors anytime
there is a change in its routing table. This is called a triggered update. The
change can result from the following.
1. A node receives a table from a neighbor, resulting in changes in its own table after
updating.
2. A node detects some failure in the neighboring links which results in a distance
change to infinity.
Problem with Distance vector routing
shows a system with three nodes. We have shown only the portions of
the routing table needed for our discussion. At the beginning, both nodes A and B know
how to reach node X. But suddenly, the link between A and X fails. Node A changes its
table. If A can send its table to B immediately, everything is fine. However, the system
becomes unstable if B sends its routing table to A before receiving A's routing table.
Node A receives the update and, assuming that B has found a way to reach X, immediately
updates its routing table. Based on the triggered update strategy, A sends its new update to B.
Now B thinks that something has been changed around A and updates its
routing table. The cost of reaching X increases gradually until it reaches infinity. At this
moment, both A and B know that X cannot be reached. However, during this time the
system is not stable. Node A thinks that the route to X is via B; node B thinks that the
route to X is via A. If A receives a packet destined for X, it goes to B and then comes
back to A. Similarly, if B receives a packet destined for X, it goes to A and comes back
to B. Packets bounce between A and B, creating a two-node loop problem. A few solutions
have been proposed for instability of this kind.
Defining Infinity The first obvious solution is to redefine infinity to a smaller number,
such as 100. For our previous scenario, the system will be stable in less than 20
updates. As a matter of fact, most implementations of the distance vector protocol
define the distance between each node to be I and define 16 as infinity. However, this
means that the distance vector routing cannot be used in large systems. The size of the
network, in each direction, can not exceed 15 hops.
Split Horizon Another solution is called split horizon. In this strategy, instead of
flooding the table through each interface, each node sends only part of its table through
each interface. If, according to its table, node B thinks that the optimum route to reach
X is via A, it does not need to advertise this piece of information to A; the information
has corne from A (A already knows). Taking information from node A, modifying it,
and sending it back to node A creates the confusion. In our scenario, node B eliminates
the last line of its routing table before it sends it to A. In this case, node A keeps the
value of infinity as the distance to X. Later when node A sends its routing table to B,
node B also corrects its routing table. The system becomes stable after the first update:
both node A and B know that X is not reachable.
Split Horizon and Poison Reverse Using the split horizon strategy has one drawback.
Normally, the distance vector protocol uses a timer, and if there is no news about
a route, the node deletes the route from its table. When node B in the previous scenario
eliminates the route to X from its advertisement to A, node A cannot guess that this is
due to the split horizon strategy (the source of information was A) or because B has not
received any news about X recently. The split horizon strategy can be combined with
the poison reverse strategy. Node B can still advertise the value for X, but if the source
of information is A, it can replace the distance with infinity as a warning: "Do not use
this value; what I know about this route comes from you."
Three-node instability
The two-node instability can be avoided by using the split horizon strategy combined
with poison reverse. However, if the instability is between three nodes, stability cannot
be guaranteed. Figure shows the scenario.
Suppose, after finding that X is not reachable, node A sends a packet to Band C to
inform them of the situation. Node B immediately updates its table, but the packet to C
is lost in the network and never reaches C. Node C remains in the dark and still thinks
that there is a route to X via A with a distance of 5. After a while, node C sends to Bits
routing table, which includes the route to X. Node B is totally fooled here. It receives
information on the route to X from C, and according to the algorithm, it updates its
table, showing the route to X via C with a cost of 8. This information has come from C,
not from A, so after awhile node B may advertise this route to A. Now A is fooled and
updates its table to show that A can reach X via B with a cost of 12. Of course, the loop
continues; now A advertises the route to X to C, with increased cost, but not to B. Node
C then advertises the route to B with an increased cost. Node B does the same to A.
And so on. The loop stops when the cost in each node reaches infinity.
Example: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. RIP implements distance vector routing directly with some considerations:
1. In an autonomous system, we are dealing with routers and networks (links). The
routers have routing tables; networks do not.
2. The destination in a routing table is a network, which means the first column
defines a network address.
3. The metric used by RIP is very simple; the distance is defined as the number of
links (networks) to reach the destination. For this reason, the metric in RIP is called
a hop count.
4. Infinity is defined as 16, which means that any route in an autonomous system using
RIP cannot have more than 15 hops.
5. The next-node column defines the address of the router to which the packet is to be
sent to reach its destination.
The figure shows a simple domain with five nodes. Each node uses the same topology
to create a routing table, but the routing table for each node is unique because the calculations
are based on different interpretations of the topology. This is analogous to a city
map. While each person may have the same map, each needs to take a different route to
reach her specific destination. The topology must be dynamic, representing the latest state of
each node and each
link. If there are changes in any point in the network (a link is down, for example), the
topology must be updated for each node.
How can a common topology be dynamic and stored in each node? No node can
know the topology at the beginning or after a change somewhere in the network. Link
state routing is based on the assumption that, although the global knowledge about the
topology is not clear, each node has partial knowledge: it knows the state (type, condition,
and cost) of its links. In other words, the whole topology can be compiled from the
partial knowledge of each node. Figure 2 shows the same domain as in Figure 22.20,
indicating the part of the knowledge belonging to each node.
Node A knows that it is connected to node B with metric 5, to node C with metric 2,
and to node D with metric 3. Node C knows that it is connected to node A with metric 2,
to node B with metric 4, and to node E with metric 4. Node D knows that it is connected
only to node A with metric 3. And so on. Although there is an overlap in the
knowledge, the overlap guarantees the creation of a common topology-a picture of
the whole domain for each node.
Building Routing Tables
In link state routing, four sets of actions are required to ensure that each node has the
routing table showing the least-cost node to every other node.
]. Creation of the states of the links by each node, called the link state packet (LSP).
2. Dissemination of LSPs to every other router, called flooding, in an efficient and
reliable way.
3. Formation of a shortest path tree for each node.
4. Calculation of a routing table based on the shortest path tree.
Creation of Link State Packet (LSP) A link state packet can carry a large amount
of information. For the moment, however, we assume that it carries a minimum amount
of data: the node identity, the list of links, a sequence number, and age. The first two,
node identity and the list of links, are needed to make the topology. The third, sequence
number, facilitates flooding and distinguishes new LSPs from old ones. The fourth, age,
prevents old LSPs from remaining in the domain for a long time. LSPs are generated on
two occasions:
1. When there is a change in the topology of the domain. Triggering of LSP dissemination
is the main way of quickly informing any node in the domain to update its
topology.
2. On a periodic basis. The period in this case is much longer compared to distance
vector routing. As a matter of fact, there is no actual need for this type of LSP dissemination.
It is done to ensure that old information is removed from the domain.
The timer set for periodic dissemination is normally in the range of 60 min or 2 h
based on the implementation. A longer period ensures that flooding does not create
too much traffic on the network.
Flooding of LSPs After a node has prepared an LSP, it must be disseminated to all
other nodes, not only to its neighbors. The process is called flooding and based on the
following:
1. The creating node sends a copy of the LSP out of each interface.
2. A node that receives an LSP compares it with the copy it may already have. If the
newly arrived LSP is older than the one it has (found by checking the sequence
number), it discards the LSP. If it is newer, the node does the following:
a. It discards the old LSP and keeps the new one.
b. It sends a copy of it out of each interface except the one from which the packet
arrived. This guarantees that flooding stops somewhere in the domain (where a
node has only one interface).
Formation of Shortest Path Tree: Dijkstra Algorithm.
The Dijkstra algorithm creates a shortest path tree from a graph. The algorithm
divides the nodes into two sets: tentative and permanent. It finds the neighbors of a
current node, makes them tentative, examines them, and if they pass the criteria,
makes them permanent. We can informally define the algorithm by using the flowchart
Dijkstra algorithm
Example of formation of shortest path tree
EXAMPLE:
OSPF
The Open Shortest Path First or OSPF protocol is an intradomain routing protocol
based on link state routing. Its domain is also an autonomous system.
Areas To handle routing efficiently and in a timely manner, OSPF divides an autonomous
system into areas. An area is a collection of networks, hosts, and routers all
contained within an autonomous system. An autonomous system can be divided into
many different areas. All networks inside an area must be connected.
Path Vector Routing
Distance vector and link state routing are both intradomain routing protocols. They can
be used inside an autonomous system, but not between autonomous systems. These two
protocols are not suitable for interdomain routing mostly because of scalability. Both of
these routing protocols become intractable when the domain of operation becomes
large. Distance vector routing is subject to instability if there are more than a few hops
in the domain of operation. Link state routing needs a huge amount of resources to calculate
routing tables. It also creates heavy traffic because of flooding. There is a need
for a third routing protocol which we call path vector routing.
Path vector routing proved to be useful for interdomain routing. The principle of
path vector routing is similar to that of distance vector routing. In path vector routing,
we assume that there is one node (there can be more, but one is enough for our conceptual
discussion) in each autonomous system that acts on behalf of the entire autonomous
system. Let us call it the speaker node. The speaker node in an AS creates a
routing table and advertises it to speaker nodes in the neighboring ASs. The idea is the
same as for distance vector routing except that only speaker nodes in each AS can communicate
with each other. However, what is advertised is different. A speaker node
advertises the path, not the metric of the nodes, in its autonomous system or other
autonomous systems. Node Al is the speaker node for ASl, Bl for AS2, Cl for AS3, and Dl for
AS4.
Node Al creates an initial table that shows Al to A5 are located in ASI and can be
reached through it. Node Bl advertises that Bl to B4 are located in AS2 and can be
reached through Bl. And so on.
Sharing Just as in distance vector routing, in path vector routing, a speaker in an
autonomous system shares its table with immediate neighbors. In Figure 1, node
Al shares its table with nodes Bl and Cl. Node Cl shares its table with nodes Dl, Bl,
andAl. Node Bl shares its table with Cl andAl. Node Dl shares its table with Cl.
Updating When a speaker node receives a two-column table from a neighbor, it
updates its own table by adding the nodes that are not in its routing table and adding its
own autonomous system and the autonomous system that sent the table. After a while
each speaker has a table and knows how to reach each node in other ASs.
FIG1. Initial routing tables in path vector routing