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

MCA SEMESTER-IV

LAB ASSIGNMENT – ITA

1. Implement the working of Dynamic Host Control Protocol (DHCP) using Java.
[Hints. Each time a client computer request the server for an IP, the server
assigns a unique IP to the client]
2. Write a program using Java Socket Programming which accept the URL of a
website and display the following information:
(i) protocol used
(ii) port number
(iii) host name
(iv) IP address
3. Write a program which accepts an IP address in IPV4 format display the class to
which it belongs.
4. Write a program which accepts an IP address in IPV4 format and display it in
IPV6 format.
[Ex: Ipv4: 209.131.36.159 Ipv6 : 0000:0000:0000:0000:0000:0000:4593:7d41]
5. Build a server capable of receiving text messages from clients. The server should
print these text messages on standard output, but should not print any other
messages such as debug information. From the server perspective, a message
corresponds to the data received from a particular client during a communication
session with that client. The server should be listening for text messages to a port
known to the clients. The server should be able to receive text messages from
multiple clients. When multiple clients simultaneously try to send text messages
to the server, the server should print them one at a time (in any order). Note that
you don't have to implement an event-driven or multi-threaded server. Serving
one client at a time is enough.
6. You need to implement both the client and server using Java socket
programming satisfying the following design guidelines.
(i) The server listens on port 1000 for incoming connections (TCP). When a
client connects, it sends a “WELCOME TO SERVER" message to which the
client replies with the messages it wishes to send and the corresponding IP
Addresses to which the messages are to be sent..
(ii) The server manages a list of messages to be sent and periodically (every 30
seconds) checks the message list to see if any IP address that is connected to it
presently has a message in the list for it. If so, it sends the message to that host
on its existing connected socket and deletes it from its message queue.
(iii) The server also supports a command line with support for one command
“display" that will show all the messages currently saved on the server and all the
IP addresses currently connected to it.
7. Create an online auction system. People can join the auction, leave the auction,
and bid for an item in the auction. The current price of an item gets flashed as
soon as anybody bids a valid price for the item. This is similar to the online stock
market where the current prices of the shares are flashed as soon as their value
changes.

Let us look at some of the details:


You need to create an auction server. The server should support at least the
following methods:
• join auction
• leave auction
• bid on an item.
You can read the initial list of items and minimum prices from a file or from
standard input. When somebody joins the auction, you need to send the items on
sale and their current price.
Then, you need to create a client, either as an applet, or as an application. The
client joins the auction, displays the items for sale along with their current price,
and lets the user place a bid for a particular item.
Since multiple clients will be bidding at the same time, the methods on the server
must be properly synchronized. Whenever any client makes a successful bid, the
current price at all the clients must reflect this change. [Hint: You need to use
RMI or CORBA to call back the clients from the server.]. All the exceptions
must be properly handled.
8. Implement a multi-threaded HTTP server and an SMTP client. Your HTTP
server should implement both the GET and POST methods and should support
the following functionalities:

Your server should support a root and should dynamically generate a default
index HTML file and an email form web page when a browser requests one of
these files . The index page should have three different links. One pointing to the
course web page, one pointing to one of your favorite web sites, and one
pointing to the email form web page.

If the user presses on the email form link, the HTTP server will respond by
producing the email form page. This latter will have the following fields:
• a (From:) field to hold the email address of the sender,
• a (TO) field to hold the email address of the receiver,
• a (SUBJECT) field to hold the email subject,
• a (BODY) field to hold the email body,
• a (SEND) command button, and
• a (SMTP SERVER) field which users can optionally fill to designate a
specific SMTP server to use. If this field is not filled, your SMTP client
should be able to use a default server.
* If the user presses the SEND button, The POST method will be used in this
case to send the SMTP request to the HTTP server. This latter will then forward
the request received to the SMTP client who will take care of sending this email
message to its destination.
* If the server receives an empty request, he should respond by producing the
index page.
* Both the index page and the email form page should be dynamically generated
by your HTTP server using HTML. You should not use any external HTML files
for these pages or any other HTML page for this assignment.
* You should work with browsers that are HTTP/1.0 compliant.
You should not use servlets or any existing SMTP or HTTP classes in this
assignment.
* Your program should take a command line argument specifying what is the
port number it will use.
* All exceptions must be properly handled.

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