Está en la página 1de 18

LECTURE 12 Contents

Application Layer: DNS, • I. Domain Name System


Remote Logging, e-Mail — I.1 Name Space
— I.2 Domain Name Space
— I.3 Distribution of Name Space
— I.4 DNS in The Internet
— I.5 Resolution
— I.6 DNS Messages
— I.7 Types of Records
Chapter 25 Domain Name System — I.8 Registrars
Chapter 26 Remote Logging, Electronic Mail, and File — I.9 Dynamic Domain Name System (DDNS)
Transfer
(Forouzan, Data Communications and Networking, 4th Edition) — I.10 Encapsulation
• II. Remote Login
1 • III. Electronic Mail 2

I. Domain Name System


Figure 25.1 Example of using the DNS service Service Architecture
• In a small network, mapping is done by a host
file
—Every host stores host file and update it periodically
from a master host file
Server • In a medium-size network, host file can be
stored in a single computer
• SMTP client is directly accessed by user —Providing information to other computers
—Can cause hugh traffic in a large network
• DNS client supports SMTP client
• In Internet, mapping information is divided and
• DNS maps name to an IP address, or
stored on multiple computers
map IP address to a name
3 4
I.1 Name Space
Name Space Organization
• Flat name space
To be unambiguous, the names assigned to machines
—Sequence of characters without structure
must be carefully selected from a name space with
—Must be centrally controlled to avoid duplication
complete control over the binding between the names
—Cannot be used in a large system
and IP addresses.
• Hierarchical name space
• Names must be unique because the addresses are —Each name is made of several parts: Nature of
unique organization, organization name, department, etc.
• Mapping can be organized in two ways: flat or —Authority to assign and control name spaces can be
hierarchical decentralized
• Names are unique without the need for central authority
• Central authority controls only part of the name
Topics discussed in this section:
—Even if part of the address is duplicated, the whole
Flat Name Space address is different
Hierarchical Name Space 5 6

I.2 Domain Name Space Figure 25.2 Domain name space

To have a hierarchical name space, a domain name


space was designed. In this design the names are
defined in an inverted-tree structure with the root at the
top. The tree can have only 128 levels: level 0 (root) to
level 127.

Topics discussed in this section:


Label
Domain Name
Domain

7 8
Figure 25.3 Domain names and labels Figure 25.4 FQDN and PQDN

• Label: String with maximum of 63


characters
— Children of a node must have different
labels
• Guarantee the uniqueness of the
domain names • FQDN: Fully Qualified Domain Name
• Domain name: Sequence of labels — Terminated by a null string (dot)
separated by dots (.) — Contain the full name of a host
— Always read from node up to the root — DNS server can only match FQDN to an IP address
• Root has a null label, so the last
character of domain name is a dot
• PQDN: Partially Qualified Domain Name
— Start from a node, but does not reach root
— Used when name to be resolved belongs to the same site as client
• Application appends suffix to create an FQDN

9 10

Figure 25.5 Domains I.3 Distribution of Name Space


• Domain = subtree of The information contained in the domain name space
domain name space
must be stored. However, it is very inefficient and also
— Name of domain = domain
name of the node at the top unreliable to have just one computer store such a huge
of the subtree amount of information. In this section, we discuss the
— Can be divided into smaller distribution of the domain name space.
domains or subdomains

Topics discussed in this section:


Hierarchy of Name Servers
Zone
Root Server
Primary and Secondary Servers
11 12
Figure 25.6 Hierarchy of name servers Figure 25.7 Zones and domains

• Zone indicates area where server is responsible for or


has authority over
• The whole domain space is divided into many domains — Zone = domain if server do not further divide domain into
• DNS allows further division into smaller domains smaller domains
— Zone < domain if server divides domain into smaller domains
13 • Or delegates parts of its authority to other servers 14

I.4 DNS in The Internet


