This article introduces some basic concepts for getting started

1. Differentiate several “nets”

1.1. Computer networks

Let’s start with a common web, a spider web:

So what are the characteristics of this web? Geometrically, there are no more than two features: points (red) and lines (blue).

In fact, the nets you can see in life, such as fishing nets, iron nets, rope nets and so on, all have this feature.

Similarly, computer networks also have these two characteristics, except that they are not properly called points and lines. Instead, we use two terms: nodes and links.

Therefore, a computer network is composed of a number of nodes and links connecting these nodes.

Nodes can be computers, switches, routers, and other devices. A link can be simply defined as a network cable.

The following figure shows a computer network consisting of five nodes (four computers, one hub) and four links, which can be referred to simply as a network:

When studying the relationship between networks, we need to look at the network as a whole and ignore the intricacies of the network. At this point, a network can be replaced by a cloud:

To compare a network to a person, the nodes and links are the heart, liver, spleen, lungs, kidneys and blood vessels.

Studying the inside of a network is like a doctor looking at your body, looking at certain organs in your body, and how those organs are connected.

The study of the network and the relationship between the network is just like interpersonal communication. It focuses on the whole individual, not the organ. After all, no one wants to make friends with the organ.

1.2. Network of Networks (Internet/Internet)

Networks of networks are like “networks of people” :

Smartphones connect people together and form a network of relationships. Replace people with networks, smartphones with routers, and “networking” is “networks of networks.”

For a moment, think of the router as a special computer. For example:

Nodes are compared to cities, links to expressways, networks to provinces, transmitted data to passenger cars, routers to toll booths on interprovincial expressways, and the Internet to countries.

The networks are connected by routers to form a larger network of computers, called a “network of networks,” or the Internet.

A cloud in Figure 1-4 represents a network that connects multiple computers. The blue clouds (networks) in Figure 1-6 are connected to form a larger gray cloud (Internet). From the two pictures, we can conclude that computers are connected together to form a network, while networks are connected together through routers to form an Internet.

1.3. Internet (Internet)

The Internet is the world’s largest and most important computer network. If you really understand the Internet, then you can say that you really understand computer networks.

So what is the Internet?

We surf the Internet every day, chat on wechat, Honor of Kings, watch videos, read blogs and so on. The “net” we use refers to the Internet. The reason we can chat and play games together is because we are all connected to the same “net”. This is the first experience that the Internet gives us as users: that all of us are invisibly connected, connected. You can now see my blog post, which is the second experience that the Internet has given us as users: sharing resources. Without the Internet, you wouldn’t be able to see my post.

Two features of the Internet: connectivity and resource sharing.

The Internet and the Internet should be distinguished:

  1. Internet generally refers to the computer network formed by connecting multiple computer networks together.
  2. The Internet is now the largest and most important computer network in the world.

The Development of the Internet so far, the connection in which is not only our ordinary use of the “computer”, such as smart phones, smart bracelets, smart appliances can access the Internet. These devices can all be called host or end systems.

Figure 1-7 highlights host access to the network, ignoring routers or links in the network.

So how do hosts get connected to the Internet?

That starts with the current Internet infrastructure. The current Internet is the Internet with multi-level ISP structure.

An ISP is an Internet Service Provider, such as China Mobile. Isps obtain many IP addresses from Internet management agencies and also own devices such as communication links and routers. We ordinary users pay a fee to the ISP to get an IP address and access the Internet (in my case, China Mobile).

For example, an IP address is like a license plate. You buy a car, but you can’t get on the road without a license plate. Isps issue license plates, build roads, and fix toll booths.

IP addresses pass through Internet management agencies, ISPs, and finally users. The Internet management agencies send A batch of IP addresses to ISPs.

This model is similar to manufacturer, distributor and consumer.

Multi-level ISPs can be classified into backbone ISP, regional ISP, and local ISP according to the coverage area of the service and the number of IP addresses.

Backbone ISPs serve the largest area (usually with national coverage) and are created and maintained by several specialized companies. Regional ISPs take second place and can be connected to each other via backbone ISPs. Regional ISPs provide services directly to users.

Similar to country, province, city, the user is similar to citizens.

2. Composition of the Internet

The Internet is the world’s largest global computer network. The way a network of this size works, it can be divided into two parts: the edge part and the core part

2.1. Edges

The edge part is composed of hosts connected to the Internet, which is directly used by users to provide users with data communication and resource sharing services.

The edge can provide users with communication and resource sharing services only by using the services provided by the core. For example, in Figure 1-8, any two people can communicate with each other using the computer in front of them.

