Communication and Networks Assignment
Communications and Networks
version 1.0
Diploma in Information Technology
Copyright © 2020 by Singapore Institute of Management Pte Ltd. All rights reserved.
Lesson 5: Internet Applications
1
Lesson 5 Learning Outcomes
Understand the purpose of File Transfer Protocols
Describe the steps performed in email
Describe the specifications used in email
Understand the role of ISP, Mail server and Mail Access
Compare and contrast SMTP, POP and IMAP
Describe the commonly used Email Representation standards
2
Lesson 5 Outline
File Transfer Protocol
Email Protocols
Email Transfer Protocols
Email Access & Representation
3
Transferring Files over the Internet
File Transfer Protocol (FTP): allows sending a copy of a file from one computer to another
FTP provides a powerful mechanism for the exchange of data
Most FTP is one-to-one
4
Files on the Internet
File: the fundamental storage abstraction
Holds an arbitrary object like document, spreadsheet, computer program, graphic image, or data
File transfer over the Internet is complicated because computers are heterogeneous
Different file representations
Different type information
Different naming
Different file access mechanisms
5
Heterogenous Computers
Different OS representation:
Extension for a JPEG image can be .jpg or .jpeg
Each line in text file is terminated by a LINEFEED character or CARRIAGE RETURN and LINEFEED
Separator in files names can be slash (/) or backslash (\)
User accounts which are given the right to access certain files
Account information differs among computers
User X on one is not same as user X on another
6
FTP Characteristics
Arbitrary file contents: can transfer any type of data
Bidirectional transfer: download or upload
Supports authentication & ownership
Each file have ownership & access restrictions
Ability to browse folders
Textual control messages that are sent as ASCII text
Accommodates heterogeneity: hides the details of individual computer OS
FTP is mostly invisible: invoked automatically by browser when user requests for file download
7
FTP Communication Paradigm
FTP uses a client/server model
Client establishes a command connection to FTP server and sends requests to which the server responds
Control connection: connection used for commands, requests from clients
When FTP server needs to download or upload a file, it opens a data connection
Data connection: connection used to transfer files
This inverts client-server relationship for data connections!
8
FTP Communication Sequence
Source: Douglas, C (2016) Computer Networks and Internets
1
2
3
4
5
6
7
8
9
10
11
9
FTP Authentication
After creating the control connection, client must log into the server
USER command for login name
PASS command for password
Server sends a numeric status response over control connection to indicate if login is successful
Client can only send other commands if login is successful
10
Anonymous Login
For public files, anonymous clients can access
username “anonymous”
password mostly “guest”
Souce: Bing, licensed under CC BY-SA
11
FTP Port Number
However, what protocol port number should server specify when connecting to the client?
Default FTP port number is 21
Client allocates a protocol port on local OS and sends port number to the server
Client binds to port to wait for a connection
Clients transmits PORT command over control connection to inform server
12
FTP Exceptions
Transmission of port number may fail if one of the two endpoints lies behind a Network Address Translation (NAT) device
like wireless router in residence or small office
To support FTP, a NAT device will recognise FTP control connection, inspects the contents and rewrites values in a PORT command
13
FTP Commands
Four common commands:
open and close: for command connection
ls and cd: to list and change directory
get and put: to open download and upload data
quit: to close FTP
14
FTP Algorithm
Source: Douglas, C (2016) Computer Networks and Internets
15
Modern FTP
Modern FTP now comes with a GUI
It now more intuitive rather than by commands
More visually understood by user
Source: Dropbox
Source: Google Drive
Source: Microsoft OneDrive
16
Practice 5.1
A user uses FTP to transfer files between his laptop and a file server.
What kind of communication model does FTP uses?
What format are control messages sent as in FTP?
What are the TWO commands does the user need to provide to the file server in order authenticate himself?
17
Trivial File Transfer Protocol (TFTP)
Some devices do not have enough memory and processing capability
Hosts within same LAN has lower probability of errors
TFTP is a light-weight file transfer protocol
Based on message paradigm but each message must be acknowledged before another message can be sent
18
TFTP Usage and Limitations
TFTP is often used by network managers to download or upload router configurations and software
Unlike FTP, it cannot locate files in directories
File to be transferred are specified in the command line
TFTP has no authentication facility
Network managers need to configure to allow only known IP address
19
Network File System (NFS)
Sometimes it is easier to access files rather than transfer them
NFS allows physically remote directories to be mounted on local systems
Appears to be local to the users
All standard operations carried out by the OS are supported transparently on remote directories and files
20
NFS Communication Paradigm
NFS can use message or stream paradigm for its transport service
Since it is simple client/server application, best to use message paradigm
NFS is generally not secure but have some simple authentication facilities
21
Practice 5.2
What is the rational for using the TFTP over FTP?
Distinguish NFS from FTP by giving an explanation to each.
22
Lesson 5 Outline
File Transfer Protocol
Email Protocols
Email Transfer Protocols
Email Access & Representation
23
Electronic Mail
Email is one of the most common Internet application
Email software is divided into:
Email interface application: mechanism to compose/edit outgoing and read/process incoming messages
Mail transfer program: acts as client to send a message to a mail server on the destination computer
mail server accepts incoming messages and deposits each in the corresponding mailbox
Source: Douglas, C (2016) Computer Networks and Internets
24
Email Algorithm
Source: Douglas, C (2016) Computer Networks and Internets
25
Email Specifications
Specifications for email can be divided into three broad categories
| Protocol Type | Description |
| Transfer | Move a copy of an email message from one computer to another |
| Access | Allows user to access their mailbox and to view/send email messages |
| Representation | Specifies the format of an email when stored on disk |
26
Lesson 5 Outline
File Transfer Protocol
Email Protocols
Email Transfer Protocols
Email Access & Representation
27
Simple Mail Transfer Protocol (SMTP)
SMTP: standard protocol used by mail transfer program uses
Simple text-based protocol
SMTP can send a message to multiple recipients
By allowing clients to list users
Sends a copy of a message to all users on list
28
SMTP Headers and Body
Messages comprise a set of envelope headers
Headers has MAIL FROM and RCPT TO
Message header are followed by a blank line and the actual text
Message is prefixed with DATA followed by the text (content)
Body is terminated by newline with just a full stop followed by another newline
29
SMTP Characteristics
Follows a stream paradigm
Uses textual control messages
Only transfers text messages
Allows a sender to specify recipients’ names and check each name
Sends one copy of a given message
30
Multipurpose Internet Mail Extensions (MIME)
MIME extends the functionality of email to allow the transfer of non-text data in a messages
MIME specifies how a binary file can be encoded into printable characters and decoded by receiver
MIME defines several data types
text/plain, text/html, image/jpeg, application/msword
31
MIME Encoding
MIME permits a sender/receiver to choose a convenient encoding
Sender includes additional lines in the header to specify encoding used
User can attach multiple attachments, each with their own encoding
Base64 encoding is most popular, but MIME does not restrict encoding to a specific form
32
MIME Header
MIME adds two lines to an email header
To declare that MIME has been used to
To specify how MIME information is included
For example, the header lines:
MIME-Version: 1.0
Content-Type: Multipart/Mixed;
Boundary=Mime_separator
Mime_separator (e.g. “/”) will appear in the message body before each part
33
MIME Backward Compatibility
MIME is backward compatible with email that do not understand the MIME standard or encoding
Such systems have no way of extracting non-text attachments
But will treat the body as a single block of text
34
SMTP Session Example
Source: Douglas, C (2016) Computer Networks and Internets
35
Practice 5.3
What is the limitation of SMTP that resulted in the protocol MIME?
What happen if a system is using an older version of email that do not support MIME but receives a message with an attachment that uses MIME?
36
Lesson 5 Outline
File Transfer Protocol
Email Protocols
Email Transfer Protocols
Email Access & Representation
37
Internet Service Providers (ISP)
Most users leave computer running continuously
But do not know how to manage an email server
ISPs began offering email server services
Provides a mailbox for each user
each ISP provides interface to access mailbox
Email access follows one of two forms:
Special-purpose email interface application
Web browser that accesses an email web page
38
ISP Email Access
Source: Douglas, C (2016) Computer Networks and Internets
39
Accessing Email via Mail Application
Mail application can download an entire mailbox to a computer when connected to the Internet
Advantages:
Mailbox can be downloaded prior to disconnected from the Internet (process email on plane)
Once Internet connectivity is back, the application can upload email created and download any new email
40
Accessing Email via Web Browser
Web browser approach is straightforward:
ISP provides a special web page that displays messages from a user's mailbox
Advantages:
Ability to read email from any computer
Do not need to run special mail interface application
41
ISP Mail Access Protocols
Variety of mechanisms available for email access:
Some ISPs provide free email access software to their subscribers
In addition, two standard email access protocols have been created
42
Mail Access Protocols
Access protocol is distinct from transfer protocol
Access only involves a user interacting with a single mailbox
Transfer protocols allow users to send mail to others
Two common access protocols
each provides its own authentication mechanism that user follows to identify themselves
| Acronym | Expansion |
| POP3 | Post Office Protocol version 3 |
| IMAP | Internet Mail Access Protocol |
43
POP3 vs IMAP
44
Access Protocols Characteristics
Provide access to a user mailbox
Permit preview of headers, download, delete, or send messages
Client runs on user personal computer
Server runs on a computer that stores user mailbox
45
Email Preview
View a list of messages without downloading the message contents is useful
Good when link between two parties is slow
Example: user browsing on a cell phone may look at headers and delete spam without waiting to download the message contents
46
POP3 Characteristics
Downloads email onto the device, delete message on mail server
Has 3 basic phases
Authentication: authenticate user with username and password
Transaction: download messages from server
Update: delete messages (if required) after it is downloaded to the client
47
IMAP Characteristic
IMAP allows preview of mail
Useful when bandwidth are expensive and limited
Reduce wastage for spam or unwanted messages
Keeps original message on mail server
Saves a copy on local computer
48
Mail Representation Standards
Other than MIME, another standard is RFC (Request For Comments) 2822 Mail Message Format
From IETF standards document RFC 2822
Message is represented as a text file & consists:
header section, blank line and a body
Header lines each have the form:
Keyword: information
Set of keywords is defined to include From:, To:, Subject:, Cc:
49
Fixed Representation Problem
Traditional application protocols employs a fixed representation
Main problem is the difficulty involved when making changes
Example: SMTP restrict message content to text, major change was needed to add MIME extensions
50
Extensible Representation
Alternative to fixed representation is the extensible system that allows sender to specify format of data
One widely accepted extensible representation is the Extensible Markup Language (XML)
XML resembles HTML in the sense that both languages embed tags into a text document
51
Tags in XML
Tags in XML are not specified a priori and do not correspond to formatting commands
XML describes the structure of data and provides names for each field
52
XML Tags Characteristics
Tags in XML are well-balanced
Each occurrence of a tag <X> must be followed by an occurrence of </X>
XML does not assign any meaning to tags
Tag names can be created as needed
Tag names can be selected to make data easy to parse or access
53
XML Example
Suppose two companies agree to exchange corporate telephone directories
Can define an XML format that has data items
Employee's name, phone number, office
Can further divide a name into last & first name
Source: Douglas, C (2016) Computer Networks and Internets
54
Practice 5.4
Distinguish between POP3 and IMAP email protocols based on the following characteristics:
Location of the original message
Bandwidth consumption
55
Reading
Douglas, C. (2016). Computer Networks and Internets, Global Edition (6th ed.). Pearson Education. ISBN: 978-1292061177 Chapter 4
56
End of Lesson
57