TCP/IP Detailed Explanation Volume 1 Reading Notes 1

TCP/IP Detailed Explanation Volume 1: Chapter 1

1. Layering

  1. Network protocols are usually developed at different levels, and each layer is responsible for different communication functions.

insert image description here
  Doubtful

  1. Media access control method
      Multiple hosts need to send and receive data through a "shared medium" is called "multiple access/multiple access". If there are two or more hosts sending data on a "shared medium" at the same time, the multi-channel signals will interfere with each other, causing the receiving host to fail to correctly receive any data sent by one host, resulting in conflicts; there are two ways to resolve
      conflicts :
      The first one sets up a central control host computer in the local area network to determine the order of sending data. The advantage of this control method is: simple and effective. The disadvantage is that the central control host may become the bottleneck of LAN performance and reliability.
      The second method is to adopt the method of distributed control, and there is no central control host in the local area network. Instead, each host decides whether to send data and how to deal with conflicts. This method is called "media access control method".
      The bus type Ethernet using the carrier sense multiple access (CSMA/CD) control method with collision detection, referred to as "Ethernet"; the Token
      Bus type (Token Bus) LAN using token control, referred to as "Token Bus" "or "token bus network";
      Token Ring (Token Ring) local area network controlled by tokens, referred to as "Token Ring" or "Token Ring Network".
      Refer to Blog Media Access Control Methods

2. Multiplexing, decomposition and encapsulation in layered implementation

  Protocol Data Unit PDU: protocol Data Unit, if a layer obtains the PDU provided by its upper layer, it usually promises not to check the specific content in the PDU. This is the nature of encapsulation. Each layer treats data from the layer above as opaque information that requires no interpretation. The most common processing is to add its own header in front of the PDU obtained by a certain layer, and some protocols add a tail.

insert image description here

  Encapsulation happens on the sender side, decapsulation happens (restore operation) on the receiver side. Most protocols use headers during encapsulation, and a few protocols also use trailers.

  In pure layering, not all network devices need to implement all layers.

insert image description here
3. Multiplexing, decomposition and encapsulation
insert image description here
  doubts in TCP/IP

  1. Ethernet, ethernet, local area network.
  2. ARP, Address Resolution Protocol, address resolution protocol, is a dedicated protocol for IPV4. It is only used for multi-access link layer protocols (Ethernet and Wi-Fi), and completes the connection between the address used by the IP layer and the address used by the link layer. conversion.
  3. ICMP, Internet Control Message Protocol, Internet Control Message Protocol. It is an auxiliary protocol of IP.
  4. IGMP, Internet Group Management Protocol, Internet Group Management Protocol. This protocol runs between hosts and multicast routers. There are three versions of the IGMP protocol, namely IGMPv1, v2 and v3.
  5. DCCP, Datagram Congestion Control Protocol, datagram congestion control protocol. It provides a type of service between TCP and UDP: connection-oriented, unreliable packet switching, but with congestion control. Congestion control includes a variety of techniques to control the sending rate of the sender to avoid traffic from clogging the entire network.
  6. SCTP, Stream Control Transmission Protocol, Stream Control Transmission Protocol.

4. Port number

  The port number is a 16-bit, two-byte non-negative integer (0--65535). Each IP address has 65536 available port numbers, and each transport protocol can use these port numbers.

  Standard port numbers are assigned by the Internet Assigned Numbers Authority.

  1. Well-known port numbers (0–1023), used to identify many well-known services. eg, FTP (20 and 21), Telnet (23), etc.
  2. Register port numbers (1024–49151), provided to clients or servers with special privileges.
  3. Dynamic/private port numbers (49152–65535), largely unregulated and free to use.

5. Service Model

  Common patterns are client/server and peer-to-peer.

  Most network applications are written assuming that one end is a client and the other end is a server. The purpose is to allow the server to provide some specific services to the client. There are two types of services: iterative and concurrent.
   iterative server

  1) Wait for a client request to arrive.
  2) Handle customer requests.
  3) Send a response to the client that sent the request.
  4) Go back to step 1).

  The main problem with repetitive servers occurs in the 2) state, which takes a long time. At this time, it cannot serve other clients.
  Concurrent server
  1) waits for a client request to arrive.
  2) Start a new server to handle the client's request. During this time a new process, task or thread may be spawned, depending on the support of the underlying operating system. How this step is performed depends on the operating system. The generated new server handles all requests from clients. After processing, terminate the new server.

  3) Go back to 1) step.

  The advantage of a concurrent server is that it handles client requests by spawning other servers. Each client has its own corresponding server. If the operating system allows multitasking, then it is possible to serve multiple clients at the same time.

illustrate:

(1) The reason for classifying servers, rather than clients, is because it is usually not possible for a client to tell whether it is talking to a repeating server or a concurrent server.
(2) In general, TCP servers are concurrent, while UDP servers are repetitive, but there are some exceptions.
  Peer-to-peer mode: P2P, even if the client is also a server, it is mainly a discovery service. That is, how a peer discovers other peers in the network that provide the data or services it needs.

Guess you like

Origin blog.csdn.net/koudan567/article/details/90712983