Вы находитесь на странице: 1из 8

BT 0052

ASSIGNMENT SET - 01

Client Server Architecture

1. Distinguish CISC and RISC.

2. Write a short note on Asynchronous Transfer Mode of transmission.


Ans: - ATM is cell and multiplexing technology that combines the benefits of dedicated
circuits (invariant transmission delay and guaranteed capacity) with those of packet switching
(flexibity and efficiency for intermittent traffic). The fixed length of ATM’s cells(53 bytes—
48 bytes for the “payload” and 5 bytes for headers)facilitates high speed implementation that
can support isochronous (time critical) application such as video and telephony with constant
flow rates, in addition to more conventional data communications between computers where
fluctuation in packet arrival rates typically not problematic (7). ATM standards define a
board range of bandwidths – from 1.5 mbps (via t1 or DS1) to 622 mbps (OC -12) and above
– but most commercially available ATM products currently provide 155.52 mbps (OC—3 )
or 100 mbps (TAXI). ATM is currently implemented over fiber connections to and various
twisted pair wiring alternatives.
All devices in an ATM network attach directly to an ATM switch.
Multiple ATM switches can be combined in a fabric sometimes called an “ATM cloud” and
virtual circuits can be dynamically created between any two nodes on one or more ATM
switches so long as the switch can handle the aggregate cell transfer rate, additional
connections to the switch can be made.

3. Explain various client/server applications using Java.

4. How will you develop a simple web client in Java using Sockets?

