CN-Module 5 Notes
CN-Module 5 Notes
MODULE 5
Course Notes
Syllabus:
Textbooks:
Reference Books:
Different clients use different sockets, but the server creates only one socket and
changes only the remote socket address each time a new client makes a
connection.
The server makes a passive open, in which it becomes ready for the
communication, but it waits until a client process makes the connection. It creates
an empty socket. It then binds the socket to the server and the well-know port, in
which only part of the socket (the server socket address) is filled. The server then
issues a receive request command, which blocks until it receives a request from
a client.
The client process makes an active open. Creates a socket and sends the request.
The client then issues a receive command, which is blocked until a response
arrives from the server.
The controller receives input from the keyboard or the mouse and uses the client
programs to access the document. After the document has been accessed, the
controller uses one of the interpreters to display the document on the screen.
The client protocol can be one of the protocols described later, such as HTTP or
FTP. The interpreter can be HTML, Java, or JavaScript, depending on the type of
document.
Web Server
The web page is stored at the server. Each time a request arrives, the
corresponding document is sent to the client. To improve efficiency, servers
normally store requested files in a cache in memory. A server can also become
Web Documents
The documents in the WWW can be grouped into three broad categories: static,
dynamic, and active.
Static Documents
Static documents are fixed-content documents that are created and stored in a
server HyperText Markup Language (HTML), Extensible Markup Language
(XML), Extensible Style Language (XSL), and Extensible Hypertext Markup
Language (XHTML).
Dynamic Documents
A dynamic document is created by a web server whenever a browser requests the
document. Java Server Pages (JSP), Active Server Pages (ASP).
Active Documents
For many applications, we need a program or a script to be run at the client site.
These are called active documents.
Javascript and Java applet
In a persistent connection, the server leaves the connection open for more requests
after sending a response. The server can close the connection at the request of a
client or if a time-out has been reached.
Nonpersistent Connections
In a nonpersistent connection, one TCP connection is made for each
request/response.
The following lists the steps in this strategy:
1. The client opens a TCP connection and sends a request.
2. The server sends the response and closes the connection.
3. The client reads the data until it encounters an end-of-file marker; it then closes
the connection.
Request message
The first line in a request message is called a request line.
The method field defines the request types.
GET method is used to get a document from server, the body of the message is
empty. The data form values are passed as query parameters in the URL.
The HEAD method is used when the client needs only some information about
the web page from the server, such as the last time it was modified. The response
message in this case has only the header section; the body section is empty.
The PUT method allows the client to post a new web page on the server (if
permitted).
The POST method is used to send some information to the server to be added to
the web page or to modify the web page.
The TRACE method is used for debugging;
The DELETE method allows the client to delete a web page on the server if the
client has permission to do so.
The CONNECT method was originally made as a reserve method; it may be used
by proxy servers.
The OPTIONS method allows the client to ask about the prop
URL defines the address and name of the corresponding web page.
The third field, version, gives the version of the protocol; the most current version
of HTTP is 1.1.
After request line we can have zero or more request header lines.
Each header line sends additional information from the client to the server.
Each header line has a header name, a colon, a space, and a header value
Response Message
The first line in a response message is called the status line.
The status code field defines the status of the request.
However, to use the proxy server, the client must be configured to access the
proxy instead of the target server.
Proxy server acts as both server and client.
The proxy servers are normally located at the client site
File Transfer Protocol (FTP) is the standard protocol provided by TCP/IP for
copy ing a file from one host to another.
Two systems may use different file name conventions.
Two systems may have different ways to represent data.
Two systems may have different directory structures.
All of these problems have been solved by FTP
The control connection is made between the
control processes. The data connection is made between the data transfer
processes.
Separation of commands and data transfer makes FTP more efficient.
In control connection We need to transfer only a line of command or a line of
response at a time.
The data connection, on the other hand, needs more complex rules due to the
variety of data types transferred
Port 21 is used for the control connection, and Port 20 is used for the data
connection.
Control Connection
Communication is achieved through commands and responses.
Data Connection
1. The client, not the server, issues a passive open using an ephemeral port. This
must be
done by the client because it is the client that issues the commands for
transferring files.
2. Using the PORT command the client sends this port number to the server.
3. The server receives the port number and issues an active open using the well
known port 20 and the received ephemeral port number.
A user agent is a software package (program) that composes, reads, replies to,
and forwards messages.
It also handles local mailboxes on the user computers.
To send mail, the user, through the UA, creates mail that looks very similar to
postal mail. It has an envelope and a message.
The envelope usually contains the sender address, the receiver address, and other
information.
The message contains the header and the body.
The header of the message defines the sender, the receiver, the subject of the
message, and some other information. The body of the mes sage contains the
actual information to be read by the recipient.
Addresses
A mail handling system must use an addressing system with unique addresses.
The address consists of two parts: a local part and a domain name, separated by
an @ sign.
The local part defines the name of a special file, called the user mailbox, where
all the mail received for a user is stored for retrieval by the message access agent.
The second part of the address is the domain name.
Message Transfer Agent: SMTP
Simple Mail Transfer Protocol is an example for MTA. SMTP is a push protocol.
TELNET
TErminaL NETwork
TELNET allow a user on the client site to log into the computer at the server site
and use the services available there.
The commands or text, in NVT form, travel through the Internet and arrive at the
TCP/IP stack at the remote machine.
Here the characters are delivered to the operating system and passed to the
TELNET server, which changes the characters to the corresponding characters
understandable by the remote computer.
the remote operating system is not designed to receive characters from a TELNET
server; it is designed to receive characters from a terminal driver.
The solution is to add a piece of software called a pseudoterminal driver, which
pretends that the characters are coming from a terminal.
If we want to access any remote computer in the world, we must first know what
type of computer we will be connected to.
TELNET solves this problem by defining a universal interface called the Network
Virtual Terminal (NVT) character set.
Via this interface, the client TELNET translates characters (data or commands)
that come from the local terminal into NVT form and delivers them to the
network.
The server TELNET, on the other hand, translates data and commands from NVT
form into the form acceptable by the remote computer.
• SSH for Remote Logging – PuTTy, Tectia are few examples for remote
logging
• SSH for File Transfer - Secure File Transfer Program (SFTP) is used for
file transfer.
Port Forwarding - The SSH port forwarding mechanism creates a tunnel through
which the messages belonging to other protocols (TELNET, SMTP) can travel.
TCP/IP protocols use the IP address, which uniquely identifies the connection of
a host to the Internet. People prefer to use names instead of numeric addresses.
Internet needs to have a directory system that can map a name to an address.
Name Space
A name space that maps each address to a unique name can be organized in two
ways: flat or hierarchical.
In a flat name space, a name is assigned to an address.
A name in this space is a sequence of characters without structure.
The main disadvantage of a flat name space is that it cannot be used in a large
system such as the Internet because it must be centrally controlled.
In a hierarchical name space, each name is made of several parts
One part defines the nature of the organization, the second part can define the
name of an organiza tion, the third part can define departments in the organization
etc. It can be decentralized.
Domain Name Space
Root Server
A root server is a server whose zone consists of the whole tree.
A root server usually does not store any information about domains but delegates
its authority to other servers,
Primary and Secondary Servers
A primary server is a server that stores a file about the zone for which it is an
authority. It is responsible for creating, maintaining, and updating the zone file.
A secondary server is a server that transfers the complete information about a
zone from another server and stores the file on its local disk.
The sec ondary server neither creates nor updates the zone files. If updating is
required, it must be done by the primary server, which sends the updated version
to the secondary.
A primary server loads all information from the disk file;
The secondary server loads all information from the primary server.
Resolution
Mapping a name to an address is called name-address resolution.
Iterative Resolution
Caching
When a server asks for a mapping from another server and receives the response,
it stores this information in its cache memory before sending it to the client.
If the same or another client asks for the same mapping, it can check its cache
memory and resolve the problem.
DNS Messages