Sie sind auf Seite 1von 184

UNIT 3

DNS(Domain Name System)


NEED FOR DNS

map a name to an address or an address to a name.


Client/Server application program
Maps a host name in the application layer to
an IP address in the network layer.
Purpose of DNS

User

1
Host
name
Host
name
2

5
IP address
6 3 Query
IP address
Response 4
Transport layer
NAME SPACE
•the names assigned must be carefully selected.
•the names must be unique because the addresses are
unique.
• name space can be organized in two ways:
• Flat (a name is assigned to an address.a name is a
sequence of characters without any structure,it has no
meaning.cannot be used for internet because of no
central control-duplication,ambiguity)
• hierarchical.(each name is made of several
parts,central authority controls only part of name not
whole.eg.www.srmuniv.ac.in,www.vi.ac.in)
Domain names and labels
FQDN and PQDN
Domains-subtree of domain name space
Hierarchy of name servers
Zones and domains
DNS in the Internet
Generic Domains
Figure 19.9 Generic domains
Country Domains
Inverse Domain
RESOLUTION

Mapping a name to an address or an address to a name is


called name-address resolution.
Recursive resolution

3
4
8 7

2 5
9
6

10
Iterative resolution

5
6

3
4

1
2

7
8

9
10
DNS MESSAGES

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
Header format
Flags field
TYPES OF RECORDS

two types of records are used in DNS. The question


records are used in the question section of the query and
response messages.
The resource records are used in the answer,
authoritative, and additional information sections of the
response message.
Question record format
Query name format
Resource record format
COMPRESSION

DNS requires that a domain name be replaced by an offset


pointer if it is repeated.
For example, in a resource record the domain name is
usually a repetition of the domain name in the question
record.
For efficiency, DNS defines a 2-byte offset pointer that
points to a previous occurrence of the domain or part of it.
Figure 19.20 Format of an offset pointer
19-8 ENCAPSULATION

DNS can use either UDP or TCP.


In both cases the well-known port used by the server is
port 53.
UDP is used when the size of the response message is less
than 512 bytes because most UDP packages have a 512-
byte packet size limit.
If the size of the response message is more than 512
bytes, a TCP connection is used.
19-9 REGISTRARS

How are new domains added to DNS? This is done


through a registrar, a commercial entity accredited by
ICANN.
A registrar first verifies that the requested domain name is
unique and then enters it into the DNS database. A fee is
charged.
19-10 DDNS

In DNS, when there is a change, such as adding a new


host, removing a host, or changing an IP address, the
change must be made to the DNS master file.
The DNS master file must be updated dynamically.
The Dynamic Domain Name System (DDNS) therefore
was devised to respond to this need.
19-11 SECURITY OF DNS
DNS is one of the most important systems in the Internet
infrastructure; it provides crucial services to the Internet
users.
Applications such as Web access or e-mail are heavily
dependent on the proper operation of DNS.
DNS can be attacked in several ways.
To protect DNS, IETF has devised a technology named DNS
Security (DNSSEC) that provides the message origin
authentication and message integrity using a security service
called digital signature.
TELNET
TELNET

TELNET is an abbreviation for TErminaL NETwork. It is


the standard TCP/IP protocol for virtual terminal service
as proposed by ISO. TELNET enables 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.
Topics Discussed in the Section
 Concepts
 Time-Sharing Environment
 Network Virtual Terminal (NVT)
 Embedding
 Options and Suboption Negotiation
 Controlling the Server
 Out-of-Band Signaling
 Escape Character
 Modes of Operation
 User Interface
 Security Issue
Figure 20.1 Local login
Figure 20.2 Remote login
Figure 20.3 Concept of NVT
Figure 20.4 Format of data and control
characters
Figure 20.5 An example of embedding

c a t f i l e a IAC EC 1
Figure 20.6 Offer to enable an option

WILL
Will I enable the option?

DO or DONT
Do (or don’t) enable the option
Figure 20.7 Request to enable an option

DO
Do enable the option

WILL or WONT
I will (won’t) enable the option
Figure 20.8 Offer to disable an option

WONT
I won’t use the option any more

