IP address Basics

Source: Internet
Author: User

When talking about the Internet, IP addresses cannot be mentioned because IP addresses are a very important concept from the perspective of learning and using the Internet, many INTERNET services and features are reflected by IP addresses.
I. Concepts of IP addresses
We know that the Internet is a general term for a communication network composed of computer connections all over the world. When two computers connected to a network communicate with each other, some additional information is contained in the packets transmitted by them, the additional information is the address of the computer that sends the data and the address of the computer that receives the data. In this way, people allocate an ID address that is similar to the phone number in our daily life to every computer for convenience of communication. The ID address is the IP address we will introduce today. According to TCP/IP protocol, IP addresses are composed of 32-bit binary numbers and are unique over the INTERNET. For example, the IP address of a computer connected to the Internet is:
11010010 01001001 10001100 00000010
Obviously, these numbers are not very memorable. In order to facilitate memory, people divide the 32-bit binary code that makes up the IP address of a computer into four segments, each segment has eight digits, separated by decimal places, and converted each eight-bit binary code into decimal digits, in this way, the IP address of the above computer becomes 210.73.140.2.
Ii. IP address classification
We have said that the Internet is a large inter-network that connects countless networks around the world. Computers in each network are uniquely identified by their own IP addresses. Therefore, we can imagine that, on the INTERNET, each network also has its own identifier. This is very similar to the phone number in our daily life. For example, if a phone number is 0515163, the first four digits in the number indicate the region of the phone number, the following number indicates a telephone number in the region. Similar to the preceding example, we divide the IP address of a computer into two parts: the network ID and the host ID. All hosts on the same physical network use the same network ID. The four bytes of the IP address are divided into two parts, and one part is used to indicate the specific network segment, that is, the network ID; the other part is used to indicate the specific node, that is, the host ID, that is, the specific computer number in a network. For example, the IP address of the server in Yancheng Information Network Center is 210.73.140.2. For this IP address, we can divide it into two parts: the network ID and the host ID, so that the above IP address can be written:
Network ID: 210.73.140.0
Host ID: 2
Write in combination: 210.73.140.2
Because there may be many computers in the Network, some networks may contain many computers, and some networks may contain fewer computers. Therefore, according to the size of the network, the 32-bit address information is divided into three positioning methods, which correspond to Class A, Class B, and class C IP addresses respectively.
1. Class a ip Address
A Class a ip address refers to the network number of the first segment of the four segments of the IP address, and the remaining three segments are the numbers of the local computer. If A binary IP address is used to represent an IP address, A Class a ip address consists of A 1-byte network address and A 3-byte host address. The maximum IP address must be 0 ". In Class a ip addresses, the network ID length is 7 bits, the host ID is 24 bits, and the number of class A network addresses is small. It can be used in large networks with hundreds of thousands of hosts.
2. Class B IP Address
A Class B IP address refers to the four segments of the IP address. The first two segments are network numbers, and the remaining two segments are the numbers of the local computer. If the IP address is expressed in binary format, the B-type IP address consists of a 2-byte network address and a 2-byte host address. The maximum IP address must be "10 ". In type B ip addresses, the network ID length is 14 bits, and the host ID is 16 bits. Type B network addresses are suitable for medium-scale networks, each network can accommodate more than 60 thousand computers.
3. Class c ip Address
A Class c ip address refers to the network number in the four segments of the IP address, and the remaining segment is the number of the local computer. If the IP address is expressed in binary format, the class c ip address consists of a 3-byte network address and a 1-byte host address. The maximum network address must be 110 ". In Class c ip addresses, the network ID length is 21 bits, the host ID is 8 bits, and the number of class C network addresses is large, which is suitable for small-scale local networks, each network can contain up to 254 computers.
In addition to the above three types of IP addresses, there are also several special types of IP addresses, the TCP/IP protocol stipulates that all the addresses starting with "lll0" in the first byte of the IP address are called multi-point broadcast addresses. Therefore, any IP address whose first byte is greater than 223 or less than 240 is a multicast address. Each byte of the IP address is 0 ("0.0.0.0") and corresponds to the current host; the IP address ("255.255.255.255") of each byte in the IP address is the broadcast address of the current subnet. All IP addresses that use "llll0" will be reserved for future use.
Iii. IP address addressing rules
1. network addressing rules
A. The network address must be unique.
B. The network ID cannot start with a number 127. In Class A addresses, the number 127 is reserved for the internal return function.
C. The first byte of the network logo cannot be 255. The number 255 is used as the broadcast address.
D. the first byte of the network ID cannot be "0". "0" indicates that the address is a local host and cannot be transferred.
2. Host addressing rules
A. The host ID must be unique in the same network.
B. each bit of the host ID cannot be "1". If all the bits are "1", the address of the host is the broadcast address, not the host address.
C. each bit of the host ID cannot be "0". If each bit is "0", it means "only this network", and there is no host on this network.
Iv. IP subnet mask Overview
1. Concept of subnet mask
The subnet mask is a 32-bit address. It is used to shield a part of the IP address to distinguish the network ID and host ID, and shows whether the IP address is on the LAN or on a remote network.
2. determine the number of subnet masks
The number of digits used for the subnet mask is determined by the number of possible subnets and the number of hosts in each subnet. Before defining the subnet mask, you must determine the number of subnets and the number of hosts used.
To define a subnet mask, follow these steps:
A. determine which group addresses are used by us. For example, if the requested network is "210.73.a. B", the network address is a class c IP address, the network ID is "210.73", and the host ID is "a. B ".
B. Define the subnet mask based on the number of subnets we need and the number of subnets that may be extended in the future. For example, we need 12 subnets now and 16 subnets in the future. Determine the subnet mask with the first four digits of the third byte. The first four digits are set to "1", that is, the third byte is "11110000". This number is now called the New Binary subnet mask.
C. Set each bit of the corresponding initial network to "1", that is, the first two bytes are set to "1", and the fourth byte is set to "0 ", the uninterruptible binary form of the subnet mask is: "11111111.111111.112.16.00000000"
D. Convert the number into a break decimal format: "255.255.240.0"
This number is the subnet mask of the network.
3. IP mask Annotation
A. Non-subnet annotation Method
For an IP address without a subnet, it can be written as a mask with the host number 0. For example, if the IP address is 210.73.140.5 and the mask is 255.255.255.0, you can also use the default mask to write only the IP address.
B. subnet Annotation
When a subnet exists, the two must be paired. Take Class C address as an example.
1. The first three bytes in the IP address indicate the network number. The last byte indicates both the subnet number and the host number, and whether the two IP addresses belong to one CIDR block. If they belong to the same network range, the information exchange between the two addresses will not pass through the router. If it is not in the same network range, that is, the subnet number is different, the information exchange between the two addresses will be carried out through the router. For example, for a host whose IP address is 210.73.140.5, its host ID is 00000101, for a host whose IP address is 210.73.140.16, its host ID is 00010000, and the first three digits of the above two Host IDS are all 000, the two IP addresses are in the same network area.
Host address, such? The host ID of 10.73.60.1 is 00000001,210.73. The first three digits of the two host IDs are different from those of the 011, indicating that the two are in different network areas and information needs to be exchanged through the router. Each of its subnetwork host numbers is 1 and 252.
2. the mask function is to indicate that there are subnets and several subnets, but the number of subnets can only be expressed as a range. Instead of specifying the specific subnets, the mask does not indicate the specific subnet number, mask format with subnet (for Class C addresses): the first few digits of the host ID are subnet numbers, and no host is written at the end. All digits are written to 0.
V. Other IP address issues
1. Generally, the international Internet Information Center allocates IP addresses based on the network. Therefore, Class A, Class B, and class C can be used only when it comes to network addresses;
2. When a network address is assigned, the network ID is fixed, and the computer ID can be changed within a certain range. The following are the three types of network addresses:
Class A address: 73.0.0.0
Class B address: 160.153.0.0
Class C address: 210.73.140.0
Each of the preceding values can be 0 ~ Change between 255.
3. because the first three digits of an IP address determine the network type of an IP address, the-class network address cannot be further divided into B-class IP addresses, class B IP addresses cannot be further divided into Class C IP addresses.
4. when talking about A specific computer ip address, Class A, Class B, and class C should not be used, but it can be said that the Host address belongs to which class A, Class B, and class C network.
Through the above study, you must have an understanding of IP addresses. With an IP address, you can send emails and obtain other information on the Internet, such as the WWW Service, BBS service, and FTP service on the Internet. Article entry: dnbm responsibility Editor: dnbm

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.