Server Types
• Root server DNS is a protocol that can be used in different
— There are multiple root servers, each cover the whole domain platforms. In the Internet, the domain name space (tree)
name space
• Distributed all around the world is divided into three different sections: generic domains,
• Primary server country domains, and the inverse domain.
— Create, maintain, and update zone file
• Secondary server
— Transfer complete information from another server
— Neither create nor update the zone file Topics discussed in this section:
— Can be primary server for another zone Generic Domains
Country Domains
A primary server loads all information from the disk file; the Inverse Domain
secondary server loads all information from the primary server.
When the secondary downloads information from the primary, it
is called zone transfer. 15 16
Figure 25.8 DNS IN THE INTERNET Figure 25.9 Generic domains

• Register host
according to their
generic behavior

17 18

Table 25.1 Generic domain labels Figure 25.10 Country domains

• Use two-character country


abbreviation
• Second label can be
organizational or national-
specific
— US uses State abbreviation
(e.g., ca.us)
• De Anza College in
Cupertino, California,
United States

19 20
Figure 25.11 Inverse domain I.5 Resolution
• First level node is always called arpa
• Second level node is always called in-
Mapping a name to an address or an address to a name
addr (inverse address) is called name-address resolution.
• The rest of the domain defines IP
address
• Corresponding to IP address of
Topics discussed in this section:
132.34.45.121 Resolver
— IP address puts higher level label first Mapping Names to Addresses
— Domain name puts higher level label last Mapping Addresses to Names
— Address will look inverted Recursive Resolution
Caching

21 22

Name-address Resolution
Figure 25.12 Recursive resolution

• Resolver = DNS client • Resolver expects server


— Map address to a name, or name to an address to supply the final answer
— Access the closest DNS server with a mapping request
• Mapping name to address
• Request travels forward
— Server checks generic domains or country domains to find the • Response travels
mapping backward until it reaches
• Mapping address to name the requesting client
— Also called pointer (PTR) query
— Resolver sends inverse domain (121.45.34.132.in-addr.arpa) to
DNS server for a query
• If DNS server has no information, it can refer to other
servers (Iterative) or ask other servers itself (Recursive)

23 24
Caching
Figure 25.13 Iterative resolution

• Server returns IP • Information can be cached at the intermediate


address of another server to serve a similar request by another
server that it thinks
client
can resolve the
query —Speed up resolution
• Client repeats the —Can only be used before the information expires
same query to the • Authoritative server provides time-to-live (TTL) information
new server • Cached response is marked unauthoritative

25 26

I.6 DNS Messages Figure 25.14 Query and response messages

DNS has two types of messages: query and response.


Both types have the same format. The query message
consists of a header and question records; the response
message consists of a header, question records, answer
records, authoritative records, and additional records.

Topics discussed in this section:


Header

27 28
DNS Message Sections
Figure 25.15 Header format

• Question section contains the domain name


• Answer section contains one or more resource
records
—Each domain name (each node on the tree) is
associated with a resource record
—Answer from the server to the client (resolver)
Used by client to match Defines message type, type of • Authoritative section gives information about
response with query answer requested, resolution authoritative server for the query
type (recursive or iterative) • Additional information section provides
Number of queries Not used in query message response-specific information
—e.g., IP address of other authoritative servers
Not used in query message Not used in query message
29 30

I.7 Types of Records I.8 Registrars

As we saw in Section 25.6, two types of records are How are new domains added to DNS? This is done
used in DNS. The question records are used in the through a registrar, a commercial entity accredited by
question section of the query and response messages. ICANN. A registrar first verifies that the requested
The resource records are used in the answer, domain name is unique and then enters it into the DNS
authoritative, and additional information sections of the database. A fee is charged.
response message.
• List of registrars is available at www.internic.net
Topics discussed in this section: —New entry can be registered with domain name and
Question Record IP address
Resource Record

