【Computer Network】Simple Analysis of Data Flow

introduction

There are many protocols, many hardwares, related algorithms, and related models in computer networks. In short, there are many theories and abstractions;

Therefore, from the perspective of data, analyze the entire transmission process, and then discover the meaning of each division, each hardware, and each algorithm;

The purpose of writing these is to use a line to connect all the core points, and the rest are more serving this framework and are implemented in different forms;


 

application layer

The user uses various applications to generate some data that needs to be transmitted;
after generating the data, he intends to send it to the target, but there are thousands of machines in the middle, and he does not know what program the other party uses to receive it;
fortunately, the program is different, but according to The protocol and port are still the same;
then, the IP, port and data of both parties are assembled into a new data and submitted to the transport layer;

write picture description here

 

transport layer

After the transport layer receives the application layer data, it intends to send the new data generated to the target application process;
however, there may be problems in the subsequent transmission process of the data, so the reliability of data transmission must be ensured at this layer;
here The application layer data is re-blocked and split, and some header tags are added to ensure its reliability. There are two ways to reassemble the application layer data;

TCP method
write picture description here

UDP method
write picture description here

 

Network layer

After the network layer receives the data of the transport layer, it intends to send the generated new data to the target;
however, the network types, routers, and protocols responsible for transmitting the data are different, so this layer must ensure that the data can be transmitted in the past;
First, the local network layer hardware first adds a header tag, and then transmits it to the adjacent hardware devices;
each hardware (bridge, router, gateway) of the subsequent network layer removes the data transmitted by other hardware and labels them with the header tag , and then label it with its own header, and then pass it to the next hardware;
here is a simple list of several data in the transmission process;

After native network layer processing
write picture description here

Local discovery and router connection using LLC
write picture description here

The router discovers the X25 used by the next router
write picture description here

 

data link layer

After the data link layer receives the network layer data, it also knows who to pass to the next one according to the routing told by the network layer, and now plans to send the generated new data to the following hardware devices;
however, there may be chaos during the transmission process. Therefore, this layer must ensure the reliable transmission of data;
at this layer, the data transmitted by the network layer has become 01 strings, and the data link layer is to send these 01 strings in batches to the The next hardware, at the same time add some header tags at the beginning and end to ensure the reliability of the data, and the unit of the amount of data sent each time is called a frame; of
course, the frame format of different protocols or different hardware is different, the following are several frame formats data;

HDLC Frame Format - FAC-I-FCS-F
write picture description here

PPP frame format - FAC-PI-FCS-F
write picture description here

 

physical layer

After the physical layer receives the data from the data link layer, it starts to transmit data. The current data is a pure 01 string;
however, the hardware used to transmit data cannot transmit 0 and 1, but they can transmit other signals. to replace 0s and 1s, and then the hardware that receives the signals converts those signals into 0s and 1s;

Here are several ways to encode 0 and 1 according to different hardware:

  • Unipolar non-return-to-zero code: 0-below half level; 1-above half level;
  • Bipolar non-return-to-zero code: 0-negative current; 1-positive current;
  • Unipolar return-to-zero code: 0-no current; 1-positive current;
  • Bipolar return-to-zero code: 0-negative pulse; 1-positive pulse;

 

summary

In fact, the real flow of data is that after a computer generates data, it is converted into 01 strings, converted into physical signals, transmitted from one machine to another machine, and finally passed to the target computer;

The data has undergone the data transformation of the application layer-transport layer-network layer-data link layer-physical layer on the local computer, and then transmitted to the nearby router through the physical device;

The router converts electrical signals (or optical signals) into 01 strings, and then transforms upwards into physical layer-data link layer-network layer data, then finds the next physical device, and transforms downward into network layer-data link layer- The data of the physical layer, and then transmit the specific physical signal;

Finally reach the target host, the physical signal is converted into 01 string, and then the data is transformed into the data of the physical layer-data link layer-network layer-transport layer-application layer, find the specific program and port, and convert it into a display that users can understand form;

From the perspective of data flow, we can better understand the abstract concepts in computer networks, because the core purpose of computer networks is to transmit data;

Then, following the flow of data, you can know what each layer is doing, and also know where each layer is embodied, what devices are there, what protocols are used, and what functions are implemented.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325386566&siteId=291194637
Recommended