TCP/IP Tutoriallogin
TCP/IP Tutorial
author:php.cn  update time:2022-04-13 17:05:49

TCP/IP addressing



TCP/IP uses 32 bits, or 4 groups of numbers between 0 and 255, to address computers.


IP Address

Each computer must have an IP address to connect to the Internet.

Each IP packet must have an address before it can be sent to another computer.

You will learn more about IP addresses and IP names in the next section of this tutorial.


An IP address contains 4 sets of numbers:

TCP/IP uses 4 sets of numbers to address a computer. Each computer must have a unique 4-digit address.

Each set of numbers must be between 0 and 255, separated by periods, for example: 192.168.1.60.


32 bits = 4 bytes

TCP/IP uses 32 bits for addressing. A computer byte is 8 bits. So TCP/IP uses 4 bytes.

One computer byte can contain 256 different values:

00000000, 00000001, 00000010, 00000011, 00000100, 00000101, 00000110, 00000111, 00001000... until 11111111 .

Now, you should know why a TCP/IP address is a set of 4 numbers between 0 and 255.


IP V6

IPv6 is the abbreviation of "Internet Protocol Version 6", also known as the next generation Internet protocol. It was developed by the IETF group (Internet Engineering Task Force) Force) is a new IP protocol designed to replace the current IPv4 (current) protocol.

We know that all hosts on the Internet have a unique IP address. The IP address uses a 32-bit binary number to represent a host number. However, the 32-bit address resources are limited and cannot meet the needs of users. Therefore, The Internet Research Group releases a new method of host identification, IPv6.

In RFC1884 (RFC is the abbreviation of Request for Comments document. RFC is actually some standards for Internet services), the prescribed standard syntax recommends writing the 128 bits (16 bytes) of the IPv6 address as 8 A 16-bit unsigned integer, each integer is represented by 4 hexadecimal digits, and these numbers are separated by colons (:), for example:

686E:8C64:FFFF:FFFF:0:1180:96A:FFFF

Colon hexadecimal notation allows zero Compression, that is, a series of consecutive 0s can be replaced by a pair of colons, for example:

FF05:0:0:0:0:0:0:B3可以定成:FF05::B3

In order to ensure a clear explanation of zero compression, the recommendation stipulates that zero compression can only be used once at any address. This technique is particularly useful for the proposed allocation strategy, since there will be many addresses containing consecutive strings of zeros.

Colon hexadecimal notation combined with a suffix of bit decimal notation. This combination is particularly useful during the transition from IPv4 to IPv6. For example, the following string is a legal colon hexadecimal notation:

0:0:0:0:0:0:128.10.1.1

In this notation, although each value separated by a colon is a 16-bit quantity, each point The value in the decimal part specifies the value of a byte. Then use zero compression to get:

::128.10.1.1

Domain name

12 Arabic numerals are difficult to remember. It's easier to use a name.

The name used for a TCP/IP address is called a domain name. php.cn is a domain name.

When you type a domain name like http://www.php.cn, the domain name will be translated into numbers by a DNS program.

Across the world, a huge number of DNS servers are connected to the Internet. DNS servers are responsible for translating domain names into TCP/IP addresses and for updating each other's systems with the new domain name information.

When a new domain name is registered along with its TCP/IP address, DNS servers around the world update this information.

php.cn