Use the link👇
Thursday, March 11, 2021
Wednesday, February 3, 2021
Application Layer
Application Layer
The application layer in the OSI model is the closest layer to the
end user which means that the application layer and end user can interact
directly with the software application. The application layer programs are
based on client and servers.
It is the top most layer of OSI Model. Manipulation of
data(information) in various ways is done in this layer which enables user or
software to get access to the network. Some services provided by this layer
includes: E-Mail, transferring files, distributing the results to user,
directory services, network resources, etc.
The Application layer includes the following functions:
- Identifying communication
partners: The
application layer identifies the availability of communication partners
for an application with data to transmit.
- Determining resource
availability: The
application layer determines whether sufficient network resources are
available for the requested communication.
- Synchronizing communication: All the communications
occur between the applications requires cooperation which is managed by an
application layer.
Services of
Application Layers
- Network Virtual terminal: An application layer
allows a user to log on to a remote host. To do so, the application
creates a software emulation of a terminal at the remote host. The user's
computer talks to the software terminal, which in turn, talks to the host.
The remote host thinks that it is communicating with one of its own terminals,
so it allows the user to log on.
- File Transfer, Access, and
Management (FTAM): An
application allows a user to access files in a remote computer, to
retrieve files from a computer and to manage files in a remote computer.
FTAM defines a hierarchical virtual file in terms of file structure, file
attributes and the kind of operations performed on the files and their
attributes.
- Addressing: To obtain
communication between client and server, there is a need for addressing.
When a client made a request to the server, the request contains the
server address and its own address. The server response to the client
request, the request contains the destination address, i.e., client
address. To achieve this kind of addressing, DNS is used.
- Mail Services: An application layer
provides Email forwarding and storage.
- Directory Services: An application
contains a distributed database that provides access for global
information about various objects and services.
- Authentication: It authenticates the
sender or receiver's message or both.
The Application Layer contains a variety of protocols that are
commonly needed by users. Most widely-used application protocol is HTTP (Hypertext Transfer Protocol),
which is the basis for the World Wide Web. When a browser wants a web page, it
sends the name of the page it wants to the server using HTTP. The server then
sends the page back. TELNET, FTP, DNS, SMTP etc are other protocols.
Presentation Layer
Presentation Layer
The Presentation Layer is concerned with the
syntax and semantics of the information exchanged between two communicating
devices.
- The presentation
layer takes care such that the data is sent to the receiver in
such a way that the receiver will understand the information (data) and
will be able to use the data.
- Syntax may be different from
the two communicating machines. In this condition, the presentation
layer plays the role of translator between them.
- It is possible for two
machines to communicate with different data representations, data
structures to be exchanged can be defined in an abstract way. These
abstract data structures will be managed by the presentation layer and
this layer allows higher-level data structures, to be defined and
exchanged.
Functions of
Presentation Layer
- Translation: Before being
transmitted, information in the form of characters and numbers should be
changed to bit streams. The presentation layer is responsible for
interoperability between encoding methods as different computers use
different encoding methods. It translates data between the formats the
network requires and the format the computer.
- Encryption: It carries out
encryption at the transmitter and decryption at the receiver.
- Compression: It carries out data
compression to reduce the bandwidth of the data to be transmitted. The
primary role of Data compression is to reduce the number of bits to be
0transmitted. It is important in transmitting multimedia such as audio,
video, text etc.
Design issues with Presentation Layer :
- Standard way of encoding
data –
The presentation layer follows a standard way to encode data when it needs to be transmitted. This encoded data is represented as character strings, integers, floating point numbers, and data structures composed of simple components. It is handled differently by different machines based on the encoding methods followed by them. - Maintaining the Syntax and
Semantics of distributed information –
The presentation layer manages and maintains the syntax as well as logic and meaning of the information that is distributed. - Standard Encoding on the
wire –
The data structures that are defined to be exchanged need to be abstract along with the standard encoding to be used “on the wire”.
Session Layer
The session layer is also known as a network dialog controller, it creates, maintains, synchronizes the interaction between communicating applications.
Session layer manages and synchronize the conversation between two
different applications. In Session layer, streams of data are marked and are
resynchronized properly, so that the ends of the messages are not cut
prematurely and data loss is avoided.
- The session layer tracks
the dialogs between systems, which are also called sessions. This layer
manages a session by initiating the opening and closing of sessions
between end-user application processes.
- It also controls single or
multiple connections for each end-user application and directly
communicates with both the presentation and the transport layers. The services
provided by the session layer are generally implemented
in the application environment using remote procedure calls (RPCs).
- In the Session layer,
streams of data are marked and are resynchronized properly, so that the
ends of the messages are not cut prematurely and data loss is avoided.
- A protocol such as Zone
Information Protocol, AppleTalk Protocol, and Session Control Protocol are
used to implement sessions on Web browsers.
- Through check pointing and
recovery session management and restoration are possible using these
protocols.
Functionalities of
the Session layer
Specific functionalities of the transport layer are as follows:
1. Dialog Control
- The session layer behaves as
a dialog controller.
- It allows two communication
machines to enter into a dialog.
- It permits to communicate in
either half-duplex (one way at a time) or full-duplex (two ways at a time)
mode of communication.
For Example, A dialog between a terminal connected to the
mainframe can be half-duplex.
2. Synchronization
- This layer permitted a
process to add checkpoints which are referred to as synchronization points
into the stream of data.
Example: If a system is sending a file of 2500 pages, It is
advisable to add checkpoints after every 100 pages to ensure that a 100-page
unit is successfully received and acknowledged independently. In this case, if
a crash happens during transmission of page number 824; then retransmission
begins on page 801. There is no need to retransmit pages 1 to 800 pages.
3. Token Management
This layer is also responsible for managing tokens. Through this,
it prevents the two users to simultaneously attempt access of the same critical
operation.
Design Issues with Session Layer:
- Establish sessions between
machines –
The establishment of session between machines is an important service provided by session layer. This session is responsible for creating a dialog between connected machines. The Session Layer provides mechanism for opening, closing and managing a session between end-user application processes, i.e. a semi-permanent dialogue. This session consists of requests and responses that occur between applications. - Enhanced Services –
Certain services such as checkpoints and management of tokens are the key features of session layer and thus it becomes necessary to keep enhancing these features during the layer’s design. - To help in Token management
and Synchronization –
The session layer plays an important role in preventing collision of several critical operation as well as ensuring better data transfer over network by establishing synchronization points at specific intervals. Thus it becomes highly important to ensure proper execution of these services.
Some of the famous session layer's protocols are:
- Remote procedure call
protocol (RPC)
- Point-to-Point Tunneling
Protocol (PPTP)
- Session Control Protocol
(SCP)
- Session Description Protocol
(SDP) etc.
Transport Layer
Transport layer is a 4th layer from the top. The role of the transport layer is to provide the communication services directly to the application processes running on different hosts.
The
transport layer provides a logical communication between application processes
running on different hosts. Although the application processes on different
hosts are not physically connected, application processes use the logical
communication provided by the transport layer to send the messages to each
other.
A
computer network provides more than one protocol to the network applications.
For example, TCP and UDP are two transport layer protocols that provide a
different set of services to the network layer. The transport layer protocols
are implemented in the end systems but not in the network routers.
All
transport layer protocols provide multiplexing/demultiplexing service. It also
provides other services such as reliable data transfer, bandwidth guarantees,
and delay guarantees.
Each
of the applications in the application layer has the ability to send a message
by using TCP or UDP. The application communicates by using either of these two
protocols. Both TCP and UDP will then communicate with the internet protocol in
the internet layer. The applications can read and write to the transport layer.
Therefore, we can say that communication is a two-way process.
Services provided by the Transport Layer
1. End-to-end delivery: The transport layer
transmits the entire message to the destination. Therefore, it ensures the
end-to-end delivery of an entire message from a source to the destination.
2. Addressing : Data generated by an
application on one machine must be transmitted to the correct application on
another machine. In this case, addressing is provided by the transport layer.
The transport layer provides the user address which is specified
as a station or port. The port variable represents a particular TS user of a
specified station known as a Transport Service access point (TSAP). Each
station has only one transport entity.
The transport layer protocols need to know which upper-layer
protocols are communicating.
3. Reliable delivery:
The
transport layer provides reliability services by retransmitting the lost and
damaged packets.
The reliable delivery has four aspects:
- Error
control:
The primary role of reliability is Error Control. In reality,
no transmission will be 100 percent error-free delivery. Therefore,
transport layer protocols are designed to provide error-free transmission.
The data link layer also provides the error handling mechanism,
but it ensures only node-to-node error-free delivery. However, node-to-node
reliability does not ensure the end-to-end reliability.
The transport layer performs the checking for the errors
end-to-end to ensure that the packet has arrived correctly.
- Sequence
control:
The second aspect of the reliability is sequence control which is
implemented at the transport layer.
On the sending end,
the transport layer is responsible for ensuring that the packets received from
the upper layers can be used by the lower lay.
- Loss
control:
Loss Control is a third aspect of reliability. The transport layer ensures
that all the fragments of a transmission arrive at the destination, not
some of them. On the sending end, all the fragments of transmission are
given sequence numbers by a transport layer. These sequence numbers allow
the receiver’s transport layer to identify the missing segment.
- Duplication
control:
Duplication Control is the fourth aspect of reliability. The transport
layer guarantees that no duplicate data arrive at the destination.
Sequence numbers are used to identify the lost packets; similarly, it
allows the receiver to identify and discard duplicate segments.
4. Flow Control: Flow control is used
to prevent the sender from overwhelming the receiver. If the receiver is
overloaded with too much data, then the receiver discards the packets and
asking for the retransmission of packets. This increases network congestion and
thus, reducing the system performance.
The transport layer is responsible for flow control. It uses the
sliding window protocol that makes the data transmission more efficient as well
as it controls the flow of data so that the receiver does not become
overwhelmed. Sliding window protocol is byte oriented rather than frame
oriented.
5. Multiplexing: The transport layer uses the multiplexing to improve
transmission efficiency.
Multiplexing can occur in two ways:
Upward multiplexing: Upward multiplexing means multiple transport layer
connections use the same network connection. To make more cost-effective, the
transport layer sends several transmissions bound for the same destination
along the same path; this is achieved through upward multiplexing.
Downward multiplexing: Downward multiplexing means one transport layer connection
uses the multiple network connections. Downward multiplexing allows the
transport layer to split a connection among several paths to improve the
throughput. This type of multiplexing is used when networks have a low or slow
capacity.
Elements of Transport Protocols
The fourth layer in the OSI model is known as the transport layer
from the top. This layer provides the communication services directly to the
running application processes on different hosts. Even though these processes
on various hosts are not linked physically, and use logical communication to transmit
the messages to each other.
The protocols of this layer are implemented within the end
systems, not in the routers of the network.
For instance, the two transport layer protocols like TCP &UDP
provides different services to the network layer.
All the protocols in this layer provide different services
like multiplexing, de-multiplexing, reliable data transfer, bandwidth
& delay guarantees.
Elements of Transport Layer
The elements of this layer include the following.
Service-point Addressing
Computers frequently run several programs at a time, because of
this reason, the delivery of source to destination in two computers is not
possible. So this layer is used for an exact kind of address to its header
which is known as a port address or service point address. Through this
address, every packet arrives at the correct computer & also transport
layer attains the total message to the exact method on that computer.
Segmentation & Reassembly
In a segmentation process, a message can be separated into communicable
segments where each segment includes a sequence number that enables the layer
to rebuild the message. Once the message arrives from the source system to the
destination system then the message can be reassembled properly, packets can be
identified and replaced because of the lost data in transmission.
Connection Control
These are two types namely connectionless and connection-based.
Connectionless based Transport Layer
In connectionless, the transport layer treats every packet like an
individual & transmits it to the destination computer. In this kind of
transmission, the receiver doesn’t transmit an acceptance to the sender regarding
a packet receipt.
Connection based Transport Layer
This layer makes a connection with the layer at the destination of
the computer before sending the packets toward the target. The connection can
be created by using the following steps: (Three way hand shaking mechanism)
- Establishment of Connection
- Transfer of Data
- Termination Connection
So connection-based service is used for the entire data
transmission, whereas connectionless service is less consistent
Multiplexing & De-multiplexing
Several packets are transmitted across a system from various
applications by using control systems and these are found within the transport
layer. This layer allows packets using different methods, and these packets are
distinguished through their port numbers & transmit them to the layer once
adding correct headers.
In the De-multiplexing process, the data can be obtained which is
transmitted from different processes. It gets the data segments from this layer
to deliver it to the suitable method running on the machine at the receiver
end.
Flow Control
The transport layer is also accountable for the flow control
between the contiguous layers of the TCP/IP model. It doesn’t execute
across a single link even it executes a continuous node. By impressive flow
control methods, loss of data can be stopped from the sender & slow
receiver.
For example, it uses the sliding window protocol technique. In
this technique, the receiver transmits a window back toward the sender to
update the received data size.
Error Control
This is also achieved back-to-back similar to the data link layer.
In this layer, the total message can appear at the receiving end of the layer
without any fault. The improvement of error can be attained through the packet
re-transmission. The integrity of data can be checked once the data has arrived
or not by using the services like the ACK & NACK to update the sender.
Monday, January 11, 2021
Link State Routing Algorithm
Link state routing is a technique in which each router shares the knowledge of its neighborhood with every other router in the internetwork.
The three keys to understand the Link State Routing algorithm:
- Knowledge about the neighborhood: Instead of sending its routing table, a router
sends the information about its neighborhood only. A router broadcast its
identities and cost of the directly attached links to other routers.
- Flooding: Each
router sends the information to every other router on the internetwork
except its neighbors. This process is known as Flooding. Every router that
receives the packet sends the copies to all its neighbors. Finally, each
and every router receives a copy of the same information.
- Information sharing: A
router sends the information to every other router only when the change
occurs in the information.
Link
State Routing has two phases:
Reliable
Flooding
- Initial state: Each
node knows the cost of its neighbors.
- Final state: Each
node knows the entire graph.
Route Calculation
Each
node uses Dijkstra's algorithm on the graph to calculate the optimal routes to
all nodes.
- 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.
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
In the above algorithm, an initialization step is followed by the
loop. The number of times the loop is executed is equal to the total number of
nodes available in the network.
where,
o c( i , j): Link cost from node i to node j. If i and j nodes are not
directly linked, then c(i , j) = ∞.
o D(v): It defines the cost of the path from source code to
destination v that has the least cost currently.
o P(v): It defines the previous node (neighbor of v) along with
current least cost path from source to v.
o N: It is the total number of nodes available in the network.
Example:
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.
Step
2:
In
the table, we observe that vertex D contains the least cost path in step
1. Therefore, it is added in N. Now, we need to determine a least-cost path
through D vertex.
Step
3:
In
the table, we observe that both E and B have the least cost path in step
2. Let's consider the E vertex. Now, we determine the least cost path of
remaining vertices through E.
Step
4:
In
the table, we observe that B vertex has the least cost path in step 3.
Therefore, it is added in N. Now, we determine the least cost path of remaining
vertices through B.
Step
5:
In
the table, we observe that C vertex has the least cost path in step 4.
Therefore, it is added in N. Now, we determine the least cost path of remaining
vertices through C.
Step |
N |
D(B),P(B) |
D(C),P(C) |
D(D),P(D) |
D(E),P(E) |
D(F),P(F) |
1 |
A |
2,A |
5,A |
1,A |
∞ |
∞ |
2 |
AD |
2,A |
4,D |
2,D |
∞ |
|
3 |
ADE |
2,A |
3,E |
4,E |
||
4 |
ADEB |
3,E |
4,E |
|||
5 |
ADEBC |
4,E |
||||
6 |
ADEBCF |
Distance-vector routing protocol
A distance-vector routing protocol in data networks determines the best route for data packets based on distance. Distance-vector routing protocols measure the distance by the number of routers a packet has to pass, one router counts as one hop.
Some
distance-vector protocols also take into account network latency and
other factors that influence traffic on a given route.
To
determine the best route across a network, routers, on which a distance-vector
protocol is implemented, exchange information with one another,
usually routing tables plus hop counts for destination networks and
possibly other traffic information.
Distance-vector
routing protocols also require that a router informs its neighbors
of network topology changes periodically.
The Distance vector algorithm is iterative, asynchronous and
distributed.
- Distributed: It
is distributed in that each node receives information from one or more of
its directly attached neighbors performs calculation and then distributes
the result back to its neighbors.
- Iterative: It
is iterative in that its process continues until no more information is
available to be exchanged between neighbors.
- Asynchronous: It
does not require that all of its nodes operate in the lock step with each
other.
Three
Keys to understand the working of Distance Vector Routing Algorithm:
- Knowledge about the whole network: Each router shares its knowledge through the
entire network. The Router sends its collected knowledge about the network
to its neighbors.
- Routing only to neighbors: The router sends its knowledge about the network
to only those routers which have direct links. The router sends whatever
it has about the network through the ports. The information is received by
the router and uses the information to update its own routing table.
- Information sharing at regular intervals: Within 30 seconds, the router sends the
information to the neighboring routers.
Let dx(y) be the cost of the least-cost path from node x to node y. The least costs are related by Bellman-Ford equation,
dx(y)
= minv{c(x,v) + dv(y)}
Where the minv
is the equation taken for all x neighbors. After traveling from x to v, if we
consider the least-cost path from v to y, the path cost will be c(x,v)+dv(y).
The least cost from x to y is the minimum of c(x,v)+dv(y) taken over
all neighbors.
With the Distance Vector Routing algorithm, the node x contains
the following routing information:
- For each neighbor v, the cost c(x,v) is the path cost
from x to directly attached neighbor, v.
- The distance vector x, i.e., Dx = [ Dx(y)
: y in N ], containing its cost to all destinations, y, in N.
- The distance vector of each of its neighbors, i.e., Dv =
[ Dv(y) : y in N ] for each neighbor v of x.
Distance
vector routing is an asynchronous algorithm in which node x sends the copy of
its distance vector to all its neighbors. When node x receives the new distance
vector from one of its neighboring vector, v, it saves the distance vector of v
and uses the Bellman-Ford equation to update its own distance vector. The
equation is given below:
dx(y)
= minv{ c(x,v) + dv(y)} for each node y in N
The
node x has updated its own distance vector table by using the above equation
and sends its updated table to all its neighbors so that they can update their
own distance vectors.
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.
Initialization:
At
the beginning, each node can know only the distance between itself and its
immediate neighbors, those directly connected to it.
Assume
that each node can send a message to the immediate neighbors and find the
distance between itself and these neighbors. The distance for any entry that is
not a neighbor is marked as infinite (unreachable).
In distance vector
routing, each node shares its routing table with its immediate neighbors
periodically and when there is a change.
Updating:
When a node receives a two-column(next column is not necessary) 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 , and the distance between A and C is y , then the distance between A and that destination, via C, is x + y.
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
anymore. The new route has a distance of infinity.
When D sends table to E:
When B sends table to A:
When
E sends table to A:
Similarly,
this goes on until all nodes are updated.