Record review notes, learning video from bi station “king one’s deceased father grind” : www.bilibili.com/video/BV19E…

Reference books: Illustrated TCP/IP, Computer Networks-Xie Xiren

1. Computer network related concepts

1. Computer Network:

Computer network is a collection of computer systems that are scattered in different places and have independent functions, connected with each other by communication equipment and communication lines, and carried out data communication under the support of network protocols and software to achieve information transmission and resource sharing. In short, a computer network is an interconnected, autonomous collection of computers.

2. Composition of computer network:

From the component point of view, a complete computer network is mainly composed of hardware, software and protocol.

  1. Hardware: consists of a number of nodes and links connecting these nodes; The nodes can be computers, hubs, switches, routers, and so on
  2. Software: Exchange information over the network
  3. Protocol: Communication protocol – Rules

From its way of working, computer networks can be divided into the following two chunks:

  • Edge: Consists of all hosts (end systems) connected to the Internet (networks of computers connected by routers to form the larger network, the Internet, which is a network of networks). This part is directly used by users and uses the services provided by the core part for communication and resource sharing.
  • Core: consists of a large number of networks and the routers that connect them. This part serves the edge part (providing connectivity and switching), and the router is the key.

At the edge of the Internet are all the hosts connected to the Internet. These hosts are also called end systems. When we say “host A communicates with host B “, we really mean” A process of host A communicates with another process of host B “, which is often called “communication between computers”. The communication modes between the end systems on the edge of the network can be divided into the following two categories: client-server mode (C/S mode) and peer-to-peer mode (P2P mode)

  • Client-server mode (C/S mode) : The client is the service requester and the server is the service provider.
  • Peer-to-peer connection (P2P) : The communication between two hosts does not distinguish between service requesters and service providers.

3. Functions of computer networks

  • Data communication

    It is the most basic and important function of computer network, which is used to realize the transmission of all kinds of information between networked computers, and connect the computers scattered in different geographical locations for unified deployment, control and management. For example, applications such as file transfer and E-mail cannot be implemented without a computer network.

  • Resource sharing

    Resource sharing can be software sharing, data sharing, or hardware sharing. Make the resources in the computer network mutually available, division of labor cooperation, thus greatly improve the utilization rate of hardware resources, software resources and data resources.

  • Distributed processing

    When a computer system in the computer network is overloaded, a complex task can be assigned to other computer systems in the network, so that the utilization rate of the whole system can be improved by using idle computer resources.

  • High availability

    Each computer in a computer network can substitute for each other through the network.

  • Load balancing [e.g. Nginx]

    Distribute work tasks evenly to each computer in the computer network.

The two most important functions are data communication and resource sharing. According to these two functions, we can divide computer networks into communication subnets (to achieve data communication) and resource subnets, as shown in the following figure

4. Categories of computer networks

According to the scope of the network:

  • Wide area network (WAN) : the scope of tens to thousands of kilometers, is the core part of the Internet, its task is to transport the data sent by the host computer through long distance, WAN nodes use high-speed links, there is a large communication capacity [switching technology]
  • Metropolitan Area Network (MAN) : connects multiple Local area networks (Lans) in a city using the Ethernet technology
  • Local area network (LAN) : The scope of action is about 1km, generally connected by a microcomputer or workstation through high-speed communication lines
  • Personal Area network (PAN) : with a scope of about 10m, it connects the personal equipment in the place where individuals work with wireless technology, also called Wireless Personal Area Network (WPAN).

By network user:

  • Utility network: a large network financed by a telecommunications company that anyone can pay to use. Also called a public network
  • Private network: a network established to meet special service needs and not provided to outsiders

A network used to connect users to the Internet:

  • Access network AN: also called local access network or resident access network

By switching technology:

  • Circuit switching, message switching, packet switching

Classification according to topological structure:

  • Bus, star, ring, mesh (often used in wide area networks)

By transmission technology:

  • Broadcast network: Shared common communication channels
  • Point-to-point networking: Uses packet store-and-forward and routing mechanisms

5. Performance indicators of computer networks

  1. Rate: The rate at which exponential data is transmitted, also called data rate or bit rate (bit: 0/1), expressed in bit/s (b/s or BPS). 【 1 byte = 8 bit 】

  2. Bandwidth: In computer networks, bandwidth represents the capacity of a network’s communication lines to transmit data, usually the “highest data rate” that can pass a channel in the network per unit of time; The unit is “bits per second,” or the maximum speed that a network device can support.

  3. Throughput: indicates the actual amount of data passing through a network (or channel, interface) in unit time;

  4. Delay: The time it takes for data to travel from one end of the network to the other. Including transmission delay, propagation delay, processing delay and queuing delay;

  5. Delay-bandwidth product: delay-bandwidth product = propagation delay * bandwidth;

  6. Round-trip time (RTT) : the time required for a two-way exchange of information on the Internet;

  7. Usage: The higher the usage, the higher the delay.

