Lecture 6
Some TCP and UDP applications
3/6/2024 Lecturer: Alex Frank Mongi 1
Lecture overview
1. FTP and TFTP
2. Electronic Mail Protocols
3. SMTP
4. POP and IMAP
5. SNMP
6. DHCP
7. HTTP
8. Telnet
3/6/2024 Lecturer: Alex Frank Mongi 2
1. FTP and TFTP
File Transfer Protocol (FTP) is the standard mechanism
provided by TCP/IP for copying a file from one host to
another.
FTP differs from other client-server applications in that it
establishes two connections between the hosts.
One connection is used for data transfer, the other for
control information (commands and responses).
Separation of commands and data transfer makes FTP
more efficient.
FTP uses two well-known TCP ports: Port 21 is used for the
3/6/2024 Lecturer: Alex Frank Mongi 3
Trivial File Transfer Protocol (TFTP) is designed for
occasions needing to simply copy a file without the
need for all of the features of the FTP protocol.
It is so simple that the software package can fit
into the read-only memory of a diskless
workstation.
The reason that it fits on ROM is that it requires
only basic IP and UDP.
Writing means copying a file from the client site to
3/6/2024 Lecturer: Alex Frank Mongi 4
However, there is no security for TFTP.
TFTP can read or write a file for the client.
Reading means copying a file from the server site to the
client site.
3/6/2024 Lecturer: Alex Frank Mongi 5
2. Electronic Mail: SMTP, POP and IMAP
At the beginning of the Internet era, the messages sent
by electronic mail were short and consisted of text only;
they let people exchange quick memos.
Today, electronic mail is much more complex.
It allows a message to include text, audio, and video. It
also allows one message to be sent to one or more
recipients.
To explain the architecture of e-mail, we give four
scenarios.
The fourth scenario is the most common in the exchange
3/6/2024 Lecturer: Alex Frank Mongi 6
First Scenario
§ In the first scenario, the sender and the receiver of the e-
mail are users (or application programs) on the same
mail server; they are directly connected to a shared mail
server.
§ The administrator has created one mailbox for each user
where the received messages are stored.
§ A mailbox is part of a local hard drive, a special file with
permission restrictions. Only the owner of the mailbox
has access to it.
§ When Alice needs to send a message to Bob, she runs a
user agent (UA) program to prepare the message and
3/6/2024store it in Bob’s mailbox.
Lecturer: Alex Frank Mongi 7
§ The message has the sender and recipient
mailbox addresses (names of files).
§ Bob can retrieve and read the contents of his
mailbox at his convenience using a user agent
3/6/2024 Lecturer: Alex Frank Mongi 8
Second Scenario
§ In the second scenario, the sender and the receiver of
the e-mail are users (or application programs) on two
different mail servers.
§ The message needs to be sent over the Internet. Here we
need user agents (UAs) and message transfer agents
(MTAs)
3/6/2024 Lecturer: Alex Frank Mongi 9
Third Scenario
§ Alice still needs a user agent to prepare her message.
She then needs to send the message through the LAN or
WAN.
§ This can be done through a pair of message transfer
agents (client and server).
§ The MTA client establishes a connection with the MTA
server on the system, which is running all the time.
§ The system at Alice’s site queues all messages received.
It then uses an MTA client to send the messages to the
system at Bob’s site; the system receives the message
3/6/2024
and stores it in Bob’s mailbox.
Lecturer: Alex Frank Mongi 10
3/6/2024 Lecturer: Alex Frank Mongi 11
Fourth Scenario
§ In the fourth and most common scenario, Bob is also
connected to his mail server by a WAN or a LAN.
§ After the message has arrived at Bob’s mail server, Bob
needs to retrieve it.
§ Here, we need another set of client-server agents, which
we call message access agents (MAAs).
§ Bob uses an MAA client to retrieve his messages. The
client sends a request to the MAA server, which is
running all the time, and requests the transfer of the
messages
3/6/2024 Lecturer: Alex Frank Mongi 12
3/6/2024 Lecturer: Alex Frank Mongi 13
3. Simple Mail Transfer Protocol (SMTP)
The actual mail transfer is done through message transfer
agents (MTAs).
To send mail, a system must have the client MTA, and to
receive mail, a system must have a server MTA.
The formal protocol that defines the MTA client and server
in the Internet is called Simple Mail Transfer Protocol
(SMTP).
As w e s ai d be fo re , tw o pai rs o f M TA c l i e n t-s e rve r
programs are used in the most common situation (fourth
scenario)
3/6/2024 Lecturer: Alex Frank Mongi 14
3/6/2024 Lecturer: Alex Frank Mongi 15
4. POP AND IMAP
The first and the second stages of mail delivery use SMTP.
SMTP is not involved in the third stage because it is a
push protocol; it pushes the message from the client to the
server.
On the other hand, the third stage needs a pull protocol;
the client must pull messages from the server.
The direction of the bulk data are from the server to the
client. The third stage uses a message access agent.
Currently two message access protocols are available:
Post Office Protocol, version 3 (POP3) and Internet Mail Access
Protocol, version 4 (IMAP4).
3/6/2024 Lecturer: Alex Frank Mongi 16
POP3:
§ Post Office Protocol, version 3 (POP3) is simple and
limited in functionality.
§ The client POP3 software is installed on the recipient
computer; the server POP3 software is installed on the
mail server.
3/6/2024 Lecturer: Alex Frank Mongi 17
§ Mail access starts with the client when the user needs to
download its e-mail from the mailbox on the mail server.
§ The client opens a connection to the server on TCP port
110.
§ It then sends its user name and password to access the
mailbox.
§ The user can then list and retrieve the mail messages,
one by one.
3/6/2024 Lecturer: Alex Frank Mongi 18
IMAP4
§ IMAP4 is similar to POP3, but it has more features; IMAP4
is more powerful and more complex.
§ POP3 is deficient in several ways. It does not allow the
user to organize her mail on the server; the user cannot
have different folders on the server. (Of course, the user
can create folders on her own computer.)
§ In addition, POP3 does not allow the user to partially
check the contents of the mail before downloading
3/6/2024 Lecturer: Alex Frank Mongi 19
IMAP4 provides the following extra functions:
i. A user can check the e-mail header prior to downloading.
ii. A user can search the contents of the e-mail for a specific
string of characters prior to downloading.
iii. A user can partially download e-mail. This is especially
useful if bandwidth is limited and the e-mail contains
multimedia with high bandwidth requirements.
iv. A user can create, delete, or rename mailboxes on the mail
server.
v. A user can create a hierarchy of mailboxes in a folder for e-
3/6/2024 mail storage.
Lecturer: Alex Frank Mongi 20
5. Simple Network Management Protocol
(SNMP)
SNMP is a framework for managing devices in an internet
using the TCP/IP protocol suite.
It provides a set of fundamental operations for
monitoring and maintaining an internet.
SNMP uses the concept of manager and agent.
A manager, usually a host, controls and monitors a set of
agents, usually routers or servers
3/6/2024 Lecturer: Alex Frank Mongi 21
SNMP is an application-level protocol in which a few
manager stations control a set of agents.
The protocol is designed at the application level so that it
can monitor devices made by different manufacturers and
installed on different physical networks
3/6/2024 Lecturer: Alex Frank Mongi 22
6. Dynamic Host Configuration Protocol
(DHCP)
Each computer that uses the TCP/IP protocol suite needs
to know its IP address.
If the computer uses classless addressing or is a member
of a subnet, it also needs to know its subnet mask.
In other words, four pieces of information are normally
needed:
i. The IP address of the computer
ii. The subnet mask of the computer
iii. The IP address of a router 4
iv. The
3/6/2024
IP address of a name server
Lecturer: Alex Frank Mongi 23
ARP AND RARP
§ A protocol called Reverse Address Resolution Protocol (RARP)
was designed to provide the IP address for a booted
computer
§ ARP maps an IP address to a physical address while RARP
maps a physical address to an IP address.
§ However, RARP is deprecated today for two reasons.
i. RARP used the broadcast service of the data link layer,
which means that a RARP server must be present in each
network.
ii. RARP can provide only the IP address of the computer, but
3/6/2024
a computer today needs all four pieces of information
Lecturer: Alex Frank Mongi 24
BOOTP
The Bootstrap Protocol (BOOTP) is the prerunner of
DHCP.
It is a client/server protocol designed to overcome the
two deficiencies of the RARP protocol.
First, since it is a client/server program, the BOOTP
server can be anywhere in the Internet
Second, it can provide all pieces of information we
mentioned above, including the IP address. To provide
the four pieces of information described above, it
3/6/2024 Lecturer: Alex Frank Mongi 25
BOOTP, however, is a static configuration protocol.
When a client requests its IP address, the BOOTP server
consults a table that matches the physical address of the
client with its IP address.
This implies that the binding between the physical
address and the IP address of the client already exists.
The binding is predetermined
3/6/2024 Lecturer: Alex Frank Mongi 26
The Dynamic Host Configuration Protocol (DHCP) is a
client/server protocol designed to provide the four pieces
of information for a diskless computer or a computer that
is booted for the first time.
DHCP is a successor to BOOTP and is backward
compatible with it. Although BOOTP is considered
deprecated, there may be some systems that may still use
BOOTP for host configuration.
The DHCP client and server can either be on the same
network or on different networks.
3/6/2024 Lecturer: Alex Frank Mongi 27
Same Network
3/6/2024 Lecturer: Alex Frank Mongi 28
Different Networks
3/6/2024 Lecturer: Alex Frank Mongi 29
7. Hypertext Transfer Protocol
The Hypertext Transfer Protocol (HTTP) is a protocol used
mainly to access data on the World Wide Web.
HTTP functions like a combination of FTP and SMTP
It is similar to FTP because it transfers files and uses the
services of TCP using only one TCP connection.
HTTP is like SMTP because the data transferred between
the client and the server look like SMTP messages.
3/6/2024 Lecturer: Alex Frank Mongi 30
Unlike SMTP, the HTTP messages are not destined to be
read by humans; they are read and interpreted by the
HTTP server and HTTP client (browser).
HTTP uses the services of TCP on well-known port 80.
3/6/2024 Lecturer: Alex Frank Mongi 31
Web Caching: Proxy Server
§ A proxy server is a computer that keeps copies of
responses to recent requests.
§ The HTTP client sends a request to the proxy server.
§ The proxy server checks its cache. If the response is not
stored in the cache, the proxy server sends the request
to the corresponding server.
§ Incoming responses are sent to the proxy server and
stored for future requests from other clients. The proxy
server reduces the load on the original server, decreases
traffic, and improves latency.
§ However, to use the proxy server, the client must be
3/6/2024configured to access the proxy instead of the target
Lecturer: Alex Frank Mongi 32
Proxy Server Location
The proxy servers are normally located at the client site.
This means that we can have a hierarchy of proxy
servers as shown below:
i. A client computer can also be used as a proxy server in a
small capacity that stores responses to requests often
invoked by the client.
ii. In a company, a proxy server may be installed on the
computer LAN to reduce the load going out of and coming
into the LAN.
iii. An ISP with many customers can install a proxy server to
3/6/2024
reduce the load going out of and coming into the ISP
Lecturer: Alex Frank Mongi 33
Hypertext and Hypermedia
•Hypertext means creating documents that refer to
other documents.
• In a hypertext document, a part of text can be defined
as a link to another document.
•When a hypertext is viewed with a browser, the link can
be clicked to retrieve the other document.
•Hypermedia is a term applied to d o c u m e n t th a t
contains links to other textual document or documents
containing graphics, video, or audio.
3/6/2024 Lecturer: Alex Frank Mongi 34
Web Client (Browser)
A variety of vendors offer commercial browsers that
interpret and display a Web document, and all of them use
nearly the same architecture.
Each browser usually consists of three parts: a controller,
client protocol, and interpreters
3/6/2024 Lecturer: Alex Frank Mongi 35
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
previously such as FTP, or TELNET, or HTTP
The interpreter can be HTML, Java, or JavaScript,
depending on the type of document.
3/6/2024 Lecturer: Alex Frank Mongi 36
Web Server
§ The Web page is stored at the server.
§ Each time a client request arrives, the corresponding document
is sent to the client.
§ To improve efficiency, servers normally store requested files in a
cache in memory; memory is faster to access than disk.
§ 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.
3/6/2024 Lecturer: Alex Frank Mongi 37
Uniform Resource Locator (URL)
§ A client that wants to access a Web page needs the file
name and the address.
§ To facilitate the access of documents distributed
throughout the world, HTTP uses locators.
§ The uniform resource locator (URL) is a standard locator
for specifying any kind of information on the Internet.
§ The URL defines four things: protocol, host computer,
port, and path
3/6/2024 Lecturer: Alex Frank Mongi 38
7. Telnet
TELNET is an abbreviation for TErminaL NETwork. It is
the standard TCP/IP protocol for virtual terminal
service as proposed by ISO.
It the establishment of a connection to a remote
system in such a way that the local terminal appears
to be a terminal at the remote system.
It is a general-purpose client-server application
program.
3/6/2024 Lecturer: Alex Frank Mongi 39
8.1 Concepts related to Telnet
i. Time-Sharing Environment:
§ In such an environment, a large computer supports
multiple users.
§ The interaction between a user and the computer occurs
through a terminal, which is usually a combination of
keyboard, monitor, and mouse.
§ In a time-sharing environment, all of the processing must
be done by the central computer.
§ Time-sharing creates an environment in which each user
has the illusion of a dedicated computer
3/6/2024 Lecturer: Alex Frank Mongi 40
ii. Login
§ Each authorized user has an identification and probably
a password. The user identification defines the user as
part of the system.
§ To access the system, the user logs into the system with
a user id or login name.
§ The system also includes password checking to prevent
an unauthorized user from accessing the resources.
3/6/2024 Lecturer: Alex Frank Mongi 41
iii. Local Login
§ When a user logs into a local time-sharing system, it is
called local login.
§ As a user types at a terminal or at a workstation running
a terminal emulator, the keystrokes are accepted by the
terminal driver.
§ The terminal driver passes the characters to the
operating system.
§The operating system, in turn, interprets the
combination of characters and invokes the desired
3/6/2024 Lecturer: Alex Frank Mongi 42
Fig.1: Local
Login
Fig.2: Local
Login
3/6/2024 Lecturer: Alex Frank Mongi 43
When a user wants to access an application program
or utility located on a remote machine, he or she
performs remote login.
The user sends the keystrokes to the terminal driver
w h e re t h e l o c a l o p e r a t i n g s y s t e m a c c e p t s t h e
characters but does not interpret them.
The characters are sent to the TELNET client, which
transforms the characters to a universal character set
called Network Virtual Terminal (NVT) characters and
delivers them to the local TCP/IP stack.
3/6/2024 Lecturer: Alex Frank Mongi 44
TELNET suffers from security problems.
Although TELNET requires a login name and
password (when exchanging text), often this is not
enough.
A microcomputer connected to a broadcast LAN
can easily eavesdrop using snooper software and
capture a login name and the corresponding
password (even if it is encrypted).
Another popular remote login application program
3/6/2024 Lecturer: Alex Frank Mongi 45
SSH, like TELNET, uses TCP as the underlying transport
protocol, but SSH is more secure and provides more
services than TELNET.
3/6/2024 Lecturer: Alex Frank Mongi 46