Networking basics
Networking is a broad and complex topic. In particular, a subtopic, such as addressing, is quite involved. We will introduce the terms and concepts that are commonly encountered and useful from a Java perspective.
Most of this discussion will focus on Java support for the Internet. A Uniform Resource Locator (URL) is recognized by most Internet users. However, the terms Uniform Resource Identifier (URI) and Uniform Resource Name (URN) are not recognized or understood as well as URL. We will differentiate between these terms and examine the Java supporting classes.
A browser user would normally enter a URL for the site that they would like to visit. This URL needs to be mapped to an IP address. The IP address is a unique number identifying the site. The URL is mapped to an IP address using a Domain Name System (DNS) server. This avoids a user having to remember a number for each site. Java uses the InetAddress
class to access IP addresses and resources.
UDP and TCP are used...