2. Computer network architecture

2.1. Standardization of computer networks and related organizations

All Internet standards are published on the Internet in the form of Request For Comments (RFC), but not every RFC is an Internet standard. RFC needs to go through the following four stages to become an official standard of the Internet.

  1. Internet Draft. This stage is not yet a formal RFC document.
  2. The Proposed Standard. From this stage on it becomes an RFC document.
  3. Draft Standards.
  4. Internet Standard.

Standardization organizations responsible for the formulation and implementation of relevant network standards are mainly as follows:

  • International Organization for Standardization (ISO) : as long as the development of network standards or specifications OSI reference model, HDLC and so on.
  • International Telecommunication Union (ITU) : Formerly known as the International Telephone and Telegraph Advisory Committee (CCITT), itU-T, its sub-body, produces a large number of standards for telecommunication.
  • The International Institute of Electrical and Electronics Engineers (IEEE) : The world’s largest professional and technical association of computer and engineering professionals. The most famous research achievement of IEEE in the field of communication is the 802 standard.

In order to make the computer network of different architecture can be interconnected, the international organization for Standardization (ISO) puts forward a standard framework, the basic reference model of open system interconnection (OSI), which can make all kinds of computers interconnect into a network in the world. In this way, as long as the OSI standard is followed, a system can communicate with any other system located anywhere in the world that also complies with the same standard. The so-called OSI seven-layer protocol architecture was formed in 1983, but for various reasons failed to become a global standard, while TCP/IP is often referred to as the de facto international standard

2.2 Protocol and Hierarchy

1. What is network protocol?

In order to exchange data methodically in a computer network, there are some agreed rules that must be followed. These rules specify the format of the data to be exchanged and the associated synchronization issues. Synchronization here is not in the narrow sense (i.e. same frequency or same frequency in phase) but in the broad sense of what should happen under certain conditions (e.g., a response message should be sent), and thus synchronization implies timing. These rules, standards, or conventions established for the exchange of data on a network are called network protocols. Network protocols can also be referred to simply as protocols.

Components of network protocols

  • Syntax, the structure or format of data and control information;
  • Semantics, that is, what kind of control information needs to be sent, what kind of action needs to be completed and what kind of response needs to be made;
  • Synchronization is a detailed description of the order in which events are implemented

2. Network protocol hierarchy division

Why layering?

We can use a simple example to illustrate the concept of hierarchy. Now suppose we transfer files over a communication network between host 1 and host 2. This is a complicated job because there is a lot of work to be done. We can divide the work we are going to do into three categories. The first type of work is directly related to the transmission of documents. For example, a file transfer application on the sending side should be confident that the file manager on the receiving side is ready to receive and store files. If the file format used by the two hosts is different, at least one of the two hosts must convert the file format. A file transfer module can do both of these tasks. Thus, the two hosts can use the file transfer module as the highest layer (Figure 1-17). The dotted line between the two modules represents the two host systems exchanging files and some commands for file swapping.

However, we don’t want the file transfer module to do all the details, which would make the file transfer module too complicated. You can also set up a communication service module to ensure that files and file transfer commands are reliably exchanged between the two systems. That is, let the file transfer module above take advantage of the services provided by the communication service module below. We can also see that if the file transfer module above is replaced by the E-mail module, the E-mail module can also take advantage of the reliable communication services provided by the communication service module below it.

Similarly, we construct a network access module, let this module is responsible for the work related to the details of the network interface, and provide services to the upper layer, so that the communication service module above can complete the task of reliable communication.

Basic principles of layering

  • The layers are independent of each other. A layer does not need to know how its next layer is implemented, but only the services it provides through the interfaces (interfaces) between layers. Because each layer implements only one relatively independent function, it is possible to decompose a difficult and complex problem into several smaller problems that are easier to deal with. So the complexity of the whole problem goes down.

  • Good flexibility. When any layer changes (for example due to a change in technology), the layers above or below are not affected as long as the layer interface relationship remains unchanged. In addition, the services provided by a layer can be modified. A layer can even be removed when services provided by it are no longer needed.

  • Structurally separable. Each layer can be implemented using the most appropriate technology.

  • Easy to implement and maintain. This structure makes it easy to implement and debug a large and complex system because the whole system has been decomposed into several relatively independent subsystems.

  • Can facilitate standardization work. Because the functionality of each layer and the services it provides have been precisely defined.

  • Each layer follows certain network protocols to fulfill its functions

