Computer Network_Unit 5
Computer Network_Unit 5
The session layer is Layer 5 layer from the bottom in the OSI model. The job of the
session layer is to control and maintain connections between systems to share data. It
establishes, maintains, and ends sessions across all channels. In case of a network error,
it checks the authenticity and provides recovery options for active sessions. It manages
sessions and synchronizes data flow.
Basically, this layer regulates when computers can send data and how much data they
can send. Essentially it coordinates communication between devices.
DNS is a TCP/IP protocol used on different platforms. The domain name space is
divided into three different sections: generic domains, country domains, and inverse
domain.
Generic Domains
o It defines the registered hosts according to their generic behavior.
o Each node in a tree defines the domain name, which is an index to the DNS
database.
o It uses three-character labels, and these labels describe the organization type.
Label Description
Inverse Domain
The inverse domain is used for mapping an address to a name. When the server has
received a request from the client, and the server contains the files of only authorized
clients. To determine whether the client is on the authorized list or not, it sends a query
to the DNS server and ask for mapping an address to the name.
SNMP
o SNMP stands for Simple Network Management Protocol.
o SNMP is a framework used for managing devices on the internet.
o It provides a set of operations for monitoring and managing the internet.
SNMP Concept
Architecture
The WWW today is a distributed client-server service, in which a client using a browser
can access a service using a server. However, the service provided is distributed over
many locations called sites. Each site holds one or more web pages. Each web page,
however, can contain some links to other web pages in the same or other sites. In other
words, a web page can be simple or composite. A simple web page has no links to
other web pages; a composite web page has one or more links to other web pages.
Each web page is a file with a name and address.
Example
Assume we need to retrieve a scientific document that contains one reference to
another text file and one reference to a large image. Figure 26.1 shows the situation.
o The main document and the image are stored in two separate files (file A and
file B) in the same site; the referenced text file (file C) is stored in another site.
Since we are dealing with three different files, we need three transactions if we
want to see the whole document.
o The first transaction (request/response) retrieves a copy of the main document
(file A), which has references (pointers) to the second and third files. When a
copy of the main document is retrieved and browsed, the user can click on the
reference to the image to invoke the second transaction and retrieve a copy of
the image (file B). If the user needs to see the contents of the referenced text
file, she can click on its reference (pointer) invoking the third transaction and
retrieving a copy of file C.
o Note that although files A and B both are stored in site I, they are independent
files with different names and addresses. Two transactions are needed to
retrieve them. A very important point we need to remember is that file A, file B,
and file C in Example 26.1 are independent web pages, each with independent
names and addresses. Although references to file B or C are included in file A,
it does not mean that each of these files cannot be retrieved independently. A
second user can retrieve file B with one transaction. A third user can retrieve file
C with one transaction.
Web Server
o The web page is stored at the server. Each time a request arrives, the
corresponding document is sent to the client.
o To improve efficiency, servers normally store requested files in a cache in
memory; memory is faster to access than a disk.
o A server can also become more efficient through multithreading or
multiprocessing. In this case, a server can answer more than one request at a
time. Some popular web servers include Apache and Microsoft Internet
Information Server.
HTTP
o HTTP stands for HyperText Transfer Protocol.
o It is a protocol used to access the data on the World Wide Web (www).
o The HTTP protocol can be used to transfer the data in the form of plain text,
hypertext, audio, video, and so on.
o This protocol is known as HyperText Transfer Protocol because of its efficiency
that allows us to use in a hypertext environment where there are rapid jumps
from one document to another document.
o HTTP is similar to the FTP as it also transfers the files from one host to another
host. But, HTTP is simpler than FTP as HTTP uses only one connection, i.e., no
control connection to transfer the files.
o HTTP is used to carry the data in the form of MIME-like format.
o HTTP is similar to SMTP as the data is transferred between client and server. The
HTTP differs from the SMTP in the way the messages are sent from the client to
the server and from server to the client. SMTP messages are stored and
forwarded while HTTP messages are delivered immediately.
Features of HTTP:
o Connectionless protocol: HTTP is a connectionless protocol. HTTP client
initiates a request and waits for a response from the server. When the server
receives the request, the server processes the request and sends back the
response to the HTTP client after which the client disconnects the connection.
The connection between client and server exist only during the current request
and response time only.
o Media independent: HTTP protocol is a media independent as data can be
sent as long as both the client and server know how to handle the data content.
It is required for both the client and server to specify the content type in MIME-
type header.
o Stateless: HTTP is a stateless protocol as both the client and server know each
other only during the current request. Due to this nature of the protocol, both
the client and server do not retain the information between various requests of
the web pages.
HTTP Transactions
The above figure shows the HTTP transaction between client and server. The client
initiates a transaction by sending a request message to the server. The server replies
to the request message by sending a response message.
Messages
HTTP messages are of two types: request and response. Both the message types follow
the same message format.
Request Message: The request message is sent by the client that consists of a request
line, headers, and sometimes a body.
Response Message: The response message is sent by the server to the client that
consists of a status line, headers, and sometimes a body.
FTP
o FTP stands for File transfer protocol.
o FTP is a standard internet protocol provided by TCP/IP used for transmitting the
files from one host to another.
o It is mainly used for transferring the web page files from their creator to the
computer that acts as a server for other computers on the internet.
o It is also used for downloading the files to computer from other servers.
Objectives of FTP
o It provides the sharing of files.
o It is used to encourage the use of remote computers.
o It transfers the data more reliably and efficiently.
Why FTP?
Although transferring files from one system to another is very simple and
straightforward, but sometimes it can cause problems. For example, two systems may
have different file conventions. Two systems may have different ways to represent text
and data. Two systems may have different directory structures. FTP protocol
overcomes these problems by establishing two connections between hosts. One
connection is used for data transfer, and another connection is used for the control
connection.
Mechanism of FTP
The above figure shows the basic model of the FTP. The FTP client has three
components: the user interface, control process, and data transfer process. The server
has two components: the server control process and the server data transfer process.
o Control Connection: The control connection uses very simple rules for
communication. Through control connection, we can transfer a line of
command or line of response at a time. The control connection is made between
the control processes. The control connection remains connected during the
entire interactive FTP session.
o Data Connection: The Data Connection uses very complex rules as data types
may vary. The data connection is made between data transfer processes. The
data connection opens when a command comes for transferring the files and
closes when the file is transferred.
FTP Clients
o FTP client is a program that implements a file transfer protocol which allows
you to transfer files between two hosts on the internet.
o It allows a user to connect to a remote host and upload or download the files.
o It has a set of commands that we can use to connect to a host, transfer the files
between you and your host and close the connection.
o The FTP program is also available as a built-in component in a Web browser.
This GUI based FTP client makes the file transfer very easy and also does not
require to remember the FTP commands.
Advantages of FTP:
o Speed: One of the biggest advantages of FTP is speed. The FTP is one of the
fastest way to transfer the files from one computer to another computer.
o Efficient: It is more efficient as we do not need to complete all the operations
to get the entire file.
o Security: To access the FTP server, we need to login with the username and
password. Therefore, we can say that FTP is more secure.
o Back & forth movement: FTP allows us to transfer the files back and forth.
Suppose you are a manager of the company, you send some information to all
the employees, and they all send information back on the same server.
Disadvantages of FTP:
o The standard requirement of the industry is that all the FTP transmissions should
be encrypted. However, not all the FTP providers are equal and not all the
providers offer encryption. So, we will have to look out for the FTP providers
that provides encryption.
o FTP serves two operations, i.e., to send and receive large files on a network.
However, the size limit of the file is 2GB that can be sent. It also doesn't allow
you to run simultaneous transfers to multiple receivers.
o Passwords and file contents are sent in clear text that allows unwanted
eavesdropping. So, it is quite possible that attackers can carry out the brute
force attack by trying to guess the FTP password.
o It is not compatible with every system.
ELECTRONIC MAIL
o Electronic mail (or e-mail) allows users to exchange messages. The nature of
this application, however, is different from other applications discussed so far.
o In an application such as HTTP or FTP, the server program is running all the
time, waiting for a request from a client. When the request arrives, the server
provides the service. There is a request and there is a response.
o In the case of electronic mail, the situation is different. First, e-mail is
considered a one-way transaction. When Alice sends an email to Bob, she may
expect a response, but this is not a mandate. Bob may or may not respond. If
he does respond, it is another one-way transaction. Second, it is neither feasible
nor logical for Bob to run a server program and wait until someone sends an e-
mail to him. Bob may turn off his computer when he is not using it. This means
that the idea of client/server programming should be implemented in another
way: using some intermediate computers (servers). The users run only client
programs when they want and the intermediate servers apply the client/server
paradigm, as we discuss in the next section.
Architecture
To explain the architecture of e-mail, we give a common scenario, as shown in Figure
26.12.
In the common scenario, the sender and the receiver of the e-mail, Alice and Bob
respectively, are connected via a LAN or a WAN to two mail servers. The administrator
has created one mailbox for each user where the received messages are stored. A mail
box is part of a server hard drive, a special file with permission restrictions. Only the
owner of the mailbox has access to it. The administrator has also created a queue
(spool) to store messages waiting to be sent. A simple e-mail from Alice to Bob takes
nine different steps, as shown in the figure. Alice and Bob use three different agents: a
user agent (UA), a message transfer agent (MTA), and a message access agent (MAA).
When Alice needs to send a message to Bob, she runs a UA program to prepare the
message and send it to her mail server. The mail server at her site uses a queue (spool)
to store messages waiting to be sent. The message, however, needs to be sent through
the Internet from Alice’s site to Bob’s site using an MTA. Here two message transfer
agents are needed: one client and one server. Like most client-server programs on the
Internet, the server needs to run all the time because it does not know when a client
will ask for a connection. The client, on the other hand, can be triggered by the system
when there is a message in the queue to be sent. The user agent at the Bob site allows
Bob to read the received message. Bob later uses an MAA client to retrieve the
message from an MAA server running on the second server.