Client/Server Paradigm: Mod 4 Process-To-Process Delivery

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 29

Mod 4

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

5. Multiplexing and Demultiplexing


 The addressing mechanism allows multiplexing and demultiplexing by the
transport layer
 Multiplexing 
At the sender site, there may be several processes that need to send packets. but
there is only one transport layer protocol at any time.
This is a many-to-one relationship and requires multiplexing.
 Demultiplexing
 At the receiver site, the relationship is one-to-many and requires demultiplexing.
The transport layer receives datagrams from the network layer.
After error checking and dropping of the header, the transport layer delivers each
message to the appropriate process based on the port number.
 
            

6. Connectionless Versus Connection-Oriented Service


A transport layer protocol can either be connectionless or connection-oriented.
 Connectionless Service 
In a connectionless service, the packets are sent from one party to another with no
need for connection establishment or connection release.
The packets are not numbered; they may be delayed or lost or may arrive out of
sequence. There is no acknowledgment either.
 Connection~Oriented Service
 In a connection-oriented service, a connection is first established between the
sender and the receiver.
Data are transferred. At the end, the connection is released.
7. Reliable Versus Unreliable
 The transport layer service can be reliable or unreliable.
If the application layer program needs reliability, we use a reliable transport layer
protocol by implementing flow and error control at the transport layer. This means
a slower and more complex service.
 In the Internet, there are three common different transport layer protocols.
UDP is connectionless and unreliable; TCP and SCTP are connection oriented and
reliable. These three can respond to the demands of the application layer programs.
 The network layer in the Internet is unreliable, we need to implement reliability at
the transport layer.
8. Three Protocols
The original TCP/IP protocol suite specifies two protocols for the transport layer:
UDP and TCP.
shows the position of these protocols in the TCP/IP protocol suite.

USER DATAGRAM PROTOCOL (UDP)


The User Datagram Protocol (UDP) is called a connectionless, unreliable transport
protocol.
It does not add anything to the services of IP except to provide process-to process
communication instead of host-to-host communication. Also, it performs very
limited error checking.

Well-Known Ports for UDP


shows some well-known port numbers used by UDP.
Some port numbers can be used by both UDP and TCP.
Checksum
The UDP checksum calculation is different from the one for IP and ICMP.
Here
the checksum includes three sections: a pseudoheader, the UDP header, and the
data coming from the application layer.

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 value of the protocol field for UDP is 17.


If this value is changed during transmission, the checksum calculation at
the receiver will detect it and UDP drops the packet. It is not delivered to the
wrong protocol.
TCP
The second transport layer protocol is called Transmission Control Protocol (TCP).
TCP is a process-to-process (program-to-program) protocol.
TCP uses port numbers.
TCP is a connection-oriented protocol; it creates a virtual connection between two TCPs to send
data.
In addition, TCP uses flow and error control mechanisms at the transport level.

TCP is called a connection-oriented, reliable transport protocol. It adds


connection-oriented and reliability features to the services of IP.
TCP Services:

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.

 
 

Stream Delivery Service:


TCP, unlike UDP, is a stream-oriented protocol.
TCP, on the other hand, allows the sending process to deliver data as a
stream of bytes and allows the receiving process to obtain data as a stream
of bytes.
TCP creates an environment in which the two processes seem to be
connected by an imaginary "tube" that carries their data across the Internet.
This imaginary environment is depicted in the following figure. The sending
process produces (writes to) the stream of bytes, and the receiving process
consumes (reads from) them.
 
 
Sending and Receiving Buffers:
 

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:
 

1. The two TCPs establish a connection between them.


2. Data are exchanged in both directions.
3. The connection is terminated.
The TCP segment is encapsulated in an IP datagram and can be sent out of
order, or lost, or corrupted, and then resent.
Each may use a different path to reach the destination. There is no physical
connection.
TCP creates a stream-oriented environment in which it accepts the
responsibility of delivering the bytes in order to the other site.

Reliable Service

TCP is a reliable transport protocol. It uses an acknowledgment mechanism


to check the safe and sound arrival of data. We will discuss this feature
further in the section on error control.

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.

TCP Connection Establishment: Three-way Handshake


The connection establishment in TCP is called three- way handshaking.

Following are the three steps involved in establishing the


connection using the 3-way handshake process in TCP:

1. The client sends the SYN to the server: 

When the client wants to connect to the server.

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 client's synchronization request, the server


sends an acknowledge to the client by setting the ACK flag to '1'.

The acknowledgement number of the ACK is one more than the


received sequence number.

3. The client sends the ACK to the server: 

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.

After the connection is being established, the minimum of the


sender's and receiver's maximum segment size is taken under
consideration for data transmission.
Following are the three steps involved in terminating the
connection using the 3-way handshake process in TCP:

1. The client sends the FIN to the server: 

When the client wants to terminate the connection.

It sets the FIN flag as '1' and sends the message to the server
with a random sequence number.