Ans –
Import java.io.*;
Import java.net.*;
Public class webc
{
Public static void main (String args [ ])
{
Try
{
Socket cSock1 = new socket ( “cecasun.utc.edu”,80);
System.out.println( “client1 : “ + cSock1);
getpage (cSock1);
}
catch (UnknownhostExeception e);
System.out.println (UnknownhostExeception: “ + e);
}
catch (IOExeception e)
{
System.err.println(“IOException: “+e);
}
}
Public static void getpage (socket c sock)
{
Try
{
Dataoutputstream outbound = new dataoutputstream
( cSock.getoutputstream());
{
{
Datainputstream inbound = new datainputstream(cSock.getinputstream ());
Outbound.writebytes(“GET /~cslab/cpsc591/test.htm HTTP/1.0\r\n\r\n”);
String responseLine;
While ((responseline = inbound.readline()) !=null)
{
System.out.println (responseLine);
If (responseline.indexof(“</html>”)!=-1)
break;
}
Outbound.close( );
Inbound.close ( );
cSock.close ( );
}
Catch (IOexception ioe)
{
System.out.println (“IOException: “+ ioe);
}
}
}
5. Explain TCP/IP Protocol in detail.
Ans- TCP/IP, an acronym for transmission control protocol, corresponds to the forth layer of
OSI reference model. IP corresponds to the third layer of the some model. Each of the protocols
has the following features:

TCP: it provides a connection types service. That is


a logical must be established prior to communication. Because of this, continues transmission of
large amount data is possible. This ensures a highly reliable data transmission for upper layers
using IP protocol. The sender keeps on sender data at constant intervals until receives a positive
acknowledgement.

A negative acknowledgment implies that the failed data segment needs to be


retransmitted.

The TCP header includes both source and destination port fields for identifying the applications
for which the connection is established. The sequence and acknowledgment number fields under
the positive acknowledgement and retransmission technique. Integrity checks are accommodator
using the checksum field.

IP: In contrast to TCP, it is a connectionless type service and operates at third layer of OSI
reference model. That is prior to transmission of data, no logical connection is needed. This type
of protocol is suitable for the sporadic transmission of data to a number of destinations. This has
no functions like sequence control, error recovery and control, flow control but this identifies the
connection with port number.

6. Explain Remote Procedure Call in detail.


BT 0052

ASSIGNMENT SET - 01

Client Server Architecture

1. Explain the different types of Client / Server Architectures


Ans – different types of client/server architectures are:-

1. Two tier client/server architecture


2. Three tier client/server architecture

Two tier client server architecture: - @-tier architecture, RPC’s or SQL are typically used to
communicate between the client and server. The server is likely to have support for stored procedures
and trigger. These mean that the server can be programmed to implement business rules that are better
suited to run on the client, resulting in a much more efficient overall system.
Since 1992 software vendors have developed and brought to market
toolsets to simplify development of application for the 2-tier client/server architecture. The best
known of these tools are Microsoft’s visual basic Borland’s Delphi, and Sybase’s power Builder

These modern, powerful tools combined with literally million of developer who to use them that the
2-tiered client/server approach is a good and economical solution for certain classes of problems.

The 2-tiered client/server architecture has proven to be very effective in solving


workgroup problems. “Workgroup”, as used here, is loosely defined as a dozen to 100 people
interacting on a LAN. For bigger, enterprise -class problems and/or application that distributed over a
WAN, use of this 2-tier approach has generated some problem.

Three tier client/server architecture:- The client can deliver its request to the middle layer, disengage
and be assured that a proper response will be forthcoming at a later time. In addition, the middle layer
add synonymous in this context .There’s no free lunch, however, and the price for this added
flexibility and performance has been a development environment of 2-tiered applications.

The most part type of middle layer (and the oldest, the concept on mainframes dating from the early
1970’s) is the transaction processing monitor or TP Monitor.

TP monitor as a kind of message queuing service. The client connects to the TP monitor instead of
the database server.

The transaction is accepted by the monitor, which queues it and then takes responsibility for
managing it to correct completion.

The net result of using a 3-tier/server


architecture with a TP monitor is that the resulting environment is FAR more scalable than a 2-tier
approach with direct client to server connection. For really large (10, 00 user) application, a TP
monitor is one of the most effective solutions.

2. Explain hierarchical vs localized file server deployment.

3. Explain WAN Connectivity in detail.

Ans – A frequently overlooked aspect of a LAN’s topology is its connection to the wide area network.
In many cases, WAN connectivity is provided by a single connection from the backbone to the router.

The LAN’s connection to the router that provides WAN connectivity is a


crucial link in a building’s overall LAN topology. Improper technology selection at this critical point
can result in unacceptably deteriorated levels of performance for all traffic entering or exiting the
building. LAN technologies that use a connection- based access method are highly inappropriate for
this function.

Networks that support a high degree of WAN to LAN and LAN to

WAN traffic benefit greatly from having the most robust connection possible in this aspect of

their overall topology. The technology selected should be robust in terms of its nominal

transmission rate and its access method. Connection- based media, even on a dedicated

switched port, may become problematic in high usage networks. This is the bottleneck for all

traffic coming into, and trying to get out to the building.

4. Write a Java Program to implement a simple web server.

Ans: - uses a server socket to wait for a connection, then opens a socket to the client to
return an HTML document with HTTP headers.

Import java.io.*;
Import java.net.*;

Class websrv {
Public static void main (String args []) {
Serversocket srvsock = null;
Socket clisock=null;
Int connection = 0;
Try {
Srvsock = new serversocket(60337, 5);
While (connects <3) {
clisock = srvsock.accept ();
Serviceclient (clisock);
Connects++;
}
Srvsock.close();
} catch (IOException e) {
System.out.println (“error in simple webserver: “+e);
}
}
Public static void serviceclient (socket client)
Throws IOException {
Datainputstream inbound = null;
Dataoutputstream outbound = null;
Try {
Inbound = new Datainputstream (client.getinputstream());
Outbound = new Dataoutputstream (client.getoutputstream());
StringBuffer buffer = prepareoutput();
String inputLine;
While ((inputLine = inbound.readline()) !=null) {
If (inputline.equals (“”)) {
Outbound.writebytes (buffer. to string ());
System.out.println (“wrote buffer to “+ client);
//sleep (500); for slow win 95
break;
}
}
} finally {
System.out.println (“cleaning up connection: “+ client);
Outbound.close ( );
Inbound.close ( );
Client.close ( );
Client.close ( );
}
}
Public static stringbuffer prepare output ( ) {
Stringbuffer outputbuffer = newstring buffer ( );
Outputbuffer.append (“<HTML>\n<HEAD>\n<TITLE>Test HTML Document
</TITLE>\n”);
outputBuffer.append (“</HEAD>\n”);
outputBuffer.append (“</BODY>\n This is a <STRONG>test</STRONG>HTML
Document!\n” );
outputBuffer.append (“</BODY>\n”);
outputBuffer.append (“</HTML>\n”);
stringbuffer headerbuffer = new stringbuffer ( );
headerBuffer.append (“HTTP/1.0 200 ok\r\n”);
headerBuffer.append (“content.type: text/html\r\n”);
headerBuffer.append (“content-length: ” + outputbuffer.length( ));
headerBuffer.append (“\r\n\r\n”);
headerBuffer.append (“outputbuffer.tostring() );
return headerbuffer;
}
}

5. Explain Booth Multiplication Algorithm with a suitable example.


Ans – Booth algorithm gives a procedure for multiplying binary integers in signed-2’s
complement representation. It operates on the fact that strings of 0’s in the multiplier require
no addition but just shifting, and a string of l’s in the multiplier from bit weight 2k to weight
2m can be treated as 2k-1 . For example
The binary number 001110(+14) has a string of 1’s from r to 21 (k=3, m=1).

Numerical example of binary Multiplier


Multiplicand B = 10111 E A Q SC

Multiplier in Q 0 0000 10011 101

Qn =1; add B 10111

First partial product 0 10111

Shift right EAQ 0 01011 11001 100

Qn = 1; add B 10111

Second partial product 1 00010

Shift right EAQ 1 00001 01100 011

The number can be represented as rk+1 – 2” = 2n-2’ = 16-2=14. Therefore, the multiplication
M*14, where M is multiplicand and 14 the multiplier, can be done as M*24 – M*2*. Thus, the
product can be obtained by shifting the binary multiplicand M four times to the left and
subtracting M shifted left once.
As in all multiplication schemes booth algorithm requires examination of the multiplier bits
and shifting of the partial product. Prior of the shifting, the multiplicand may be added to the
partial product, subtracted from the partial product, or left unchanged according to the
following rules:-
1. The multiplicand is subtracted from the partial product upon encountering the first
least significant 1 in a string of 1’s in the multiplier.
2. The multiplicand is added to the partial product upon encountering the first Q in a
string of 0’s in the multiplier.
3. The partial product does not change when the multiplier bit is identical to the previous
multiplier bit.
The algorithm works for positive or negative multipliers in 2’s complement representation.

This is because a negative multiplier ends with a string of l’s and the last operation will be a

subtraction of the appropriate weight. For example, a multiplier equal to -14 is represented in

2’s complement as 110010 and is treated as -24 + 22 = -- 14.

6. What is meant by Remote Method Invocation? Explain


with a suitable example
Ans - Remote Method Invocations (RMI):-
Java Remote Method Invocation (RMI) allows you to write
distributed objects using java. This paper describes the benefit of RMI,
and how you can connect it to existing and legacy system as well as to
components written in java.
RMI provides a simple and direct model for
distributed computation with java objects. These objects can be java
objects, or can be simple java wrappers around an existing API. Java
embraces the “Write Once, Run Anywhere model. RMI extends the java
to be run everywhere.”
RMI connects to exiting and legacy system using the
standard java native method interface JUI. RMI can also connect to
existing relation database using the standard JDBC? Package. The
RMI/JNI and RMI/JDBC combinations let you use RMI to communication
today with existing server in non-java languages, and to expand your
use of java to those server when it make sense for you to do so RMI
lets you take full advantage of java when you do expand you use.
RMI is java’s remote procedure call (RPC)
mechanism. RMI has several advantages over traditional RPC system
because it is part of java’s oriented approach. Tradition RPC system
are language-neutral, and therefore are essentially least-commondenominator
system- they cannot provide functionality that is not
available on all possible target platforms
*The primary advantages of RMI:-
Object oriented, Mobile
behavior, Design patterns, Safe secure, Easy to write/easy to use,
Connects to existing/legacy system, Write once, run anywhere,
Distributed garbage collection, parallel computing, the java
distributed computing solution.

Вам также может понравиться