DONT
Don’t use it
Figure 20.9 Request to disable an option

DONT
Don’t use the option any more

WONT
I won’t
Example 20.1
Figure 20.10 shows an example of option negotiation. In this example,
the client wants the serverto echo each character sent to the server. In
other words, when a character is typed at the user keyboard terminal,
it goes to the server and is sent back to the screen of the user before
being processed. 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.
Figure 20.10 Example 20.1: Echo option

Do enable the echo option


1 ECHO DO IAC

IAC WILL ECHO 2


I will enable the echo option
Figure 20.11 Example of sub-option
negotiation

I will enable the terminal option


1 Terminal type WILL IAC
Do enable terminal option
IAC DO Terminal type 2

Set the terminal type to “VT”


3 SE IAC ‘T’ ‘V’ Terminal type SB IAC
Figure 20.12 Example of interrupting an application
program
Figure 20.13 Out-of-band signaling

Data DM IP IAC Data


Kept Discarded
Urgent pointer
Figure 20.14 Two different interruptions
Example 20.2
In this example, we use the default mode to show the concept and its
deficiencies even though it is almost obsolete today. The client and the
server negotiate the terminal type and terminal speed and then the
server checks the login and password of the user (see Figure 20.15).
Figure 20.15 Example 20.2

GO AHEAD 1
2 WILL TERMINAL TYPE

DO TERMINAL TYPE 3
GO AHEAD 4
5 WILL TERMINAL SPEED

DONT TERMINAL SPEED 6


Login: 7
GO AHEAD 8
9 forouzan

Password: 10
GO AHEAD 11
12 XXXXX

GO AHEAD 13
14 cp file1 file2
Example 20.3
In this example, we show how the client switches to the character
mode. This requires that the client request the server to enable the
SUPPRESS GO AHEAD and ECHO options (see Figure 20.16).
Figure 20.16 Example 20.3

GO AHEAD 1
2 DO SUPPRESS GO AHEAD
WILL SUPPRESS GO AHEAD 3
4 DO ECHO
WILL ECHO 5
Login: 6
7 f
f 8
9 o
o 10
World Wide Web:
HTTP


ARCHITECTURE
The WWW is a distributed client-server service, in which a client using a
browser can access a service using a server. The service provided is
distributed over many locations called sites.

Each site holds one or more documents called webpages.

Each webpages contain some links to other webpages in the same or other
sites.

Webpages can be simple/composite.

Each webpage is a file with a name and address.

(Hypertext –documents referring other documents)


Hypermedia-document contains links to other textual document or
document containing graphics, video, or audio)
Architecture of WWW
Web client(Browser)

Browser interpret and display a web document


Browser has 3 parts controller,client protocol,a nd
interpreters.
Eg.IE,Netscape Navigator and Firefox.
Web server
Webpage is stored at the server.
Client request a page ,the page is sent to client.
Server store the file in cache memory/faster to
access than a disk.
Eg.Apache ,Microsoft Internet Information Server
URL

To access documents throughout the world,


HTTP uses locators.
URL(Uniform Resource Locator)standard
locator for specifying any kind of
information.
WEB DOCUMENTS
The documents in the WWW can be grouped into three broad categories:
static, dynamic, and active. The category is based on the time the contents
of the document are determined.

The topics discussed in this section include:

Static Documents
Dynamic Documents
Active Documents
Static document
Fixed content documents that are created and stored in server.
Client gets a copy of the document only.
Contents of file determined when file is created, not when it is used.
Prepared by any languages like
 HTML(Hyper Text Markup Language),
 XML(Extensible Markup Language)
 XSL(Extensible Style Language)
 XHTML(Extended Hypertext Markup Language)
Dynamic document using CGI

Created by webserver whenever a browser requests the document.


Server runs an application program or a script that creates the dynamic
document.
Server returns the output of the program or script as a response.
Each time it is generated output may vary from request to request.
Eg.date and time program.
CGI(Common Gateway Interface)
 Technology that creates and handles dynamic documents.
 A standard that defines how document is written, How data is input
and how result is used.
 Allows programmers to use any language such as C,C++,Bourne