The set of layers and protocols of a computer network is the architecture of a network. Put another way, the architecture of a computer network is a precise definition of what the network and its components should do.

2.3 computer network hierarchical structure model

OSI’s seven-layer protocol architecture is clear in concept and complete in theory, but it is complicated and impractical.

The TCP/IP architecture, however, is now very widely used. TCP/IP is a four-tier architecture consisting of the application layer, transport layer, Internet layer, and network interface layer (the name Internet layer emphasizes that this layer is used to solve the problem of interconnecting different networks).

But in essence, only the top three layers of the TCP/IP, because of the network interface layer on the bottom of the basically and general there is no much difference, the function of the communication link for computer network, this layer and no special new concrete content, so in the study of computer network principle is often USES the compromise, That is, combining the advantages of OSI and TCP/IP, using a five-layer protocol architecture, which is both concise and can explain the concept clearly.

1. 7-layer OSI reference model

The OSI seven-layer model consists of seven layers, including the physical layer, data link layer, network layer, transport layer, session layer, presentation layer and application layer. The lower three layers are collectively called communication subnets, which are additional communication devices for networking and complete data transmission. The third layer is collectively referred to as the resource subnet, which is equivalent to a computer system to complete data processing and other functions. The transport layer connects the preceding and the following.

The OSI hierarchy is shown below:

Let’s use an example to illustrate the communication process of application process data between layers in the seven-layer model. Suppose two hosts are connected through an intermediate system router:

The intermediate system has only the lower three layers, so the third layer of the whole communication can be regarded as end-to-end communication, while the lower three layers can be regarded as point-to-point communication. The whole process can be understood as packing and unpacking operations

While app data needed to pass through a complex process like the one pictured above to reach the other app, those complicated processes were blocked out to users, so that app subjects AP1 felt like they were giving data directly to the app subjects AP2. Similarly, between any two identical levels (for example, layer 4 of two systems), data (i.e., data unit SDU plus control information PCI) can be passed directly to each other as shown by the horizontal dotted line in the figure. This is called “peer” communication. The layers of protocol that we often refer to are really the rules for transferring data between peer layers.

Detailed OSI reference model layers:

Reference links: blog.csdn.net/cl19950327/…

(1) Physical Layer

How can consider is the physical transmission media on a variety of computer to transmit data bit stream, not a specific transmission media, the task is to block out as much as possible of the physical transmission media and means of communication, make the data link layer above the physical feeling less than these differences, the need to consider this layer protocols and services, Regardless of the specific transmission media and means of communication. The physical layer transmits data in bits. The sender sends 1 or 0, and the receiver receives 1 or 0. The physical layer needs to consider how much voltage to represent 1 or 0. The intermediate device used by the physical layer is the forwarder.

(2) Data Link Layer

The task of the data link layer is to assemble IP datagrams handed over by the network layer into frames and transmit frames on the link between two adjacent nodes. Each frame includes data and necessary control information (synchronization information, address information, error control, etc.). The protocols of the data link layer include PPP, CSMA/CD, etc. The intermediate devices used by the data link layer are Bridges or Bridges.

(3) Network Layer

The task of the network layer is to provide communication services for different hosts on the packet switching network. When sending data, the network layer encapsulates the packet segments or user datagrams generated by the transport layer into packets or packets for transmission. Another task of the network layer is to select an appropriate route so that packets passed down from the source host transport layer can find the destination host through routers in the network. The protocols at the network layer include IP, ARP, ICMP, and IGMP. The intermediate device used by the network layer is the router.

(4) Transport Layer

The transport layer is responsible for providing a common data transfer service for communication between two host processes. Transport layer agreements mainly include

  • Transmission control protocol (TCP), which provides connection-oriented and reliable data transmission service, data transmission unit is segment;
  • User datagram protocol (UDP), which provides a connectionless, best-effort data transfer service in the form of user datagrams.

(5) Session Layer

The session layer allows sessions between processes on different hosts. The session layer uses the end-to-end services provided by the transport layer to provide its value-added services to the presentation layer. This service is mainly for the presentation layer entities or process users to establish a connection and orderly transfer of data on the connection, which is called the session, also known as the establishment of synchronization (SYN).

The session layer manages the session processes between hosts, including establishing, managing, and terminating sessions between hosts. The session layer can use the check point to make the communication session resume communication from the check point when the communication fails to realize data synchronization.