Here, the ACK is set to 0.

2. The server replies with the FIN and the ACK to the
client:

 After receiving the client's termination request, the server


sends an acknowledge to the client by setting the ACK flag to '1'.
The acknowledgement number of the ACK is one more than the
received sequence number.

3. The client sends the ACK to the server:

 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.

TCP Segment structure –


TCP segment consists of data bytes to be sent and a header that is added to
the data by TCP as shown:
The header of a TCP segment can range from 20-60 bytes. 40 bytes are for
options. If there are no options, header is of 20 bytes else it can be of upmost
60 bytes.
Header fields:
 Source Port Address –
16 bit field that holds the port address of the application that is sending
the data segment.
 Destination Port Address –
16 bit field that holds the port address of the application in the host
that is receiving the data segment.
 Sequence Number –
32 bit field that holds the sequence number, i.e, the byte number of the
first byte that is sent in that particular segment. It is used to
reassemble the message at the receiving end if the segments are
received out of order.
 Acknowledgement Number –
32 bit field that holds the acknowledgement number, i.e, the byte
number that the receiver expects to receive next. It is an
acknowledgment for the previous bytes being received successfully.
 Header Length (HLEN) –
This is a 4 bit field that indicates the length of the TCP header by
number of 4-byte words in the header, i.e, if the header is of 20
bytes(min length of TCP header), then this field will hold 5 (because 5
x 4 = 20) and the maximum length: 60 bytes, then it’ll hold the value
15(because 15 x 4 = 60). Hence, the value of this field is always
between 5 and 15.
 Control flags –
These are 6 1-bit control bits that control connection establishment,
connection termination, connection abortion, flow control, mode of
transfer etc. Their function is:
 URG: Urgent pointer is valid
 ACK: Acknowledgement number is valid( used in case of
cumulative acknowledgement)
 PSH: Request for push
 RST: Reset the connection
 SYN: Synchronize sequence numbers
 FIN: Terminate the connection
 Window size –
This field tells the window size of the sending TCP in bytes.
 Checksum –
This field holds the checksum for error control. It is mandatory in TCP
as opposed to UDP.
 Urgent pointer –
This field (valid only if the URG control flag is set) is used to point to
data that is urgently required that needs to reach the receiving process
at the earliest. The value of this field is added to the sequence number
to get the byte number of the last urgent byte.

DNS
An application layer protocol defines how the application processes running on different
systems, pass the messages to each other.

o DNS stands for Domain Name System.


o DNS is a directory service that provides a mapping between the name of a host on the
network and its numerical address.
o DNS is required for the functioning of the internet.
o Each node in a tree has a domain name, and a full domain name is a sequence of symbols
specified by dots.
o DNS is a service that translates the domain name into IP addresses. This allows the users of
networks to utilize user-friendly names when looking for other hosts instead of
remembering the IP addresses.

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.

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

 The names assigned to the machines must be carefully selected from a


name space with complete control over the binding between the names
and IP addresses.
 There are two types of name spaces: Flat name spaces and Hierarchical
names.
Flat name spaces

 In a flat name space, a name is a sequence of characters without


structure.
 A name in this space is assigned to an address.
 The names were convenient and short.

 A flat name space cannot be used in a large system such as the internet
Hierarchical Name Space

 In hierarchical name space, each name consists of several parts.


 First part defines the nature of the organization, second part defines the
name of an organization, third part defines department of the
organization, and so on.
 In hierarchical name space, the authority to assign and control the name
spaces can be decentralized.
 Authority for names in each partition is passed to each designated agent.

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.

Components of E-Mail System :


The basic components of an email system are : User Agent (UA), Message
Transfer Agent (MTA), Mail Box, and Spool file.

User Agent (UA) :


The UA is normally a program which is used to send and receive mail.
Sometimes, it is called as mail reader.
It accepts variety of commands for composing, receiving and replying to
messages as well as for manipulation of the mailboxes.

Message Transfer Agent (MTA) :


MTA is actually responsible for transfer of mail from one system to another
. To send a mail, a system must have client MTA and system MTA.
It transfer mail to mailboxes of recipients if they are connected in the same
machine.
It delivers mail to peer MTA if destination mailbox is in another machine.
The delivery from one MTA to another MTA is done by Simple Mail Transfer
Protocol.

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.

There are two types of connections in FTP:


o Control Connection: The control connection uses very simple rules for
communication.
o Through control connection, we can transfer a line of command or line of
response at a time.
o The control connection is made between the control processes.
o The control connection remains connected during the entire interactive FTP
session.
o Data Connection: 
o The Data Connection uses very complex rules as data types may vary.
o The data connection is made between data transfer processes.
o The data connection opens when a command comes for transferring the files and
closes when the file is transferred.
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.

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. 

Stateless: HTTP is a stateless protocol


as both the client and server know
each other only during the current
request

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.
.

You might also like