Java- Technical question on Networking Concepts

1) The API doesn’t list any constructors for InetAddress- How do I create an InetAddress instance?
ANSWER : In case of InetAddress the three methods getLocalHost, getByName, getByAllName can be used to create instances.
InetAddress add1;
InetAddress add2;
add1 = InetAddress.getByName(“”);
add2 = InetAddress.getByName(“”);
}catch(UnknownHostException e){}

2) Is it possible to get the Local host IP?
ANSWER : Yes. Use InetAddress’s getLocalHost method.

3) What’s the Factory Method?
ANSWER : Factory methods are merely a convention whereby static methods in a class return an instance of that class. The InetAddress class has no visible constructors. To create an InetAddress object, you have to use one of the available factory methods. In InetAddress the three methods getLocalHost, getByName, getByAllName can be used to create instances of InetAddress.

4) What’s the difference between TCP and UDP?
ANSWER : These two protocols differ in the way they carry out the action of communicating. A TCP protocol establishes a two way connection between a pair of computers, while the UDP protocol is a one-way message sender. The common analogy is that TCP is like making a phone call and carrying on a two-way communication, while UDP is like mailing a letter.

5) What is the Proxy Server?
ANSWER : A proxy server speaks the client side of a protocol to another server. This is often required when clients have certain restrictions on which servers they can connect to. And when several users are hitting a popular web site, a proxy server can get the contents of the web server’s popular pages once, saving expensive internetwork transfers while providing faster access to those pages to the clients.
Also, we can get multiple connections for a single server.

6) What are the seven layers of OSI model?
ANSWER : Application, Presentation, Session, Transport, Network, DataLink, Physical Layer.

What Transport Layer does?
ANSWER : It ensures that the mail gets to its destination. If a packet fails to get its destination, it handles the process of notifying the sender and requesting that another packet be sent.

8) What is DHCP?
ANSWER : Dynamic Host Configuration Protocol, a piece of the TCP/IP protocol suite that handles the automatic assignment of IP addresses to clients.

9) What is SMTP?
ANSWER : Simple Mail Transmission Protocol, the TCP/IP Standard for Internet mails. SMTP exchanges mail between servers; contrast this with POP, which transmits mail between a server and a client.

10) In OSI N/w architecture, the dialogue control and token management are responsibilities of…
Answer : Network b) Session c) Application d) DataLink
ANSWER : b) Session Layer.

11) In OSI N/W Architecture, the routing is performed by ______
Answer : Network b) Session c) Application d) DataLink
ANSWER : Answer : Network Layer.

If you have questions, please ask below

Leave a Reply

If you have any questions headover to our forums

You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>