There are two modes of communication: client-server mode and peer connection mode.

Client-server approach

This is by far the most common way on the Internet. All kinds of information on the Internet are stored on the server. When we need some information, we send a request to the server through the service provided by the core part of the Internet, retrieve it, and then the server sends it to our device.

The client is the service requester and the server is the service provider.

Clients and servers also have the following characteristics:

  1. The client actively sends requests to the server, and the server passively receives requests, which requires the server to run all the time.
  2. The client needs to know the server address, the server does not need to know the client address.
  3. Customers have low requirements on hardware (ordinary computers and smart phones), while servers have high requirements on hardware.

2. Peer connection mode

Peer-to-peer (P2P) refers to the communication between two hosts without distinguishing the service provider from the service requestor. The two can download each other’s content. This approach is also a special client-server approach, but on an equal footing.

For example, client-server approach is equivalent to students asking questions from teachers, while P2P approach is equivalent to students asking questions from each other.

2.2. Core

The core consists of a large number of networks and the routers that connect them. The core provides services — connectivity and exchange — to the edge so that hosts in the edge can communicate data and share resources. The core is much more complex than the edges.

It’s not hard to understand why a large number of networks in the core provide connectivity. And who offered the exchange? What was exchanged? What is grouping? How do I switch packets? Here is a brief overview of these issues.

Q1: Who provides the exchange?

A1: Router

A router is a special computer whose job is to perform packet switching.

Q2: What is exchanged? What is grouping?

A2: Packets are exchanged

In the network, which the information we want to transmit a message (message), not the whole transmission out, because there will be long (for example, this article), so usually divided by its smaller data segment, but only the data in the data block, it does not know the way, how to make it not get lost in the complicated network? It needs to add some necessary control information (head), the block plus the head to form a group.

For example, if a company has to ship 100 tons of goods, there is no way to transport all of them at once, so it has to be shipped separately, say 10 tons per container. But these 10 tons of goods do not know the way, so we need to add a truck head to the container. The truck head has a driver and a map, so we can find the destination.

100 tons of goods is the information (message) we want to send, each container is a data segment divided one by one, the head of the truck is the head, the head of the truck plus the container is a complete truck, namely grouping.

Q3: How do I switch packets?

A3: Uses the packet switching technology

For example, we usually communicate with each other through wechat. The distance between us may be thousands of miles. How can what you want to say just happen to reach each other’s phone?

This is the most important function at the heart of the network – packet switching.

As shown in Figure 1-6, routers connect many networks together to form a larger network. There are countless large and small networks in the Internet, and communication links are more complex and changeable.

You can open a map of China and see the railways and roads on it. It’s dazzling. It’s a similar story on the Internet.

A router is a key component to implement packet switching. After receiving a packet, the router saves it temporarily and then selects an appropriate interface for it according to the header information in the packet and forwards the packet. Packet switching uses store-and-forward technology.

For example, in journey to the West, the master and his apprentice go to get scriptures. Group exchange is “dare to ask where the road is”.

Whenever he went to a place, tang Monk would say to his lodger, “A poor monk is a monk who came from the Eastern land of Tang Dynasty and went to the west to pray for Buddha and sutras.” Upon hearing this, people would naturally tell him where to go next as long as he was not a monster. Although there may be detours, or be caught by demons, but on the whole will certainly get closer and closer to the west, and eventually arrive.

In the above scenario, “Dongtu Datang” is the source address, and “Xitian” is the destination address. These two pieces of information are stored in the head of the packet, so that the packet can be transmitted over the network. “Tang’s monk four people” be group, “borrow stay somebody else” be router, group exchange be the process that you ask a way, however this kind ask a way, passer-by won’t tell you whole route, can tell you next step how to walk only.

3. Know computer networks

Definition 3.1.

There are several kinds of webs, such as spider webs, interpersonal networks, computer networks, networks of networks (Internet), the Internet. All but the first two are computer networks. But having said so much, it seems that there is no precise definition of what a computer network is? Can we give a precise definition like a mathematical theorem?

I don’t think it’s necessary now. (Definitions can be found in relevant books and online)

For example, when you first had the idea to learn about networking, did the first thing you did (almost reflexively) go online and find out what a network was? This shows that the computer network has penetrated into our life and we can use it very skillfully. So I think when you are learning to plan a web, you don’t have to be obsessed with its definition.

Now, as a beginner, we just need to refer to a computer network, which is associated with a network, and then there are many computers connected together, as shown in Figure 1-4 and Figure 1-6.

