Understanding the concept of computer network entry
Let me explain some of the basic knowledge of the network, which will help us to learn about the TCP/IP protocol knowledge to lay a good foundation.
First, from the background of the birth of the network. At first the computer operates independently ( standalone mode ), each computer has its own business, and users need to execute specific business logic on different computers. The user uses the cassette to put the program and data into the computer for computing. After the advent of time-sharing system, the system has "multi-terminal, a host" characteristics, due to the timing of the system CPU times the characteristics of the rotation of the user has a "one person a machine" illusion. After the 70 's, the computer became smaller and more and more computers were connected to the communication technology, and then to the 80 's, the network of interconnected computers (including supercomputers, PCs, etc.) was born. The slogan "Slimming" and "Multi-vendor connection" were put forward in the 90 's, and e-mail and World Wide Web technologies have made considerable progress. Today's society is already the era of the Internet, and even everything is "TCP/IP" connection . The computer is on a scale from the Wan(WAN) to the LAN(LAN).
Here's what the protocol is about.
A protocol is simply a rule of communication between things. Because the computer does not have the human cognition ability, therefore wants to realize the communication between the computer, formulates the communication rule then the communication mutually observes this rule is the communication premise. Here is the Packet Exchange protocol , which is used later. Packet switching refers to the method of cutting big data into packets (Packet) for transmission. Note that after you cut into the package, you must add the source host address and destination address of the packet, and the packet sequence number, which is the message header . Attention must be affixed to these things, or how you send the data out, how to let the data at the target address over the big Data out? Interspersed with the Packet Exchange , the following continuation of the protocol just mentioned earlier. The agreement began to be developed by each manufacturer, the result is that users can only use the same manufacturer's equipment to communicate ... After the ISO was not seen, the OSI Standard protocol was developed (the OSI reference model was given by the way). Although the OSI protocol given by ISO is not popular at the end, it raises this idea. Today the TCP/IP protocol is eminence. (Note: TCP/IP is not ISO-developed, it is developed by the IETF)
Now that we talk about packet switching, let's talk about the mode of modern network communication in groups. Before that, let's talk about a much older circuit switching technology. Let's take a look at the following diagram:
In circuit switching technology, the computer is connected by a circuit switch, and another batch of computers are connected through a circuit switch. What if Computer A and computer F want to establish a connection? A and F are connected by means of an intermediate circuit. Such a way does not want to have many drawbacks: can not concurrently communicate, because the middle of the circuit can only give two computers to communicate with! So people come up with better packet switching technology, see, is the left side of the computer needs to send all the data sent to the router to cut into a packet (Packet) and then cached in the route, the route in accordance with the queue to send these packets out. This solves some problems in the circuit switching technology. But it also has some problems, such as when the route cache is full, it can cause data loss or unable to send the situation.
OSI Reference Model
The OSI protocol of ISO is mentioned above, but it has not been used extensively, but the OSI reference Model of ISO has become the standard model of today's network architecture. Let's see what this is, why is it so influential? In fact, the OSI reference model is the complexity of the network communication process is divided into 7 layers (see below), each layer has their own management of things, the same level can use protocol communication, and different levels can be communicated through the interface . This layering is so wonderful, such as changing or expanding at a certain level within the system without affecting the entire system, so it has been used today. However, it also has some disadvantages, such as excessive layering leads to some functional implementation logic has to be implemented repeatedly.
Let's take a look at each of the 7 layers of the protocol. Bloggers take a scene as an example to introduce the 7-layer function, welcome to The Spit Groove. Take Xiao Ming to send e-mail to Xiao Hong as an example. Xiao Ming wrote an e-mail "Good Morning", filled out the red email address, and then click the "Send" button, the application layer began to prepare the muscles. The application layer uses the protocol to first append a header (label) information to the front end of the data, including the message "Good Morning" and the message to the recipient red. This information is analyzed and saved in the application layer of the red, and exception handling is also present. Xiaoming's application layer passes data processing to the following presentation layer. Why should there be a presentation layer pinch? Imagine, Xiao Ming's computer he uses Outlook to send e-mail, the red computer uses the Web version to collect files, assuming that the two software encoding format is different, if directly to send and receive what happens? Of course it's garbled. Therefore, there is a presentation layer To resolve this situation, the sender of the data into a common network standard data format, and then the receiver to decode these specific format data into a local encoding format, so there is no garbled problem. Note that the presentation layer also appends the header information. OK, now, after two layers of processing, the data is passed to the session layer . What does this layer do? An e-mail can not see its role, I will give an example. Xiao Ming after the "Good Morning" and sent a "eat no", the role of the session layer is to resolve the establishment of the connection, in what order to send the problem, but it does not send. For example, establish a connection to send "Good morning" and then disconnect, and then set up a connection to send "eat not" and then disconnect, or set up a connection at the same time to send "Good Morning" "Eat No". Determine how to establish the connection, how to send is the issue of this layer, this is the connection management layer. Then the session layer will continue to pass the data to the next layer, the Transport layer is the place where the network is actually transmitted. The above data to the transport layer, the transport layer determines whether Xiao Ming's host and red host is connected, no connection to establish a connection, communication is complete disconnect. In addition, the transport layer will determine whether the data is fully reachable to the red host, if not, re-send it again. It can be seen that the transport layer has the function of guaranteeing data reliability. After the transport layer, our connection is established. However, it does not actually send the data out, which requires the following network layer and Data link layer to process. Network layer refers to the process of data communication from the original address to the destination address, which is the whole communication process. The Data link layer refers to the transfer of the broker during delivery (see below). It is like Xiao Ming's mail to be sent to an individual device in order to reach the small red host.
The last layer is the physical layer , as the name implies, is through the physical media to achieve the level of data transmission. This is the fundamental of communication and no physical media communication is impossible to achieve. In this layer the data is converted from 0, 1 to a voltage or pulse light transmission, via a MAC address for delivery.
After such a long step, Xiaoming finally sent out the data. So how does little red receive the data? In fact, it is the above process flashbacks again. Little Red host from the physical layer began to constantly send Xiaoming sent to the data for reverse decoding, so that a layer of delamination finally get the desired data. The OSI reference model needs to be constantly updated and understood in future studies, where deviations may exist.
The above lists the communication process between Xiao Ming and Xiao Hong, which we call a connection-oriented connection , because both parties have established a connection before the communication. In addition to non-connected communication , UDP Everyone knows that the sender is kept, regardless of whether others receive. What is the benefit of this approach? It can make processing simple, you send the line, I receive the line, do not have to do to establish communication that set of things.
In fact, the above two modes of transmission is a classification, in addition to the number of receivers based on the classification of the way, divided into unicast , broadcast, multicast and anycast *. It's not hard to understand (see)
Note: Multicast and anycast clients all have the same address.
So much has been said about the address at last. The above communication process must have an address to be implemented. Addresses have two important features: uniqueness and hierarchy . The uniqueness is not much said, in the same communication network, the address must be uniquely specified, otherwise how to communicate ... To talk about hierarchy, hierarchy is the ability to achieve rapid location in an address. For example, from a telephone number can be seen the user's country, provinces and cities, district name. The IP address has a hierarchy because of its network number and host number. The organization structure, provider type, and hell distribution set of two IP addresses of the same network number. The MAC address does not have a hierarchical nature.
Let's talk about the addressing problem.
The node in the network transmission process according to the address of the packet data is from which network card issued, Mac addressing will refer to address forwarding , IP addressing will refer to the Routing control Table , the specific addressing reference below this picture, at a glance.
Elements of the network
It says so much, finally from the macroscopic, from the reality to perceive the existence of the network. The physical device composition of the network includes: Network card, Repeater, bridge/Layer 2 switch, routing/3 layer switch, 4-7 layer switch, gateway and cable . Computer communication is done through the cable, the transmission rate of the cable (also known as bandwidth) refers to the amount of data transmitted per unit of time. Network interface cards (NICs) are sometimes referred to as network adapters, NICs, LAN cards, computer-connected devices, and have unique MAC addresses. The repeater is in the physical layer and is the device that adjusts and amplifies the cable signal and then continues the transmission. You can assume that each port of a hub is a repeater. A network bridge (also known as a two-layer switch) is responsible for reconstructing data frames in the data link layer, discarding bad data frames, and transmitting data frames. (Wikipedia explains that > "Bridges connect multiple segments of the network at the Data Link layer (the 2nd layer of the OSI model). ”）
Routing (also known as Layer three switch) in the network layer, according to the IP address to connect two networks to relay packet packets, in addition to network security and share the function of Network load. The gateway is responsible for converting and forwarding the data from the transport layer to the application tier. The conversion service between Internet Mail and mobile mail. The internet and mobile phone set up a gateway, the gateway is responsible for reading a variety of different protocols, a reasonable conversion of them, and then the corresponding data forwarded out. A proxy server is also a gateway, called an application gateway. An individual's understanding of repeaters, bridges, and routes is a management device that transfers data from the underlying hardware to the upper layer gradually.
Understanding the concept of computer network entry