Ans: C All exception in Java are subclasses of built i n cl ass call ed Throwabl e.
Q. 3 In 32bi t IP Addressi ng scheme all 1s represent
(A) t his comput er. (B) di rect ed broadcast. (C) li mited broadcast. (D) l oop back.
Ans: C In 32 bit IP Addressi ng scheme all 1s represent limit ed broadcast.
Q. 4 DMSP st ands for
(A) Dist ributed Mail System Prot ocol (B) Dist ributed Message System Protocol (C) Dist ributed Message System Pool (D) Dist ributed Mail System Pool
Ans: A DMSP st ands for Dist ributed Mail syst em Prot ocol.
2 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 5 Which Layer is not present i n TCP/ IP model?
(A) Appli cation Layer (B) Int ernet Layer (C) Transport Layer (D) Present ati on Layer
Ans: D Presentation l ayer is not present in TCP/ IP Model.
Q. 6 Let most segment of a name i nn DNS represents
(A) Indivi dual Network. (B) Indi vidual computer. (C) Domai n name (D) Network t ype.
Ans: B Left Most segment of a name in DNS represents- Indi vidual comput er
Q. 7 Address 192. 5. 48. 3 belongs to
(A) cl ass A. (B) cl ass B. (C) cl ass C. (D) cl ass D.
Ans: C Address 192. 5. 48. 3 belongs to cl ass C.
Q. 8 Unlike Ipv4, Ipv6 does not include the fol lowing fi eld in t hee base header
(A) Next Header fi eld. (B) Fi eld for Fragment ation i nformati on (B) Flow Label. (D) Ki nd fi eld.
Ans: B Unlike Ipv4, Ipv6 does not include the Field for Fragmentation information in the base header.
Q. 9 The t erm byt e stuffing refers to:
(A) dat a stuffi ng used wi th character oriented hardware. (B) dat a stuffi ng used wi th bit ori ent ed hardware. (C) dat a stuffi ng used wi th both (A) & (B) (D) dat a stuffi ng used wi th byt e orient ed hardware.
Ans: A The t erm byte stuffing refers to dat a stuffing used with charact er-ori ented hardware.
3 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 10 FDDI (Fiber Di stributed Dat a Int erconnect) is an example of
(A) token ri ng. (B) token bus (C) st ar topology (D) multi point net work.
Ans: A FDDI is an example of token ring.
Q. 11 Hardware t hat cal cul at es CRC(Cycli c Redundancy Check) uses:
(A) Shi ft regist er (B) Xor unit (C) Both (A) & (B) (D) Instruction regi ster
Ans: B Hardware t hat cal cul at es CRC uses shi ft register and Xor unit.
Q. 12 In TCP prot ocol header checksum i s of___________
(A) 8 bits (B) 16 bi ts (C) 32 bits (D) 64 bis
Ans: B In TCP prot ocol header checksum is of 16 bi ts.
Q. 13 In IP addressing scheme, cl ass used for multi casting is:
(A) Class A (B) Cl ass B (C) Class C (D) Class D
Ans: D In IP addressing scheme, cl ass used for multi casting is cl ass D.
Q. 14 CIDR st ands for
(A) Classifi ed Internet Domai n Routing (B) Classless Int er Domain Routing (C) Classless Int ernet Domai n Routing (D) Classifi ed Inter Domain Routi ng
Ans: B CIDR st ands for Cl assless Int er Domain Routing.
4 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 15 The tot al number of cl ass of IP address are
(A) 3. (B) 4. (C) 5. (D) 9. Ans: C The tot al number of cl ass of IP addresses are 5.
Q. 16 Parent class of al l Java cl asses is
(A) java. l ang. system (B) j ava. l ang. obj ect (C) java. l ang. cl ass (D) java. l ang. reflect . obj ect
Ans: B Parent class of al l Java cl asses is java. l ang. obj ect.
Q. 17 Exceptions of t ype error inn JAVA are handl ed by
(A) User program (B) Java run time environment (C) Operating system kerne (D) Interrupt
Ans: B Exceptions of t ype error in JAVA are handl ed by JAVA run time environment.
Q. 18 Error det ecting method that can det ect more errors wit hout increasing additional information in each packet is
(A) checksum (B) even parit y mechanism (C) CRC (D) odd parit y mechanism.
Ans: C Error det ecting method that can det ect more errors wit hout increasing additional information in each packet is CRC.
Q. 19 A Net work uses a st ar topol ogy if
(A) Comput ers are arranged in a cl osed loop. (B) All comput ers att ach to a cent ral point. (C) All comput ers att ach to a singl e long cabl e. (D) Comput ers att ach t o multipl e hi erarchical cabl es.
Ans: B A Net work uses a st ar t opology i f all comput ers att ach to a cent ral point .
5 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 20 MTU is speci fi ed by
(A) IP Dat agram size (B) Hardware t echnology (C) TCP Segment si ze (D) None of t he above.
Ans: B MTU is speci fi ed by hardware t echnology.
Q. 21 Net work address prefixed by 1110 i s a
(A) Class A address (B) Multi cast address (C) Class B address (D) Reserve address.
Ans: B Net work address prefixed by 1110 i s a multicast address.
Q. 22 FTP does not use
(A) Two transfer mode. (B) Control connection t o remote computer before fil e can be t ransferred. (C) User Dat agram Protocol . (D) Authorization of a user through logi n and password verifi cation.
Ans: C FTP does not use User Dat agram Protocol.
Q. 23 A Header in CGI document can represent
(A) format of t he document (B) location i f document used t o different URL (C) both (A) & (B) (D) None of the above.
Ans: B A header in CGI document can represent format of the document and the location i f document used t o different URL.
Q. 24 127. 0. 0. 1 i s a
(A) limit ed broadcast address (B) di rect broadcast address (C) multi cast address (D) loop-back address
Ans: D 127. 0. 0. 1 i s a l oop-back address.
6 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 25 In cycli c redundancy checki ng CRC is the
(A) divi sor (B) quoti ent . (C) divi dend (D) remainder.
Ans: D In cycli c redundancy checki ng CRC is the remainder.
Q. 26 Which one of t he following uses the great est number of l ayers in t he OSI model?
Ans: D Gat eway uses the great est number of layers in the OSI model.
Q. 27 Which of the followi ng 802 standard provides for a collision free protocol?
(A) 802. 2 (B) 802. 3 (C) 802. 5 (D) 802. 6
Ans: C 802. 5 st andards provides for a collision free protocol .
Q. 28 The addressi ng especiall y used by Transport Layer is
(A) Stat ion address (B) Net work address (B) Appli cation port address (D) Di alog address
Ans: B The addressi ng speci all y used by transport layer i s applicati on port address.
Q. 29 Which one of thee followi ng i s an error report ing protocol?
(A) ARP (B) ICMP (C) TCP (D) UDP
Ans: B ICMP i s an error reporti ng protocol .
7 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 30 Which t ype of web document is run at the cli ent sit e
(A) Stat ic (B) Dynami c (C) Active (D) All of the above
Ans: C Act ive web document is run at cli ent side.
Q. 31 The main function of a browser i s to
(A) compil e HTML (B) interpret HTML (C) de-compil e HTML (D) int erpret CGI programs
Ans: B The main function of a browser i s to int erpret HTML.
Q. 32 Which of the followi ng is associ at ed with SNMP
(A) SMI (B) BER (C) DNS (D) MIB
Ans: D MIB i s associ at ed wi th SNMP.
Q. 33 ATM is an exampl e of
(A) Ring topology (B) St ar topology (C) Bus topology (D) None of t he above.
Ans: B St ar t opol ogy
Q. 34 The first part of the address in el ectroni c mail box ident ifi es:
(A) Users mailbox (B) Comput er on which mai l box resides (C) Both (A) & (B) (D) None of t he above
Ans: A Users mail nbox.
Q. 35 Protocol used to monitor and control net work devi ces operat es at:
(A) Appli cation l ayer (B) Transport l ayer (C) Network l ayer (D) Dat a Li nk layer
Ans: A Appli cation l ayer.
8 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 36 DHCP st ands for
(A) Dynami c Host Control Protocol (B) Dynami c Host Confi gurati on Prot ocol. (C) Dynami c Host Connection Protocol. (D) None of the above.
Ans: B Dynami c Host Confi guration Protocol.
Q. 37 The t ransport protocol used by TFTP (Tri vial Fil e Transfer Protocol ) is:
(A) FTP (B) UDP (C) TCP (D) IP
Ans: B UDP.
Q. 38 The Envi ronment variabl e SCRIPT_NAME in CGI script speci fies:
(A) Domain name of t he comput er runni ng o server (B) The path of URL aft er server name. (C) Name of the server (D) None of the above.
Ans: B The path of URL aft er server name.
Q. 39 Appli cation l ayer (l ayer 4) i n TCP/ IP model corresponds to:
(A) Layer 4 and 5 in OSI model (B) Layer 5 and 6 i n OSI model (C) Layer 6 and 7 in OSI model (D) Layer 1 and 2 in OSI model
Ans: C Layer 6 and 7 i n OSI model.
Q. 40 UDP (User Di agram Protocol) is
(A) Connecti onl ess (B) Message Ori ent ed (C) Connecti on ori ented (D) Both (A) and (B)
Ans: D Both (A) and (B).
Q. 41 A net work address prefixed by 1000 is:
(A) Class A address (B) Cl ass B address (C) Class C address (D) Class D address
Ans: B Cl ass B address.
9 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 42 In Java Syst em. out i s an obj ect of t ype
(A) InputSt ream (B) PrintSt ream (C) OutputSt ream (D) None of t he above.
Ans: B Pri ntSt ream.
1 Code: AT-15 INTERNET & WEB TECHNOLOGY PART-II, VOL-I
DESCRIPTIVE TYPE QUESTIONS
Q. 1 What are the various parameters insi de Appl et t ag in a HTML fil e? (6)
Ans:
<APPLET [CODEBASE= codebaseURL] CODE=applet fi l e [ALT=alt ernat e t ext] [NAME=appl et instance name] WIDTH=pixel s HEIGHT= pixels [ALIGN = ali gnment] [VSPACE= pixel s][HSPACE = pixels] > [<PARAM NAME = Attribut e name VALUE = Att ribute value>]
</APPLET>
CODE BASE Optional at tri but e used to specify the base URL of the appl et code, whi ch is the Di rectory t hat will be searched for appl ets execut abl e cl ass fi le. If the applet Resides i n the same di rectory as HTML file then t his att ribute is not requi red.
CODE This i s the requi rement att ribute used t o speci fy t he name of the applet cl ass to be l oaded (name of the al ready compil ed. cl ass fil e).
ALT Optional att ribute used to speci fy a short t ext message that shoul d be displ ayed If browser underst ands the APPLET t ag but can not currentl y run Java appl ets.
NAME Optional att ri but e used to speci fy a name for appl et inst ance so that t he other applet s on the page may refer t o this applet.
ALIGN Opti onal att ribute used for ali gnment (LEFT, RIGHT, TOP, BOTTOM, MIDDLE)
2 Code: AT-15 INTERNET & WEB TECHNOLOGY
VSPACE & HSPACE VSPACE specifi es space in pixel s above and HSPACE in pixels on each side of appl et.
WIDTH & HEIGHT Required at tri but es t hat give t he size of displ ay area i n pixels.
PARAM NAME & NULL The PARAM t ag allows you to speci fy applet speci fic arguments in an HTML page.
Q. 2 Write an appl et whi ch accepts t wo int egers from the user and displ ays thei r sum in the fol lowing format. (8)
Input a number in each box:
The sum is : 5
Ans: import j ava . awt. *; import j ava. Appl et. *; publi c cl ass sum ext ends Appl et { Text Field t ext1, t ext2; Publi c void init () { text1 = new Text Fiel d(8); text2 = new Text Fiel d(8); add(t ext1); add(t ext2); text1. setText (0); text2. setText (0); } publi c void paint (Graphics g) {int x = 0, y= 0, z = 0; String s1, s2, s; g. drawst ring(Input a number i n each box, 10, 50); s1 = t ext1. getText(); x = Integer. parseInt (s1); s2 = t ext2. getText(); y = Integer. parseInt (s2); z = x+y; 3 2
3 Code: AT-15 INTERNET & WEB TECHNOLOGY
s = St ring. val ueOf(z); g. drawStri ng(The sum is : , 10, 75); g. drawStri ng(s, 100, 75); } }
Q. 3 What are the main differences bet ween OSI and TCP/ IP reference models? Explain bri efl y. (8)
Ans: We will be focusing onl y on t he key differences bet ween the two references model s. Three concepts are cent ral to OSI model: servi ces, i nt erfaces and prot ocols. OSI model makes t he cl ear disti nct ion between these t hree concepts. The TCP/ IP model did not ori gi nall y clearl y distingui sh between services, interface, and prot ocol . For exampl e the onl y real servi ces offered by the Int ernet l ayer are SEND IP packet and RECEIVE IP packet. The OSI reference model was devi sed before the protocol s were invent ed. This ordering means that model was not biased towards one parti cul ar set of prot ocols, whi ch made it quit e general. With TCP/ IP reverse was true: the prot ocol came first, and the model was reall y just a descript ion of t he existi ng protocols. So probl em was model di d not fit for any ot her prot ocol stack. Anot her di fference is in the area of connecti onl ess versus connection- ori ent ed communication. The OSI model supports both connectionl ess and connecti on ori ent ed communicati on in net work l ayer, but onl y connecti on ori ent ed i n the transport l ayer. The TCP/ IP model has onl y connecti on l ess mode in network l ayer but supports both the mode i n t ransport layer.
Q. 4 Define a socket? How read and writ e i s performed using sockets? (6)
Ans: An appli cati on program i nterface speci fi es t he det ails of how an appli cati on program int eracts wi th prot ocol soft ware. Socket API is a defact o st andard. Once a socket has been est ablished the applicati on can transfer information.
recv() and send() are used t o read and wri te t he dat a. recv(socket, buffer, l ength, fl ags)
4 Code: AT-15 INTERNET & WEB TECHNOLOGY
The socket is t he descri ptor of the socket, buffer speci fi es t he address in memory where incoming message should be pl aced and l engt h specifies the size of the buffer, fl ags al lows t he call er to cont rol det ails.
send(socket, data, l ength, flags)
Here dat a i s the address of dat a t o be sent and other arguments are same.
Sockets also al lows read() and wri te() to t ransfer dat a like send () and recv(). read() and writ e() have three arguments: a socket descriptor, t he locat ion of the buffer i n the memory and the l ength of t he memory buffer.
Q. 5 How optimizati on i s achi eved in DNS? (7)
Ans: There are two primary optimizati ons used in DNS: repli cation and cachi ng. Each root server is repli cat ed; many copies of t he server exist around the world. When a new site j oins t he i nt ernet, the sit e confi gures its local DNS server wi th a list of root server. The sit e server uses whi chever root server is most responsi ve at a given point of time. In DNS caching each server maint ai ns a cache of names. Whenever it looks up a new name, t he server places a copy of the bindi ng i n it s cache. Before cont acting another server to request a binding , the server checks its cache, if t he cache cont ains the answer the server uses t he cached answer to generate a repl y.
Q. 6 How physi cal addressing is performed i n WAN? (7)
Ans: WAN networks operat e simil ar to a LAN. Each WAN t echnology defines the exact frame format a comput er uses when sending and receiving dat a. Each comput er connect ed to a WAN is assi gned a physi cal address. When sendi ng a frame t o anot her comput er, the sender must suppl y t he desti nations address. Many WANs use a hierarchi cal addressing scheme that makes forwarding more effi ci ent. Hi erarchi cal addressing scheme divides an address into mult ipl e parts. The simplest scheme divi des address in t o t wo parts; the fi rst part identifies packet switch, and second part identi fi es comput er att ached to that packet swit ch.
Address [1, 2] Address [2, 1]
Address [1, 5] Address [2, 6]
Switch 1
Swi tch 1
5 Code: AT-15 INTERNET & WEB TECHNOLOGY
Example of Hi erarchical addresses in WAN
The above figure shows each address as a pair of decimal integers. A computer connected to port 6 on packet switch 2 is assigned address [2,6].
Q. 7 How do you make an image clickabl e in HTML? Gi ve an example. (6)
Ans: To make an image or text clickable hyperlinks are used, which use the <A> and </A> tags. This tag has various parameters, including HREF(the URL), NMAE(the hyperlink name), and METHODs(access methods).
As an example consider the following HTML fragment:
<A HREF = http://www.foobar.com> Foobar Home Page</A> when a page with this fragment is displayed, following will appear on the screen:
Foobar Home Page
If the user clicks on this, the browser immediately fetches the page whose URL is http://www.foobar.com and displays it. Now we put a image in place of text. <A HREF = http://www.foobar.com> <IMG SRC = img1.gif ALT = Foobar </A> when displayed this page shows a picture(img1.gif). clicking on the picture switches to foobar home page just as in previous example.
Q. 8 Desi gn a form for a publi shing house called foobar that allows the books to be ordered vi a t he Internet. The form should incl ude t he customers name, address, phone no. and Boos titl e, aut hor and edition. Payment has to be made i n cash on deli very so no credit card information is needed. (8)
Ans:
Book Title : Author : Edition : Customer's Name :
6 Code: AT-15 INTERNET & WEB TECHNOLOGY
Address : Phone Number :
SUBMIT
RESET
<html>
<head> <title>New Page 1</title> </head> <body> <H2 align="center"><b><u>FORM TO PURCHASE BOOK ONLINE</u></b></H2> <FORM METHOD ="POST" ACTION ="/cgi-bin/formmail"> <input type="hidden" NAME = "SUBJECT" VALUE = "FORM"> <INPUT TYPE="HIDDEN" NAME = "REDIRECT" VALUE ="FORM"> <p><STRONG>Book Title :</STRONG> & nbsp; <INPUT NAME ="NAME" TYPE = "TEXT" SIZE="50"> </p> <p><STRONG>Author : </STRONG> & nbsp; <INPUT NAME ="NAME" TYPE = "TEXT" SIZE="50"> </p> <p><b>Edition : &nbs p; &nb sp; </b><INPUT NAME ="NAME1" TYPE = "TEXT" SIZE="11"> </p> <p><b>Customer's Name : </b><INPUT NAME ="NAME2" TYPE = "TEXT" SIZE="50"> </p> <p><b>Address : &nbs p; </b><INPUT NAME ="NAME3" TYPE = "TEXT" SIZE="50"> </p>
7 Code: AT-15 INTERNET & WEB TECHNOLOGY
<p><b>Phone Number : </b><INPUT NAME ="NAME4" TYPE = "TEXT" SIZE="18"> </p>
Q. 9 How non-textual i nformation is cont ained in a web page? (7)
Ans: Non-t extual information such as a graphics image or di giti zed photo is not insert ed directl y i n a HTML document. Instead the dat a resi des in a separate location, and t he document , and the document contai ns a reference to t he dat a. When the browser encounters such a reference, the browser goes to t he speci fi ed l ocati on, obtai ns a copy of t he image, and inserts t he i mage in t he speci fi ed document .
Q. 10 When web pages contai ning emails are sent out they are prefixed by MIME Header. Why? (7)
Ans: Initi all y email consi sted messages cont aining si mpl e t ext written i n English and expressed i n ASCII. Now a days on world wide i nternet messages can be sent in languages wi t h accents like French and German, l anguages wit hout
8 Code: AT-15 INTERNET & WEB TECHNOLOGY
alphabet li ke Chi nese and Japanese etc. the basic idea of MIME is to add struct ure to the message body and define encoding rule for non- ASCII messages. MIME defines five additional message headers to the RFC 822 format.
Header
Meaning MIME Versi on
Cont ent Descri ption
Cont ent -ID
Cont ent t ransfer encoding
Cont ent Type
Identi fi es t he MIME version
Readabl e st ri ng t elli ng about message
Unique Identi fi er
How the body is wrapped for transmi ssion
Nat ure of the message
Q. 11 What i s t rivi al fil e transfer protocol. Explain briefl y? (5)
Ans: Tri vial Fil e Transfer Protocol (TFTP) is useful for boot strapping a hardware device t hat does not have a di sk on whi ch to store system soft ware. All the device needs is a net work connect ion and a small amount of read onl y memory (ROM) int o whi ch TFTP, UDP and IP are hardwired. Although TFTP is les powerful than FTP. TFTP does have two advant ages. Fi rst, TFTP can be used in environment s where UDP i s availabl e, but TCP is not. Second t he code for TFTP requires l ess memory than the code for FTP.
Q. 12 Why Gat eways are used during mail transfer? (5)
Ans: Emai l using SMTP works best when bot h the sender and t he recei ver are on the int ernet and can support TCP connections bet ween sender and recei ver. However many machines that are not on the i nternet st ill want to send and receive email from i nternet sit es. For exampl e many companies i ntentional l y remove t hemselves for securit y reasons. Anot her problem occurs when the sender and recei ver speaks di fferent prot ocols so di rect communi cation is impossibl e. Bot h of these problems are solved usi ng applicati on l ayer email gat eways.
9 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 13 An SNMP int eger whose val ue i s 200 has to be t ransmitted. Show its represent ati on in ASN. 1 syntax. (4)
Ans: An ASN. 1 transfer synt ax defines how values of ASN. 1 t ypes are unambi guousl y convert ed to a sequence of byt es for t ransmission. Every val ue transmitt ed consists of up to four fields
a. identifier t ype b. the length of dat a fi eld in byt es c. the data fiel d d. the end of cont ent fl ag, if dat a l ength i s unknown.
The l ast one is forbi dden by SNMP, so we will assume dat a lengt h is always known.
Tag length val ue
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0
Integer 200
Q. 14 Is TCP checksum necessary or could TCP all ow IP to checksum the dat a. (7)
Ans: Yes, TCP Checksum is necessary. TCP layer i s responsible for error det ecti on, error control, ret ransmission of packets i f requi red, reassembl y of packets as well as their fragment ation. Hence for all error cont rol and detect ion purposes TCP Checksum is essent ial .
TCP cannot all ow IP to checksum data however IP has it s own checksum for its header. IP layer is basi call y responsibl e for routing of IP datagrams immat erial of whether that packet is intended for TCP services or UDP servi ces. Thus immaterial of what information is cont ained i n dat a part , IP layer i s onl y responsible for routing of packets and all the issues rel ated to error cont rol , error det ection , fl ow control with regards to Routing onl y. Hence IP does not have a checksum for data unlike TCP.
10 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 15 Explain Three-Way Handshake Mechanism used by TCP to terminate a Sessi on reli abl y. (7)
Ans: To guarant ee that connecti on are est abl ished or t erminat ed rel iabl y, TCP uses 3-way handshake in whi ch three messages are exchanged. TCP uses t he t erm synchronization segment (SYN segment ) to descri be messages in a 3-way handshake used t o creat e a connecti on , and t he t erm FIN segment(short for finish) to descri be messages in 3-way handshake t o close a connecti on.
Events at Host 1 Events at host 2
Send FIN + ACK
Recei ve FIN + ACK Send FIN + ACK
Recei ve Fin + ACK Send Ack
Recei ve ACK
Threeway handshake used to close a connecti on
Q. 16 Explain the si gnifi cance of i nit () and dest roy() methods of an appl et? Also explai n t wo ways of invoking an applet . (7)
Ans: The ini t() method is used for basi c initi al ization inside the applet . It is execut ed onl y once during t he life time of the appl et . This i s t he fi rst met hod to be i nvoked when appl et is st arted. The dest roy() method is used t o cl ear the space from the memory when appl et is stopped fi nal l y. There are two ways t o invoke an appl et Executing the appl et withi n a j ava compat ible web browser or Using an Applet vi ewer
11 Code: AT-15 INTERNET & WEB TECHNOLOGY
To execut e an appl et in a web browser a short HTML t ext fil e is writt en. Fol lowing is t he HTML fil e to execute SimpleApplet:
<appl et code = SimpleApplet width =200 hei ght =60> </applet >
the wi dth and hei ght speci fi es t he dimensi ons of the displ ay area used.
To execut e SimpleAppl et with an appl et viewer we will execute HTML fil e shown above. For exampl e i f preceding HTML fil e i s called app. HTML then the following command will execut e t he SimpleApplet:
C: \<applet vi ewer app. HTML
Q. 17 Why does IPV6 use separat e extension headers? Explain. (7)
Ans: The extension headers in Ipv6 are used for economy and extensibilit y. Part itioning t he dat agram functionalit y i n to separat e headers is economi cal because it saves space. Al so havi ng separate headers in Ipv6 makes it possi ble to define l arge set of feat ures wit hout requi ring each dat agram header to have at l east one fi eld for each feat ure.
Extensi bilit y comes in to exist ence when new feat ures are requi red to be added to a protocol . A protocol l ike Ipv4 needs compl et e change, the header must be redesi gned t o accommodat e new features. In Ipv6 however, existi ng prot ocol header remains unchanged. A new header fi el d can be defined to accommodat e new change.
Q. 18 How address resolut ion is performed wi th tabl e lookup? Explai n wi th thee hel p of a suit abl e exampl e. (7)
Ans: The t abl e lookup approach to address resolution requi res a data structure that contai ns i nformati on about address bindi ngs. The table consi sts of an array. Each entry i n the array contai ns a pair [P, H] where P is a protocol address and H is the equival ent hardware address. A separat e address bindi ng table is used for each physi cal net work. Consequentl y all IP addresses in a given tabl e have the same prefix. For example the following address binding table corresponds to a net work wit h the cl ass C number 197. 15. 3. 0. therefore, each IP address i n the table will begin wit h 197. 15. 3 prefix. The chi ef advantage of t his t abl e l ookup approach i s that a t able can st ore t he address bi ndi ngs for an arbit rary set of comput ers on a gi ven network.
Q. 19 Write a CGI program that displays a count of how many times a browser on each comput er has cont act ed the server. (7)
Ans: echo Cont ent -t ype: t ext/html echo
N=$QUERY_STRING Echo <HTML>
Case x$N i n
x) N = 1 Echo This i s t he ini tial page. <BR><BR> ;; X[0-9]*) N = expr$n + 1 Echo you have displ ayed t his page $N times. <BR><BR> ;;
*) echo The URL you used is invali d </ HTML>
exit 0 ;; esac echo <A HREF=\htt p://$SERVER_NAME$SCRIPT_NAME?$N\> echo Cli ck here to refresh t he page. </ A></ HTML>
13 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 20 Write short not es on the following: (14)
(i) MIB vari abl es Ans: MIB (Management Information Base ) variabl es:
MIB is a set of named items that an SNMP agent underst ands. To monitor or cont rol a remote comput er, a manager must fet ch or st ore val ues to MIB vari ables. Because SNMP does not specify a set of MIB vari abl es, the desi gn is fl exibl e. The separation of communi cat ion prot ocol from the definit ion of the obj ect s permits t o define MIB vari abl e as needed. there are MIB vari abl es that corresponds to prot ocols like UDP, TCP, IP and ARP, as well as MIB variables for net work hardware such as Ethernet . In addition to simpl e variabl es such as integers that corresponds to count ers, a MIB can incl ude a vari able that corresponds t o a t abl e or an array.
(ii ) Circul ar Dependenci es Ans: Circul ar Dependenci es:
To underst and the problem of ci rcul ar dependenci es consider a fil e server that uses a t i meserver to obt ain t he current t ime whenever a file is accessed. Ci rcul ar dependenci es can occur i f t he timeserver also uses the fil e server. For example suppose a programmer is asked to modi fy t he time server so it keeps a record of each request. If the programmer choose to have the time server become a cli ent of t he fil e server, a cycl e can result; the fil e server becomes a client of the time server whi ch becomes a cl ient of t he fil e server, and so on.
(iii ) UDP Ans: UDP(User Datagram Protocol) :
UDP uses a connectionl ess communi cation paradi gm. That is, an applicati on usi ng UDP does not need to preest ablish a connection before sending dat a, nor does appli cat ion need to termi nat e communi cat ion when fini shed. Furt hermore, UDP all ows an appli cation t o delay an arbit raril y long time bet ween t he transmission of two messages. UDP does not use any control messages. Communi cat ion consist s onl y of the dat a messages themselves.
14 Code: AT-15 INTERNET & WEB TECHNOLOGY
(iv) RPC Ans: RPC (Remot e Procedure Call ) :
The facilit y that was creat ed t o hel p the programmers writ e client -server soft ware is known as Remot e Procedure Call. In RPC i nst ead of gi ving a programmer expli ci t communi cation primiti ves such as the socket interface, hi de communi cation from the programmer by using a conventional programming l anguage facili t y. The programming mechanism chosen i s a procedure call. The RPC mechanism all ows a programmer to pl ace procedures on two or more machines, and aut omat icall y generat es code t hat wi ll allow a procedure call t o pass from one comput er t o anot her.
(v) CGI st andard Ans: The CGI St andard:
Technology used for bui lding dynamic web documents is known as Common Gat eway Interface (CGI). The CGI st andard speci fies how a server int eracts wit h an appli cation program t hat impl ements dynami c documents. The appl ication is call ed a CGI program. CGI provi des general guideli nes and allows a programmer to choose more det ail s. For example, CGI does not speci fy a parti cul ar programmi ng language. Inst ead the standard permits a programmer to choose an appropri at e language for each dynami c document . For exampl e a programmer can use a conventional programmi ng language like C for documents that requires extensive comput ation, and use a scripti ng language li ke perl for documents that require onl y minor text editi ng.
(vi ) Token Ring. Ans: Token Ring:
A token ring i s a col lection of indi vidual point -to-point links t hat happen o form a circl e. In a t oken ring a speci al bit patt ern, cal led the token, circulat es around the ring whenever all st ations are idl e. When a st ation wants t o t ransmit a frame, it i s requi red t o seize t he token and remove it fro the ri ng before t ransmitting. This acti on is done by inverti ng a si ngl e bit in the 3-byt e t oken, whi ch i nst antl y changes i t into t he first 3 byt es of a normal dat a frame. Because there is onl y one token one stati on can transmit at a gi ven i nstant.
15 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 21 Write an appl et that sets the background colour t o cyan and foreground col our t o red and displ ays a message t hat ill ust rat es the order in whi ch various appl et methods are called when an applet starts up. For exampl e : inside i nit ()insi de start() (7)
publi c cl ass Method_order Ext ends Appl et { String msg; //Sets the background and foreground col or. publ ic voi d i nit( ) { set Background(Col or. cyan); set Foreground(Col or. red); msg =" i nside init 0- -"; } // Init ial ize t he st ring to be displayed. publ ic voi d i nit( ) { msg =" i nside st art O- - "; }
lSets the background and foreground col or. publi c void paint (Graphics g ) {
msg =" i nside paint ()-"; g. drawst ring(msg, 10 , 30); } }
Q. 22 How exceptions are handl ed i n j ava? Explain wi th t he hel p of suit abl e exampl e. (7) Ans: Exception Handli ng In Java:
A java exception is an object that describes an exceptional condition that has occurred in a piece of code. When an exceptional condition arises, an object representing that exception is created and thrown in the method that causes the error. That method may choose to handle the exception itself or may pass it on. Either way, at some point exception is caught and processed. Java exception handling is managed by five keywords: try, catch, throw, throws, and finally. The general form of an exceptional handling block is as follows:
/
16 Code: AT-15 INTERNET & WEB TECHNOLOGY
try { //Bl ock of code to monitor errors.
} catch(Exception1 e) { //Bl ock of code to handl e Exception1.
} catch(Exception2 e)
{ //Bl ock of code to handl e Exception2. .
}
finall y {
//Bl ock of code to be execut ed before try block ends.
} Q. 23 What are the maj or component s of a web browser? Draw a neat di agram to explai n them. (7) Ans: The Major Component of a Web browser
17
Code: AT-15 INTERNET & WEB TECHNOLOGY
A browser consists of a set of clients, a set of interpreters, and a controller that manages them. Each browser must contain an HTML interpreter to display the document. Other interpreters are optional. The controller forms the central piece of browser. It interprets both mouse click and key board input, and calls other components to perform operations specified by the user.
Q. 24 How aliases are used in DNS? Explai n. (7)
Ans: CNAME entri es are analogous to a symbolic link in a fil e system- the ent r y provides an ali as for another DNS entry. Foobar Corporation has two comput ers named hobbes. foober. com and calvi n. foobar. com. furt her suppose that Foobar deci de to run a web server and wants to follow t he convention of usi ng the name www for t he computer t hat runs the organizati ons Web server. Alt hough t he organizations could choose t o rename one of t hei r comput ers (e. g. hobbes), a much easi er soluti on exists: the organizat ion can creat e a CNAME ent ry for www. foobar. com that point s to hobbes. Whenever a resolver sends a request for www. foobar. com , t he server returns the address of comput er hobbes.
The use of aliases is especially convenient because it permits an organization to change the computer used for a particular service without changing the names or addresses of the computers. For example Foobar Corporation can move its web service from computer
hobbes to computer calvin by moving the server and changing the CNAME record in the DNS server- the two computers retain their original names and IP addresses.
Q. 25 What are the three basi c t ypes of web documents? Also explain the advantages and disadvantages of each t ype. (8)
Ans: There are three basi c t ypes of web documents:
stati c Dynami c Act ive
STATIC A st atic web document resides i n a fil e that is associ at ed with a web server. The developer of st ati c document determines the cont ent s at. the time the document i s writt en. Because cont ents do not change, each request for a stati c document results in exactl y the same response.
18
Code: AT-15 INTERNET & WEB TECHNOLOGY
DYNAMIC A dynamic web document does not exist in predefined form: Instead a dynamic web document is created by a web server whenever a browser requests the document. When a request arrives, the web server runs an application program-that creates the dynamic document. Because a fresh document is created for each request, the contents of dynamic document can very from one request to another.
ACTIVE An active document is not fully specified by the server. Instead, an active document consists of a computer program-that understands how to compute and display values. When a browser request an active document, the server returns a copy of the program that the browser must run locally. When it runs active documents can interact with the user and change the display continuously. Thus the contents of an active document are never fixed
ADVANTAGES AND DISADVANTAGES OF EACH DOCUMENT:
The chi ef advant ages of a st ati c document are simplicit y, reli abilit y and performance. A browser can displ ay a stati c document qui ckl y and pl ace a copy i n cache on a l ocal disk to speedup the future request for the document.
The chief disadvantage of static document is inflexibility.
The advant age of an active document over a dynami c document lies in its abili t y t o updat e the information continuousl y.
The chief disadvantages of active documents arise from the additional costs of creating and running such documents, and from a lack of security. The active document has a potential security risk because the document can export as well as can import the information.
The chi ef advant age of a dynamic document li es i n it s abi lit y t o report current information. For example a dynamic document can be used t o report current st ock pri ces, current weather conditions et c.
The chi ef disadvant ages of dynamic document approach are increased cost and the inabili t y to displ ay changing i nformation. A dynamic document takes sli ghtl y longer t o retri eve than a stat ic document because server requi res additi onal time to run t he applicati on program t hat creat es the documents.
19 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 26 How physi cal addressing is performed in WAN? (6)
Ans: WAN net works operat e simil ar to a LAN. Each WAN technol ogy defines t he exact frame format a comput er uses when sending and receivi ng dat a. Each comput er connected to a WAN is assi gned a physi cal address. When sending a frame t o anot her comput er, t he sender must suppl y t he dest inations address. Many WANs use a hierarchi cal addressi ng scheme that makes forwarding more effici ent. Hi erarchi cal addressing scheme divides an address int o multipl e parts. The simplest scheme divi des address in to two parts; the first part i denti fi es packet swit ch, and second part ident ifi es computer att ached t o that packet swit ch.
Address [1, 2] Address [2, 1]
Address [1, 5] Address [2, 6]
Exampl e of Hi erarchical addresses in WAN
The figure shows each address as a pair of decimal integers. A computer connected to port 6 on packet switch 2 is assigned address [2,6].
Q. 27 Different iat e between htt p and ft p. (5)
Ans: FTP and HTTP were developed to make Int ernet t ransmi ssi on bett er. FTP is used to exchange fil es bet ween comput er accounts, to transfer fil es bet ween an account and a desktop computer (upl oad), or t o access soft ware archives on t he Int ernet. It ' s also commonl y used to download programs and other fil es to your comput er from ot her servers. It t ransfers fil es i n two different formats ASCII for t ext files and Binary format for bi nary fil es. This allows a user to perform basi c file and directory management operations such as del eting, copying, or renaming. Al so, there is somet hing
Switch 1
Swit ch 1
20 Code: AT-15 INTERNET & WEB TECHNOLOGY
called Anonymous FTP used heavil y t oday by several universiti es and privat e organizations. Anonymous FTP is a faci lit y offered by many machines on t he Int ernet. This permits you t o log in with the user name ' anonymous' or the user name ' ftp' . When prompt ed for a password, t ype your e-mail address -- i t ' s not necessary, but it ' s a court esy for t hose sit es that like to know who is maki ng use of their facilit y. Be court eous. Some sites requi re a valid e-mail address, ot hers don' t. HTTP is used primaril y i n todays soci et y as a set of rules for exchanging fil es (text, graphic i mages, sound, video, and other multi medi a files) on the World Wide Web. It also provides access to other prot ocols like FTP, SMTP, NNTP, WAIS, Gopher, Telnet, and TN3270. Essential concepts t hat are part of HTTP i ncl ude (as it s name implies) t he i dea that fil es can contai n references to other files whose selection wi ll eli cit additional
transfer requests. Any web server machine contains, i n addition to the HTML and other fil es it can serve, an HTTP daemon, a program that is desi gned t o wait for HTTP request s and handle t hem when t hey arri ve. Your Web browser is an HTTP cli ent , sending requests to server machines. When the browser user ent ers fil e requests by either "openi ng" a Web fi le (t yping in a Uniform Resource Locator) or cli cki ng on a hypert ext link, the browser builds an HTTP request and sends i t to the Int ernet Protocol Address indi cat ed by the URL. The HTTP daemon in the desti nation server machine receives the request and, after any necessary processing, t he request ed fi le is ret urned.
Q. 28 Wri te the HTML code to accomplish the web page: (3)
(i) Insert t he frame ext ending 300 pixels across t he page from l eft side. (ii ) Insert scroll abl e lists that will al ways display four ent ri es of t he list. (iii ) Insert an image ont o a page using good. gi f as and image and having wel come as the ALT t ext.
Q. 30 Explain dynamic server creation bri efl y. (7)
Ans: Dynamic Server Creation:
If a server handles one request at a time, all clients must wait while the server fulfills the one request. In contrast, a concurrent server can handle multiple requests simultaneously. When a request arrives, the server assigns the request to a thread of control that can execute concurrently with existing thread. The server program is constructed in two parts: one that accepts request and creates a new thread for the request, and another that consists of the code to handle an individual request. When a concurrent server start executing, only the first part runs. That is the main server thread waits for a request to arrive. When a request arrives, the main thread creates a new service thread to handle the request. The service thread handles one request and then terminates.
23 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 31 What i s socket inheri tance? Explain. (7)
Ans: Socket Inheritance:
In socket inheritance a reference count mechanism is used. When a socket is first created, the system sets the sockets reference count to 1;the socket exists as long as the reference count remains positive. When a program creates an additional thread, the system provides the thread with a list of all the sockets that program owns, and increments the reference count of each by 1. when a thread calls close for a socket, the system decrements the reference count on the socket by 1 and removes the socket from the threads list.
The main thread of a concurrent server creates the socket that the server uses to accept incoming connections. When a connection request arrives, the system creates a new socket for the new connection. After a service thread finishes, it calls close on the new socket.
Q. 32 How does a comput er know whether an arriving frame contains an ARP message? Explai n. (7)
Ans: The type field in the frame header specifies that the frame contain an ARP message. A sender must assign an appropriate value for the type field before transmitting the frame and a receiver must examine the type field in each incoming frame. For example, the Ethernet standard specifies that the type field in an Ethernet frame carrying an ARP message must contain the hexadecimal value Ox806.
Dest. Address source address frame type data in frame
Il lustrati on of t ype field in a Ethernet header used t o specify t he frame contents. A value of 0x806 informs the recei ver that the frame cont ains an ARP message.
806 complete ARP message
24 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 33 What i s the chief advantage of using vi rt ual packet s i nst ead of frames? (7)
Ans: The router cannot transfer a copy of a frame from one type of network to another because the frame formats differ. More importantly, the router cannot simply reformat the frame header because the two networks may use incompatible address format.
To overcome het erogeneit y, Int ernet protocol soft ware defines an i nter packet format that is independent of the underl yi ng hardware. Thi s is called virt ual packet and can be t ransferred across the underl yi ng hardware. The underl yi ng hardware does not underst and or recognize the Internet packet format, t he prot ocol soft ware creat es and handl es Int ernet packets.
Q. 34 A dat agram cannot be l arger t han the MTU of a network over whi ch it is sent . Is the st atement true or fal se? Explain with the hel p of a suit able exampl e. (7)
Ans: Each hardware technology specifies the maximum amount of dat a that a frame can carry. Thi s limit is known as maximum t ransmissi on uni t(MTU). There is no exception to MTU limi t, the net work hardware i s not desi gned to accept or t ransfer frame to carry more dat a than the MTU allows. Thus a dat agram must be small er or equal t o net work MTU or it cannot be encapsulat ed for transmission.
An Exampl e of a router that connects t wo networks with di fferent MTU val ues
In the figure host H2 attaches to a network that has an MTU of 1000. Therefore each datagram that H2 transmits must be 1000 octets or less. However, because host HI attaches to a network that has an MTU of 1500 octets, HI can transmit datagrams that contains up to 1500 octets. To solve this problem IP router uses a technique called fragmentation. When a datagram is larger than the MTU of a network over which it is sent, the router divides the
25 Code: AT-15 INTERNET & WEB TECHNOLOGY
datagram into smaller pieces called fragments and sends each fragment independently. To fragment a datagram for transmission across the network, a router uses the network MTU and datagram header size to calculate maximum amount of data that can be sent in each fragment and number of fragment that will be needed.
Q. 35 Draw a neat labeled diagram of the OSI reference model for comput er net works showi ng all the l ayers and the communi cation subnet boundary. (7) Ans: Layer name of unit engaged
7 applicati on protocol APDU
6 present ation protocol PPDU
5 session protocol SPDU
4 transport prot ocol TPDU
communi cation subnet boundary
3 packet
2 frame
1 bit
Net work layer host rout er protocol Dat a link l ayer host rout er protocol physi cal l ayer host rout er protocol The OSI reference Model Appl i cat i on Appli cation pr esent at i on present at i on
Sessi on Sessi on
Transport Transport
Net work
Dat a link Net work Dat a link
Physi cal Physi cal
Net work
Dat a link
Net work
Dat a link
Physi cal
Physi cal
Rout e Rout e
26 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 36 Explain various fiel ds in IPV6 base header? (8)
Ans: Although IPv6 base header i s twi ce as large as an IPv4 header, it cont ains less information. Fol lowing diagram illustrates the format:
The format of an Ipv6 base header
Most of the space in header is devoted to two fields that identify the sender and recipient. Each address occupies sixteen octets, four times than an IPv4 address.
In addition to source and destination address, the bas header contains six fields. The VERS field identifies the protocol as version 6. the PRIORITY field specifies the routing priority class. The PAYLOAD LENGTH field corresponds to IPv4's datagram length field. The HOP LIMIT corresponds to the IPv4 TIME-TO-LIVE field. IPv6 interprets the HOP LIMIT strictly.. field FLOW LABEL is intended for use with new applications that requires performance guarantees.
Q. 37 Different iat e between adaptive and non-adaptive rout ing. (6)
Ans: Adapti ve routi ng descri bes t he capabilit y of a syst em, through which routes are characterised by their dest ination, to alter the pat h that the rout e takes through the syst em i n response to a change in conditi ons. The adaptat ion is
27 Code: AT-15 INTERNET & WEB TECHNOLOGY
intended t o allow as many rout es as possibl e to remain valid (that is, have dest inations t hat can be reached) in response to the change. People using a transport system can display adaptive routing. For example, if a local railway station is closed, people can alight from a train at a different station and use another method, such as a bus, to reach their destination. Systems that do not implement adaptive routing are described as using non-adapting or static routing, where routes through a network are described by fixed paths (statically). A change, such a loss of a node, or loss of a connection between nodes, is not compensated for. This means that anything that wishes to take an affected path will either have to wait for the failure to be repaired before restarting its journey, or will have to fail to reach its destination and give up the journey.
Q. 38 How congestion is controll ed in TCP? (7)
Ans: One of t he most import ant aspects of TCP is a mechanism for congestion control. In most modern int ernets, packet loss or extreme l ong del ays are more li kel y t o be caused by congestion than a hardware fai lure. Int erestingl y, t ransport protocols t hat ret ransmit can exacerbate the probl em of congesti on by i nj ecting addi tional copi es of a message.
To avoid such a probl em, TCP always uses packet l oss as a measure of congestion and responds t o congestion by reducing t he rat e at which it ret ransmits data.
TCP does not comput e an exact transmission rate. Instead, TCP bases transmi ssion on buffers. That is, t he receiver adverti ses a wi ndow size and the sender can transmit data to fill the recei vers window before an ACK i s received. To cont rol the dat a rate, TCP imposes a restri cti on on the window size by t emporaril y reducing the window size , the sendi ng TCP effectivel y reduces t he data rat e.
TCP congesti on control takes over when a message is l ost. Inst ead of ret ransmit ting enough dat a to fill the receivers buffer (the receivers window size), TCP begins by sendi ng a single message containi ng data. If the acknowl edgement arri ves without additional loss, TCP doubl es the amount of dat a being sent and sends two additi onal messages. If acknowl edgement arrive for those two , TCP sends four more and so on.
28 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 39 While using FTP what i s wildcard expansion i n fil e names? (7)
Ans: To make it easy for users to specify a set of fil e names, FTP allows a remot e comput er system to perform traditional fil e name expansion. The user ent ers an abbrevi ation, whi ch FTP expands to produce a valid fil e name. In abbrevi ati ons, a wildcard charact er stands for zero or more charact ers. Many comput er syst ems use the ast eri sk _* as a wildcard. On such syst ems, the abbrevi ation li *
Mat ches all fil e names t hat begin wit h the prefix li. Thus, i f a remot e comput er cont ains the six fil es:
Dark li ght lonel y crab link tuft
FTP will expand the abbreviat ion li* t o two names: li ght and li nk. Fil e name expansion can be especiall y useful with commands mget or mput because expansion makes it possibl e t o specify a l arge set of fil es wi thout ent ering each fil e name expli citl y.
Q. 40 Write short not es on the following: (14)
(i) Multihomed host .
Ans: A host computer that connects to multiple networks is called multihomed host. Multihoming is sometimes used to increase reliability. If one network fails, the host can still reach the Internet through the second connection. Alternatively multihoming is used to increase performance. Connections to multiple networks can make it possible to send traffic directly and avoid routers, which are sometimes congested. Like a router, a multihomed host has multiple protocol addresses, one for each network connection.
29 Code: AT-15 INTERNET & WEB TECHNOLOGY
(ii ) Star topology.
Ans: A net work uses a star topol ogy if all comput ers attach to a central point . The following fi gure illustrat es t he concept:
Comput ers connect ed
To net work hub
Because a star shaped network resembl es the spoke of a wheel, cent er of a st ar network i s oft en call ed a hub. In practi ce, star network seldom have a symmet ric shape i n whi ch t he hub is l ocat ed at equal dist ance from all comput ers. Inst ead a hub oft en resides in a location separate from the comput ers att ached to i t.
(iii ) Remot e Procedure Call (RPC).
Ans: The facility that was created to help the programmers write client server software is known as Remote Procedure Call. In RPC instead of giving a programmer explicit communication primitives such as the socket interface, hide communication from the programmer by using a conventional programming language facility. The programming mechanism chosen is a procedure call. The RPC mechanism allows a programmer to place procedures on two or more machines, and automatically generates code that will allow a procedure call to pass from one computer to another.
(iv) E-mail gateways.
Ans: Email using SMTP works best when both the sender and the receiver are on the Internet and can support TCP connections between sender and receiver. However, many machines that are not on the internet still want to send and receive emails from internet sites.
30 Code: AT-15 INTERNET & WEB TECHNOLOGY
Anot her problem occurs when the sender speaks onl y RFC 822 and the recei ver speaks onl y X. 400 or some vendor speci fic protocol. Bot h of these problems are solved using email gateways. Email gat eways are used at appli cation l ayer.
(v) CIDR.
Ans: CIDR is a new addressi ng scheme for t he i nt ernet whi ch al lows for more effi ci ent allocation of IP addresses than ol d class A, B, and C addressi ng scheme. Instead of bei ng limi ted to net work ident ifi er (or prefixes) of 8, 16, or 24 bit s, CIDR currentl y uses prefixes any where from 13 t o 27 bits. Thus, block of addresses can be assi gned t o a net work as small as 32 hosts or t o those with 500, 000 hosts. This allows for address assi gnments t hat much more closel y fit an organizati ons speci fic need.
A CIDR address includes the standard 32- bit address and also information on how many bits are used for the network prefix. For example in CIDR address 206.13.01.48/25, the /25 indicates that the first 25 bits are used to identify unique network leaving the remaining bits to identify the specific host.
(vi ) HDLC.
Ans: HDLC - High Level Data Li nk Control : Protocol Overall Description: Layer 2 of the OSI model is the data link layer. One of the most common layer 2 protocols is the HDLC protocol. The basic framing structure of the HDLC protocol is shown below: HDLC uses zero insertion/deletion process (commonly known as bit stuffing) to ensure that the bit pattern of the delimiter flag does not occur in the fields between flags. The HDLC frame is synchronous and therefore relies on the physical layer to provide method of clocking and synchronizing the transmission and reception of frames.The HDLC protocol is defined by ISO for use on both point-to-point and multipoint (multidrop) data links. It supports full duplex transparent-mode operation and is now extensively used in both multipoint and computer networks. HDLC has three operational modes: 1. Normal Response Mode (NRM) 2. Asynchronous Response Mode (ARM) 3. Asynchronous Bal anced Mode (ABM)
31 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 41 How does TCP achi eve reli abili t y? (4)
Ans: One of the most import ant t echnologi es i s ret ransmissi on. When TCP st ands dat a the sender compensates for packet loss by i mplement ing a ret ransmissi on scheme. Both si des of a communicati on participat e. When TCP receives dat a, it sends it acknowledgements back to the sender. Whenever it sends dat a, TCP starts a ti mer . if the timer expires before an acknowl edgement arrives, t he sender retransmit s the data. The fol lowing fi gure ill ust rates ret ransmissi on.
Send message1
Receive message1 Send Ack1
Receive ack1 Send message2
Receive message2 Send Ack2
Receive ack2 Send message3
Packet l ost
Retransmission ti mer expires, retransmi t message3
receive message3 send ack3
32 Code: AT-15 INTERNET & WEB TECHNOLOGY
TCPs ret ransmi ssion scheme is the key t o its success because it handles communi cation across an arbit rary Internet and allows multi pl e appli cation programs to communicate concurrentl y.
Q. 42 How adaptive transmission helps TCP to maximize t hroughput on each connecti on? (5)
Ans: To underst and how adaptive retransmissi on helps TCP maximize throughput on each connection, consider a case of packet loss on two connecti ons that have different round-trip del ay. For example, Fi gure given below illustrat es traffi c on t wo such connections.
Est1
Est1
Est2
Est2
Ti me out Ti me out packet lost
Packet l ost
Time out and ret ransmission on t wo connections that have di fferent round t ri p del ays.
33 Code: AT-15 INTERNET & WEB TECHNOLOGY
As the fi gure shows , TCP sets t he retransmissi on timeout to be sli ghtl y longer than the mean round-t rip del ay. If t he delay is l arge, TCP uses a large ret ransmi ssion timeout; if t he del ay is small , TCP uses a small time out. The goal is t o wai t long enough to det ermine that a packet was l ost, without waiting longer than necessary.
Q. 43 Explain that the l ost acknowl edgement does not necessaril y enforce ret ransmissi on of the packet . (5)
Ans: To guarant ee reliabl e t ransfer, prot ocols use positive acknowl edgement wi th ret ransmissi on. When recei ver gets t he packet an acknowl edgement is sent. If an acknowl edgement is l ost, generall y packet i s ret ransmitt ed. Ret ransmission can not succeed if a hardware failure has permanentl y disconnect ed the net work or if receiving comput er has crashed. Therefore, prot ocols retransmit ting the messages bound the maximum number of transmi ssions. When the bound has been reached, the prot ocol stops ret ransmissi on of packet even if acknowl edges i s not received. So lost acknowl edgement does not necessaril y enforce ret ransmission of packet .
Q. 44 Does it make sense for two domai n servers to contain exactl y t he same set of names? Why or why not? (5)
Ans: Yes. It i s very advantageous for t wo domain servers cont aining same set of names. If there is onl y one server than traffi c on one server woul d be i n tolerabl e, because it woul d be the onl y server to receive all the request and handl e them appropriat el y. If there is more t han one server contai ning same set of dat a then geographi call y closet server wil l respond t hus reducing the load on one server. Also if one server i s down due t o some probl em t hen another server cont aini ng same set of dat a can be used to ful fill t he incoming requests.
Q. 45 Reassembli ng of IP fragments at the ulti mat e destination is advantageous. Give reasons. (5)
Ans: Requiri ng the ult imat e destinati on to reassembl e the fragment s has two main advant ages. First, it reduces the amount of state i nformation in rout ers. When forwarding a dat agram, a rout er does not need to know whether a datagram is a fragment. Second, it all ows routes t o change dynami call y. If an i ntermedi ate rout er reassembl es fragments, all fragments woul d need to reach the rout er.
34 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 46 What is the maximum number of fragments that can result from a single IP Dat agram? Explain. (4)
Ans: To fragment a dat agram for t ransmi ssion across a net work, a rout er uses the net work MTU (Maxi mum Transmi ssion Unit ) and the dat agram header size to calculate the maximum amount of dat a t hat can be sent in each fragment and number of fragment that wil l be needed. The rout er t han creat es the fragments. A datagram can not be l arger than the MTU of a net work over whi ch it i s sent . If a fragment event ual l y reaches another net work that has a small er MTU t hen fragment i s furt her divided i n to smaller fragments. IP does not disti nguish between ori ginal fragment s and sub fragments. So the maximum number of fragments from a si ngl e dat agram will depend on size of dat agram and MTU of t he networks over which it is sent al ong i ts pat h.
Q. 47 Does a numeri c mai lbox identi fi er have any advant age over a mnemoni c identifier? Explain. (7)
Ans: Some software systems allow the syst em admi nist rator to choose mailbox names, whil e ot her systems requi re a users mail box identifier by concat enating a users fi rst name, middl e initi al and l ast name, wit h underscore to separate t he three it ems. For example, t he emai l address for empl oyee john Qui ggl ey Public at Foobar Corporati on mi ght be: John_Q_Publi c@foober. com On syst ems that require a users l ogin identifi er to be used as a mailbox identifier, the resulti ng e-mail address is not nearl y as readabl e. For exampl e, i f login accounts on a computer at nonexistent Corporat ion consi st of t wo six-di git numbers separat ed by a peri od, an i ndividual s e-mail address on that computer mi ght be:
912743. 253843@nonexist. com Obvi ousl y mnemoni c from makes the mai l box portion of an e-mail address easi er to remember and ent er correctl y.
Q. 48 What are the various address Translat ion schemes? Explain which scheme i s used inn Int ernet? (7)
Ans: Transl ati on from a comput ers prot ocol address to an equivalent hardware address is known as address resoluti on. Address resol ution algorithms can be grouped int o three basi c cat egori es:
35 Code: AT-15 INTERNET & WEB TECHNOLOGY
Table lookup- Bindings or mappi ng are st ored in a t able in memory, whi ch the soft ware searches when it needs to resolve an address.
Closed Form Computation- The prot ocol address assi gned to a comput er is chosen carefull y so the comput ers hardware address can be comput ed from the protocol address using basi c bool ean and arit hmetic operations.
Message Exchange- Comput er exchange messages across a network to resol ve an address. One comput er sends a message t hat requests an address bindi ng (i. e. , transl ation), and another computer sends a repl y t hat cont ains the requested information.
TCP/ IP can use any of the three met hods; the method chosen for a parti cul ar net work depends on the addressing scheme used by underl ying hardware.
Generall y thi rd scheme i s used over int ernet. The TCP/ IP suite cont ains a standard address resoluti on prot ocol (ARP). ARP defines the format of the messages that computers exchange t o resolve an address as well as rul es for handling ARP messages.
Q. 49 What are t he three basi c t ypes of web document s? Discuss t he advant ages & disadvant ages of each t ype. (5)
Ans: Static- A st ati c web document resides i n a fil e that i s associ at ed wit h a Web server. The author of a st ati c document determi nes t he cont ents at t he time the document i s wri tten. Because the cont ents do not change, each request for a stati c document results in exactl y the same response.
Dynamic- A dynami c web document does not exist in a predefined form. Inst ead a dynami c document i s creat ed by a web server whenever a browser request s the document . When a request arrives t he web server runs an applicati on program that creates the dynami c document . The server returns the out put of t he program as a response t o t he browser that request ed the document.
36 Code: AT-15 INTERNET & WEB TECHNOLOGY
Because a fresh document is creat ed for each request the cont ents of dynami c document can very from one request to another.
Active- An acti ve document is not ful l y specifi ed by t he server. Instead an acti ve document consi sts of a comput er program that underst ands how t o comput e and displ ay val ues. When a browser request s an active document , the server ret urns a copy of the program that t he browser must run locall y. When it runs the active document program can interact wi th the user and change the displ ay continuousl y. Thus the contents of an active document are never fixed- they can conti nue t o change as long as the user allows the program to run. ADVANTAGES AND DISADVANTAGES OF EACH DOCUMENT:
The chi ef advant ages of a st ati c document are simplicit y, reli abilit y and performance. A browser can displ ay a stati c document qui ckl y and pl ace a copy i n cache on a l ocal disk to speedup the future request for the document. The chi ef disadvant age of st ati c document is i nfl exibilit y.
The advant age of an active document over a dynamic document lies in its abili t y t o updat e the information continuousl y.
The chief disadvantages of active documents arise from the additional costs of creating and running such documents, and from a lack of security. The active document has a potential security risk because the document can export as well as can import the information.
The chi ef advant age of a dynamic document li es i n it s abi lit y t o report current information. For example a dynamic document can be used t o report current st ock pri ces, current weather conditions et c. The chi ef disadvant ages of dynamic document approach are increased cost and the inabili t y to displ ay changing i nformation. A dynamic document takes sli ghtl y longer t o retri eve than a stat ic document because server requi res additi onal time to run t he applicati on program t hat creat es the documents.
Q. 50 What i s the advant age of caching in a web browser? (5)
Ans: Li ke other appli cati ons browsers use a cache t o improve document access. The browser pl aces a copy of each it em it retri eves i n a cache on t he l ocal disk. When a user selects an it em the browser checks t he di sk cache before ret ri evi ng a fresh copy. If the cache contains the it em t he browser obt ai ns the copy from the cache without using t he net work.
37 Code: AT-15 INTERNET & WEB TECHNOLOGY
Keepi ng i tems in a cache can improve performance dramati call y- a browser can read the it em from disk wi thout wai ting for net work connecti ons. For exampl e, consi der a user who connects to t he Internet over a dial up tel ephone line. Alt hough a hi gh-speed modem can transfer data at 28. 8 Kbps, t he effecti ve rat e can be substantial l y l ower it the connection is noisy. At such speeds, ret ri evi ng a l arge it em from a l ocal disk cache, in fact , local access can seem inst antaneous when compared to i nternet access.
Q. 51 Describe the advant ages of JAVA servl ets over CGI i nt erface. (4)
Ans: The Advantage of Servlets Over "Tradi tional" CGI:
Java servl et s are more effi ci ent , easier t o use, more powerful, more port able, and cheaper than t raditional CGI and than many alt ernative CGI- like technol ogi es. (More i mport antl y, servl et developers get pai d more than Perl programmers : -). Effi cient. With t raditional CGI, a new process is st art ed for each HTTP request . If t he CGI program does a relativel y fast operati on, the overhead of start ing the process can dominat e the executi on time. With servl ets, the Java Vi rtual Machine stays up, and each request is handl ed by a li ghtwei ght Java thread, not a heavywei ght operating syst em process. . Conveni ent . Hey, you al ready know Java. Why l earn Perl too? Besides t he conveni ence of bei ng abl e to use a famili ar l anguage, servl ets have an extensive infrastructure for aut omaticall y parsi ng and decoding HTML form dat a, reading and setting HTTP headers, handling cooki es, tracki ng sessions, and many ot her such utili ties. Powerful . Java servlets let you easil y do several things that are diffi cult or impossi ble with regul ar CGI. For one t hing, servlets can talk directl y to t he Web server (regul ar CGI programs can' t). This simpli fi es operati ons that need to look up images and ot her dat a stored in st andard places. Servl ets can also share dat a among each other, maki ng useful things like database connection pools easy t o implement. They can also mai ntain i nformation from request to request, simpli fyi ng things li ke session tracking and caching of previous comput ati ons. Port abl e. Servl ets are writt en in Java and follow a well -st andardized API. Consequent l y, servl et s writ ten for, say I-Pl anet Enterprise Server can run virt uall y unchanged on Apache, Mi crosoft IIS, or WebSt ar. Servlet s are support ed directl y or vi a a plugi n on al most every major Web server.
38 Code: AT-15 INTERNET & WEB TECHNOLOGY
Inexpensive. There are a number of free or very inexpensi ve Web servers avail abl e that are good for "personal " use or l ow-volume Web sites. However, wit h the major exception of Apache, which is free, most commerci al -qualit y Web servers are rel ati vel y expensive. Neverthel ess, once you have a Web server, no matter t he cost of that server, addi ng servl et support to i t (if i t doesn' t come preconfi gured to support servlet s) i s generall y free or cheap. Q. 52 Write short not es: (14) (i) Client Server Model.
Ans: In the cli ent- server model , communi cat ion generall y t akes t he form of a request message from the cli ent t o the server aski ng for some work t o be done. The servers than does the work and sends back the repl y. A server appli cati on waits passi vel y for cont act, whil e a cli ent applicati on i niti at es communi cation acti vel y.
A client and server must select a transport protocol that supports connectionless service or one that supports connection-oriented service. Connectionless service allows an application to send a message to an arbitrary destination at any time; the destination does not need to agree that it will accept the message before transmission occurs. In contrast, connection oriented service requires two application to establish a transport connection before data can be sent.
(ii ) POP. Ans: POP (Post Office Protocol) The Post Offi ce Prot ocol provides remote access t o an elect ronic mail box. The protocol allows a users mail box to reside on a comput er that runs a mail server, and all ows the user to access it ems in the mailbox from another comput er. This protocol requi res an additional server to run on the comput er with the mail box. The additional server uses the POP protocol . A user runs email software that becomes a cli ent of POP server to access the contents of the mail box.
(iii ) Anonymous FTP.
Ans: Use of a login name and password helps keep file secure from unauthorized access. But sometimes such authorization can also be inconveni ent. In part icul ar, requi ring each user to have a vali d name and password makes it di ffi cult t o allow arbit rary access. For
39 Code: AT-15 INTERNET & WEB TECHNOLOGY
exampl e, suppose a corporation finds a bug in one of the programs it sells. The corporation mi ght creat e fil e of changes, and make the file avail abl e t o any one. To permit arbi trary users t o access a fil e without a specifi c l ogin and password anonymous FTP i s used, In whi ch access t o an FTP server i s allowed using login name anonymous and password guest.
(iv) SNMP.
Ans: SNMP (simple network management prot ocol )
When SNMP is used the management station sends a request to an agent asking it for i nformation or commanding it t o update i ts st at e. SNMP defines seven messages t hat can be sent. The foll owing six messages form an i ni tiator.
Get -request - request s the val ue of one or more vari abl es
Get -next-request request s t he value of next variabl e
Get -bulk-request used for large transfer like t abl es
Set-request updat es one or more variables
Inform-request all ows the manager to update an agent s vari abl es
SnmpV2-t rap Agent to manager t rap report.
(v) UDP.
Ans: UDP (User Datagram Protocol):
UDP uses a connectionl ess communi cat ion paradi gm. That is, an applicati on using UDP does not need t o preest abl ish a connecti on before sendi ng dat a, nor does appli cation need to t erminat e communi cation when finished. Furt hermore, UDP all ows an applicati on t o del ay an arbi traril y long time bet ween the transmi ssions of t wo messages. UDP does not use any control messages. Communication consists onl y of the data messages themsel ves.
40 Code: AT-15 INTERNET & WEB TECHNOLOGY
(vi ) Direct broadcast & li mited broadcast.
Ans: Broadcast i s a way t o send a packet to al l the stat ions on a part icular net work at once. Broadcast syst ems allow the possi bilit y of addressi ng a packet to all destinations by using a speci al code in t he address fi eld. When a packet with t his code is t ransmitt ed, it is received and processed by every machi ne on the net work. This i s called di rect broadcasting. The direct ed broadcast address for a net work is formed by addi ng a suffix t hat consi sts of all 1 bi ts to the net work prefix.
The limit ed broadcast refers to a broadcast on a local physi cal net work. Limit ed broadcast is used duri ng syst em st art up by a comput er t hat dosed not yet know the net work number. The IP limited Broadcast address is found by setti ng all 32 bit s of t he IP address t o a val ue of 1.
Q. 53 Write a CGI program that keeps a list of comput ers that have contact ed the server. If comp1 is cont acti ng fi rst time i t will displ ay t he message: This i s the fi rst cont act from comp1 else it will di spl ay t he message Comput er comp1 has requested t his URL previ ousl y. (7)
Ans: #!/bin/sh FILE = ipaddress
echo Cont ent -t ype: t ext/plain echo # see if IP address comput er appears in file i paddress
if grep s $REMOTE_ADDR $FILE>/ dev/null 2 >&1 then
echo Computer $REMOTE_ADDR has requested this URL previously. else # append browsers address to the file echo $REMOTE_ADDR >> $FILE echo This is the first contact from computer $REMOTE_ADDR.
fi
41
Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 54 Desi gn a HTML form for a company Bookonl ine that al lows you t o order t he books vi a int ernet. Form includes the foll owing informati on: (i) Book titl e, aut hor, edition. (ii ) Customers name, address, phone number. (7)
Ans:
Book Title : Author : Edition : Customer's Name : Address : Phone Number :
SUBMIT
RESET
<html>
<head> <title>New Page 1</title> </head> <body> <H2 align="center"><b><u>FORM TO PURCHASE BOOK ONLINE</u></b></H2> <FORM METHOD ="POST" ACTION ="/cgi-bin/formmail"> <input type="hidden" NAME = "SUBJECT" VALUE = "FORM"> <INPUT TYPE="HIDDEN" NAME = "REDIRECT" VALUE ="FORM"> <p><STRONG>Book Title :</STRONG> <INPUT NAME ="NAME" TYPE = "TEXT" SIZE="50"> </p> <p><STRONG>Author : </STRONG> &nbs p;
42 Code: AT-15 INTERNET & WEB TECHNOLOGY
<INPUT NAME ="NAME" TYPE = "TEXT" SIZE="50"> </p>
<p><b>Edition : &nb sp; & nbsp; </b><INPUT NAME ="NAME1" TYPE = "TEXT" SIZE="11"> </p> <p><b>Customer's Name : </b><INPUT NAME ="NAME2" TYPE = "TEXT" SIZE="50"> </p> <p><b>Address : &nb sp; </b><INPUT NAME ="NAME3" TYPE = "TEXT" SIZE="50"> </p> <p><b>Phone Number : </b><INPUT NAME ="NAME4" TYPE = "TEXT" SIZE="18"> </p> </form> <form method="POST" action="_derived/nortbots.htm" webbot- action="--WEBBOT-SELF--" onSubmit="location.href='_derived/nortbots.htm';return false;" WEBBOT-onSubmit> <p> & nbsp;   ; &nb sp; & nbsp; <input type="submit" value="SUBMIT" name="B1"> <input type="reset" value="RESET" name="B2"></p> </form> <p> </p>
</body>
</html>
Q. 55 How does the Applet updat e it s window when information changes? (6)
Ans: Whenever an appl et needs t o updat e the information displayed in its window, it si mpl y calls repaint () method. The repaint () met hod i s defi ned by AWT( abstract window tool kit). It causes the AWT run-t i me syst em to execut e a call t o applet s updat e() met hod, whi ch in it s default
43 Code: AT-15 INTERNET & WEB TECHNOLOGY
implementation calls paint (). Thus for another part of t he applet to output t o its wi ndow, si mpl y stores t he output and then calls repaint (). The AWT will then execut e a cal l t o paint ( ).
Q. 56 Write an applet t hat displ ay the di rect ory holdi ng the HTML fil e that start ed the appl et and the di rect ory from whi ch, appl et class fil e was loaded. (8)
publi c cl ass Base extends Appl et { publi c void pi ant (Graphics g) {
String msg; URL url = getCodebase(); Msg = Code base: +url. t ost ring(); g. drawst ring(msg, 10, 20); URL url = get Document base(); Msg = Document base: +url . tost ri ng(); g. drawst ring(msg, 10, 40); }
}
Q. 57 How many Oct ets does the smallest possi ble IPV6 datagram contai n? Explain the si gni fi cance IPV6 over IPV4. (4)
Ans: The maximum size of an Ipv6 datagram is 65575 byt es, i ncl uding the 0 byt es Ipv6 header. Ipv6 also define a mi nimum reassembl y buffer size: the minimum datagram size t hat we are guaranteed any impl ement ati on must support . The minimum size for Ipv6 datagram i s 1500 byt es.
Despit e ret ai ning t he basi c concept s from IPv4, IPv6 changes all the det ail s. IPv6 uses larger addresses and an enti rel y new dat agram format. IPv6 uses a
44 Code: AT-15 INTERNET & WEB TECHNOLOGY
series of fixed-lengt h headers t o handle header information. Thus, unlike IPv4, whi ch pl aces key information i n fixed fields of t he header and onl y appends vari abl e-lengt h options for l ess import ant i nformat ion, t he IPv6 header is al ways vari abl e size.
Q. 58 Suppose you have t o develop an error recovery prot ocol for a li nk t hat is unreli abl e and del ay sensit ive, whi ch of the fol lowing prot ocol would you choose? (6) (i) St op & wait . (ii ) Sel ective Repeat. (iii ) Go back. Justify your answer.
Ans: Sel ecti ve- repeat and Go -back work well i f errors are rare. But i f error rat e is hi gh t han a lot of bandwi dth wi ll be wast ed in retransmissi on of frames. So both the above methods are not suit abl e for a li nk t hat is unreli abl e and del ay sensitive.
For this ki nd of li nk stop and wait prot ocol is most suit abl e protocol . In this prot ocol sender wai ts aft er t ransmit ti ng each packet. When the receiver is ready for anot her packet, t he receiver sends a cont rol message, usuall y in form of acknowl edgement. Alt hough thi s protocol prevents overrun, they can cause extremel y ineffici ent use of net work capacit y.
Q. 59 Explain the t erm mi ddleware i nn cont ext of RPC. (4)
Ans: A vari et y of commerci al tool s have been devel oped to hel p the programmer in constructi ng cli ent- server soft ware. Such tools are generall y call ed middl eware because they provide software that fits bet ween a conventional applicati on program and t he net work soft ware. Now desi gners are creat ing new mi ddl eware syst ems that extend met hod i nvocation across computers in the same way that remot e procedure cal l extended procedure call . Such syst ems are known as dist ri but ed obj ect systems.
45 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 60 Different iat e between (6)
(i) message swi tching, packet swit chi ng and circuit swit chi ng
Ans: Message switching:
Recourse computer sends dat a to swit ching offi ce whi ch stores the dat a i n buffer and l ooks for a free li nk. If link is availabl e than sends it to anot her swi tchi ng offi ce. This process conti nues unti l dat a are deli vered to destinati on comput er. Circuit swit ching versus Packet swit chi ng:
In ci rcuit swit ching an end-to-end path is to be est abli shed before any dat a can be sent . Once a connect ion i s i n its pl ace, dat a can be sent across the connection. Finall y when communi cat ion i s compl et e, the connecti on must be t erminat ed. Circuit swit chi ng provides connecti on-ori ent ed interface. In principle, circuit switching and packet switching both are used in high-capacity networks. In circuit-switched networks, network resources are static, set in copper if you will, from the sender to receiver before the start of the transfer, thus creating a circuit. The resources remain dedicated to the circuit during the entire transfer and the entire message follows the same path. In packet-switched networks, the message is broken into packets, each of which can take a different route to the destination where the packets are recompiled into the original message.
(ii ) Bridges & Gateways.
Ans: Gateways and Bridges: A machine which connects a LAN to the Internet is called a gateway. The gateway machine is responsible for routing packets which are destined for a domain outside the local domain. These machines are called routers. A bridge is a machine which transparently connects two segments of the LAN together. These two segments have the same domain name and behave as if part of the same LAN. In our case, we connect the Cape Town LAN and the Sutherland LAN by a PC running the public domain software called PCBRIDGE. Similarly, a PC at Sutherland, also running PCBRIDGE, connects the Sutherland LAN to the Cape Town LAN. These are soon to be replaced by CISCO bridges.
46 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 61 What i s the use of urgent point er in TCP segment? (4)
Ans: To accommodat e out of band si gnali ng, TCP allows the sender to specify dat a as urgent , meaning t hat the receiving program should be noti fi ed of it s arrival as quickl y as possibl e, regardl ess of its position in the st ream. For this purpose Urgent point er fi el d is used. The mechanism used to mark urgent dat a when transmitti ng it in a segment consi sts of URG code bit and the URGENT POINTER fiel d. When t he URG bit is set, t he urgent poi nter speci fi es t he position in the segment where urgent data ends.
Q. 62 Why does FTP use t wo st andard ports whereas other protocols, in general use onl y one port? Justify. (4)
Ans: FTP uses a control connection onl y to send commands and receive responses. When it t ransfers a fil e, FTP does not send t he dat a across the control connection. Inst ead, t he cli ent and server establish a separat e data connecti on for each fil e transfer, use it t o send one fil e, and then cl ose the connecti on. If the user request s another transfer, the cli ent and server est abli sh a new dat a connecti on. To avoi d confl ict between control and data connecti ons, FTP uses a different port number for each.
Q. 63 Does the use of wire-cent er have any i nfluence on the performance of a token ring? Expl ain. (4)
Ans: One problem wit h a ring network is that if the cabl e breaks somewhere, the ring di es. This probl em can be sol ved by the use of wi re center. Insi de the wi re cent er are bypass rel ays that are energized by current from the st ations. If the ri ng breaks or a st ati on goes down, loss of drive current will rel ease the rel ay and bypass the stati on. The relays can also be operat ed by soft ware to permi t diagnosti c program to remove stati ons one at a time to fi nd fault y station and ri ng segment s. The ring can then cont inue operation with the bad segment bypassed.
47 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 64 Explain the meani ng of fol lowing socket primit ive: (8) BIND, LISTEN, ACCEPT and CONNECT.
Ans: The bi nd Pri mi tive when creat ed, a socket has neit her a l ocal address nor a remote address. A server uses the bind procedure to suppl y a prot ocol port number at whi ch the server will wait for cont act . Bi nd t akes three arguments:
bi nd(socket, localaddr, addrlen)
Argument socket i s t he descri ptor of a socket t hat has been created but not previousl y bound; t he cal l is a request that t he socket be assi gned a parti cul ar protocol port number. Argument local addr is a struct ure t hat speci fi es the local address to be assi gned to socket and argument addrel en is an i nteger that specifies the length of t he address.
The li sten Pri mi tive
Aft er speci fyi ng a protocol port a server must i nst ruct t he operati ng syst em to pl ace a socket in passive mode so it can be used to wait for contact from cli ents. To do so a server cal ls the listen procedure which takes to argument s: listen( socket, queuesize)
argument socket is the descri ptor of a socket that has been created and bound to a local address and argument queuesize speci fi es a length for t he socket ' s request queue.
The Accept Pri miti ve A server t hat uses connection-ori ent ed transport must cal l procedure accept to accept t he next connection request. If a request as present in the queue, accept returns immediat el y; if no request have arrived the system bl ocks the server unt il a cli ent forms a connecti on. The accept call has the form: newsock= accept(socket , caddress, addresslen)
Argument socket is the descript or of a socket the server has creat ed and bound to a speci fi c prot ocol port. Argument caddress is the address of a struct ure of t ype sockaddr and caddresslen is a point er to an i nteger. Accept fills in fi elds of argument caddress with the address of the cl ient t hat formed the connecti on and sets caddressl en t o the length of he address.
48 Code: AT-15 INTERNET & WEB TECHNOLOGY
The connect Pri mi ti ve Client s use procedure connect to establish connection with a speci fi c server. The form is
connect (socket , saddress, saddressl en)
Argument socket is the descript or of a socket on the client ' s comput er t o use for the connect ion. Argument saddress is a sockaddr struct ure that speci fi es the server' s address and protocol port number. Argument saddresslen speci fi es me length of t he server' s address measured in oct ets.
Q. 65 What are two reasons for usi ng l ayered protocol? (2)
Ans: Layered protocol means protocols used i n each layer are the l ayers own business i. e. they dont affect protocol of another l ayer.
So each layer can use any prot ocol as long as it gets t he gob done
They can be repl aced easil y as t he t echnol ogy changes.
Being abl e t o make such changes is t he idea for usi ng layered prot ocols.
Q. 66 Give t he format of Ethernet frame and explai n the semanti cs of each fiel d. (6) Ans: An Ethernet frame begins with a header that contains three fields. The 64-bit preamble, that precedes the frame contains alternating 1s and 0s that allows the receivers hardware to synchronize with the incoming signal.
49 Code: AT-15 INTERNET & WEB TECHNOLOGY
The Fi rst t wo fi el ds of t he header cont ain the physi cal addresses. The thi rd field of the header consist s of a 16- bi t Ethernet frame t ype.
Q. 67 Why is packet swit ching import ant? Give at least two reasons. (4)
Ans: Packet swit ching i s i mportant because of the following to reasons: 1. A sender and the receiver need t o coordi nat e transmission t o ensure that dat a arrives correctl y. Divi ding the dat a into small blocks hel ps a sender and receiver det ermi nes which block arri ve int act and which do not.
2. Second, because communi cation ci rcuit s and the associ at ed modem hardware are expansive, multi pl e comput ers oft en share underl yi ng connecti ons and hardware. To ensure t hat all computers recei ve fair, prompt access t o a shared communi cat ion facilit y, a network syst em allows one comput er to deny access to ot hers. Using small packets helps ensure fairness.
Q. 68 Different iat e between Transport and Session l ayers of OSI model . (4)
Ans: OSI Model Transport Layer The transport layer uses the services provided by the network layer, such as best path selection and logical addressing, to provide end-to-end communication between source and destination.
The transport -layer dat a st ream i s a l ogi cal connection between t he endpoi nts of a network. End-to-end control is provided by slidi ng wi ndows and rel iabil it y in sequencing numbers and acknowl edgment s. The t ransport layer regul ates informati on flow to ensure end-to-end connecti vit y between host appli cations rel iabl y and accuratel y. The TCP/ IP protocol of Layer 4 (t ransport layer) has two prot ocols. They are TCP and UDP. The t ransport layer accepts dat a from the session layer and segment s the dat a for t ransport across t he network. Generall y, t he t ransport layer is responsibl e for maki ng sure t hat the data is delivered error-free and in the proper sequence. Fl ow cont rol general l y occurs at the t ransport l ayer. OSI Model Sessi on Layer The session layer establishes, manages, and terminates communication sessions. Communication sessions consist of service requests and service responses that occur
50 Code: AT-15 INTERNET & WEB TECHNOLOGY
between applications located in different network devices. These requests and responses are coordinated by protocols implemented at the session layer. The session layer establishes, manages, and terminates sessions between applications Funct ions of t he session l ayer and the different processes that occur as dat a packets travel through t his l ayer. More specificall y, you learned that Communi cation sessions consist of mini-conversations that occur bet ween appli cati ons locat ed in di fferent net work devi ces Requests and responses are coordinat ed by protocols impl ement ed at the session layer The session layer decides whether to use two-way si multaneous communi cation or t wo-way alt ernat e communi cation by usi ng di al ogue control The sessi on l ayer uses di alogue separat ion to initi at e, terminat e, and manage communi cati on in an orderl y fashion
Q. 69 Describe the various charact eri sti cs of UDP prot ocol. (6)
Ans: The charact eri stics of the UDP are as foll ows:
End t o end: UDP i s a t ransport protocol that can disti nguish among multipl e appli cation programs runni ng on a given computer.
Connectionless: The UDP foll ows a connectionl ess paradi gm.
Message Ori ent ed: An appli cat ion that uses UDP sends and recei ves indivi dual messages.
Best Effort: UDP offers appl icati on the same best effort delivery semanti cs as IP.
Arbitrary int eraction: UDP all ows an appli cation to send to many ot her appli cations, receive from many ot her appli cati ons, or communi cate with exact l y one another applicati on.
Operati ng syst em i ndependent: UDP provi des a mean of identifyi ng appl ication programs that does not depend on Identi fi ers used by the l ocal operating system.
51 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 70 Why is fragment ation needed on Int ernet not on a t ypi cal WAN? (4)
Ans: TCP/IP protocol uses the name IP datagram to refer to an Internet packet. The amount of data carried in a datagram is not fixed. The sender chooses an amount of data that is appropriate for a particular purpose. If size of a datagram is larger than network MTU than fragmentation is performed.
When a datagram is larger than the MTU of a network over which it is sent, the router divides the datagram into smaller pieces called fragments.
Fragmentation is needed on Internet as it in connection of different networks using different LAN technologies (such as Ethernet, Token ring, etc.). Each technology has a different frame size, which is Smaller to fit an entire IP datagram.
While a typical Wan is consists of electronic devices called packet switches interconnected by communication lines. The packet switches consist of special purpose hardware. A packet switch is implemented with special purpose computer that is dedicated to the task of providing communication.
Q. 71 How does TCP take of wrapping over of sequence numbers? (4)
Ans: To handle out of order deliveries, transport protocols use sequencing. The sending side attaches a sequence number to each packet. The receiving side stores both the sequence number of the last packet received in order as well as a list of additional packets that arrived out of order. When a packet arrives, the receiver examines the sequence number to determine how the packet should be handled.
TCP take care of wrapping over of sequence numbers by leaving a set of consecutive sequence numbers between initial sequence numbers of two TCP connection beginning within some specified time. This duration is known as forbidden region.
Q. 72 Write not es o Frame Filt ering Techni ques. (5)
Ans: Frame fil tering:
The most valuable function performed by bridges is frame filtering. A bridge does not forward a frame unless necessary. In particular, if a computer attached to one segment sends a frame to a computer on the same segment, the bridge does not need to forward a copy of the frame to the other segment.
52 Code: AT-15 INTERNET & WEB TECHNOLOGY
To determine whether to forward a frame, a bridge uses the physical address found in the frame headers. When a frame arrives on a segment, the bridge extracts and checks the destination address. If the bridge knows that the destination computer is attached to a segment over which the frame arrived, the destination will also have received a copy of the frame, so the bridge can discard a frame without forwarding a copy. Most bridges are called adaptive or learning bridges because they learn the location of a computer automatically. The bridge uses the source address to automatically determine the location of the computer that sent a frame, and uses the destination address to determine whether to forward a frame.
Q. 73 What funct ions connect() and accept () call in Socket int erfaci ng? (5)
Ans: connect() system cal l: cli ents use procedure connect to est ablish connect ion with a speci fi c server. The form is connect ( socket, saddress, saaddressl en) Argument socket is the descriptor of a socket on t he cli ent s comput er to use for the connecti on. Argument sockaddress is a sockaddr structure that speci fi es the servers address and protocol port number. Argument saaddressl en speci fies the l ength of the servers address measured in oct ets. The cli ent does not have to bi nd a local address before calli ng connect(). connect () int ernall y can call bind() to connect to a l ocal address if not done earli er.
accept() system call : Aft er a connection ori ent ed server execut es the list en() system call, an actual connecti on from some cli ent process is wait ed for by havi ng the server execute the accept () syst em call . The form is:
accept(sockfd, sockaddr * peer, i nt* addrlen)
This system call returns up to three values: an integer return code that is either an error indication or a new socket descriptor, the address of the client process (peer), and the size of this address(addrlen). Accept automati call y creates a new socket descri ptor, assuming t he server is a concurrent server. When a connecti on request is recei ved, the process forks, with the chi ld process servi cing the connection and t he parent process waiting for t he another connection request .
53 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 74 Can SMTP be used as transfer prot ocol for Web pages? Why? (4)
Ans: SMTP is a simpl e mail transfer prot ocol. It uses ASCII t ext for all communi cation. SMTP requires reli able del ivery- the sender must keep a copy of the message until the receiver has st ored a copy in nonvolat ile memory.
SMTP can not be used as transfer protocol for web pages as it is not necessarily use hypertext and its header needs information of sender and receiver mail ID which is not required for web pages.
Q. 75 Describe the El ect ronic Dat a Exchange (EDI) archit ecture in bri ef. (5)
Ans: Elect ronic Data Interchange (EDI) may be most easil y understood as t he repl acement of paper-based purchase orders wi th elect ronic equi val ents. It is act ual l y much broader i n its appli cat ion t han the procurement process, and its impacts are far great er than mere aut omat ion. A more careful definiti on of EDI i s ' t he exchange of documents in standardized elect ronic form, bet ween organizations, i n an automat ed manner, di rectl y from a comput er appli cation in one organization to an applicati on i n another' . Archi tecture for EDI EDI can be compared and contrast ed with el ectroni c mail (email). Email enabl es free-format, textual messages to be el ectroni call y t ransmitt ed from one person to anot her. EDI, on the ot her hand, supports struct ured business messages (those which are expressed i n hard-copy, pre-pri nted forms or business documents), and transmits them el ect roni call y bet ween comput er applicati ons, rat her t han between peopl e. The essential elements of EDI are: the use of an electronic transmission medium (originally a value-added network, but increasingly the open, public Internet) rather than the dispatch of physical storage media such as magnetic tapes and disks; the use of structured, formatted messages based on agreed standards (such that messages can be translated, interpreted and checked for compliance with an explicit set of rules);
rel ati vel y fast delivery of elect ronic documents from sender to receiver (generall y impl yi ng receipt wi thin hours, or even mi nut es); and direct communicati on between appli cations (rather t han merel y between comput ers).
54 Code: AT-15 INTERNET & WEB TECHNOLOGY
EDI depends on a moderat el y sophisticat ed information technol ogy infrastructure. Thi s must include dat a processing, dat a management and net worki ng capabil i ties, to enabl e the effici ent capture of data int o el ect roni c form.
Q. 76 How do acti ve web pages work? Descri be with a small exampl e. (5) Ans: Active Web Pages: An acti ve document is not ful l y specifi ed by t he server. Instead an acti ve document consi sts of a comput er program that underst ands how t o comput e and displ ay val ues. When a browser request s an active document , the server ret urns a copy of the program that t he browser must run locall y. When it runs the active document program can interact wi th the user and change the displ ay continuousl y. Thus the contents of an active document are never fixed- they can conti nue t o change as long as the user allows the program to run. Following i s the exampl e of acti ve document using j ava applet s.
55 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 77 Discuss the l ife cycl e of JSP. (4)
Ans: A JSP page servi ces requests as a servl et. Thus, t he life cycl e and many of the capabiliti es of JSP pages (in parti cul ar the dynami c aspects) are det ermined by Java Servlet t echnology Servlet Life Cycle The li fe cycl e of a servl et is controll ed by t he contai ner in whi ch the servl et has been depl oyed. When a request is mapped to a servlet, t he contai ner performs t he fol lowing st eps. 1. If an inst ance of the servl et does not exist, the Web cont ainer a. Loads the servl et cl ass. b. Creat es an instance of the servlet class. c. Initi alizes t he servl et inst ance by calling the init met hod. 2. Invokes the service method, passing a request and response obj ect . If the container needs to remove the servlet, it finalizes the servlet by calling the servlet's destroy method. Handl i ng Servlet Li fe-Cycle Events You can monitor and react to events in a servlet's life cycle by defining listener objects whose methods get invoked when life cycle events occur. To use these listener objects, you must define the listener class.
56 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 78 Discuss the WAP st ack inn brief. (5)
Ans:
Wap St ack impl emented the protocol st ack part for the WAP research and devel opment plat form. The protocol st ack will be exploit ed i n various WAP speci fi c syst em components such as WAP proxy servers and gat eways
Wap Stack: WAP Architecture
WAPSTACK develops software for: API (interface to applications/Wireless Application Environment) WAP Forum stack layers (WSP/Session, WTP/Transaction, WTLS/Transport Layer Security, WDP/Datagram, WCMP/Control Message) Si mulation l ayer (simul at es the behavior of an ai r int erface and underl yi ng communi cation layer protocols of a wi rel ess dat a channel )
57 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 79 Discuss the mai n t ags of WML. (5)
Ans:
Tag Defini tion <wml> </wml> It defi nes the begi nni ng and the endi ng of the page, li ke <html> </ html >. <card> </card> It defines the beginning and the ending of the card. WML pages are organized in decks and cards. A deck is a collection of cards, and cards are the basic unit of a WML page. Like a website consists of a lot of html pages and that html page is the basic unit. The id identifies this card in the deck. It has to be unique for each card in the deck. It is used to referred to this card by other cards. The next example will show you how to use it. <p> </ p> All text wi thi n these tags are organi zed in paragraph. It is required for all cards to have at least one paragraph. <!-- All text after this are comments. They are not interpreted by the browser. <do> </ do> This tag gives the user a general way to perform actions. It has to be defined between the card tags. It is usually placed before the first <p> tag. There are different actions that the user can perform as follows: The accept indicates the type of action. For this one, it is a general positive acknowledge. It's like the user clicking an Ok button. <go/> It is the action that will happen when the user performs the action. For this one, it will go the WML page that we specify. Unlike the other tags, there is no closing tag. Instead there is a slash at the end of the tag. The href indicates the destination WML page. It can be URL which will go to another deck, or for this one, another card in the same deck. An # plus the id of another card will identify that card.
58 Code: AT-15 INTERNET & WEB TECHNOLOGY
<do> </ do> The onti mer i ndicates the desti nation (a card or a deck) after the ti mer expires. Agai n for a card, an # is required. <ti mer> This tag let you specify the val ue for the ti mer. It is an error to have two ti mer tags i n the same card. The value sets how much time for the timer to expire. The unit is one-tenth of a second. For the example above, the timer event will trigger after 15 seconds.
<a> </a> This tag i s exactly l ike the <a> i n HTML. It's an anchor, or a li nk that when the user click i t, it will navigate to the next page. The href is the place where you can set the destination. .
Q. 80 Different iat e between WML-Script and Web-based scripti ng languages. (4)
Ans: WML Scri pt is a li ghtwei ght procedural scripting l anguage, optimized for small -memory, low-power CPU wi reless devi ces. It has i t s roots i n the ECMA- Script scri pting l anguage, a standardized version of JavaScript based on core features of that l anguage. WML Script language constructs, syntax, flow control structures, and so on are similar to those of JavaScript because of this inheritance. It provides an optimized and extended subset of JavaScript for the narrowband wireless network-based devices like mobile phones, PDAs, and two-way pagers. Difference between WML script and other web based languages: o WML Script is loosely coupled with WML and can be used independently as a stand- alone tool o The way WML Script is transferred from the WAP gateway to be executed on the wireless client is different from the way JavaScript is transferred over the Web for execution on the client browser. JavaScript is transferred in clear text, while WML Script is compiled by the WAP gateway into byte code before being transmitted to the wireless client. The advantage of this approach is that the byte code is generally much smaller in size than WML Script source code. This enables faster download of WML Script with less bandwidth consumption. It also allows low-memory capacity of the wireless device to store more application data.
59 Code: AT-15 INTERNET & WEB TECHNOLOGY
o Another key difference is that the WS code isn't embedded with the WML source file but is kept as an independent module.
o WML Script doesn't support global variables; only variables declared inside functions or passed as function parameters are allowed. o Language support for arrays is not present. o Support for low-level binary arithmetic operations is also present in the form of bit-wise operators. The wireless device needs a WML Script virtual machine to interpret this WS byte code. If the device doesn't contain a WS VM, it can ignore the reference to WML Script in a WML file. When the WML document interpreter comes across a reference to WML Script, it asks the WAP gateway for the referred WML Script module (compilation).
Q. 81 Two comput ers using TDM t ake up turns to send 100-byt es packet over a shared channel t hat operat es at 64000 bi ts per second. The hardware t akes 100 mi croseconds after one comput er stops sendi ng before the other can begin. How l ong wi l l it t ake for each comput er to send one megabyt e dat a fil e? (5)
Ans: channel rate is 64000 bits/second or 8000 bytes per second. Therefore 1000 bytes size packet will take 1000/8000 seconds that is .125 seconds.
One megabyte file will contain 1000000/1000 = 1000 packets of 1000 bytes size each. two system sending one megabyte file each means 2000 packets will be sent
Therefore, 2000 packets will take 2000 X .125 = 250.000 seconds
Hardware take 100 micro second or 0.001 seconds.
Computer send packets turn by turn between every two consecutive packets there will be 0.001 second gap for 200 packets gap is 2000 X 0.001 = 2.0 seconds.
Total time will 250 + 2 = 252 seconds a computer.
60 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 82 Comput e the number of Ethernet frames formed for a dat a of 64 KB IP packet. (5)
Ans: Following figure illustrates the format of the Ethernet frame. Maximum data in a frame is 1500 bytes. Number of frames formed for 64 KB IP packets is: 64*1000/1500 = 43
Q. 83 Why does Et hernet speci fy a minimum frame size. (4)
Ans: Ethernet frame specifi es a mi nimum frame size of 46 byt es. Whil e a dat a field of zero byt e i s legal , it causes a probl em. When a transceiver detect s a colli sion, it t runcates t he current frame, whi ch means that stray bits and pieces of frames appear on the cable all the time. To make it easi er to distinguish valid frames from garbage, Ethernet speci fi es that valid frame must be at least 64 byt es l ong from desti nati on address to checksum. If dat a port ion of frame is less t he pad fiel d is used to fill out the frame to t he minimum size.
61 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 84 A rout er connects t o at most K net works. How many rout ers R are requi red to connect to N networks? Derive an equation t hat gives R in t erms of N and K. (5)
Ans: R = 1 if N <= K otherwise R = (N -1)/ (K-1) for N >K and K >=2
it is K-1 since one network is connected to two routers. and N- 1 is end router will also connect a network.
Q. 85 How many responses does a comput er expect t o recei ve when it broadcast an ARP request? Why? (4)
Ans: An ARP request message is placed in a hardware frame and broadcast t o all comput er on the net work. Each comput er receives the request and examines the IP address. The comput er mentioned in the request sends a response, al l other computers process and di scard the request without sendi ng a response. So response wi ll be obtained onl y from the machine for which request is bei ng sent not fro the other machines on the network.
Q. 86 Explain the t echnique used i n the asymmetric Key Cryptography. (5)
Ans: Asymmet ri c or publi c-key crypt ography differs from conventi onal cryptography in that key mat eri al i s bound to a si ngl e user. The key mat eri al is divi ded i nto t wo components: a privat e key, to whi ch onl y the user has access, and a publi c key, whi ch may be published or distribut ed on request. Each key generates a function used to transform text. The private key generates a private transformation function, and the public key generates a public transformation function. The functions are inversely related, i.e., if one function is used to encrypt a message, the other is used to decrypt the message. The order in which the transformation functions are invoked is irrelevant. Note that since the key material is used to generate the transformation functions, the terms private key and public key not only reference the key values, but also the transformation functions. For example, the phrase, ``the message is encrypted using the message recipient's public key'', means the recipient's public key transformation function is invoked using the recipient's public key value and the message as inputs, and a cipher text representation of the message is generated as output. The advantage of a public-key system is that two users can communicate securely without exchanging secret keys. For example, assume an originator needs to send a message to a
62 Code: AT-15 INTERNET & WEB TECHNOLOGY
recipient, and secrecy is required for the message. The originator encrypts the message using the recipient's public key. Only the recipient's private key can be used to decrypt the message. This is due to the computational infeasibility of inverting the public key transformation function. In other words, without the recipient's private key, it is computationally infeasible for the interceptor to transform the cipher text into its original plain text.
Q. 87 Give t he format of ICMP header and explain meaning of each fi eld. (4)
Ans: Internetwork Control Message Protocol (ICMP)
Type Code Checksum
Data
ICMP Header and Data
ICMP is a error reporti ng prot ocol. ICMP uses IP t o transport each error message. ICMP header cont ains an 8-bi t integer message TYPE fiel d that identifies t he message, an 8-bit CODE fi eld that provi des further information about t he message t ype, and a 16-bit Checksum fi eld.
Q. 88 How does TCP/ IP decide t he size of an IP fragment? Explain. (4)
Ans: TCP/IP protocol uses the name IP datagram to refer to an Internet packet. The amount of data carried in a datagram is not fixed. The sender chooses an amount of data that is appropriate for a particular purpose. If size of a datagram is larger than network MTU than fragmentation is performed.
When a datagram is larger than the MTU of a network over whicjh it is sent, the router divides the datagram into smaller pieces called fragments and sends each fragment independently. To fragment a datagram for transmission across the network, a router uses the network MTU and datagram header size to calculate maximum amount of data that can be sent in each fragment and number of fragment that will be needed.
63 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 89 Could you di rectl y use TCP over Ethernet wit hout usi ng IP? Justify. (3)
Ans: Each Ethernet station has a uni que, burned-in hardware address known as a Medi um Access Cont rol (MAC) address. No matter what higher layer protocols are being used, all addressing in Ethernet must be eventually done at layer 2 as a MAC. For example, if TCP/IP is being used at layers 3 and 4, each computer will be assigned a 32-bit IP address. Before communicating, an Ethernet- attached station must resolve any IP address to a MAC address. This is done using Address Resolution Protocol, or ARP. The address resolution protocol (ARP) is a protocol used by the Internet Protocol (IP), specifically IPv4, to map IP network address to the hardware addresses used by a data link protocol.So we cannot directly use TCP without IP over Ethernet. Q. 90 What i s the l argest UDP message that can fit into single Et hernet frame? (3) Ans: UDP uses IP for delivery. Like ICMP UDP packet is encapsul at ed in IP dat agram. So ent i re UDP message must fi t i nt o IP dat agram, and t hat dat agram must fi t i nt o si ngl e Et hernet frame. Maxi mum si ze of a Et hernet frame i s 1500 byt es. So l ar gest UDP message t hat can fi t i nt o si ngl e Et hernet frame shoul d not be l arger t han 1500 byt es.
64 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 91 Give t he sequence of procedure call s for both server and cli ent for connecti on-ori ent ed applicati on. (4)
Ans:
The Sequence of Procedure calls in connection oriented communication
Q. 92 Can bot h client and server use t he same prot ocol port on the same comput er at t he same time? Explai n. (4)
Ans: Client and server cannot use the same port number on the same computer at the same time. It is because two end points will be same and same port cannot be assigned to two processes. Also when a process request a port then new empty port is assigned.
Singl e socket bi nd on a remote machine can accept more t han one connecti on from the other machine.
65 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 93 Does it make sense for two domain name servers t o cont ain exactl y the same set of names? Why? (3)
Ans: Yes. It i s very advantageous for t wo domain servers cont aining same set of names. If there is onl y one server than traffi c on one server woul d be i n tolerabl e, because it woul d be the onl y server to receive all the request and handl e them appropriatel y. If there are more than one server cont aining same set of dat a t hen geographi call y closet server will respond thus reducing t he l oad on one server. Al so i f one server is down due t o some problem then another server contai ning same set of dat a can be used t o ful fill the incoming request s.
Q. 94 If voice is convert ed to digital form usi ng PCM, how many bi ts of data will be produced in hal f a second? (3)
Ans: when voi ce is converted to di git al form using PCM (Pulse Code Modul ati on) a device call ed codec (coder decoder) is used producing a 8=bit number. The codec makes 8000 samples per second. Out of 8 bit s seven bit s are for dat a and 1 bit i s for control .
So dat a produced per second will be 7*8000=56000 bit s per second and 56000/2 = 28000 bits in hal f a second.
Q. 95 Discuss the advant ages of El ectroni cs Dat a Exchange (EDI). (4)
Ans: Advantages of EDI : EDI's saves unnecessary re-capture of data. This leads to faster transfer of data, far fewer errors, less time wasted on exception-handling, and hence a more stream-lined business process. Benefits can be achieved in such areas as inventory management, transport and distribution, administration and cash management. EDI offers the prospect of easy and cheap communication of structured information throughout the government community, and between government agencies and their suppliers and clients. EDI can be used to automate existing processes. In addition, the opportunity can be taken to rationalize procedures, and thereby reduce costs, and improve the speed and quality of services. Because EDI necessarily involves business partners, it can be used as a catalyst for gaining efficiencies across organizational boundaries. This strategic potential inherent in EDI is expected to be, in the medium term, even more significant that the short-term cost, speed and quality benefits.
66 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 96 Describe archit ecture of WAP gat eway. (4)
Ans: WAP GATEWAY : The WAP Gateway is a very unique product providing semi-automatic redirection of HTML documents to WAP compatible mobile phones. Wirel ess Appl icati on Protocol (WAP) is a gl obal, open st andard that gives mobil e users access to Int ernet servi ces through handhel d devices. WAP Gat eway, proves to be the perfect answer to the growing demand for wirel ess mobile services across the world. The WAP Gateway acts as a bridge between t he Int ernet world and the mobil e worl d and offers servi ces such as end-user authenticat ion, encoding of WML pages, and WML scri pt compi li ng. WAP uses t he underl yi ng web struct ure t o render more effi ci ent communication bet ween content provi ders and mobil e devi ces. The wi reless protocol employs Wi rel ess Markup Language (WML) for appli cation cont ents inst ead of Hypert ext Markup Language (HTML). How WAP Gateway works
An import ant feature of WAP i s the support of t elephony service int egrat ed with mi cro browsing of dat a. aveAccess WAP Gat eway acts as a proxy bet ween the wi rel ess network and the Internet whil e encodi ng WAP data into byt e code so as to conserve bandwidt h. Q. 97 Why is XML superi or to ot her forms of dat a exchange? (3)
Ans: The XML provides universal data format for int egrated el ect roni c business soluti ons. Rel ational and ot her dat abase syst ems cannot meet all the demands of el ectroni c business because t hey process dat a i ndependentl y of its cont ext.
67 Code: AT-15 INTERNET & WEB TECHNOLOGY
Traditional databases may be well suited for data that fits into rows and columns, but cannot adequately handle rich data such as audio, video, nested data structures or complex documents, which are characteristic of typical Web content. To deal with XML, traditional databases are typically retrofitted with external conversion layers that mimic XML storage by translating it between XML and some other data format. This conversion is error-prone and results in a great deal of overhead, particularly with increasing transaction rates and document complexity. XML databases, on the other hand, store XML data natively in its structured, hierarchical form. Queries can be resolved much faster because there is no need to map the XML data tree structure to tables. This preserves the hierarchy of the data and increases performance. Q. 98 What are the li mitati ons of mobi le devi ces? (3)
Ans: For mobil e devi ces we need both PC-i nt egrated appl icati ons and speci alized mobil e servi ces rather than re purposed websit e content. The latest mobile devices are agonizingly close to being practical, but still lack key usability features required for mainstream use. Emai l must be reconceptualized for mobil e devices. The old model of "anyt hing sent to t his address goes into thi s mailbox" doesn' t work for mobil e. We need both bett er filt ering and a way t o summarize mail that arrives at the offi ce so you can get what you need on t he road without being bogged down by a fl ood of non-urgent messages. Information browsing also needs to change. Currently, the best we can hope for are websites that are basically scaled-down and redesigned to eliminate graphics and multi- column layouts. At worst, websites offer no mobile version, so you get crunched images and skinny columns that are almost impossible to read. To cater to mobile devices, websites and services should offer much shorter arti cles, dramati call y simpli fi ed navi gati on, and hi ghl y sel ective feat ures, ret aini ng onl y what ' s needed i n a mobil e setti ng.
68 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 99 What i nt erprets can a browser cont ai n besides HTML and HTTP? (4)
Ans:
Besides an HTTP cl ient and an HTML i nterpreter, a browser can cont ain component s that enable the browser to perform additi onal task. For exampl e, many browsers i nclude an FTP cli ent that is used to access the fil e transfer servi ces. Some browsers al so contai n e-mail cl ient software that enabl es the browser t o send and recei ve e-mail messages.
Q. 100 Can we speci fy file transfer in a Web page? Explain wit h the hel p of suit abl e exampl e. (8)
Ans:
Yes, fil e transfer can be specifi ed in a web page. The first field in a URL speci fi es a protocol . The URL
ftp:// ft p. cs. purdue. edu/pub/comer/ net book/cli ent . c
speci fi es t hat browser shoul d use anonymous FTP to ret rieve the fil e pub/ comer/netbook/ client . c from comput er ftp. cs. purdue. edu.
A URL that speci fi es FTP can be easil y embedded I HTML consider the foll owi ng example:
Source code from <A HREF = ftp: //ftp. cs. purdue. edu/pub/ comer/ netbook/ cli ent . c > an exampl e cli ent program
</A> is availabl e online.
The program segment will be displ ayed as given below:
Source code from an exampl e cli ent program i s avail abl e online.
If t he user sel ect the underl ined segment , the browser uses it s FTP cli ent to obt ain a copy of the fil e cli ent. c.
69 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 101 Why is Java cal led Machine Independent? (4)
Ans: When a java program is compil ed it is not converted into an executabl e code. Rather, it is convert ed int o a byt e code. Byt e code is hi ghl y optimized set of instruct ions desi gned to be executed by j ava run time system call ed
java Virtual Machi ne (JVM). Transl ati ng a program into byt e code helps make it much easier to run a program on vari et y of envi ronments. Onl y JVM needs to be implement ed for each plat form. Int erpret ers for various plat forms can int erpret same byt e code.
Q. 102 Write an appl et that can i nteract with both the HTTP cli ent and HTML interpreter in a browser. (8)
publi c void init () { add(new But ton{Yi n}); add(new But ton{Yang}); }
publi c Bool ean action(Event e, Object arg) { if ((( Button) e. t arget). get Label() == Yi n) { try { get AppletCont ext (). showDocument(new URL(htt p://www. nonexist. com/ yi n(); } catch(Exception ex) { // not e: code to handle t he exception goes here // } } else i f(((Butt on) e. t arget). get Label () == Yang) { try { get AppletCont ext (). showDocument(new URL(htt p://www. ot her. com/ yang(); } catch(Exception ex) { // not e: code to handle t he exception goes here // } }
70 Code: AT-15 INTERNET & WEB TECHNOLOGY
ret urn t rue; } }
Q. 103 Write an HTML program segment that contai ns hypert ext links from one document t o another. (8)
Ans:
HTML all ows any it em to be pl aced as a hypert ext reference. Thus a singl e word, a phrase, an entire paragraph, or an image can refer to another
document. The HTML uses tags<A> and </A> for t he reference. All it ems bet ween the t wo are the part of anchor. Consider t he following exampl e:
This Arti cle is writt en by <A HREF = ht tp:// www. ideanews. com> IDEA NEWS, </A> One of t he popul ar newspapers worldwide.
Cont ains an anchor t hat references the URL ht tp:// www. i deanews. com When displayed it produces t he following:
This arti cl e is writt en by IDEA NEWS, One of t he popul ar newspapers worldwide. When underli ned text is selected, the document specifi ed by the URL http:// www. i deanews. com is opened.
Q. 104 Write a CGI program that prints dat e and time at which it was run. (6)
Ans:
#!/bin/sh
# # CGI script that pri nts t he date and time at which it was run #
# Output the document header followed by a bl ank line
71 Code: AT-15 INTERNET & WEB TECHNOLOGY
echo Cont ent -t ype: t ext/plain echo
# Output the date
echo Thi s document was creat ed on dat e
Q. 105 What i s the advant age of divi ding an email address i nto two part s? (4)
Ans: The di vision of an e-mail address i nto two parts is import ant because it achi eve t wo goals. First, the divisi on all ows each comput er system to assi gn mailbox identi fi ers i ndependentl y. Second, the divi sion permits the user on arbit rary comput er systems to exchange e-mail messages. E-mail soft ware on the senders comput er uses the second part to det ermine whi ch computer to cont act, and the e-mail soft ware on the recipient comput er uses the fi rst part of the address t o sel ect a parti cul ar mailbox into which message shoul d be pl aced.
Q. 106 Why can CRC det ect more errors t han si mple Checksum? (6)
Ans: There are two reasons a CRC can detect more errors than a si mpl e Checksum. Fi rst, because an input bit is shift ed t hrough all three registers, a single bi t of the message affect s the resulting CRC in dramati c ways. Second, hardware uses feedback in whi ch out put from the leftmost shift regist er affects each exclusive or unit , t he effect from a singl e bit of the message cycl e through the shi ft registers more than one time.
Q. 107 As IPV6 cont ai n multipl e headers, how does it know where part icular header ends and next item begi ns? (7)
Ans: Some headers t ypes have fixed size. For exampl e a base header has a fixed size of exactl y fort y oct ets. To move t o the i tem following base header, IPV6 software simpl y adds fort y t o the address of the base header. But some extension headers do not have a fixed size. In such cases, t he header must contai n suffi cient information to allow IPV6 to determi ne where the header ends. The foll owing fi gure illustrat es the general form of an IPV6 opt ion header.
72
Code: AT-15 INTERNET & WEB TECHNOLOGY
The Ipv6 opti on extension header. Because t he size of the options header can very fro one dat agram to another the HEADER LEN field speci fi es the exact l ength.
Q. 108 Why is TCP call ed end-t o-end protocol? (3)
Ans: TCP is call ed an end-t o-end prot ocol because it provides a connection directl y from an application on one comput er to an appli cat i on on a remote comput er. The appl i cations can request that TCP form a connecti on, send and receive dat a, and cl ose t he connecti on. The connecti ons provided by TCP are call ed virt ual connect ions because t hey are achi eved in soft ware
Q. 109 IP specifi ed t hat datagram can arri ve i n a di fferent order than they were sent . If a fragment from one dat agram arrives at a destinati on before al l the segments from a previous dat agram arrive, how does t he destinat ion know to whi ch dat agram t he fragments bel ong? (6)
Ans: To solve the probl em of reassembling t he fragments that arri ve out of order a unique identi fi cat i on number is placed in the IDENTIFICATION fi eld of each out going dat agram. When a rout er fragments a dat agram, t he rout er copies the identi fi cation number i nto each segment . A receiver uses t he identificati on number and IP source address i n an i ncoming fragment to det ermine the dat agram to whi ch the fragment bel ongs. In addition the fragment OFFSET field t ells a receiver how t o order fragment s withi n a gi ven dat agram.
73 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 110 What i s the advant age of using abbrevi ati ons i n DNS? (5)
Ans: While using abbrevi ation some part of the name of the comput er can be skipped. Because users tend to enter names for local computer more often, abbrevi ati ons for l ocal names are very conveni ent . For exampl e Foobar Corporati on mi ght choose t o all ow users to omit Foobar. com whi le ent eri ng a domain name.
with such an abbrevi ation in effect, a user coul d enter the name venus. walnut. candy to refer to comput er venus i nn the walnut subdivi sion of t he candy division in place of venus. walnut. candy. foobar. com.
Q. 111 Describe ARP message format i n bri ef. (6)
Ans:
0 8 16 24 31 HARDWARE ADDRESS TYPE PROTOCOL ADDRESS TYPE HADDER LEN PADDER LEN OPERATION SENDER HADDER (first 4 oct ets) SENDER HADDER (last 2 oct ets) SENDER PADDER (first 2 oct ets) SENDER PADDER (last 2 oct ets) TARGET HADDER (first 2 oct ets) TARGET HADDER (last 4 oct ets) TARGET pADDER (all 4 oct ets)
The Format of an ARP Message
74 Code: AT-15 INTERNET & WEB TECHNOLOGY
The fi rst t wo 16-bit fields contai n values that speci fy t he t ype of hardware and protocol addresses being used. For exampl e HARDWARE ADDRESS TYPE cont ains 1 when ARP i s used wi th Ethernet, and fiel d PROTOCOL ADDRESS TYPE contai ns 0x0800 when ARP is used with IP. The second pai r of fiel ds HADDR LEN and PADDR LEN speci fy the number of oct ets in a hardware address and a prot ocol address. Fi eld OPERATION specifies whether the message is a request or a response.
Each ARP message contai ns fi el ds for t wo address bindings. One for the reci pient and the ot her for the intended recipient, which ARP calls the target.
Q. 112 What is the advantage or disadvant age of using INADDR_ANY inst ead of the IP address of t he comput er running on the server? (5)
Ans: Structure sockaddr_in defines t he format TCP/ IP uses t o represent an address. Struct ure cont ains fiel d for bot h an IP address and a protocol port number. Although a server can choose to fill i n the IP address when speci fyi ng an IP address, doi ng so causes probl ems when a host i s multi - homed because it means the server onl y accepts request s sent to one speci fi c address. To allow a server t o operate on a multi-homed host , the socket API includes a speci al symboli c const ant , INADDR_ANY that all ows a server to use a specific port at any of t he comput ers IP address.
Q. 113 Is the TCP checksum necessary or coul d TCP allow IP to checksum thee dat a? (5)
Ans: Yes, TCP Checksum is necessary. TCP layer is responsibl e for error detection, error cont rol, t ransmission of packets i f requi red, reassembl y of packets as well as their fragment ation. Hence for all error cont rol and detect ion purposes TCP Checksum is essent ial .
TCP cannot all ow IP to checksum data however IP has it s own checksum for its header. IP layer is basi call y responsibl e for routing of IP datagrams immat erial of whether that packet is intended for TCP services or UDP servi ces. Thus immaterial of what information is cont ained in dat a part , IP layer i s onl y responsible for routing of packets and all the issues rel ated to error control, error det ection, and flow cont rol wit h regards to Routing onl y. Hence IP does not have a checksum for dat a unli ke TCP.
75 Code: AT-15 INTERNET & WEB TECHNOLOGY
Q. 114 What is the chi ef advantage of CIDR over the ori gi nal classful addressing scheme? (6)
Ans: CIDR (Cl assl ess Int er-Domain Routi ng) i s a new addressi ng scheme for t he Int ernet, whi ch allows for more effici ent all ocati on of IP address than the old cl assful scheme.
There are a maximum number of net works and hosts that can be assi gned using 32-bit cl assful addressi ng scheme. Some addresses are reserved (for broadcasti ng et c. ), and there were a lot of wasted addresses al so.
For example i f you needed 100 addresses you woul d be assi gned the small est cl ass addresses (class C), but that stil l means 154 unused addresses. The overall result was Interest was runni ng out of unassi gned addresses.
A rel at ed probl em was the size of t he Int ernet global routing tabl es. As the number of net works on the Internet increased, so did the number of route.
Inst ead of being l imited to net work i dentifi ers of 8, 16 or 32 bits, CIDR currentl y uses prefi xes any where bet ween 13 to 27. Thus, bl ock of addresses can be assigned t o net works as small as 32 hosts or to t hose wit h over 5000, 000 host s. A CIDR address i ncl udes st andard 32-bit IP address and also information on how many bit s are used for the network prefix.
In the CIDR address 206. 13. 01. 48/25, the 25 i ndi cate t he fi rst 25 bit s are used to identify the unique net work l eaving the remai ning bits to i dentif y the specifi c hosts.
CIDR addressing scheme also enabl es rout e-aggregation in whi ch singl e hi gh-l evel rout e ent ry can represent many l ower level rout es in the global rout ing tabl e.
Q. 115 Write short not es: (16)
(i) Sliding Window Prot ocol.
Ans: To obt ain hi gh t hroughput rat es, protocols use a fl ow control technique known as sli ding wi ndow. The sender and receiver are programmed t o use a fixed window size, whi ch is t he maximum amount of dat a that can
76 Code: AT-15 INTERNET & WEB TECHNOLOGY
be sent before an acknowl edge arrives. For exampl e, t he sender and receiver mi ght agree on a window size of four packet s.
wi ndow
(a)
st i l l unsent al r eady acknowl edged wi ndow
(b)
wi ndow
(c)
A 4-packet window sliding through out going dat a. (a) When t ransmi ssion begi ns (b) after t wo packets has been acknowl edged, and (c) aft er ei ght packets have been acknowl edged.
(ii ) Di git al Si gnature.
Ans: This t echni que is used to aut henti cate t he sender of a message. To sing a message, t he sender encrypts t he message usi ng a key known onl y to t he sender. The recipient uses the inverse functi on to decrypt the message. The recipi ent knows who sent t he message because onl y the sender has the key needed to perform the encrypt ion. To ensure that encrypt ed messages are not copi ed and resent l ater, t he ori ginal message can contai n dat e and time it was sent.
A publi c key syst em can be used to provi de a di git al si gnature. To si gn a message, a user encrypts t he message using his or her own privat e key. To veri fy thee si gnature, t hee reci pient l ooks up thee users publi c key, onl y the user can encrypt a message t hat can be encoded wi th the public key.
Ans: TCP/ IP desi gner observed that many of t he confi gurati on st eps could be combined into a si ngle step i f a server was able to suppl y more than one item of confi gurati on informati on. To provi de such a servi ce BOOTP was invent ed.
To obt ain confi guration information, prot ocol software broadcasts a BOOTP request message. A BOOTP server t hat recei ves the request looks up several pi eces of confi gurati on information for the comput er that issued the request int o a singl e BOOTP response message, and ret urns the repl y to t he requesting computer.
(iv) Virtual Packets
Ans: The rout er cannot transfer a copy of a frame from one t ype of net work to another because the frame formats differ. More i mport antl y, the rout er cannot simpl y reformat the frame header because the two net works may use incompati bl e address format.
To overcome heterogeneit y, Int ernet protocol software defi nes an int er packet format that i s independent of the underl ying hardware. This i s called vi rtual packet and can be t ransferred across the underl yi ng hardware. The underl yi ng hardware does not underst and or recognize the Internet packet format, t he protocol software creat es and handl es Int ernet packet.
Q. 116 What i s XML DTD (Document Type Defi nition)? What i s t he advant age of having a DTD for an XML document? (6)
Ans: DTD is a document t hat defines l egal bui lding blocks of an XML document. It defines the document struct ure with a list of l egal element s. A DTD can be decl ared i nline i n your XML document , or as external reference.
Exampl e XML document wit h External DTD:
<?xml versi on = 1. 0?> <| DOCTYPE note SYSTEM not e. dtd> <note> <to>TOM</to>
78 Code: AT-15 INTERNET & WEB TECHNOLOGY
<from>Jani</ from> <heading>Remi nder</heading> <body>Dont forget me t his weekend. </ body> </note>
not e. dt d <?xml versi on = 1. 0?> <| ELEMENT not e (t o, from, heading, body)> <| ELEMENT t o (#PCDATA)> <| ELEMENT from (#PCDATA)> <| ELEMENT heading (#PCDATA)> <| ELEMENT body (#PCDATA)>
Why use a DTD?
XML provi des an applicati on i ndependent way of sharing data. With a DTD, independent group of peopl e can agree to use a common DTD for interchanging data. An appli cat ion can use a standard DTD t o veri fy that
dat a that an appli cati on recei ves from out side world is vali d. An appli cation can also use a DTD t o veri fy it s own dat a.
Q. 117 What i s WAP? Why WAP gateways are used? (6)
Ans:
Wirel ess Appl icati on Protocol (WAP) is a gl obal, open st andard that gives mobil e users access to Int ernet servi ces through handl ed devices. WAP Gat eway proves to be the perfect answer to the growing demand for wi rel ess mobil e servi ces across the world.
The WAP Gateway is a very unique product provi ding semi -automati c redirection of HTML document s to WAP compati bl e mobil e phones.
The WAP Gateway acts as a bridge between t he Int ernet world and the mobil e worl d and offers servi ces such as end-user authenticat ion, encoding of WML scri pt compiling. WAP uses the underl yi ng web structure to render more effi ci ent communi cat ion between cont ent provi ders and mobil e devices. The wi reless protocol employs Wirel ess Markup Language (WML) for appl icati on cont ents i nst ead of Hypert ext Markup Language (HTML).
An import ant feature of WAP i s the support of t elephony service int egrat ed with micro browsing of dat a. AveAccess WAP Gateway acts as a proxy bet ween the wi rel ess network and the Internet whil e encodi ng WAP data into byt e code so as to conserve bandwidt h.