One, foreword

Computer network should be a programmer must be able to know the knowledge, the reality is also everywhere use the network, so here summarizes the relevant knowledge points of the network, the follow-up learning process will continue to update, I hope to let myself more in-depth understanding of the computer network related knowledge.

Ii. Internet and the Internet

Internet: A network of interconnected computers.

Internet: A term for the world’s largest, open, specific computer network connected by many networks. It uses THE TCP/IP protocol family as the communication rules, and its predecessor is ARPANET in the United States.

The fringe and core of the Internet

The edge is the host (such as mobile phone, computer) and the core is the network and router.

The main functions of a router are as follows: Implements packet switching and forwards received packets.

Fourth, exchange technology

What is an exchange? It is the dynamic allocation of transmission line resources.

(1) Circuit switching

For example, the information transmission between telephone and telephone is in the form of circuit exchange. It is ok to connect them directly with wires, but every two devices must be connected by telephone, and each device must have a lot of interfaces, which is impossible.

So we chose to put the switch in the middle.

This is what happens if you use circuit switching in real life.

This way of circuit communication can certainly ensure the stability of communication, but it also has its disadvantages. The transmission of computer data is sudden. If A and B establish A connection, they can certainly ensure their communication, but how much data is transmitted in the process of establishing A connection? If you pass a lot of data all of a sudden, and then it doesn’t pass for a long time, and then it passes again, then the connection stays occupied, and other devices can’t connect, and that leads to very low utilization.

(2) Packet switching

Another type of switching technology is packet switching, which converts longer messages into shorter, fixed-length data segments.

Translation:

The sender transmits the packet as a data segment of fixed length, and the receiver converts the data segment into the previous packet.

In this way, the header of each packet contains the source address and destination address, and each packet is sent independently, so that it can be transmitted in different transmission paths.

How does a router work?

First, the router puts the received packets into the cache for temporary storage, searches the forwarding table, finds out which port to start from to a certain destination, and forwards the ports sent by the packets.

However, packet switching also has certain problems. Each storage location needs to queue for forwarding, which will cause delay.

(3) Message exchange

As the name suggests, it was the old way of sending telegrams, which were also sent in segments. Also known as store and forward.

(4) Schematic diagram of three switching technologies

Obviously, circuit switching is the connection is established and then the entire message is sent in the past, message switching is to put the message into a small part to send, but due to time delay, time may be longer than those of circuit switching, and packet switched split more detailed, so that each part of the waiting time is shorter, but also can realize reuse, the efficiency is very high.

Categories of computer networks

(1) Classification according to scope of action

  • WAN (Wide Area Network) : The range is usually tens to thousands of kilometers.
  • MAN (Metropolitan Area Network) : The range is about 5 to 50 km.
  • Local Area Network (LAN) : Limited to a small Area (for example, about 1 km).
  • PAN (Personal Area Network) : The range is small, about 10 meters.

It’s actually impossible to make that distinction.

(2) Classification according to network users

  • Public network A network available to all who pay a prescribed fee. Therefore, it can also be called a public network.
  • Private network A network built to meet the needs of a particular service.

6. Performance indicators of computer networks

How do we judge a network?

Rate: Data transfer rate, expressed in bit/s. Often said that the network fast and this has a lot to do with.

Bandwidth: Indicates the highest data rate that a channel can pass in a unit of time. The unit is bit/s.

Throughput rate: indicates the amount of data passing through a network (channel, interface) in a unit time. Represents how much data actually passes through the network.

Delay: The time it takes for data (a message or packet, or even bits) to travel from one end of a network (or link) to the other. Transmission delay, propagation delay, processing delay, queuing delay; Just like express delivery, it takes a lot of time to wait for the delivery, wait for the delivery after arriving at the destination, and finally queue for the delivery, all of which are time-consuming.

Latency bandwidth product: The latency bandwidth product of a link is also called the link length in bits.

Round trip time RTT: Indicates the total time elapsed from the time when the sender sends data to the time when the sender receives an acknowledgement from the receiver. Because data is sent and received in both directions.

Utilization: it is divided into channel utilization and network utilization. Channel utilization indicates the percentage of time a channel is used (with data passing). A completely idle channel has zero utilization. Network utilization is the weighted average of channel utilization of the whole network. Higher channel utilization is not always better. When the utilization of a channel increases, the delay caused by the channel increases rapidly.

According to queuing theory, when the utilization of a channel increases, the delay caused by the channel increases rapidly.

If D0 represents the delay when the network is idle and D represents the current delay of the network, the following simple formula can be used to represent the relationship between D and D0 under appropriate assumptions:

Relationship between delay and network utilization:

Stratification of computer networks

1. Formation of computer network architecture

A computer network is a very complex system, so to fully understand it and be able to operate it, you need to layer it. It is transformed into several smaller local problems, and these smaller local problems are easier to study and deal with, so as to coordinate all parts of the network.

As all countries want to develop corresponding network standards to win the right to speak on the network, many companies have launched their own standards. Due to the difference in network architecture, it is difficult for devices of different companies to communicate with each other. To unify networks, the International Organization for Standardization (ISO) proposed the Open Systems Interconnection Reference Model (OSI/RM).

But that model didn’t go well, and we all used TCP/IP.

Agreement division:

2. General steps of data transmission

Step 1: The application process data is sent to the application layer and the application layer header is added to form application layer PDUs.

Step 2: The APPLICATION layer transmits the PDU to the transport layer.

Step 3: The transport layer transmits the packets to the network layer.

Step 4: IP datagrams are retransmitted to the data link layer.

Step 5: Data link layer frames are transmitted to the physical layer.

Step 6: Electrical signals (or optical signals) propagate in the physical media, from the sender physical layer to the receiver physical layer.

And then you upload it back.

Step 7: The physical layer receives the bitstream and forwards it to the data link layer.

Layer 8: Data link layer strips the front and tail of frames, takes out the data part, and delivers it to the network layer.

Layer 9: The network layer strips the head and takes out the data part and hands it to the transport layer.

Tenth layer: transport layer strip the head, take out the data part and hand it to the application layer.

Layer 11: The application layer strips off the header and takes out the application data and presents it to the application process.

The technical principles and steps of each layer will be introduced one by one.