Java network programming from getting started to mastering (1): Overview of Internet addresses

Source: Internet
Author: User
Tags top level domain to domain

All terminal devices connected to the Internet (including computers, PDAs, printers, and other electronic devices) have a unique index called an IP address. Most IP addresses on the internet now consist of four bytes, which are called IPv4. In addition to this four-byte IP, there is an IP on the Internet, which consists of 16 bytes, called IPv6. The number following IPv4 and IPV6 is the version number of the Internet Protocol (Internet Protocol,ip).

The general form of IPV4 address is: x.x.x.x. where x is an integer of 0 through 255. These four integers use "." Separated. Theoretically, the IPV4 address can represent 2 of the 32 power, that is, 4,294,967,296 IP addresses, but due to the exclusion of some of the special significance of IP (such as 0.0.0.0, 127.0.0.1, 224.0.0.1, 255.255.255.255, etc.), Therefore, the number of IP addresses that the IPV4 address can freely allocate is less than the amount of IP address it can represent.

In order to facilitate the management, the IPV4 is divided into Class A, Class B and Class C IP addresses artificially.

Class A IP address

Scope: 0.0.0.0––127.255.255.255, the standard subnet mask is 255.0.0.0.

Class B IP Address

Scope: 128.0.0.0––191.255.255.255, the standard subnet mask is 255.255.0.0.

Class C IP Address

Scope: 192.0.0.0––223.255.255.255, the standard subnet mask is 255.255.255.0.

As you can see from the above description, the first byte between 0 and 127 is a Class A IP address, between 128 and 191 is a class B IP address, and between 192 and 223 is the C class IP address. If the two IP addresses and their subnet masks are the same as the resulting value, it is indicated that the two IP is in the same network segment. Below are two Class C IP address IP1, IP2, and their subnet masks.

ip1:192.168.18.10 Subnet Mask: 255.255.255.0

ip2:192.168.18.20 Subnet Mask: 255.255.255.0

These two IP and their subnet masks are bitwise-and then the resulting value is 192.168.18.0. Therefore, IP1 and IP2 are in the same network segment. When the user uses modem or ADSL modem to surf the Internet, the IP assigned to this computer is generally a class C address, that is to say, the first byte will be between 192 and 223.

The IP address and subnet mask given above are only standard forms. Users can also use additional IP and subnet masks, such as the IP address set to 10.0.0.1, and the subnet mask set to 255.255.255.128, depending on their needs. However, in order to facilitate the classification and management, in the LAN set IP address, it is recommended that the standard classification to set.

The IPV6 address is composed of 16 bytes and is divided into 8 segments. Each paragraph consists of 16 bytes and is represented by 4 hexadecimal digits, separated by ":" Between segments. such as A34E:DD3D:1234:4400:A123:B231:A111:DDAA is a standard IPV6 address. IPV6 can be abbreviated in two cases:

1. The paragraph beginning with 0 can be omitted by 0. such as A34E:003D:0004:4400:A123:B231:A111:DDAA can be abbreviated to A34E:3D:4:4400:A123:B231:A111:DDAA.

2. A continuous occurrence of more than 0 segments can use "::" to replace multiple segments of 0. such as A34E:0000:0000:0000:A123:B231:0:DDAA can be abbreviated to A34E::A123:B231:0:DDAA. When using this shorthand, "::" can only occur once, if multiple times, the IPV6 address will be ambiguous.

In a mixed network of IPV4 and IPV6, the latter four bytes of the IPV6 address can be written in IPV4 address format. such as A34E::A123:B231:A111:DDAA can be written as a34e::a123:b231:161.17.221.170. When a computer accessing a network resource is using a IPV4 address, the system automatically uses the IPv6 of the latter four bytes as the IPV4 address.

Whether it is IPv4 address, or IPV6 address, it is difficult to remember. Therefore, in order for these addresses to be memorable, internet designers have created DNS (domain Name System). DNS links IP addresses to domain names (an easily memorized string, such as Microsoft), when the computer accesses Internet resources through domain names, the system first obtains the IP address of the domain name through DNS, and then accesses Internet resources through the IP address. In this process, the IP address is completely transparent to the user. If a domain name corresponds to multiple IP addresses, DNS selects a random return from these IP addresses.

Domain names can be divided into different levels, such as the common top level domain name, top-level domain name, level two domain name and level three domain name.

Top Level domain Name

The top-level domain name can be divided into type top-level domain names and domain top-level domains. COM and org in www.microsoft.com, www.w3c.org are type top-level domain names that represent both business (COM) and nonprofit organization (ORG). And www.bianceng.cn in the CN is the domain top level, it represents China (CN). The main types of top-level domain names are COM (commercial), Edu (education), Gov (government), INT (International Organization), MIL (US military), net (network Department), org (non-profit organization). Most countries have their own geographical top-level domain names, such as China (CN), the United States (US), the United Kingdom (UK) and so on.

Top-level domain

such as www.microsoft.com in the microsoft.com is a top-level domain name. At the email address of the "@" followed by the top-level domain names, such as abc@126.com, mymail@sina.com and so on.

Level two domain name

such as blog.csdn.net is the top-level domain csdn.net level two domain name. A lot of people think Www.csdn.net is the top-level domain name, in fact this is a kind of misunderstanding. In fact, www.csdn.net is the top-level domain csdn.net level two domain name. Www.csdn.net and blog.csdn.net are essentially the same, but we are accustomed to using www to represent a URL using HTTP or HTTPS protocol, so the misconception is that www.csdn.net is a top-level domain.

Level three domain name

such as abc.photo.163.com is a level two domain name photo.163.com level three domain name. Many sites, such as blogs or electronic albums, have a three-level domain name assigned to each user.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.