What is a computer network?

Wikipedia defines it as:

Computer network (English: Computer network), often referred to as a network, is a digital telecommunications network that allows nodes to share resources. In computer networks, computer devices exchange data with each other through connections between nodes (data links).

In plain English, a system that connects two or more computers so that they can communicate with each other.

How do you connect the computers?

A direct connection

In the simplest case, a single wire is used to connect two computers that need to communicate. The wire and the two computers form a simple network.

This connection line is usually a cable, optical fiber and other media, generally called a link link, and the computer in the network is generally called a node node.

This method of connecting two computers directly on one link is called point-to-point connection. Another method of connecting multiple computers to the same link is called multiple-access, such as Wi-Fi.

However, this connection mode has two limitations. One is that the coverage of the network is limited, and the other is that the number of nodes that can be connected is limited. Therefore, this connection mode is generally used to connect the end user to the Internet in the last mile.

The indirect connection

Of course, it is possible for two computers to communicate with each other through a link, but this only applies when there are only a few computers in the network.

If you have a lot of computers to communicate with, the number of wires on each computer becomes unmanageable.

This is still only a few computers, and the wiring looks messy, but if you imagine a real computer on the Internet being connected in this way, it’s a little out of control.

Fortunately, in order for two computers to communicate with each other, we don’t have to connect them directly through a link. We can also connect them through an intermediate node.

In this way, each node is connected to one or more links. The nodes that are connected to two or more links (the routers in the figure) are responsible for forwarding incoming messages out. Together, these routers can form a switched network. Networks can be nested).

The clouds in the figure divide nodes into two types:

  • Nodes in the cloud: responsible for forwarding messages, commonly calledSwitch the switch.
  • Nodes outside the cloud: These are computer devices that want to send or receive messages from outside the cloud, commonly called nodesHost the host.

There is also a way to connect multiple computer devices. We can abstract the switching network and connect them in pairs with a single node, which forms the Internet. The nodes that connect the two networks are usually called routers or gateways. They function like switches, forwarding messages from one network to the other.

The Internet itself is a network, so they can also be abstracted and then connected by nodes to form a larger network, and in short, it can be a recursive process, so in theory, we can build networks that are infinitely large.

How do computers communicate?

Now we have all computers connected in some direct or indirect way, but we haven’t implemented host-to-host connectivity yet. Suppose computer A wants to send A message to computer B. How do you find A route through the network to computer B to transmit the message?

The solution is to assign a unique address to each host on the network. When the source machine wants to send a message to the destination machine, it sends both the message and the address of the destination machine. If the source machine and the destination machine are not directly connected, The switch and route in the network will decide how to forward the message according to the specified address, and finally find the destination machine and forward the message to it. The process of determining how to forward messages based on the specified address is called routing.

summary

A network can be recursively defined as a network consisting of two or more nodes connected by links or consisting of two or more networks connected by nodes.