Alternative UDP implementation Server. The server application will receive UDPdatagrams from clients, and add their ip and port address to a list of its clients. (there are appropriate get methods in UDPdatagrampacket class). It then forwards the data to all the other clients by creating new datagrams address to all the clients. To provide some management options it could read the datagrams and look for special keywords. That way a user can declare his nickname, his wish to stop receiving messages etc. At periodic intervals, the server can delete the entries in its list of clients who has been inactive for long time as we can assume the client is either not interested or disconnected. Client The client is basically the same as the server, except we maintain the ip and port address of the server machine only. In addition we need a method to read users input , and display the messages received from other clients.When the client application is started we will read the users nickname from the keyboard and then send it to the server as a UDPDataGramPacket. If we get a message from the server then we display it and run until user wants to quit.The Client program will have the same functionality as the TCP client in being able to block message display when the user is typing.A simple scheme will to to separate the display & scan function with a sleep() and block if the user indicate a wish to type a message by entering a special key string. The display function will resume after the sleep() or the block has ended, whichever be the last. Comparison: Reliability: From a top down perspective, an Internet chat System exchanges messages. A message is a string that a user has typed on the console and wants to send to other users. In the TCP implementation, we are guaranteed that this message is received and transmitted by the server without any corruption and loss. In a UDP implementation,we have no such garantes. A single message could be broken up into multiple Datagrams, and these datagrams may arrive at the destination out of order, or with some of the packet may get loss. The data grams themselves are broken into segments in the underlying transport layer and error correction is minimal. At the destination, the message must be recompiled from the multiple packets, and loss of packet will return a corrupt data.Therefore, although on a 100% reliable network, a UDP based system will outperform a TCP based system, a real life application using UDP will suffer some perventage of packet loss. In our chat system, this packet loss will translate into messages with garbled words and spellings and even loss of whole message. Performance: The reliability of the TCP protocol comes at the price of slower data transmission. While a TCP server negotiates a connection using the three way handshake, a UDP server can start sending data as soon as the datagram can be created. The UDP implementation has also the advantage that it is very light on system resources as well as the network. A tcp Server has to maintain a large number of sockets, one for each client.The UDP server needs only one socket to send its data to all its client. A TCP server would need a much larger system resource to pay for maintaining error free connection with all its Clients. A TCP server can not use the multicast system while a UDP could incorporate that as well as some error correction in the application to significantly provide a faster and more efficient network service.