Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of an IP address?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

What is the use of an IP address?

Keywords: IP, IP address, public network IP, private network IP

I. IP and IP addresses

IP is actually the abbreviation of Internet interconnection protocol, but we usually omit the address after the IP address and directly use IP to represent an identity of the computer on the network. In fact, this is not rigorous. IP is the core of the entire Internet work, what we call IP address is actually only one of the functions, that is: IP address, this is a unique address, see some children's shoes here will give rise to doubt, unique? Can four sets of numbers hold so many machines? Let's first introduce IP routing and the classification of IP addresses.

1. The role of IP

When we use the Internet, the biggest concern is whether my information and behavior can be sent successfully, and whether I can receive messages from the outside world. Through IP, our needs are fundamentally guaranteed.

Generally speaking, the sending and receiving mentioned above is actually a kind of information transmission, and our various operations will be transmitted in the form of packets (packets) by various application software. The problem is how to get from the starting point to the end, and this is not usually a direct highway, but a ladder made up of different routes that takes many jumps to get there.

IP addressing

All devices connected to the network must have a unique IP address in order to identify a destination. Therefore, a network card of a device can only be assigned to one IP address, that is, an IP address can only be assigned to one device. IP routing

Before explaining routing, let's review the issues mentioned earlier. As we all know, an IP address is made up of four sets of numbers, each with a range of 0-255. so all the possibilities add up to only about 4.2 billion. According to statistics at the beginning of 2019, the number of Internet users around the world has reached 4.388 billion, not to mention that one person has more than one device that can access the Internet. In other words, if you simply assign an IP address to every device connected to the Internet, then the concubine really can't do it.

So how did our great scientists solve this problem? That is routing through IP. Each router is equivalent to a transit station, like a signal base station (this is not a very appropriate metaphor), uniformly manage the computers or lower-level routers in a certain area. The allocation of IP addresses is managed by all levels of routes. after being managed in this way, many of our IP addresses can be reused, and the same IP address (non-public network IP address) can appear under different routers, because they do not influence and conflict with each other. Based on this mechanism, our device is actually connected to the Internet after multi-level routing, so the role of the router is to choose the path, and the IP packet is the object to be transmitted.

2. IP address classification

According to the number of Internet devices that need to be connected to the area, we set up different types of networks, and through binary conversion, we can know the number of devices that can be accommodated in all kinds of networks. The following figure shows the number of binary digits corresponding to the network number and the host number, 8 as a group, a total of four groups.

Class A (mainly used in large networks)

Start with 0, network number: 7 digits, host number: 24 digits

Class B (mainly used in medium-sized networks)

Start with 10, network number: 14 digits, host number: 16 digits

Class C (mainly for small networks)

Start with 110, network number: 21 digits, host number: 8 digits

Class D (mainly used for multicast)

At the beginning of 1110, the multicast group number: 28 digits, 224.0.0.0" 239.255.255.255

Category E (reserved address)

1110 beginning, remaining: 27 bits, reserved for the time being, 240.0.0.00mm 247.255.255.255

Second, the function of IP address 1. Public network IP address

The public network IP is the only IP address in the world. No matter where we are, the direction of this IP address is the same. As we already know from the above, the public network IP network segments that can be used by commonly used Class A, B and C IP addresses are as follows (all-0 and all-1 are usually retained):

Class A: 1.0.0.0-126.0.0.0B: 128.0.0.0-191.255.0.0C: 192.0.0.0-223.255.255.02. Private network IP address

The private network IP address refers to the IP address assigned by the router in a local area network, which is different from each other and connects to the Internet through a public network IP address.

Class A reserved private network IP address: 10.0.0.0" 10.255.255.255B reserved private network IP address: 172.16.0.0" 172.31.255.255C reserved private network IP address: 192.168.0.0" 192.168.255.255

After understanding the IP address of the public network and the IP address of the private network, we can understand why two devices in the same local area network can directly access each other, while two machines not in the same local area network can not directly access each other. Just imagine, if I tell each other my private network IP address, then do you know which LAN I am in? If what I tell you is my public network IP address, and I don't know how many devices, how can you find me?

3. Loopback address (loopback address)

We notice that there is only 127 missing in the range of IP addresses. In fact, the range of 127.0.0.0 addresses 127.255.255.255 represents a loopback address, usually the machine itself. When we install some service type software, we need to use the specified port, which is machine-related. For example, if we install a MySQL database software and use it to access port 3306 of the local machine, what does it use to represent the local machine? Of course, we can use the IP address assigned to us by the router, but there is a problem that the IP address assigned by the router may change, and maybe our computer is not connected to the router. At this point, we still want to use our database service normally, and the easiest way is to use the loopback address instead, and the most frequently used loopback address is 127.0.0.1. When we use a loopback address, our request will not alarm the router, or it can be said that it has nothing to do with the router. A series of behaviors generated are handled by our machines themselves and will not generate data with the public network.

Third, get IP information 1. Public network (wide area network) IP

If you need to know through which public network IP address the current equipment is surfing the Internet, or want to know which network operator provides the service, you can directly search in Baidu: ip, or use websites such as http://www.ip138.com/ to query.

two。 Private network (LAN) IP

To view the current LAN ip, you can query it quickly through the command, or check it in the network card configuration interface (IPv4 protocol address).

Windows:ipconfigLinux/Mac:ifconfig3. Routing hop tracking

If we want to know how many routes our current device has gone through to access the Internet, we can use the following command. Each line represents a first-level route, and since three packets are sent by default, three response times are returned, and the asterisk displayed indicates a timeout or we cannot see the specific information because the route is set to prevent ping***,.

Windows:tracertLinux/Mac:traceroute

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report