Professional Documents
Culture Documents
User Datagram Protocol: Unit V Transport, Session Amd Application Layer
User Datagram Protocol: Unit V Transport, Session Amd Application Layer
of IT 2022-2023
UNIT V
TRANSPORT, SESSION AMD APPLICATION LAYER
Transport Layer –UDP, TCP, Congestion Control & Quality of Service – Data traffic,
Congestion, Congestion Control, QoS and Flow Characteristics, Application Layer – DNS,
Remote Logging (Telnet), SMTP, FTP, WWW, HTTP, POP3, MIME, SNMP.
1
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
2
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
Length - Length field specifies the entire length of UDP packet (including header). It
is 16-bits field and minimum value is 8-byte, i.e. the size of UDP header itself.
Checksum - This field stores the checksum value generated by the sender before
sending. IPv4 has this field as optional so when checksum field does not contain any
value it is made 0 and all its bits are set to zero.
Source Port (16-bits) - It identifies source port of the application process on the
sending device.
3
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
4
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
Windows Size - This field is used for flow control between two stations and indicates
the amount of buffer (in bytes) the receiver has allocated for a segment, i.e. how much
data is the receiver expecting.
Checksum - This field contains the checksum of Header, Data and Pseudo Headers.
Urgent Pointer - It points to the urgent data byte if URG flag is set to 1.
Options - It facilitates additional options which are not covered by the regular header.
Option field is always described in 32-bit words. If this field contains data less than 32-
bit, padding is used to cover the remaining bits to reach 32-bit boundary.
Addressing
TCP communication between two remote hosts is done by means of port numbers (TSAPs).
Ports numbers can range from 0 – 65535 which are divided as:
System Ports (0 – 1023)
User Ports ( 1024 – 49151)
Private/Dynamic Ports (49152 – 65535)
Connection Management
TCP communication works in Server/Client model. The client initiates the connection and the
server either accepts or rejects it. Three-way handshaking is used for connection management.
5
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
Establishment
Client initiates the connection and sends the segment with a Sequence number. Server
acknowledges it back with its own Sequence number and ACK of client’s segment which is
one more than client’s Sequence number. Client after receiving ACK of its segment sends an
acknowledgement of Server’s response.
Release
Either of server and client can send TCP segment with FIN flag set to 1. When the receiving
end responds it back by ACKnowledging FIN, that direction of TCP communication is closed
and connection is released.
Bandwidth Management
TCP uses the concept of window size to accommodate the need of Bandwidth management.
Window size tells the sender at the remote end, the number of data byte segments the receiver
at this end can receive. TCP uses slow start phase by using window size 1 and increases the
window size exponentially after each successful communication.
6
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
For example, the client uses windows size 2 and sends 2 bytes of data. When the
acknowledgement of this segment received the windows size is doubled to 4 and next sent the
segment sent will be 4 data bytes long. When the acknowledgement of 4-byte data segment is
received, the client sets windows size to 8 and so on.
If an acknowledgement is missed, i.e. data lost in transit network or it received NACK, then
the window size is reduced to half and slow start phase starts again.
Error Control &and Flow Control
TCP uses port numbers to know what application process it needs to handover the data
segment. Along with that, it uses sequence numbers to synchronize itself with the remote host.
All data segments are sent and received with sequence numbers. The Sender knows which last
data segment was received by the Receiver when it gets ACK. The Receiver knows about the
last segment sent by the Sender by referring to the sequence number of recently received
packet.
If the sequence number of a segment recently received does not match with the sequence
number the receiver was expecting, then it is discarded and NACK is sent back. If two segments
arrive with the same sequence number, the TCP timestamp value is compared to make a
decision.
Multiplexing
The technique to combine two or more data streams in one session is called Multiplexing.
When a TCP client initializes a connection with Server, it always refers to a well-defined port
number which indicates the application process. The client itself uses a randomly generated
port number from private port number pools.
Using TCP Multiplexing, a client can communicate with a number of different application
process in a single session. For example, a client requests a web page which in turn contains
different types of data (HTTP, SMTP, FTP etc.) the TCP session timeout is increased and the
session is kept open for longer time so that the three-way handshake overhead can be avoided.
This enables the client system to receive multiple connection over single virtual connection.
These virtual connections are not good for Servers if the timeout is too long.
Congestion Control
When large amount of data is fed to system which is not capable of handling it, congestion
occurs. TCP controls congestion by means of Window mechanism. TCP sets a window size
telling the other end how much data segment to send. TCP may use three algorithms for
congestion control:
Additive increase, Multiplicative Decrease
7
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
Slow Start
Timeout React
Timer Management
TCP uses different types of timer to control and management various tasks:
Keep-alive timer:
This timer is used to check the integrity and validity of a connection.
When keep-alive time expires, the host sends a probe to check if the connection still
exists.
Retransmission timer:
This timer maintains stateful session of data sent.
If the acknowledgement of sent data does not receive within the Retransmission time,
the data segment is sent again.
Persist timer:
TCP session can be paused by either host by sending Window Size 0.
To resume the session a host needs to send Window Size with some larger value.
If this segment never reaches the other end, both ends may wait for each other for infinite
time.
When the Persist timer expires, the host re-sends its window size to let the other end
know.
Persist Timer helps avoid deadlocks in communication.
Timed-Wait:
After releasing a connection, either of the hosts waits for a Timed-Wait time to terminate
the connection completely.
This is in order to make sure that the other end has received the acknowledgement of its
connection termination request.
Timed-out can be a maximum of 240 seconds (4 minutes).
Crash Recovery
TCP is very reliable protocol. It provides sequence number to each of byte sent in segment. It
provides the feedback mechanism i.e. when a host receives a packet, it is bound to ACK that
packet having the next sequence number expected (if it is not the last segment).
When a TCP Server crashes mid-way communication and re-starts its process it sends TPDU
broadcast to all its hosts. The hosts can then send the last data segment which was never
unacknowledged and carry onwards.
Quality of Service(QoS)
8
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
Reliability
It is one of the main characteristics that the flow needs. If there is a lack of reliability then it
simply means losing any packet or losing an acknowledgement due to which retransmission
is needed.
Reliability becomes more important for electronic mail, file transfer, and for internet access.
Delay
Another characteristic of the flow is the delay in transmission between the source and
destination. During audio conferencing, telephony, video conferencing, and remote
conferencing there should be a minimum delay.
9
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
Jitter
It is basically the variation in the delay for packets that belongs to the same flow. Thus Jitter
is basically the variation in the packet delay. Higher the value of jitter means there is a large
delay and the low jitter means the variation is small.
Bandwidth
The different applications need different bandwidth.
Steps to achieve Quality of Service:
Quality of Service, can be done by techniques, like jitter buffer and traffic shaping.
Jitter buffer
This is a temporary storage buffer which is used to store the incoming data packets, it is
used in packet-based networks to ensure that the continuity of the data streams doesn't get
disturbed, it does that by smoothing out the packet arrival times during periods of network
congestion.
Traffic shaping
This technique which is also known as packet shaping is a congestion control or
management technique that helps to regulate network data transfer by delaying the flow of
least important or least necessary data packets.
QoS is included in the service-level agreement when an organization signs it with its network
service provider which guarantees the selected performance level.
There are 2 types of Quality of Service Solutions:
1. Stateless solution: Here, the server is not required to keep or store the server
information or session details to itself. The routers maintain no fine-grained state
about traffic, one positive factor of this is, that it's scalable and robust. But also, it
has weak services as there is no guarantee about the kind of performance delay in
a particular application which we encounter. In the stateless solution, the server and
client are loosely coupled and can act.
2. Stateful solution: Here, the server is required to maintain the current state and
session information, the routers maintain per-flow state as the flow is very
important in providing the Quality-of-Service which is providing powerful services
such as guaranteed services and high resource utilization, provides protection, and is
much less scalable and robust. Here, the server and client are tightly bounded.
Quality of Service Parameters:
QoS can be measured quantitatively by using several parameters
10
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
Packet loss: it happens when the network links become congested and the routers and
switches start dropping the packets. When these packets are dropped during real-time
communication, such as audio or video, these sessions can experience jitter and gaps
in speech.
Jitter: occurs as the result of network congestion, timing drift, and route changes.
And also, too much jitter can degrade the quality of audio communication.
Latency: is the time delay, which is taken by a packet to travel from its source to its
destination. For a great system, latency should be as low as possible, ideally, it should
be close to zero.
Bandwidth: is the capacity of a network channel to transmit maximum possible data
through the channel in a certain amount of time. QoS optimizes a network by
managing its bandwidth and setting the priorities for those applications which require
more resources as compared to other applications.
Mean opinion score: it is a metric for rating the audio quality which uses a five-point
scale, with a five indicating the highest or best quality.
Implementing Quality of Service:
We can implement Quality of service through three of the following existing models:
1. Best Effort: if we are applying this model then, it means that we are prioritizing all
the data packets equally. But since we all setting the priority order like this, then there
is no guarantee that all the data packets will be delivered, but it will put up the best
effort to deliver all of them. Point to remember is, that the best-effort model is applied
when networks haven’t configured with the QoS policies or incase their network
infrastructure does not support QoS.
2. Integrated Services: or IntServ, this QoS model reserves the bandwidth along a
specific path on the network. The applications ask the network's resource reservation
for themselves and parallelly the network devices monitor the flow of packets to make
sure network resources can accept packets. Point to remember: while implementing
Integrated Services Model, the IntServ-capable routers and resource reservation
protocol are necessary. This model has limited scalability and high consumption of
the network resources.
3. Differentiated Services: in this QoS model, the network elements such as routers and
switches are configured to serve multiple categories of traffic with different priority
orders. A company can categorize the network traffic based on its requirements. Eg.
Assigning higher priority to audio traffic etc.
11
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
These involve per flow Setup These involve long term Setup
12
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
13
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
14
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
15
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
connection from any client, the SMTP process initiates a connection through port 25.
After successfully establishing a TCP connection the client process sends the mail
instantly.
SMTP Protocol
The SMTP model is of two types:
1. End-to-end method
2. Store-and- forward method
The end-to-end model is used to communicate between different organizations
whereas the store and forward method is used within an organization. An SMTP client
who wants to send the mail will contact the destination’s host SMTP directly, in order
to send the mail to the destination. The SMTP server will keep the mail to itself until
it is successfully copied to the receiver’s SMTP.
The client SMTP is the one that initiates the session so let us call it client- SMTP and
the server SMTP is the one that responds to the session request so let us call it receiver-
SMTP. The client- SMTP will start the session and the receiver-SMTP will respond
to the request.
Model of SMTP system
In the SMTP model user deals with the user agent (UA), for example, Microsoft
Outlook, Netscape, Mozilla, etc. In order to exchange the mail using TCP, MTA is
used. The user sending the mail doesn’t have to deal with MTA as it is the
responsibility of the system admin to set up a local MTA. The MTA maintains a small
queue of mails so that it can schedule repeat delivery of mails in case the receiver is
not available. The MTA delivers the mail to the mailboxes and the information can
later be downloaded by the user agents.
16
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
The sender’s user agent prepares the message and sends it to the MTA. The MTA’s
responsibility is to transfer the mail across the network to the receiver’s MTA. To
send mails, a system must have a client MTA, and to receive mails, a system must
have a server MTA.
SENDING EMAIL:
Mail is sent by a series of request and response messages between the client and the
server. The message which is sent across consists of a header and a body. A null line
is used to terminate the mail header and everything after the null line is considered as
the body of the message, which is a sequence of ASCII characters. The message body
contains the actual information read by the receipt.
17
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
RECEIVING EMAIL:
The user agent at the server-side checks the mailboxes at a particular time of intervals.
If any information is received, it informs the user about the mail. When the user tries
to read the mail it displays a list of emails with a short description of each mail in the
mailbox. By selecting any of the mail users can view its contents on the terminal.
Some SMTP Commands:
HELO – Identifies the client to the server, fully qualified domain name, only sent
once per session
MAIL – Initiate a message transfer, fully qualified domain of originator
RCPT – Follows MAIL, identifies an addressee, typically the fully qualified name
of the addressee, and for multiple addressees use one RCPT for each addressee
DATA – send data line by line
Advantages of SMTP:
If necessary, the users can have a dedicated server.
It allows for bulk mailing.
Low cost and wide coverage area.
Offer choices for email tracking.
reliable and prompt email delivery.
Disadvantages of SMTP:
SMTP’s common port can be blocked by several firewalls.
SMTP security is a bigger problem.
Its simplicity restricts how useful it can be.
Just 7 bit ASCII characters can be used.
If a message is longer than a certain length, SMTP servers may reject the entire
message.
Delivering your message will typically involve additional back-and-forth
processing between servers, which will delay sending and raise the likelihood that
it won’t be sent.
File Transfer Protocol (FTP) is an application layer protocol that is used to transfer the files
between the local devices (PC, smartphone, etc.) to a server. It transfers both text and binary
files over the Internet.
FTP opens two connections between the computers − one for
the commands and replies (control connection) and a second one for data transfers (data
connection).
FTP is built on a client-server model architecture using the control connection and data
connection between the client and server.
Control Connection
A Contol Connectcion is established on Port number 21. It is the primary connection and is
used to send commands back and forth between the client and the server. It is used for sending
the control information like user identification, password, and remote directory, etc., once the
control connection is established.
Data Connection
Data Connection is initiated on Port number 20. Using the established Control Connection, the
client and server will create a separate Data Connection to transfer the requested data.
The Data Connection stays open until the transfer is complete, after that the Data Connection
is closed.
Data Connections are closed by either the client or the server, depending on which party is
sending the information. When a client is retrieving data from a server, the server will close
the connection once all the data has been transferred. When the client is transferring data to
the server, the client will terminate the connection after all the data has been transferred.
19
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
Stream mode − Here, the FTP handles the data as a string of bytes without separating
boundaries.
Block mode − In the block mode, the FTP decomposes the entire data into different
blocks of data.
Compressed mode − In this mode, the FTP uses the Lempel-Ziv algorithm to compress
the data.
Navigator, Google Chrome, etc are the popular ones. The browser fetches the page requested
interprets the text and formatting commands on it, and displays the page, properly formatted,
on the screen.
The basic model of how the web works are shown in the figure below. Here the browser is
displaying a web page on the client machine. When the user clicks on a line of text that is
linked to a page on the abd.com server, the browser follows the hyperlink by sending a
message to the abd.com server asking it for the page.
Here the browser displays a web page on the client machine when the user clicks on a line of
text that is linked to a page on abd.com, the browser follows the hyperlink by sending a
message to the abd.com server asking for the page.
Working of WWW:
The World Wide Web is based on several different technologies: Web browsers, Hypertext
Markup Language (HTML) and Hypertext Transfer Protocol (HTTP).
A Web browser is used to access web pages. Web browsers can be defined as programs which
display text, data, pictures, animation and video on the Internet. Hyperlinked resources on
the World Wide Web can be accessed using software interfaces provided by Web browsers.
Initially, Web browsers were used only for surfing the Web but now they have become more
universal. Web browsers can be used for several tasks including conducting searches,
mailing, transferring files, and much more. Some of the commonly used browsers are Internet
Explorer, Opera Mini, and Google Chrome.
21
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
Features of WWW:
HyperText Information System
Cross-Platform
Distributed
Open Standards and Open Source
Uses Web Browsers to provide a single interface for many services
Dynamic, Interactive and Evolving.
“Web 2.0”
Basic Features
There are three basic features that make HTTP a simple but powerful protocol:
HTTP is connectionless: The HTTP client, i.e., a browser initiates an HTTP request
and after a request is made, the client waits for the response. The server processes the
request and sends a response back after which client disconnect the connection. So client
22
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
and server knows about each other during current request and response only. Further
requests are made on new connection like client and server are new to each other.
HTTP is media independent: It means, any type of data can be sent by HTTP as long
as both the client and the server know how to handle the data content. It is required for
the client as well as the server to specify the content type using appropriate MIME-type.
HTTP is stateless: As mentioned above, HTTP is connectionless and it is a direct result
of HTTP being a stateless protocol. The server and client are aware of each other only
during a current request. Afterwards, both of them forget about each other. Due to this
nature of the protocol, neither the client nor the browser can retain information between
different requests across the web pages.
Basic Architecture
The following diagram shows a very basic architecture of a web application and depicts where
HTTP sits:
The HTTP protocol is a request/response protocol based on the client/server based architecture
where web browsers, robots and search engines, etc. act like HTTP clients, and the Web server
acts as a server.
23
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
Client
The HTTP client sends a request to the server in the form of a request method, URI, and
protocol version, followed by a MIME-like message containing request modifiers, client
information, and possible body content over a TCP/IP connection.
Server
The HTTP server responds with a status line, including the message's protocol version and a
success or error code, followed by a MIME-like message containing server information, entity
meta information, and possible entity-body content.
24
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
primary protocol for retrieving email or as a secondary option in addition to other protocols
like IMAP (Internet Message Access Protocol).
When using POP3 with an email application, users typically enter their email address,
password, and the server and port information for their email account. The email application
then establishes a connection to the server using POP3 and retrieves the email messages, which
are downloaded to the client and stored locally. Users can then read and manage their email
messages directly in the email application.
POP3 has some limitations compared to other protocols like IMAP, including the lack of real-
time synchronization and support for multiple device access. However, it remains a popular
choice for many users due to its simplicity and widespread support.
POP3 Ports
It uses two network ports for communication −port 110 for unencrypted connections and port
995 for encrypted connections using SSL/TLS (Secure Sockets Layer/Transport Layer
Security).
When configuring an email account in an email client, users may need to specify the POP3
port number to use. The default port for unencrypted POP3 connections is 110, and the default
port for encrypted POP3 connections using SSL/TLS is 995. Some email servers may use
different port numbers for POP3, in which case the user will need to enter the correct port
number when configuring their email account.
It is important to note that using an encrypted connection (port 995) is generally recommended
for security reasons. Unencrypted connections (port 110) are vulnerable to interception and
may not be suitable for sensitive data.
POP3 Operation
It operates by establishing a connection between the email client and the mail server and
exchanging a series of commands and responses to perform various tasks.
Here is an overview of how POP3 operates −
The email client establishes a connection to the mail server using the POP3 protocol.
The client sends a request to the server, asking for a list of available email messages.
The server responds with a list of messages, including their size and unique identifier.
The client selects which messages to retrieve and sends a request to the server to
download them.
The server sends the requested messages to the client, and marks them as read or unread
depending on the client's preference.
25
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
The client can also send commands to delete messages from the server, or to mark them
as read or unread.
Once the client has finished retrieving messages, it sends a request to the server to close
the connection. The server responds with an acknowledgment, and the connection is
closed.
POP3 is a simple protocol that allows email clients to retrieve and manage email messages
from a mail server. It does not support real-time synchronization of email messages between
the client and server, so the client must manually check for new messages. It also does not
support multiple devices accessing the same email account simultaneously, as each device will
have its own copy of the email messages. There are newer protocols available, such as IMAP
(Internet Message Access Protocol), which offer more advanced features and support for real-
time synchronization and multiple device access.
26
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
27
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
switches, servers, workstations, printers, modem racks, and more. It is used mainly in the
network management framework to monitor network-attached computers for conditions
requiring regulatory attention.
It is a framework for managing devices on the Internet using the TCP-IP protocol suite. It
supports a set of fundamental operations for monitoring and maintaining the Internet.
SNMP Concept
SNMP facilitates the concept of manager and agent. A manager, generally a host, controls and
monitors a group of agents, usually routers. This is an application-level protocol in which some
manager stations control a group of agents. The protocol is designed to monitor different
manufacturer’s devices and installed on various physical networks at the application level.
Components of SNMP
An SNMP-managed network includes three key components. These components are as
follows −
Managed Device − It is a network node that executes an SNMP interface that enables
unidirectional (read-only) or bidirectional access to node-specific information.
Agent − An agent is a network-management software mechanism that consists of a
managed device. An agent has local knowledge of management data and translates that
information to or from an SNMP specific form.
Network management system (NMS) − A network management system (NMS)
executes applications that monitor and control managed devices.
SNMP Protocols
SNMP uses two other protocols which are as follows –
SMI- SMI stands for Structure Management Information. SMI represents the general
rules for naming objects, defining object types (including range and length), and showing how
to encode objects and values.
28
St. Joseph’s College of Engineering
IT1401 Computer Communication Dept. of IT 2022-2023
SMI does not determine the number of objects an entity should handle or name the objects to
be managed or define the relationship between the objects and their values.
MIB
MIB stands for Management information base. For each entity to be handled, this protocol
must represent the number of objects, name them as per the rules represented by SMI, and
relate a type to each named object. MIB generates a collection of named objects, their types,
and their relationships to each other in an entity to be managed.
29
St. Joseph’s College of Engineering