OE ae
Les pepe
11.) Define Domain Name Space (DNS). What are the three domains of the domain name space? Expjai,
DATA COMMUNICATION AND COMPUTER NETWORKS [JNTU, HYDERABAD,
PART-B
WITH SOLUTIONS
5.1 DOMAIN NAME SPACE
Answer : Model Papers at
Domain Name Space
The domain name space isa structure where the names are defined in an inverted tree with the root atthe top, comprising
of only 128 levels (level 0 — level 127). It was designed in order to have hierarchical structure
@
o)
The three domains of the domain name space are,
(a) | Label
(©) Domain name
(© Domain,
Root
Challenger a
ay
Figure: Domain Name Space
Label
In the tree, e@th node has a unique label. A Label isa string of maximum 63
reed cacg ics ately wee lum 63 characters. The root label at the root node
Domain Name
Each node in a tree is represented by the domain name which can be defined as the separated by a dot
(). It is always defined by starting from the node up to the root node of the tree, ST sent econgant
null label, which isthe label ofthe root node. Thus, the last character of domain name isa dot).
There are two types of domain names. They are,
@ Fully Qualified Domain Name (FQDN). e.
Gi) Partially Qualified Domain Name (PQDN).
(Fully Qualified Domain Name (FQDN)
‘The FQDN is defined as the label that is terminated by a ull sting. Thus, i 5
name tat comprises the fill name of host. The DNS server reemgnizns ante me tO tis ame
‘Example: Challengercaresia.edu
Look for the SIA GROUP LocorAserver to MTA client. Each command pene n se Toth
ema nitrates oe
don. The list of responses with ther descrinas
Ee eee
o
i if code gives the status of the system or help reply
This code is used to get the help messages.
(i) 220
This code is used when the services are ready.
fi) 221
ee order to close the services of
20
pe is used once the request commands are
(wv) 251
This code describes that if the user is non local, still the
server can forward the mail message.
(wil) 354
‘This code is used in order to initiate the mail input again.
(vill) 421
‘This code describes that the services are unavailable.
(x) 430
‘This code describes that the mailbox is unavailable.
® 481
“This code describes thatthe command is terminated de
to the occurrence of local error.
ee, ee ee
503
This code descri
of sequence.
504
This code describes that the commands are not
implemented during the short period of time.
ww)
es that the received command is out
(vi)
550
“This code describes that the command is rejected for its
‘execution due to unavailability of the mailbox.
(vii)
(xvii) $51
‘This code describes that the user is non local.
(xix) $52
This code describes that the requested action is
terminated due to the over loaded storage.
(ay 553
‘This code describes that the requested action is not
considered due to the improper specification of the mail
address and name.
(xxi) 554
‘This code describes that the mail transaction is failed
due to the occurrence of errors.
18. How POP works? What are the advantages of
IMAP over POP?
Answer =
PoP3
Post Office Protocol, version 3 (POP3) can be specified
‘as one of the simplest message access protocol. It demands
installation of POP3 software not just on client machine but
also on the server machine.
‘The following figure shows the architectural view of
‘communication taking place between a POP3 client and s POP3
‘mail server.a
FIP operates in peo modes, Ste oF panne modes
1 aceive axed. tbe client sends the IP address along with the
por nuaer on which the cont Iter 1 the server machone
‘which thed establishes the TCP connection. In passive
the cheat ean"t accept the incoming TCP connection
‘behind the firewall. Here, the IP address and port sumber are
received fa response to the PASV command sent by the client
to the server max hone
“The data transfer using FTP can occur in one of the
following three modes,
Block Mode
“The incoming data is broken down into several blocks
“which are then forwarded over the TCP connection.
Stream Mode
"in this mode, all the incoming data is transmitted as a
. stream. This leaves the entire processing
over the TCP rather than on the FTP. No end-Sete GUMMMUNIGATION ANU COMPUTER NETWORKS LINTU-HYDERABAD
Wile Type (i) Binary/Image Mod ———
Three types of files can be transferred over the data
‘Sonnection in FTP They are,
@ ASCH file
(W_tmage Binary file and
Gi) BBCDIC tite,
Data Structure
‘Taree types of data structures can be used for transferring
files over the data connection in FTP. They are,
@ File structure format, in which a file is represented as a
‘continuous stream of bytes.
Record structure format, in which a fle is divided into a
‘mumber of records, This format is possible only for the
Text files,
‘Page structure format, in which a file is divided into a
‘number of pages. Each page is associated with a page
‘number and a page header and is stored or accessed in
random or a sequential manner.
‘Transmission Mode z
‘Three types of file transmission modes can be used for
transferring files over the data connection in FTP. They are,
(Stream mode
(4) Block mode and
mode
storing a file differ from retrieving a
file? What kind of file types can FTP transfer?
Answer
Fille Storage
A file is stored by the clients on a server's (that is
remotely situated) current directory by using STOR (put)
‘command. This STOR command causes the server to recognize
and accept data or files being transferred and to store the data.
‘the file transferred does not exists on the server then a new
file is created. On the other hand, ifthe file already exists with
the same name, then its contents are replaced by the new file's
content,
File Retrieval
‘A file is retrieved from the current directory of host
‘that is remote to the client, by using RETR (put) command,
‘This invocation of this command results in establishing a
data connection between host and the client, Thereafter, the
requested file is transferred to the client from the server.
w@
Gd,
‘Types of Files Being Transferred
FTP can transfer different types of files such as,
@ ASCH Fite
‘This mode is usually applied to the textual data. Here,
the data is first converted from the sending host’s
‘character representation to the 8-bit ASCII format prior
to its transmission and later it is converted back to the
receiving host’s character representation, if needed,
However, this method is not suitable for the files
‘containing data other than the plain text.
Here, the data is transmitted byte-by
machine. The receiver receives and stores
data in the manner in which it was received
(ili) ~~ EBCDIC Mode
This mode is used for transferring the plain tex
the hosts employing character sets in EBCDIC fon,
i 5.6 www
poy
Q21, Discuss the architecture of WWW.
Answer : Model Papert ato
Architecture of WWW
World Wide Web (WWW) is a storage place of
information present across the globe which is interlinked wity
a network commonly called internet. It offers features like
flexibility, portability and user convenience. It w
announced by CERN (European Laboratory
Physics) as a system that is capable of managing the resources
required for scientific research and are distributed over muliple
locations. Modern WWW acts as the distributed client-server
service where the requests generated from the clients are sened
by the servers. Clients use web browsers for this purpose. The
Places where the requested services reside are called as sites
‘websites, These websites carry documents called webpages and
links to other documents or web pages. For instance, consider
the below figure,
initially
Figure: Architecture of WWW
In the above figure, the client wants to access ®
documents that exist on website-1, tn this case, client gener
request through browser. The request carries the address of
‘Website and web pages known as Uniform Resource Loa?
(URL). A connection is established between client and se"
and the requested document is returned to the client. 1F
‘document web page consists of references to website thee ™
client forwards a request to the website-? and the docunes®
web pages an that website are also accessed.5.16 DATA COMMUNICATION AND ComPUTER NETWORKS [JNTU-HYDERABAD]
Protocols Used in URL,
The URL is-an open ended scheme that allows the browsers to use multiple protocols to fetch different types of resourves,
‘The seven most common protocols used in URLS are,
1
2
3. File
4,
Ss
z
é
a
6,
7. Telnet,
1 HTTP
TRA TTP is an acronym for Hyper Text Transfer Protocol and has been in use with WWW since 1990, ‘The first version,
HTTP. allowed forthe transfer ofraw data across the Internet. HTTP 1.0 evalved to provide messages in Multipurpose
{nvemet Mail Extension (MIME) types. MIME includes different types of data like image files or audio files not possible
with earlier version ). The latest version is HTTPS where security is taken extra care
‘ie communication between browser(client ) and server is defined by the HTTP. The same protocol is used in intranet
also( intranet is Internet only, but used within organization),
2 FTP
FTP (File Transfer Protocol) is used to access files by FTP. FTP is a standard intemet protocol through which internet
users can upload files from theit computers to a website or download files from a website to theit PC's
3. File
Tezbrotoeol is used to read or write the contents of file (i. ecess afl) present ona local filing system as awe page.
f Performs similar fle access operations as that of the HTTP but does not require a server, as files ave present ata local
filing system,
4. News
News protocol is used to access news articles as a web page, The news protocol provides two schemes,
(Defines a news group that is used to access a pre-configured news site,
Gi)_Defines how a specific news article is accessed using an identifier for that news article
5. Gopher
[hs mailto protocl is used for sending an e-mail via the web browsers, Clicking a mailto-tink i designed to trigger
application that open’ yg the Ung ater aed begin new e-mail message. This is done by clicks onthe “OPEN
button and then specifying the URL. in the following format,
‘mailto: Email address of the recipientSx DATA COMMUNICATION AND COMPUTER NETWORKS [JNTU-HYDERABAD}
(Wi) Active Documents = ‘eS
Astive documents are the documents that contain a PrORTaM or a script in it Which are executed at the client site
Example
a user wants fo run a program which is based on animated graphics, he/she has to carry out the execution of this program
‘atthe client site. To perform this execution, initially a browser Sends a request for an active document. Then, a copied docurnens
‘or script is transferred by the server to the browser to run the program at the client side
‘Active documents can be developed either by using an Java Aj
‘which the script has to be download and executed at the client site,
Client Server
a
Client request for a copy of program
Client Server
[ Hesse | oss
pplets which follows bytecode format or by JavaScripts in
Sending a copy of the program
Client Server
Program W Wl Program
Dee
Running the program and creating the document
7
*.Q26. Explain in brief about the static web document.
Figure (1: Request is Sent from Client to Server
Web document
‘Chet ‘Sener
‘Figure (2): Server Sends the Response to the Client
‘An example of the static web documents is HTML.5.19
———
imu a
HIME (Hypertext a,
language ad is irecty interme AteMEE) 8 the
Preted by » Hy
fodes (tags) that can be embedded ve
wees tables ant lists within thy
Common Tags tn HTML
angi
IRC used to create
rowser. The HT
ML
ext and the text ¢
ML provides Gu
nd develop web pages. The HTML is not a compiled
‘lactuments are also called Web Pages, HTML comes with special
‘an be linked (called hyperlinks) to other Web Pages. We ean include
environment for user's input
HEX HT
a
monty Used NTMI Ta ‘ ane
HTM HTML ee
is placed at the ‘start as well as at the end of ‘every HTML page, The
“sl which resides between these tags forms the head, title and body
of the HTML program,
Wis compulsory that every HTML program should have
ana een | SHTML> atthe start as well as at the end of the document
- 2. | Mholds the head information of the HTML code (i.e.,) title, link, meta are|
a Mei Stine of the tags that appears in the head region of the html document.
3. | The title whieh is displayed at the title bar of the html document is
Provided using
tag. It is an optional tag,
4] ‘*-) Mis the major tg which holds the contents appearing on a web page.
{holds eight attributes, They are: background, bgcolor, bottom margin,
‘eft margin, tag margin, right margin, text, scroll respectively. These
attributes can make the representation of elements depending on the
requirement
$.] Headers tag 5. | These are frequently used tags which display data
(SHIP,.... Ho) in bold font with different sizes. ‘SHI> causes data to be displayed in
biggest font, whereas in the smallest font,
6] <1.....comment,..> S |! provides comments to be displayed in the htm! document, They make
the document elucidating,
7.| Formatting text tags
* BOLD ( ......<1B>) + Temakes the text font to bold.
* MALIC «I> ......P) + Itmakes the text to appear in italic form,
ote U> on U>)] | © Teundertines the text. 2
araep connie th |e heane were yds aslahias
- foer vaste + Teinaes the texto appear in large font than the
BIG>) . “ee .
+ Ttmakes the text to appear in small font than the
+ SMALL ONT s
SA eRe * Iemakes the text to appear in subscript or in
Subscript ( ... ays
sS/SUB>) x
‘Superscript ( ...
takes the text to appear inital or in bold
‘+ taiseriminates between two lines or prevents
"addition of gap between two lines.ine dynamic web dooumeny
GMT Define dy Web document. Discuss Its two generations.
Anewer ! ‘ Model Papers, 011(8)
ynamie Webs Do §
Dynatnic eb document represents
soe slays sonora
te sid 10 be dyn
‘kind of web page whose content is generated based on user's demand. This web
"ine itis viewed, due to which itis not stored an permanent storage devices. The web
Tetause the change with respect to time, wer's preferences and their interactions. The content ean
alled server side scripting) or on client side (called client side scripting).
W content each
be generated either on ser
1, Server-side Seripting
Server-side soripting contains
inorder 10 preform chanyes in the web content present on different web pages. In addition to this the instruction when executed
eee he erate Wb Daue. The response peneraed by server afer the execution ofthe iwtrction ex be kia
cither in the form of HTML form’, heters in URI.", “browser type”. These sort of web page are developed using different
server-side languages
(i) Pert
iy) PHP a
(ii) ISP,
All these languages utilize CGH inorder to generate dynamic web pages.
COA (Common Gateway Interface)
‘The Common Gateway Interface (CG) is a standard and very old interface with which we can write client-server
‘pplications, In client-server applications, a client requests from his brower) a server for some information. At the request of
the client, the server invokes and executes a Program and the output of the execution is sent to the client. The Program may be
‘written in PERL, Many drawbacks of COI are overcome in later products like ISAPI, ASP, ‘Servlets, JSP etc. The client application
funning on a browser can take the information from the user and sent to the server.
Generally, client-side programming involves a) creating GUI interface for user's input that can be sent to the server and
})o some extent form validations. ‘The server sends its response(reply to the request), generally in HTML. or text formats and.
this is viewed by the client through the browser. Server-side programming involves writing of programs that are executed against
lens request, These programs may be writen in CGI, ISAPI, ASR, Servlets or ISP. ACI program can be writen in any language,
but programmers prefer to write in PERL (Practical Extract and Report Language) due wo the language's simplicity and builtin
functions that exactly suits to the needs of a Web programmer, PERL can replaced with either JavaScript or VBScript(these are
alo scripting languages).
Hypertext Transfer Protocol (HTTP) is used by Web browsers and Web servers to communicate with one another(default
‘ort number is 40). Universal Resource Locator(URL) isthe way representing an address of a system. The URL can be in string
www yahoo.com) or inthe number forma(like 122:120.1.8), Clients can use the URL to contact the server. By issuing’
the HTP GET command, the Web browser can inform the server of what dat it wants like text, images et(this is called setting
Internet Mail Extension) type). Sa
lients(clients tit uses HTTP protocol) to interact with programs that resides on Web server. COT is @
Feed ated tt fas ctl re Ws eve om Colston eee
‘erent programming languages. Typically, CGI applications reside inthe directory /ey-bin
3 + browser information from a user (usually by means of an HTML form) and sends it, using HTTP, to a Web
‘now Th nn sight aning to ce crs pro's boda The bat a acon
‘1 fl. format, nd may contin images, audio, Macromedia fash files or even XML. CG isan interface. That is,
iver specifications only withthe help of which we can write a program that willbe executed on the server. It cannot be
: script of executable program must be used o interact with it, ‘ ih“s DATA COMMUNICATION AND COMPUTER NE! wunns
Web Sever CGI
S re
Bt
Client
oe
Figure: Data path of @ Typical CGl-base Application
Application writen in many of today's popular programming languages use standard input (typically the keyboard) and
‘standard output (typically the screen) to interact with users.
‘The output from server-side applications(written in scripts) is directed, or piped, to the Common Gateway Interface and
then sent over the Internet to a Web browser( for rendering),
@ PERL (Practical Extraction and Report Language)
PERL stands for Practical Extraction and Report Language, revised by Larry Wall, primarily for trivial administrative
tasks. After its inception in 1987, it has been developed over the years, into a dynamic programming language operating at the
server-side. Ithas seen a steady growth from the first version of Perl.0 to the current one i.e., Perl 5.0.
Perl is a programming language, which is neither completely compiled, nor completely interpreted language rather its
‘implementation lies between the two. Perl programs are compiled, not only to check for errors but also to make the run time
performance impressive, even though itis interpreted. It also includes a debugger.
Perl finds its use in many ways, like from extracting information from a text-file, conversion of a text-file into another
form, making web pages more user-friendly and dynamic etc.
Uses of Perl
Applications of Perl can be broadly classified into three categories. They are,
@ Report Writing
Since, it was actually made for report-writing tasks, Perl does it very efficiently:
(ii) System Administration
‘The other common uses of Pel are, creation of feedback forms, guest book, ‘message boards, homepages,
Write a PERL script to. display CGI environment variables,
environmental pl
program to display CGI environmental variables
‘use CGI qw/:standard/;
print header:
print “;
counters etc.
print“ ";
on th
before you buyresponse in the form of
Reply: h,)
Hello xyz
Prediction: next year your age will be 33
Output from the PHP script.
eee FtP ie weiaps acripeng lapse end ia easy to use. Ut clisinate the requirement for wring many
mall CGI programs by enabling the user to explicitly place the simple scripts within the HT MY. files. In addition to this, PHP
easily handles the larger website by placing every component of a web page within a single HTML file.
(iii) Java Server Pages
JSP is a java-based technology which is defined as develoy
simplify the handling and sending of dynamic data on web pages.
WML, XML) with the index of dynamic behavior through JSP elements (
extension “JSP”.
ped web application, The main goal of this technology is to
ISP page is almost like regular web page (containing HTM,
ISP tags). The pages written using JSP have the file
2, Client Side Dynamic Web Page Generation
Client-side scripting includes scripting programs that are executed on client side. Client scripting is written, generally,
in JavaScript or VBScript. Client-side scripting is often used for validation(of what user enters in HTML FORM elements), 10
take user input to be sent to the server(interactivity), for adding ActiveX controls(to enhance a Web page functionality), to
add Dynamic HTML and Java applets.
Validation is important for reducing the number of trips(shifting of control) to the server and for reducing the amount
of work the server must perform. Interactivity allows the user to make decisions, click buttons, play games, etc., which is often
more interesting than just reading text, ActiveX controls, Dynamic HTML and Java applets enhance a Web page’s appearance
by providing richer functionality than HTML. Client-side scripts can access the browser and use feature specific to that browser
as well as manipulate browser documents,
Java Script
JavaScript is a scripting, object-based Language Developed by Netscape Communications. The original name is LiveScript
and due to the association of Netscape with Sun Microsystems(developers of Java), it is renamed to JavaScript. JavaScript and
Java, even though both are languages, differ a lot. JavaScript is an object-based language and Java is an object-oriented language
JavaScript is a speedy language. Like most other scripting languages, itis interpreted and not compiled. Browsers include
the JavaScript interpreter, Being interpreted, if errors exist in the program, the program runs and gives output until it does not
come across a mistake. That is, the remaining part of the program from where mistakes occur is not interpreted.
JavaScript code is written inside an HTML document. That is, JavaScript code and HTML code exists in the same file, but
{from HTML code by enclosing the JavaScript code within tags. LANGUAGE attribute
is set to “JavaScript ” inside the opening tag. The script tag is typically used as follows,
tags. JavaScript isa scripting language and tke other Tanguages it defines
Mables, functions, control structure et HTML code can contain any number of