Professional Documents
Culture Documents
• There are three phases of transmission by virtual circuits, set up, data transfer
and teardown.
• Set up Phase − In this phase, a virtual circuit or a route is established from the
source to the destination through number of switches. The source and
destination use global addresses using which the switches make routing table
entries.
• Data Transfer − Once the virtual circuit is set up, all packets follow the route
established during the set up phase adhering to the routing tables.
• Teardown Phase − When data transfer is complete, the source sends a teardown
request. The destination responds using a teardown confirmation. The switches
flush their routing table entries, thus relinquishing the circuit.
• In the following diagram, we can that a virtual circuit is created, as denoted by
the dotted lines, and all the packets from the sender to the receiver are being
routed along this virtual circuit.
Advantages & Disadvantages of Virtual
Circuit:
• Advantages
• Packets are delivered to the receiver in the same order sent by the sender.
• Virtual circuit is a reliable network circuit.
• There is no need for overhead in each packet.
• Single global packet overhead is used in virtual circuit.
• Disadvantages
• Virtual circuit is costly to implement.
• It provides only connection-oriented service.
• Always a new connection set up is required for transmission.
Datagram Network
A Datagram based network is a true packet switched A virtual circuit network uses a fixed path for a
network. There is no fixed path for transmitting data. particular session, after which it breaks the connection
and another path has to be set up for the next session.
Questions:
1.Discuss Virtual-Circuit.
2.Discuss Datagram Network .
3.Differences between Virtual-Circuit and Datagram Network.
4.What are network layer Services.
Routing Algorithms
• In order to transfer the packets from source to the destination, the network
layer must determine the best route through which packets can be
transmitted.
• Whether the network layer provides datagram service or virtual circuit
service, the main job of the network layer is to provide the best route. The
routing protocol provides this job.
• The routing protocol is a routing algorithm that provides the best path from
the source to the destination. The best path is the path that has the "least-
cost path" from source to the destination.
• Routing is the process of forwarding the packets from source to the
destination but the best route to send the packets is determined by the
routing algorithm.
Classification of a Routing algorithm
• The Routing algorithm is divided
into two categories:
• The Link state routing algorithm is also known as Dijkstra's algorithm which is used to find the
shortest path from one node to every other node in the network.
• The Dijkstra's algorithm is an iterative, and it has the property that after kth iteration of the
algorithm, the least cost paths are well known for k destination nodes.
• Let's describe some notations:
• c( i , j): Link cost from node i to node j. If i and j nodes are not directly linked, then c(i , j) = ∞.
• D(v): It defines the cost of the path from source code to destination v that has the least cost
currently.
• P(v): It defines the previous node (neighbor of v) along with current least cost path from
source to v.
• N: It is the total number of nodes available in the network.
Algorithm
• Initialization
• N = {A} // A is a root node.
• for all nodes v
• if v adjacent to A
• then D(v) = c(A,v)
• else D(v) = infinity
• loop
• find w not in N such that D(w) is a minimum.
• Add w to N
• Update D(v) for all v adjacent to w and not in N:
• D(v) = min(D(v) , D(w) + c(w,v))
• Until all nodes in N
• Step 1:
• The first step is an initialization step. The currently known least cost path
from A to its directly attached neighbors, B, C, D are 2,5,1 respectively.
The cost from A to B is set to 2, from A to D is set to 1 and from A to C is
set to 5. The cost from A to E and F are set to infinity as they are not
directly linked to A.
• v = B, w = D
• D(B) = min( D(B) , D(D) + c(D,B) )
= min( 2, 1+2)
= min( 2, 3)
The minimum value is 2. Therefore, the currently shortest path from A to B is 2.
• b) Calculating shortest path from A to C
• v = C, w = D
• D(B) = min( D(C) , D(D) + c(D,C) )
• = min( 5, 1+3)
• = min( 5, 4)
• The minimum value is 4. Therefore, the currently shortest path from A to C is 4.</p>
• Hello
• Database Description
• Link state request
• Link state update
• Link state Acknowledgment
1. Hello packet
The Hello packet is used to create a neighborhood relationship and check the neighbor's reachability. Therefore,
the Hello packet is used when the connection between the routers need to be established.
2. Database Description
After establishing a connection, if the neighbor router is communicating with the system first time, it sends the
database information about the network topology to the system so that the system can update or modify
accordingly.
3. Link state request
The link-state request is sent by the router to obtain the information of a specified route. Suppose there are two
routers, i.e., router 1 and router 2, and router 1 wants to know the information about the router 2, so router 1
sends the link state request to the router 2. When router 2 receives the link state request, then it sends the link-
state information to router 1.
4. Link state update
The link-state update is used by the router to advertise the state of its links. If any router wants to broadcast the
state of its links, it uses the link-state update.
5. Link state acknowledgment
The link-state acknowledgment makes the routing more reliable by forcing each router to send the
acknowledgment on each link state update. For example, router A sends the link state update to the router B and
router C, then in return, the router B and C sends the link- state acknowledgment to the router A, so that the router
A gets to know that both the routers have received the link-state update.
OSPF States
• Down: If the device is in a down state, it has not received the HELLO packet. Here,
down does not mean that the device is physically down; it means that the OSPF
process has not been started yet.
• Init: If the device comes in an init state, it means that the device has received the
HELLO packet from the other router.
• 2WAY: If the device is in a 2WAY state, which means that both the routers have
received the HELLO packet from the other router, and the connection gets established
between the routers.
• Exstart: Once the exchange between the routers get started, both the routers move to
the Exstart state. In this state, master and slave are selected based on the router's id.
The master controls the sequence of numbers, and starts the exchange process.
• Exchange: In the exchange state, both the routers send a list of LSAs to each other that
contain a database description.
• Loading: On the loading state, the LSR, LSU, and LSA are exchanged.
• Full: Once the exchange of the LSAs is completed, the routers move to the full state.
Border Gateway Protocol
• Features
• Types of autonomous system
• Path Attributes
• BGP Neighbor type
• BGP Table
• BGP Session
• BGP Packet and Format
ICMP Protocol
• The ICMP stands for Internet Control Message Protocol. It is a
network layer protocol. It is used for error handling in the network
layer, and it is primarily used on network devices such as routers. As
different types of errors can exist in the network layer, so ICMP can be
used to report these errors and to debug those errors.
• Query messages
• The query messages are those messages that help the host to get the
specific information of another host. For example, suppose there are
a client and a server, and the client wants to know whether the server
is live or not, then it sends the ICMP message to the server.
ICMP Message Format
• The message format has two things; one is a category that tells us
which type of message it is.
• If the message is of error type, the error message contains the type
and the code.
• The type defines the type of message while the code defines the
subtype of the message.
• The destination unreachable error occurs when the packet does not reach the
destination. Suppose the sender sends the message, but the message does not
reach the destination, then the intermediate router reports to the sender that
the destination is unreachable.
• There is no flow control or congestion control mechanism in the network layer or
the IP protocol. The sender is concerned with only sending the packets, and the
sender does not think whether the receiver is ready to receive those packets or is
there any congestion occurs in the network layer so that the sender can send a
lesser number of packets, so there is no flow control or congestion control
mechanism. In this case, ICMP provides feedback, i.e., source quench. Suppose
the sender resends the packet at a higher rate, and the router is not able to
handle the high data rate. To overcome such a situation, the router sends a
source quench message to tell the sender to send the packet at a lower rate.
• Sometimes the situation arises when there are many routers that exist
between the sender and the receiver. When the sender sends the
packet, then it moves in a routing loop. The time exceeded is based on
the time-to-live value. When the packet traverses through the router,
then each router decreases the value of TTL by one. Whenever a
router decreases a datagram with a time-to-live value to zero, then the
router discards a datagram and sends the time exceeded message to
the original source.
• The router and the destination host can send a parameter problem
message. This message conveys that some parameters are not properly
set.
• When the packet is sent, then the routing table is gradually augmented
and updated. The tool used to achieve this is the redirection message.
• The ICMP Query message is used for error handling or debugging the
internet. This message is commonly used to ping a message.A router
or a host can send an echo-request message. It is used to ping a
message to another host that "Are you alive". If the other host is
alive, then it sends the echo-reply message. An echo-reply message
is sent by the router or the host that receives an echo-request
message.
• The timestamp-request and timestamp-reply messages are also a
type of query messages. Suppose the computer A wants to know the
time on computer B, so it sends the timestamp-request message to
computer B. The computer B responds with a timestamp-reply
message.
IP
An IP stands for internet protocol. 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.
To facilitate the routing of packets, TCP/IP protocol uses a 32-bit logical address
known as IPv4(Internet Protocol version 4).An IP address consists of two parts, i.e.,
the first one is a network address, and the other one is a host address.
There are two types of IP addresses:
• IPv4
• IPv6
• What is IPv4?
• 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.
• It provides transition strategies that convert IPv4 into IPv6, and these strategies are as
follows:
• Dual stacking: It allows us to have both the versions, i.e., IPv4 and IPv6, on the same
device.
• Tunneling: In this approach, all the users have IPv6 communicates with an IPv4 network to
reach IPv6.
• Network Address Translation: The translation allows the 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.
Address space It generates 4 billion unique It generates 340 undecillion unique addresses.
addresses
End-to-end In IPv4, end-to-end connection In the case of IPv6, end-to-end connection integrity is
connection integrity is unachievable. achievable.
integrity
Security In IPv4, security depends on the In IPv6, IPSEC is developed for security purposes.
features application. This IP address is not
developed in keeping the security
feature in mind.
Address In IPv4, the IP address is In IPv6, the representation of the IP address in hexadecimal.
representation represented in decimal.
Fragmentation Fragmentation is done by the Fragmentation is done by the senders only.
senders and the forwarding
routers.
Packet flow identification It does not provide any mechanism It uses flow label field in the header
for packet flow identification. for the packet flow identification.
Checksum field The checksum field is available in The checksum field is not available in
IPv4. IPv6.
Encryption and Authentication It does not provide encryption and It provides encryption and
authentication. authentication.