VI- Delivering data to users
Once data arrive in a particular host, these must be delivered to the user.
We discussed earlier that data will have to move up the TCP/IP architecture from
the network access layer to the application layer. As data move up or down the
layers, these must be delivered to the correct protocols in each layer. But
since there may be several applications running at the same time, the system
should be to combine data from many applications into a few transport protocols
and from the transport protocols to the Internet Protocol. Combining data
from several sources into a single data stream is called multiplexing. Data
received at the destination therefore must be demultiplexed or divided for
delivery to multiple users or processes. The IP uses protocol numbers to
identify transport protocols and the transport protocols use port numbers to
identify applications.
The protocol number is a single byte in the third word of a datagram
header. The value of this identifies the protocol in the layer above IP to which
the data should be passed. Each protocol above IP therefore is assigned a
unique value. An example is the protocol file found in / etc/ protocols of a UNIX
Machine.

What happens is that when a datagram arrives and its destination address
matches that of the local IP address, the IP layers know that the datagram has
to be Delivered to a transport protocol above it. IP searches the table using the
protocol Number as search key and delivers it to the datagram is 17, then the
data is passed On to UDP.
Once the data is already in the transport layer, this will be analyzed again
so it will be correctly delivered to an application process. Application processes
(or Users) are identified by port numbers. At the transport layer, data are
called Segments. Remember that the segment header contains information on
the source Port number identifies the process that sends the data and the
destination port Number that uniquely identifies a process.
An example of port numbers can be seen in the file / etc / services of a UNIX system. Below is one specific example.





Some applications are assigned specific port numbers. For example, UNIX
telnet is assigned port 23. However, there are port numbers that are assigned
dynamically allocated ports are not pre-assigned. Instead, they are assigned to
processes when needed. It is the responsibility of the system that no one port is
assigned to more than one process. The availability of dynamically assigned
ports allows the system support multiple users.
Finally, we introduce the concept of a socket. A socket is a combination of an IP
Address and a port number. It uniquely identifies a single network process within
the entire Internet. A pair of sockets, one for the receiving host and one for the
sending host, defines the connection for connection- oriented protocols like TCP.

Telnet Protocol
The Telnet protocol provides a fairly general, bi-directional, 8-bytes oriented
communication facility. Its primary goal is to allow interfacing between terminal
devices and terminal- oriented processes. Moreover, it is envisioned to be used for
terminal- terminal communication and process-process communication.
The telnet protocol is based on the concept of a Network Virtual Terminal . The
Network Virtual Terminal (NVT) is a bi-directional character device, with printer
and a keyboard. The printer responds to incoming data and the keyboard produces
outgoing data sent over the telnet connection and, if “echoes” are desired, to the
NVT’s printer as well. “echoes” will not be expected, each and is assumed to
originate and terminate at a Network Virtual Terminal (NVT). This eliminates the
need for user hosts (host to which physical terminals are attached) and server
hosts (hosts providing the service) to keep information about the characteristics of
each other’s terminal and terminal handling convertions.
Although a telnet connection through the network is intrinsically full duplex, the
NVT is viewed as a half-duplex device operating in a line buffered mode. The
idea is that data is accumulated in the user host until a complete line of data
Is ready for transmission or until some locally defined explicit signal to transmit
occurs. The signal could either be generated by a process or by human user. In
short, data transmission is triggered by an end of line character or by an explicit
signal to transmit occurs. The signal could either be generated by a process or by
a human user. In short, data transmission is triggered by an end of line character
or by an explicit signal to transmit Once data transmission is completed, the user
host relinquishes control. The server host proceeds to process the input data, then
decides if output should be generated, control is retained by the server host until
all the output has been transmitted.
When a process has completed sending data to an NVT printer and has no queued
input from the NVT keyboard for further processing (i.e, when a process at one
end of a Telnet connection cannot proceed without input from the other end), then
the process must transmit the Telnet Go Ahead (GA) command. When Telnet GA
is received by a user host, control is basically given to it.
This rule is not intended to require that the Telnet GA command be sent from a
user host at the end of each line, since server hosts do not normally require a
special signal (in addition to end-of line or other locally –defined characters) in
order to commence processing. Rather, the Telnet GA is designed to help a user’s
local host operate a physically half duplex terminal which has a “lockable”
keyboard.
File Transfer Protocol (FTP)
the main objectives of File Transfer Protocol are:
1. to promote sharing of files;
2. to encourage indirect or implicit use of remote computers
3. to shield a user from variations in file storage system among hosts; and
4. to transfer data reliably and efficiently
Before data transfer can occur, a connection between the user host and server host
must be established. This is done by setting up the data connection to the
appropriate ports and choosing the parameters for transfers. Both the user data
transfer process ( user-DTP ) and the server data transfer process (server-DTP)
have a default data port. The default data port for the user process is U and the
default data port for the server process is L-s1.
The user-DTP listens in on the data port prior to sending a transfer request
command. This FTP request command determines the direction of the data
transfer. The server, upon receipt of the transfer request, will initiate the data
connection to the port. When the connection is established, the data transfer
begins between user-DTP and server-DTP. In general, it is the responsibility of
the server to maintain the data connection to initiate and close it.
The transfer byte size is 8-bit bytes. This byte size is relevant only for the actual
transfer of data and has no relationship o the data representation of the host’s file
system.
There are three ways of transmitting data in FTP:
1. formats the data and allows for the restart procedures
2. compresses the data for efficient transfer
3. passes data with little or no processing
All data transfers must be completed with an end-of-file (EOF) which
may be explicitly stated or implied by the closing of data connection. For
files with record structure, all the end-of-record (EOR) markers must be
explicit. For purposes of standard transfer, the sending host will translate
its internal EOF or EOR denotation into the representation prescribed by
the transfer mode and file structure. The receiving host will perform the
inverse translation to its internal denotation.