Shell,Korn Shell,C Shell,TCl or Perl

 Common-std that defines a set of rules that is common to any


language or platform.
 Gateway-can access other resources such as databases,graphic
package,and so.
 Interface-there are a set of predefined terms,variables,calls and so on
that can be used in a CGI program.
Dynamic document using server-site script
Drawback of CGI
 Inefficiency that results if dynamic document is fixed and
not changing from request to request.
 Eg. retrieve a list of spare parts ,their availability, and
prices for a specific car brand.
 {availability and prices vary from time to time, name
,description and image are fixed.}
 If use CGI, each time it should create the entire document
for each request .
 Soution:Create a file contain fixed part using HTML and
embed a script,a source code that can be run by the server
to provide price, availability.
 Eg languages used PHP(Hypertext Preprocesor ),
JSP,ASP,ColdFusion(embed SQL db queries in HTML
document)
Note:

Dynamic documents are sometimes


referred to as server-site dynamic
documents.
Active Documents
A program or script that runs at client side are called active documents.
Java Applets:
 Small program written in java on the server.
 Compiled and ready to be run.
 Document is in bytecode.
 Browser creates an instance of the applet and run it.

 Java Script:
 Script is in source code (text)and not binary.
 If active part is small can be written in scripting language ;then interpreted and run by
client .
Active document using Java applet
Active document using client-site script
Note:

Active documents are sometimes


referred to as client-site dynamic
documents.
HTTP
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.
Note:

HTTP uses the services of TCP on well-


known port 80.
HTTP transaction
Request and response messages
Request and status lines
Methods
Status codes
Status codes (continued)
Header format
General headers
Request headers
Response headers
Entity headers
Note:

HTTP version 1.1 specifies a persistent


connection by default.
What Is a Proxy Server?
Intermediary server between clients and the
actual server
Proxy processes request
Proxy processes response
Intranet proxy may restrict all
outbound/inbound requests the intranet server
What Does a Proxy Server Do?
Between client and server
Receives the client request
Decides if request will go on to the server
May have cache & may respond from cache
Acts as the client with respect to the server
Uses one of it’s own IP addresses to get page
from server
Usual Uses for Proxies
Firewalls
Employee web use control (email etc.)
Web content filtering (kids)
 Black lists (sites not allowed)
 White lists (sites allowed)
 Keyword filtering of page content
User Perspective
Proxy is invisible to the client
IP address of proxy is the one used or the
browser is configured to go there
Speed up retrieval if using caching
Can implement profiles or personalization
Main Proxy Functions
Caching
Firewall
Filtering
Logging
Web Cache Proxy

Our concern is not with browser cache!


Store frequently used pages at proxy rather than
request the server to find or create again
Why?
Reduce latency: faster to get from proxy & so makes
the server seem more responsive
Reduce traffic: reduces traffic to actual server
Proxy Caches
Proxy cache serves hundreds/thousands of users
Corporate and intranets often use
Most popular requests are generated only once
Good news:
Proxy cache hit rates often hit 50%
Bad news:
Stale content (stock quotes)
How Does a Web Cache Work?
Set of rules in either or both
Proxy admin
HTTP header
Don’t Cache Rules
HTTP header
Cache-control: max-age=xxx, must-revalidate
Expires: date…
Last-modified: date…
Pragma: no-cache (doesn’t always work!)
Object is authenticated or secure
Fails proxy filter rules
URL
Meta data
MIME type
Contents
Getting From Cache
Use cache copy if it is fresh
Within date constraint
Used recently and modified date is not recent
File Transfer Protocol:
FTP
Objectives
Upon completion you will be able to:

 Understand the connections needed for FTP file transfer


 Be familiar with FTP commands and responses

19.1 FILE TRANSFER
PROTOCOL (FTP)
File Transfer Protocol (FTP) is the standard mechanism provided by
TCP/IP for copying a file from one host to another.

The topics discussed in this section include:

Connections
Communication
Command Processing
File Transfer
Anonymous FTP
Note:

FTP uses the services of TCP. It needs


