Client/Server Paradigm: Mod 4 Process-To-Process Delivery
Client/Server Paradigm: Mod 4 Process-To-Process Delivery
Client/Server Paradigm: Mod 4 Process-To-Process Delivery
PROCESS-TO-PROCESS DELIVERY
Communication on the Internet is not defined as the exchange of data between two nodes or
between two hosts.
Real communication takes place between two processes
We need process-to-process delivery.
The transport layer is responsible for process-to-process delivery-the delivery of
a packet, part of a message, from one process to another. Two processes communicate
in a client/server relationship.
shows these three types of deliveries and their domains.
1. Client/Server Paradigm
Although there are several ways to achieve process-to-process communication, the
most common one is through the client/server paradigm.
A process on the local host, called a client, needs services from a process usually
on the remote host, called a server. Both processes (client and server) have the
same name.
For communication, we must define the following:
1. Local host
2. Local process
3. Remote host
4. Remote process
2. Addressing
At the data link layer, we need a MAC address to choose one node among several
nodes if the connection is not point-to-point.
A frame in the data link layer needs a Destination MAC address for delivery and a
source address for the next node's reply.
The IP addresses and port numbers play different roles in selecting the final
destination of data.
The destination IP address defines the host among the different hosts in the
world.
After the host has been selected, the port number defines one of the processes
on this particular host (see Figure 4.3).
3. lANA Ranges
The lANA (Internet Assigned Number Authority) has divided the port numbers
into three ranges: well known, registered, and dynamic (or private),
· Well-known ports. The ports ranging from 0 to 1023 are assigned and
controlledby lANA. These are the well-known ports.
· Registered ports. The ports ranging from 1024 to 49,151 are not assigned or
controlled by lANA. They can only be registered with lANA to prevent
duplication.
· Dynamic ports. The ports ranging from 49,152 to 65,535 are neither
controlled nor registered. They can be used by any process. These are the
ephemeral ports.
4. Socket Addresses
Process-to-process delivery needs two identifiers, IP address and the port number,
at each end to make a connection.
The combination of an IP address and a port number is called a socket address.
The client socket address defines the client process uniquely just as the server
socket address defines the server process uniquely
The pseudoheader is the part of the header of the IP packet in which the user data-
gram is to be encapsulated with some fields filled with Os
The protocol field is added to ensure that the packet belongs to UDP, and not
to other transport-layer protocols.
The services offered by TCP to the processes at the application layer are as
follows:
Process-to-Process Communication:
TCP provides process-to-process communication using port numbers. The
following table lists some well-known port numbers used by TCP.
Because the sending and the receiving processes may not write or read data
at the same speed, TCP needs buffers for storage.
There are two buffers, the sending buffer and the receiving buffer,
one for each direction and these buffers are also necessary for flow and
error control mechanisms used by TCP.)
One way to implement a buffer is to use a circular array of 1-byte locations
Segments:
The buffering handles the disparity between the speed of the producing and
consuming processes, we need one more step before we can send data.
The IP layer, as a service provider for TCP, needs to send data in packets,
not as a stream of bytes.
At the transport layer, TCP groups a number of bytes together into a packet
called a segment.
TCP adds a header to each segment (for control purposes) and delivers the
segment to the IP layer for transmission.
Full-Duplex Communication:
TCP offers full-duplex service, in which data can flow in both directions at
the same time.
Each TCP then has a sending and receiving buffer, and segments move in
both directions.
Connection-Oriented Service:
TCP, unlike UDP, is a connection-oriented protocol. When a process at site A
wants to send and receive data from another process at site B, the following
occurs:
Reliable Service
Features of tcp
TCP is reliable protocol. That is, the receiver always sends either positive or
negative acknowledgement about the data packet to the sender, so that the
sender always has bright clue about whether the data packet is reached the
destination or it needs to resend it.
TCP ensures that the data reaches intended destination in the same order it was
sent.
TCP is connection oriented. TCP requires that connection between two remote
points be established before sending actual data.
TCP provides error-checking and recovery mechanism.
TCP provides end-to-end communication.
TCP provides flow control and quality of service.
TCP operates in Client/Server point-to-point mode.
TCP provides full duplex server, i.e. it can perform roles of both receiver and
sender.
It sets the 'SYN' flag as 1 and sends the message to the server.
The message has also some additional information like the
sequence number, the ACK is set here to 0, the window size, and
the maximum segment size.
For Example, if the window size is 2000 bits, and the maximum
segment size is 200 bits then a maximum of 10 data segments
(2000/200 = 10) can be transmitted in the connection.
2. The server replies with the SYN and the ACK to the
client:
After receiving the SYN from the server, the client sets the ACK
flag to '1' and sends it with an acknowledgement number 1
greater than the server's SYN sequence number to the client.
Here, the SYN flag is kept '0'. After completion of this step, the
connection is now established from the server to the client-side
also.
It sets the FIN flag as '1' and sends the message to the server
with a random sequence number.
2. The server replies with the FIN and the ACK to the
client:
After receiving the FIN from the server, the client sets the ACK
flag to '1' and sends it with an acknowledgement number 1
greater than the server's FIN sequence number to the client.
Here, the FIN flag is kept '0'. After completion of this step, the
connection is now terminated from the server to the client-side
also.
DNS
An application layer protocol defines how the application processes running on different
systems, pass the messages to each other.
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.
Country Domain
The format of country domain is same as a generic domain, but it uses two-character
country abbreviations (e.g., us for the United States) in place of three character
organizational abbreviations.
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.
Name space
A flat name space cannot be used in a large system such as the internet
Hierarchical Name Space
Remote Login
is a process in which user can login into remote site i.e. computer and use
services that are available on the remote computer. With the help of remote
login a user is able to understand result of transferring result of processing from
the remote computer to the local computer.
Procedure of Remote Login :
1. When the user types something on local computer, then local
operating system accepts character.
2. Local computer does not interpret the characters, it will send them to
TELNET client.
3. TELNET client transforms these characters to a universal character
set called Network Virtual Terminal (NVT) characters and it will
pass them to the local TCP/IP protocol Stack.
4. Commands or text which is in the form of NVT, travel through Internet
and it will arrive at the TCP/IP stack at remote computer.
5. Characters are then delivered to operating system and which later on
passed to TELNET server.
6. Then TELNET server changes that characters to characters which can
be understandable by remote computer.
7. Remote operating system receives character from a pseudo-terminal
driver, which is a piece of software that pretends that characters are
coming from a terminal.
8. Operating system then passes character to the appropriate application
program.
Electronic Mail (e-mail) is one of most widely used services of Internet.
This service allows an Internet user to send a message in formatted manner
(mail) to the other Internet user in any part of world.
Message in mail not only contain text, but it also contains images, audio and
videos data.
The person who is sending mail is called sender and person who receives mail
is called recipient. It is just like postal mail service.
Mailbox :
It is a file on local hard drive to collect mails.
Delivered mails are present in this file.
The user can read it delete it according to his/her requirement.
To use e-mail system each user must have a mailbox .
Access to mailbox is only to owner of mailbox.
Spool file :
This file contains mails that are to be sent.
User agent appends outgoing mails in this file using SMTP. MTA extracts
pending mail from spool file for their delivery.
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.
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.
Features of HTTP:
o Connectionless protocol: HTTP is a connectionless protocol. HTTP client initiates
a request and waits for a response from the server.
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.
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.
.