31 32
I.9 Dynamic Domain Name System (DDNS) I.10 Encapsulation
The DNS master file must be updated dynamically. The DNS can use either UDP or TCP. In both cases the
Dynamic Domain Name System (DDNS) therefore was well-known port used by the server is port 53. UDP is
devised to respond to this need. In DDNS, when a used when the size of the response message is less than
binding between a name and an address is determined, 512 bytes. If the size of the response message is more
the information is sent, usually by DHCP to a primary than 512 bytes, a TCP connection is used.
DNS server. The primary server updates the zone. The
• If UDP is used and the response is larger than 512 bytes,
secondary servers are notified either actively or server will truncate message and turn on the TC bit
passively. — Resolver need to open a TCP connection and repeat the same
• Active notification: Primary server sends message to secondary request to get the full response
server about the changes
• Passive notification: Secondary server checks for changes
periodically DNS can use the services of UDP or TCP using the
• Authentication is used to prevent unauthorized changes in records well-known port 53.
33 34

II. REMOTE LOGGING TELNET: TErminaL NETwork


A user may want to run application programs at a • Enable the establishment of a connection to a
remote site and create results that can be transferred to remote system
their local site. It would be impossible to write a —Local terminal appears to be a terminal at the remote
specific client/server program for each demand. The system
better solution is a general-purpose client/server • Designed to support timesharing environment
program that lets a user access any application program —One computer can support multiple users
on a remote computer. After logging on, a user can use
• User identification and password identify the
the services available on the remote computer and
user as part of the system
transfer the results back to the local computer.
TELNET is a general-purpose client/server application
Topics discussed in this section: program.
TELNET
35 36
Figure 26.1 Local and remote log-in Figure 26.2 Concept of NVT

• Local log-in
— Terminal driver passes
characters to the OS, which
passes them on to the
applications

• Remote log-in
— TELNET client transforms
characters to a universal
character set and delivers
them to local TCP/IP
• Called Network Virtual
Terminal (NVT) characters
• TELNET uses only one TCP connection (port 23)
—Same connection for data and control characters
37 38

Table 26.1 Some NVT control characters


Figure 26.3 An example of embedding

• Each sequence of control characters is preceded


by IAC (interpret as control)
—Equal to cat filea<backspace>1, or cat file1
—Editing is done at remote server, so <backspace>
must be sent to the remote server via TELNET
• Necessary because some networks can only
transfer 7 bit for each character

39 40
Table 26.3 NVT character set for option negotiation
Table 26.2 Options

• Options between TELNET client and server

• Initiated by the offering party


— Sends WILL command (“Will I enable the options?”)
— The other party sends DO or DONT (“Please do”)
• Initiated by the requesting party
— Send DO command (“Please do enable the option”)
41
— The other party sends WILL or WONT (“I will”) 42

Example 26.1 Figure 26.4 Example 26.1: Echo option

Figure 26.4 shows an example of option negotiation. In this example,


the client wants the server to echo each character sent to the server.
The echo option is enabled by the server because it is the server that
sends the characters back to the user terminal. Therefore, the client
should request from the server the enabling of the option using DO.
The request consists of three characters: IAC, DO, and ECHO. The
server accepts the request and enables the option. It informs the client
by sending the three-character approval: IAC, WILL, and ECHO.

43 44
Example 26.2 Figure 26.5 Example of suboption negotiation

Figure 26.5 shows an example of suboption negotiation. In


this example, the client wants to negotiate the type
of the terminal.

• Suboption provides additional information

Table 26.4 NVT Character set for suboptions

45 46

III. Electronic Mail


TELNET Mode of Operation
• Default: Echo is done by client
One of the most popular Internet services is electronic
—Data is transmitted when one whole line is completed
mail (e-mail). The designers of the Internet probably
• Character mode: Echo is done by server never imagined the popularity of this application
—Data is transmitted one byte at a time program. Its architecture consists of several components
• Line mode: Line editing is done by client that we discuss in this chapter.
—Data is transmitted when one whole line is completed
Topics discussed in this section:
Architecture
User Agent
Message Transfer Agent: SMTP
Message Access Agent: POP and IMAP
Web-Based Mail
47 48
Figure 26.6 First scenario in electronic mail Figure 26.7 Second scenario in electronic mail

