Few Questions Networking
Few Questions Networking
Few Questions Networking
2) Explain with a suitable diagram the HTTP communication between Web-Server, and web client
ANs:
HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files -- such as text, images,
sound, video and other multimedia files -- over the web. As soon as a user opens their web browser,
they are indirectly using HTTP. HTTP is an application protocol that runs on top of the TCP/IP suite of
protocols, which forms the foundation of the internet.Through the HTTP protocol, resources are
exchanged between client devices and servers over the internet. Client devices send requests to
servers for the resources needed to load a web page; the servers send responses back to the client
to fulfill the requests. Requests and responses share sub-documents -- such as data on images, text,
text layouts, etc. -- which are pieced together by a client web browser to display the full web page
file.
There are three fundamental features that make the HTTP a simple and powerful protocol used for
communication:
HTTP is media independent: It specifies that any type of media content can be sent by
HTTP as long as both the server and the client can handle the data content.
List the classes in java networking? Explain Any 2 Methods of InetAddress class.
List
Write a program server communication using ServerSocket class.
Ans:
Server.java
import java.io.*;
import java.net.*;
public class MyServerProgram
{
public static void main(String[] args)
{
try
{
ServerSocket ss=new ServerSocket(6666);
Socket s=ss.accept();//establishes connection
DataInputStream dis=new DataInputStream(s.getInputStream());
String str=(String)dis.readUTF();
System.out.println("message= "+str);
ss.close();
}catch(Exception e){System.out.println(e);}
}
}
Define Following Terms
i) Define networking?
ii) Any 2 advantages of networking.
1) Networking:
Networking, also known as computer networking, is the practice of transporting and
exchanging data between nodes over a shared medium in an information system.
Computer networking enables devices and endpoints to be connected to each other on a local
area network (LAN) or to a larger network, such as the internet or a private wide area
network (WAN). This is an essential function for service providers, businesses and
consumers worldwide to share resources, use or offer services, and communicate.
Advantages (Any 2)
Define terms :
a)Web Browser b) Web Server c) Protocol d)HTTP