Classification of 3.2.

I. Classification according to the scope of the network:

  1. Wide Area Network (WAN) : The application range is tens to thousands of kilometers, which can transport data over long distances.
  2. MAN (Metropolitan Area Network) : Ranges from 5 to 50 km.
  3. Local Area Network (LAN) : This mode is widely used by schools and companies.
  4. Personal Area Network: the scope is small, about 10m, for Personal work.

Ii. Classification by network user

  1. Public network: a large network financed by a telecommunications company that ordinary users can use for a fee.
  2. Private network: a network built by an organization and not available to people outside the organization.

3.3. Performance Indicators

Take people as an example, to measure whether a person is healthy or strong, it is necessary to formulate various indicators, such as height, weight, blood pressure, blood sugar, lung capacity and so on, to measure quantitatively. The same is true for computer networks, namely performance metrics.

Before introducing several performance indicators of computer networks, let’s review the previous analogy:

Nodes are compared to cities, links to expressways, networks to provinces, transmitted data to passenger cars, routers to toll booths on interprovincial expressways, and the Internet to countries.

A rate.

Rate refers to the rate at which data is transmitted, i.e. how many bits of information are transmitted per second, also known as data rate. Because whatever data is being transmitted has to be converted into binary numbers, the units are bit/s or B /s or BPS.

Notice that this is a lowercase B, whereas the MB/s, KB/s that you normally see when you download something is a capital B. The lowercase value is a bit, and the uppercase value is a Byte. 1Byte equals 8 bits.

2. The bandwidth

In computer networks, bandwidth is used to indicate the capacity of a channel in the network to transmit data. That is, the highest data rate that a channel can pass in a network in a unit time. Therefore, the unit is also bit/s.

So the wider the bandwidth, the higher the maximum data rate that can be transmitted.

Bandwidth is similar to the width of a highway, the wider the road, the more cars can pass per unit of time.

Iii. Throughput

Throughput represents the actual amount of data moving through a network per unit of time.

4. Time delay

Delay index The time it takes for data to travel from one end of a network to the other.

The delay can be compared to the total time it takes you to get from your point of departure to your destination on a passenger bus.

(1) Transmission delay: it is the time required by the host or router to send data frames.

Transmission delay = Data frame length (bit)/Transmission rate (bit/s)

The transmission delay can be compared to the time it takes your passenger car to exit a toll booth.

(2) Propagation delay: refers to the time it takes for electromagnetic wave to propagate a certain distance in the channel.

Propagation delay = channel length (m)/propagation rate of electromagnetic wave in the channel (m/s)

The propagation delay can be compared to the time it takes a passenger car (assuming the speed is as constant as an electromagnetic wave) to travel on a highway.

(3) Processing delay: the time it takes for the host or router to process the packet after receiving it.

The processing delay can be compared to the time it takes for a passenger car to pass through a toll booth.

(4) Queuing delay: the queuing time after the packet passes through the router and the queuing time after the processing.

Queuing delay can be compared to the time spent waiting for payment after entering a toll station. If no queuing is required, the queuing delay is 0.

Therefore, total delay = transmission delay + propagation delay + processing delay + queuing delay. The delay of data in the network consists of four parts, not only one part.

Five. Latency bandwidth product

The delay-bandwidth product is the product of propagation delay and bandwidth.

As shown in the figure above, the propagation delay represents the length of the rectangle, and the bandwidth represents the width, so the product of the delay bandwidth is the area.

Vi. Round-trip time RTT

The round-trip time is the time required for two nodes to interact bidirectional once.

Similar to the total time it takes you to travel by bus from the station to your destination and back to the station when you buy a round trip ticket.

Vii. Utilization rate

It is divided into channel utilization and network utilization.

  1. Channel utilization: The percentage of time a channel is used (with data passing). The channel utilization of completely idle channels is 0.
  2. Network utilization: the weighted average of the channel utilization across the network.

The channel or network utilization rate is too high, resulting in very large delay. Therefore, some large backbone ISP usually controls the channel utilization rate not to exceed 50%. If the channel utilization rate exceeds 50%, it is necessary to prepare for capacity expansion and increase the line bandwidth.

It is easy to understand that if there are more cars on the road, it is easy to get stuck in traffic. Either reduce the number of cars on the road, or make the road wider.

3.4. Non-performance indicators

