Network Protocols in Java
In terms of protocols and services, Java offers API support for three basic types of connectivity:
TCP -- Transport Control Protocol
UDP -- User Datagram Protocol
Mcast -- Multicast Protocol.
A Socket is an abstraction of a "communications link" between machines over some network.
Socket communication is the same regardless of whether the network connection is via a phone line, cable modem, ethernet, or fiber-optic line.
A packet is a discrete quantity of information suitable for routed transport over a shared network. Packet sizes are limited, so a packet may be a fragment of a large file or message.