CHAPTER 22

 < Day Day Up > 



  1. The open source for TCP/IP protocol stack is available with the Linux operating system.

  2. The Java code for implementation of UDP server and UDP client are given in Listing C.6 and Listing C.7, respectively. The server software is used to transfer a file to the client. The server divides the file into UDP datagrams and sends it. The client will receive each datagram and assemble the file. This code can be tested on a LAN environment.

Listing C.6: UDP server software.

start example
    import java.net.*;    public class UDPServer    {       public static DatagramSocket ds;       public static int buffer_size=10;       public static int serverport=555;       public static int clientport=444;       public static byte buffer[]=new byte[buffer_size];       public static void Server() throws Exception       {          int pos=0;          byte b[] = { 'H','e','l','l','o'};                           ds.send(new          DatagramPacket (b, b.length, InetAddress.getLocalHost(), clientport));       }       public static void main(String args[])       {        try{        System.out.println("Server is ready");           ds=new DatagramSocket(serverport);           Server();        }catch(Exception e){ }    } } 
end example

Listing C.7: UDP Client software.

start example
 import java.net.*; public class UDPClient {    public static DatagramSocket ds;    public static int buffer_size=5;    public static int serverport=555;    public static int clientport=444;    public static byte buffer[]=new byte[buffer_size];    public static void Client() throws Exception    {       while(true)       {    DatagramPacket dp = new DatagramPacket(buffer, buffer.length);           ds.receive(dp);           byte b[] = dp.getData();           for(int i=0;i<=b.length;i++)           System.out.print((char)b[i] + " ");       }    }    public static void main(String args[])    {    try{           System.out.println("Client is ready");           ds=new DatagramSocket(clientport);          Client();       }catch(Exception e){ }    } } 
end example

  1. In sliding window protocol used in TCP, the receiver must advertise its window size. Receiver may advertise a small window size due to various reasons such as buffer full. In such a case, the sender has to transmit small segments. This results in inefficient utilization of the bandwidth. To avoid this problem, the receiver may delay advertising a new window size, or the sender may delay sending the data when the window size is small.

  2. In a satellite communication system, if the VSATs are receive only, it is not possible for VSAT to send an acknowledgement to the server located at the hub. In such a case, the server at the hub has to use the UDP as the transport layer to transmit the file. The server software will divide the file into UDP segments and broadcast each datagram. The datagram contains the VSAT address as the destination address. The VSAT will receive the datagarams and assemble the file.

  3. In sliding window protocol used in the TCP layer, the receiver has to advertise the window size, and the sender must adhere to this size. This may cause the silly window syndrome.



 < Day Day Up > 



Principles of Digital Communication Systems and Computer Networks
Principles Digital Communication System & Computer Networks (Charles River Media Computer Engineering)
ISBN: 1584503297
EAN: 2147483647
Year: 2003
Pages: 313
Authors: K V Prasad

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net