If performance metrics are comparable to the skill level of a player in a kryptonian game, non-performance metrics are comparable to the thickness of a player’s wallet. Yuan players can bridge some of the skill gaps, and if the player is skilled and rich, it’s no longer a problem to dominate the game.

Non-performance indicators include: cost, quality, standardization, reliability, scalability and upgradeability, ease of management and maintenance. These are all obvious nouns; there is no need to explain them.

4. Computer network architecture

4.1. The layered

Observing our real society, we will find that many things have their own architecture, such as society, schools, hospitals, stations, people and so on. These are all complex assemblies, and it is because of the architecture that they can function correctly.

Take the station as an example, there is a lot of passenger flow, but when people get in, they can stay orderly and do what they have to do instead of running around like headless chickens. Because the station is divided into levels, ticket window, security gate, waiting area, boarding area, exit door…… Well ordered.

Passing from bottom to top, passengers can perform part of the movement on each floor, with the lower level serving the upper level without interfering with each other. For example, we cancel the ticket selling window and replace it with a ticket picking machine, which does not affect other levels. We only require that those who pass the security gate can go to the ticket picking machine to pick up their tickets, and those who finish picking up their tickets can go to the waiting area to wait for the bus. In this way, the “big problem” of car travel is divided into a number of smaller problems, which are easier to solve.

The same is true for computer networks, where the architecture is layered. This will allow you to follow the steps shown in Figure 1-12. Stratification of computer network can divide this complex problem into several small problems, which is easy to study and deal with.

4.2. Protocol Layering

The most common thing we do with the Internet is to communicate. What is the communication between two communication entities (say, two computers)? Can they just send a message and receive it? Definitely not.

For example, a and B’s daily conversation (B doesn’t speak English) :

A: Have you eaten yet?

B: Yes.

A: What a nice day!

B: What are you talking about ?????

The same meaning can be expressed in many languages, but PARTY A and Party B cannot communicate without using the same language. Agreement is just like language.

In the Internet, the two communication entities involved are bound by protocols, and protocols are ubiquitous. Protocols define the format and order of messages exchanged between two or more communication entities, as well as the actions taken in sending or receiving messages or other events.

The station in front has been stratified in an orderly fashion. Now layer the protocol (only the five-tier protocol model is covered here).

  1. Application layer: Defines the rules for communication and interaction between application processes.
  2. Transport layer: Responsible for providing common data transfer services for communication between processes in two hosts.
  3. The network layer is responsible for providing communication services, routing, and IP address management for different hosts on the packet switching network.
  4. Data link layer: responsible for transferring data between interconnected devices.
  5. Physical layer: Consider how you can transmit bits of data over the transport medium that connects various computers, rather than the specific transport medium.

4.3. Entities, Services, Agreements, protocol access points

A real.

An entity is a hardware or software process that sends and receives information. Figure 1-13 shows the software process on the user’s computer.

2. Service

In a hierarchical system, each layer has its own function, and the lower layer provides services for the upper layer, but the services provided by the lower layer are not all of its functions. Only the functions seen by the upper level are considered services provided by the lower level.

For example, employees report to their leaders on a regular basis, but the reports are limited and concise. If you report your meals, your eating, your defecating, all the other little things, they’ll open you up.

Three.

A protocol is a collection of rules that govern the communication between two (more) peer entities. Under the control of the protocol, communication between two peer entities enables this layer to provide services to the next layer. To implement this layer protocol, you also use the services provided by the lower layer.

For example, employees need to communicate progress and collaborate to get work done, and then report back to their leaders. However, a leader needs work materials reported by his subordinates to complete his work.

Service access points

The upper layer must use the services provided by the lower layer by exchanging commands with the lower layer — service primitives.

In the same system, the place where two adjacent layers of entities interact is called a Service Access Point (SAP), which is abstract and actually a logical interface.

Figure 1-14 shows the relationship between the four nouns above:

It can be seen that: the protocol is between the peer entities of different systems and is horizontal; Services are vertical between the upper and lower layers of the same system.

This article only introduces some basic concepts, but does not really go into depth. Routers, packet switching, protocols, five-tier models, to name a few. Because really want to understand these, a few words are certainly not enough, for example, the understanding of the five-layer model, you may need to read all five layers, to build a real five-layer model in your mind.

Author’s brief introduction

I am Xing Xiaoguan, and I will keep updating the articles on Java, Go, Data Structure and Algorithms, Computer Fundamentals and so on in my public account “Pedestrian View”.

This article is part of a series called “interesting computer networks”.

Welcome to pay attention, we set foot on the programming journey together.

Please correct me if there are any mistakes.