two TCP connections.
The well-known port 21 is used for the
control connection and the well-known
port 20 for the data connection.
Figure 19.1 FTP
Figure 19.2 Opening the control
connection
Figure 19.3 Creating the data connection
Figure 19.4 Using the control connection
Figure 19.5 Using the data connection
Figure 19.6 Command processing
Table 19.1 Access commands
Table 19.2 File management commands
Table 19.3 Data formatting commands
Table 19.4 Port defining commands
Table 19.5 File transfer commands
Table 19.5 File transfer commands (continued)
Table 19.6 Miscellaneous commands
Table 19.7 Responses
Table 19.7 Responses (continued)
Table 19.7 Responses (continued)
Table 19.7 Responses (continued)
Table 19.7 Responses (continued)
Table 19.7 Responses (continued)
Table 19.7 Responses (continued)
Figure 19.7 File transfer
Figure 19.8 Example 1
Figure 19.9 Example 3
- DHCP -
DYNAMIC HOST
CONFIGURATION PROTOCOL
Used to allocated IP address dynamically
On demand
For mobility of users
Dhcp provides the following
 IP address
 Subnet mask
 Gateway address
 DNS address
3 protocols used to provide ip address
 RARP server(obselete)
 BOOTP(Bootstrap protocol)
 DHCP (Since 1993 backward compatible to
BOOTP)
DHCP alloactes IP address either through
 Static allocation(creates a table by maps mac
address-ip address)
 Dynamic allocation(from a pool of ip address)
CLIENT AND SERVER ON THE SAME
NETWORK
Use of UDP ports
CLIENT AND SERVER ON TWO DIFFERENT
NETWORKS

3
DHCP packet format
Flag format
Option format
Options for DHCP
Option with tag 53
DHCP client transition diagram
Exchanging messages
Electronic Mail:
SMTP, POP
ARCHITECTURE
To explain the architecture of email, we give four scenarios. We begin with
the simplest situation and add complexity as we proceed. The fourth
scenario is the most common in the exchange of email.

The topics discussed in this section include:

First Scenario
Second Scenario
Third Scenario
Fourth Scenario
First scenario
Note:

When the sender and the receiver of an


email are on the same system, we need
only two user agents.
Second scenario
Note:

When the sender and the receiver of an


email are on different systems, we need
two UAs and a pair of MTAs (client and
server).
Third scenario
Note:

When the sender is connected to the


mail server via a LAN or a WAN, we
need two UAs and two pairs of MTAs
(client and server).
Fourth scenario
Push vs. pull
Note:

When both sender and receiver are


connected to the mail server via a LAN
or a WAN, we need two UAs, two pairs
of MTAs (client and server), and a pair
of MAAs (client and server). This is the
most common situation today.
USER AGENT
The user agent (UA) provides service to the user to make the process of
sending and receiving a message easier.
User agent
Note:

Some examples of command-driven


user agents are mail, pine, and elm
Note:

Some examples of GUI-based user


agents are Eudora, Outlook, and
Netscape.
Format of an email
Email address
MIME
MIME header
Data types and subtypes in MIME
Data types and subtypes in MIME (Continued)
Content-transfer-encoding
Base64
Base64 encoding table
Quoted-printable
MESSAGE TRANSFER AGENT:
SMTP
The actual mail transfer requires message transfer agents (MTAs). The
protocol that defines the MTA client and server in the Internet is called
Simple Mail Transfer Protocol (SMTP).

The topics discussed in this section include:

Commands and Responses


Mail Transfer Phases
SMTP range
Commands and responses
Command format
Commands
Responses
Responses (Continued)
Connection establishment
Message transfer
Connection termination
MESSAGE ACCESS AGENT:
POP AND IMAP
The third stage of mail delivery uses a message access agent; the client
must pull messages from the server. Currently two message access
protocols are available: Post Office Protocol, version 3 (POP3) and
Internet Mail Access Protocol, version 4.

The topics discussed in this section include:

POP3
IMAP4
POP3 and IMAP4
POP3
WEB-BASED MAIL
Some websites such as Hotmail and Yahoo provide email service to anyone
who accesses the site. Mail transfer and retrieval requires the use of
HTTP.

Das könnte Ihnen auch gefallen