• Sender and receiver are directly connected to a shared system


• Sender and receiver belong to a different system
• Message has sender and recipient mailbox addresses (names of files)
• MTA server needs to run all the time waiting for a
When the sender and the receiver of an e-mail are on connection
the same system, we need only two user agents. When the sender and the receiver of an e-mail are on different
49
systems, we need two UAs and a pair of MTAs (client and server). 50

Figure 26.8 Third scenario in electronic mail Figure 26.9 Fourth scenario in electronic mail

• Alice is separated from her system

When the sender is


connected to the mail
server via a LAN or a • Most common
WAN, we need two UAs
and two pairs of MTAs
• Bob is also
(client and server). separated from his
mail server

51 52
Figure 26.10 Push versus pull in electronic email Figure 26.11 Services of user agent

• MTA client/server
is a push program
—MTA server needs
to run all the time
• Bob needs a pull
Handle
program (MAA Word
processor
Viewer
inboxes and
client) outboxes

When both sender and receiver are connected to the mail server Some examples of command-driven user agents are
via a LAN or a WAN, we need two UAs, two pairs of MTAs and a mail, pine, and elm.
pair of MAAs.
This is the most common situation today. Some examples of GUI-based (Graphic User Interface)
user agents are Eudora, Outlook, and Netscape.
53 54

Figure 26.12 Format of an e-mail Figure 26.13 E-mail address

• Addressing system must have unique address


• Domain name comes from DNS database

55 56
Figure 26.14 MIME Figure 26.15 MIME header

• Email can only send message in NVT 7-bit ASCII format


• Define transformation parameters
— Cannot send Thai, binary files, or video data
• MIME = Multipurpose Internet Mail Extension • Header may contain other parameters for some
— Allow non-ASCII data to be sent via email subtypes

57 58

Table 26.5 Data types and subtypes in MIME


Table 26.6 Content-transfer-encoding

59 60
Figure 26.16 SMTP range Figure 26.17 Commands and responses

• Each command is terminated by a two-character


end-of-line token
—Carriage return and line feed

Figure 26.18 Command format


• Message Transfer Agent: SMTP
—Simple Mail Transfer Protocol
• Two pairs of MTA client/server are used
—Most common situation (4th scenario) 61 62

Table 26.7 Commands Table 26.8 Responses

• 3-digit code that


may be followed
Mandatory by explanation
text
• Leftmost digit (2,
Highly 3, 4, 5) defines
recommended category

Seldom used

63 64
Table 26.8 Responses (2) Example 26.3

Let us see how we can directly use SMTP to send an


e-mail and simulate the commands and responses we described in
this section. We use TELNET to log into port 25 (the well-known
port for SMTP). We then use the commands directly to send an e-
mail. In this example, forouzanb@adelphia.net is sending an e-mail
to himself. The first few lines show TELNET trying to connect to the
Adelphia mail server.
After connection, we can type the SMTP commands and then receive
the responses, as shown on the next slide. Note that we have added,
for clarification, some comment lines, designated by the “=” signs.
These lines are not part of the e-mail procedure.
65 66

Example 26.3 (2) Example 26.3 (3)

$ telnet mail.adelphia.net 25
Trying 68.168.78.100 . . .
Connected to mail.adelphia.net (68.168.78.100).

67 68
Figure 26.19 POP3 and IMAP4 Figure 26.20 The exchange of commands and responses in POP3

• Client opens
connection to TCP
port 110
• Web-based email
—Sending and
retrieving via HTTP

• SMTP is a push protocol => Not involve in the third stage


• POP3 = Post Office Protocol 3
— Simple and limited in functionality
• IMAP4 = Internet Mail Access Protocol version 4
— Check header before download & maintain mailboxes on server69 70

TELNET Mode of Operation


• Default: Echo is done by client
—Data is transmitted when one whole line is completed
• Character mode: Echo is done by server
—Data is transmitted one byte at a time
• Line mode: Line editing is done by client
—Data is transmitted when one whole line is completed

71

También podría gustarte