(6) Presentation Layer

The presentation layer deals primarily with the representation of information exchanged between two communication systems. Different machines adopt different coding and representation methods, and use different data structures. In order to make the data and information of different representation methods can be exchanged, the representation layer uses abstract standard methods to define the data structure, and adopts the standard encoding form. Data compression, encryption, and decryption are also data representation variations that can be provided by the presentation layer.

(7) Application Layer

The application layer is the highest layer of the OSI model. The task of the application layer is to complete a specific network application through the interaction between application processes. Application layer protocols define rules for communication and interaction between application processes. By process, I mean the programs that are running on the host. Different application layer protocols are required for different network applications. There are many application layer protocols in the Internet, such as domain name system DNS, HTTP protocol to support world Wide Web applications, SMTP protocol to support E-mail, and so on. The data unit of application layer interaction is message.

The type of data transferred by the tier 5 model

OSI reference model Transmission units at all levels [PDU type]
The application layer message
The transport layer Message segment
The network layer IP datagrams, grouping (if IP datagrams are too large, split into groups)
Data link layer frame
The physical layer bitstream

Layer 4 TCP/IP model

From: blog.csdn.net/qq_42240729…

ARPR proposed TCP/IP model when studying ARPAnet. The model from low to high is network interface layer (corresponding to the physical layer and data link layer in the OSI reference model), Internet layer, transport layer and application layer (corresponding to the session layer, presentation layer and application layer in the OSI reference model).

The following figure shows the TCP/IP hierarchy and the main protocols at each layer:

  • Interfaces at the network layer function similarly to the OSI physical layer and data link layer. It represents the interface to the physical network, but TCP/IP itself doesn’t really describe this, just that the host must use some protocol to connect to the network and pass IP packets over it. The specific physical network can be either a variety of lans, such as token ring network, token bus network, etc., or a public data network such as telephone network, SDH, X.25, frame relay, and ATM. The role of the network interface layer is to receive IP packets from hosts or nodes and send them to the specified physical network.

  • The Internet layer (host-host) is a key part of the TCP/IP architecture. It is very similar in function to the OSI network layer. The Internet layer sends packets to any network and independently selects suitable routes for them, but it does not guarantee the orderly arrival of each packet. The orderly delivery of each packet is the responsibility of the higher level. The Internet layer defines the standard grouping format and protocol, IP. The current VERSION of IP is version 4, or IPv4, and the next version is IPv6.

  • The transport layer (application-application or process-process) also functions like the OSI transport layer, even though peer entities on the sending and destination hosts are talking to each other. The transport layer mainly uses the following two protocols :(1) Transmission Control Protocol (TCP). It is connection-oriented and the unit of data transmission is message segments, providing reliable delivery. (2) User Datagram Protocol (UDP) It is connectionless, the unit of data transfer is the user datagram, and reliable delivery is not guaranteed, only “best effort delivery” is provided.

  • The application layer (user-user) contains all high-level protocols, such as Virtual Terminal Protocol (Telnet), file Transfer Protocol (FTP), Domain Name Resolution Service (DNS), E-mail protocol (SMTP), and Hypertext Transfer Protocol (HTTP).

3. Summary of hierarchical structure

Layer 4 and 5 reference models

2.4. Comparison between TCP/IP model and OSI reference model

Similarities:

  • Both take a layered architecture that divides large, complex problems into smaller, more manageable problems, and the layered functionality is broadly similar.
  • Both are based on the concept of a separate protocol stack.
  • Both can solve the interconnection of heterogeneous networks and realize the communication between computers produced by different manufacturers in the world.

The difference:

  • The greatest contribution of the OSI reference model is the precise definition of three main concepts: services, protocols, and interfaces, which fits well with modern object-oriented programming thinking. However, TCP/IP model does not clearly distinguish between these three concepts, which does not accord with the idea of software engineering.

  • The OSI reference model was created before the invention of the protocol, without bias to any particular protocol, and has good universality. But designers don’t have much experience with protocols and don’t know which features to put in which layers. The TCP/IP model is the opposite. The protocol comes first. The model is actually a description of the existing model, so there is no case that the protocol cannot match the model.

  • In the design of TCP/IP model, the interconnection of heterogeneous networks is considered, and the network protocol (IP) is considered as a separate important layer.

  • The OSI reference model supports wireless and connection-oriented communication at the network layer, but only connection-oriented communication at the transport layer. The TCP/IP model considers that reliability is an end-to-end problem, so it has only one connectionless communication mode in the Internet layer, but the transport layer supports two connectionless and connection-oriented modes.