Networking Concepts, HTTP, FTP, Telnet, Sockets based Programming Assignment Help

Assignment Help: >> Java Programming >> Networking Concepts, HTTP, FTP, Telnet, Sockets based Programming

Networking

Computers running on the Internet intercommunicate to each other using either the options:
i)  Transmission Control Protocol also known as TCP.

It is a connection based protocol that offers a authentic flow of data between two computers.

ii) The User Datagram Protocol also known as UDP.
The UDP protocol offers communication that is not assured between two applications on the network. It  is not connection based like TCP, rather  it sends independent packets of data from one application to another known as datagram's. Sending datagram is  like sending a letter via postal service. The order of delivery is not significant and is not assured and each message is independent of another.

When two applications want to intercommunicate to each other in a reliable manner, they build a connection and send data back and forth via that connection. This is similar to making a telephone call. If you want to speak to someone, a connection is built when you dial a  phone number and person on other end answers. You then send data back and forth over the connection by speaking to one another over the phone lines. Similar to the phone company, TCP assures that data sent from one end of actually arrives to the other end in the same order it was sent, otherwise an error is reported.

TCP offers a point-to-point channel for applications that involve reliable communications.
The examples are:
i) The Hypertext Transfer Protocol (HTTP)
ii) File Transfer Protocol (FTP)
iii) Telnet


The order in which the data is sent and received over the network is characterized by careful evaluation to the success of these applications. When HTTP is used to read from a URL, the data must be met in the same order in which it was sent. Otherwise, you end up with a mingled HTML file or a corrupt zip file or some invalid information.

In general, a computer has a single strong-arm connection to the network. All data designated for a particular computer arrives through that connection. However, the data may be aimed for different applications running on the computer. .

Data channelized over the Internet is accompanied by dealing information that distinguishes the computer and the port for which it is designated. The computer is distinguished by its 32-bit Internet Protocol address, which Internet Protocol used to deliver data to the right computer on the network. Ports are distinguished by a 16-bit number, which TCP and UDP use to deliver the data to the right application.

An Internet Protocol address also known as IP address is a numerical unique identification number which is attributed to the devices taking part in the network for communication.

Identifying Your Computer's IP Address

To acquire IP address of one's own system in a java program  InetAddress class can be used.

InetAddress ownIP=InetAddress.getLocalHost() acquires the computer system's local host with IP address. Now we can find out the IP address with this object by calling method getHostAddress() on the InetAddress object. For example:

GetOwnIP.java

import java.util.*;

import java.lang.*;

import java.net.*;

 

public class GetOwnIP

{

  public static void main(String args[]) {

  try{

  InetAddress ownIP=InetAddress.getLocalHost();

  System.out.println("IP of my system is := "+ownIP.getHostAddress());

  }catch (Exception e){

  System.out.println("Exception caught ="+e.getMessage());

  }

  }

}

 

Output:

C:\javaexamples>javac GetOwnIP.java

 

C:\javaexamples>java GetOwnIP

IP of my system is := 192.168.10.112

Sockets
A server runs on a particular computer and has a socket that is bound to a particular port number. The server waits, listen to the socket for a client to create a connection request.

 

The client is intimate about:
i) The host name of the machine on which the server is running
ii) The port number on which the server is listening.


To create a connection request, the client attempts to meet with the server on the server's machine and port. The client also needs to distinguish itself to the server so it binds to a local port number that  will be used during this connection which is usually assigned by the system.

If everything goes in proper manner, the server accepts the connection. Upon acceptance, the server acquires a new socket bound to the same local port and has its remote endpoint set to the address and port of the client. It requires a new socket so that it can keep on listening the original socket for connection requests while inclining to the needs of the connected client.

On the client side, if the connection is accepted, a socket is created in a successful manner and the client can utilize the socket to intercommunicate with the server.

The client and server can now intercommunicate by writing to or reading from their sockets.

A socket is one endpoint of a two-way communication linked between two programs running on the network. A socket is adhered to a port number so that the TCP layer can recognize the application that data is designated to be sent. An endpoint is a combination of a port number and an IP address. Every TCP connection can be identified in unique manner by its two endpoints. In this way user can have multiple connections between host and the server.

The java.net package in the Java platform offers a class, Socket that applies one side of a two-way connection between one Java program and another program on the network. The Socket class stays on top of a platform-dependent implementation, hiding the details of any specific system from Java program. instead of relying on native code , using the java.net.Socket class, Java programs can communicate over the network in a platform independent fashion.

Java Assignment Help - Java Homework Help

Struggling with java programming language? Are you not finding solution for your java homework and assignments? Live java experts are working for students by solving their doubts & questions during their course studies and training program. We at Expertsmind.com offer java homework help, java assignment help and Java projects help anytime from anywhere for 24x7 hours. Computer science programming assignments help making life easy for students.

ExpertsMind.com - Networking Concepts Assignment Help, Networking Concepts Homework Help, Networking Concepts Assignment Tutors, Networking Concepts Solutions, Networking Concepts Answers, Java Programming Assignment Tutors

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd