Java Network Programming tutorial
Java Networking Introduction
Java Networks Home
Java is practically a synonym for Internet programming. To write network based programs, Java providing a rich set of classes in a package called java.net.
Network Basics
What Is a Socket?
A socket is a connection between two programs running on the network for two-way communication.
Socket classes are used to represent the connection between a client program and a server program.
port → A numbered socket on a particular machine. Client connects to a port to request a particular service.
A server allows multiple clients to connect to the same port number. To accomplish this,
a server process must be a multithreaded.
Socket communication takes place via a protocol.
What is protocol?
A protocol is a common set of rules that are accepted by both the ends to communication,
acceptance of data format etc.
IP (Internet Protocol) → a low level routing protocol that breaks data into small packets and sends to address across a network, which is not guarantee to deliver packets to destination.
TCP (Transmission Control Protocol) → is a higher-level protocol manages to combine
together all the packets and transmits them to the destination.
UDP (User Datagram Protocol) → sits next to TCP and directly to support fast connectionless unreliable transport of packets.
Commonly used ports for different services provided by the server.
Protocol port
FTP 21
Telnet 23
email 25
WHOIS 43
finger 79
http 80
netnews 119
Ex. HTTP is the protocol transmits HTML pages and images on port 80. HTTP is simple protocol for basic
page-browsing on web server.
Address → A key component of Internet. Every computer on the Internet has one address.
it is nothing but a number, that uniquely identifies each computer on a
on the Net. Each Address consisted of 32-bit values. Organized as four 8-bit
values. There are 2 Types of address schemas.
1. IPV4 (Internet Protocol version 4)
2. IPV6 (Internet Protocol version 6)--uses 128-bit value to represent Address and organized into 8 16-bit chunks.
Ex. IPV4 IP Address: 255.255.255.255
This IP Address describes a network hierarchy, the name of an Internet address called
its domain name, describes a machine's location in a web.
Ex. www.google.com → here
.com → is domain
google → is a company name.
www → identifies the server for web requests.
An internet domain name is mapped to an IP Address by Domain Naming Service(DNS),
which enables the user to work with domain names rather than IP Addresses.
Comments
Post a Comment