Skip to main content

Posts

Showing posts with the label Computer Networks

Reliable User Datagram Protocol

RUDP provides  a solution where UDP  is too primitive because guaranteed-order  p acket  delivery is desirable, but  T CP  adds too much overhead.  In order for RUDP to gain higher Quality of Service , RUDP implements features that are similar to TCP with less overhead. Implementations: In order to ensure quality, it extends UDP by means of adding the following features: Acknowledgment of received packets Flow control Re-transmission of lost packets Over buffering (Faster than real-time streaming) RUDP is not currently a formal standard, however it was described in an n 1999. It has not been proposed for standardization. Working Example: One way to think about how RUDP types of transport work is to use a basic model where all the data is sent in UDP format, and each missing packet is indexed.  Once the main body of the transfer is done, the recipient sends the sender the index list and the sender re-transmits ...

UDP Client and Server program in Java

UDP: Contrary to TCP, UDP is connection less and unreliable protocol. Connection less means before sending data we do not establish the connection between server and client, we just send the data right away. This protocol is unreliable because when the data do not reach the destination, this protocol will not let the sender know about it. Then obviously one question arises : Then why we have such protocol ? The answer is very simple, there are certain situation where we use UDP because of its speed. In Telecommunication: As UDP is very fast, we just want the voice to reach and little bit of data loss do not hamper the call. In DNS UDP is used. In transmitting multicast packets. The below code simulation shows how UDP server and client work.. Client sends some alphabets to server and server returns them in sorted order. UDP Server Code: import java.io.IOException; import java.net.*; import java.util.Arrays; public class UDPServer { public static void main(S...

TCP Client and Server program in Java

TCP: Transport control protocol is transport layer protocol in TCP/IP model. It is connection oriented and reliable protocol. It guarantees packet transmission between process to process. Connection oriented means that for transmission before starting connection is established and then data is transmitted, that is the reason reliability comes into the picture. So below is typical abstract diagram for TCP protocol, please note this picture just shows the overall functionality of the entire process not the specifics, for more information please click here . TCP Handshaking Process The TCP Server Code in java is given below: This is a demo program which will take sort alphabets sent from client program. import java.net.*; import java.util.Arrays; import java.io.*; public class TCPServer{ private ServerSocket serverSocket; public TCPServer(int port) throws IOException { serverSocket = new ServerSocket(port); // setting port number @server ...