Test Development Fundamentals | Yiwen Computer Network (1)

Computer network knowledge is a very important basic skill for testers. Whether it is in the usual testing work (such as interface testing), or when testing technical interviews, it will often be involved. Many students with weak foundations rely on cramming to search and learn, and their understanding of system knowledge and key difficulties is always not thorough enough.
This series of articles will take you to start with the most basic network knowledge, learn step by step, and finally understand and master the core knowledge points of computer network, related interview questions and application in testing work.
Network, Internet, Internet, these three terms that are often heard, what is the difference between them? First refer to the following figure

  • Network

  • The computer is formed into a local area network through the switch equipment, generally no more than 100 meters, such as the computer room of the school;

    • Internet (Network of Network)
  • Taking the computer room of a school as an example, the networks between different classrooms can be connected to each other through routers, which is called the Internet; and they can be connected to a long distance through a wide area network.

    • Internet (Internet)
  • The world's largest internet

    • Summarize
    • Network: many computers connected together
    • internet: internet many networks connected together
    • Internet: Internet One of the largest Internet in the world
    • ISP: Telecom operator internet service producer
  • From the above picture, we can clearly see the direct relationship between the network, and it is easy to withdraw cash in real life; for example, when I was in school, the file transfer between classmates and teachers was very fast, because everyone was on the same campus network; For example, when downloading from the network, several download paths are generally provided. Usually, we choose the local download is the fastest.

  • From the actual scene in the figure below, we can clearly see the relationship between ISPs, enterprises and our ordinary netizens:

    • Local area network: buy equipment by yourself, maintain by yourself, fixed bandwidth, 100M 1000M distance within 100 meters
    • WAN: Pay for service, pay for bandwidth
  • 1) Circuit switching - connection oriented

    • Three stages of connection:
    • establish connection
    • communication
    • release the connection
    • shortcoming
    • Computer data is bursty, resulting in low utilization of communication lines
    • Applicable scenario: suitable for real-time transmission of a large amount of data, circuit switching can be used between core routers
  • 2) Packet switching

  • A long piece of message data

  • After grouping, each segment of data is added with a header. The header information contains control information such as addresses
    . The node in the packet switching network slows down and forwards the packet to the next node switch according to the address information in the header of the received packet. In this way of store and forward, the final destination can be finally reached, and then the original message can be recovered by splicing the data according to the header information.

  • advantage:

    • efficient
    • flexible
    • fast
    • reliable
    • shortcoming:
    • delay
    • overhead
  • 3) Message exchange

  • The packet exchange generally sends the entire packet, so that the packet is generally much longer than the packet, and the delay is also longer.

  • Comparison of three exchange methods:

    • 1. Rate:
  • The rate at which a host connected to a computer network transmits bits of data on a digital channel, also known as data rate or bit rate.

  • The unit is b/s, kb/s, Mb/s, Gb/s.

    • 2. Bandwidth:
  • In the field of data communication, the highest data rate that a digital channel can transmit

  • Units are b/s, kb/s, Mb/s, Gb/s

    • 3. Throughput:
  • That is, the amount of data passing through a certain network in unit time

  • Unit b/s, Mb/s, etc.

    • 4. Delay: We often talk about delay, which is the delay here. Then the delays are as follows:
    • Sending delay:
  • When sending data, the time required for the data block to enter the transmission medium from the node;

  • It can be classified as a train leaving the station. The whole train is like a piece of data. Then the train exiting from the platform is like the data block entering the transmission medium from the node. The time it takes to exit the station is 发送时延.

    • Propagation delay:
  • The time it takes for an electromagnetic wave to travel a certain distance in a channel;

  • It's like the time it takes for a train to travel from one station to another.

    • Queue delay:
  • The delay experienced by packet queuing in the node cache queue;

  • This is also a good analogy to the example in life. For example, when we pass the toll booth on holidays, vehicles need to queue up in different lanes to wait for entry. This time period is the queuing delay.

    • Processing delay:
  • The time spent by the switching node to perform some necessary processing for store and forward;

  • We can still take driving into the toll station as an example. After arriving at the toll station, we need to take the card and pay the fee. Even the ETC has to slow down and wait for the pole to be lifted. time to become 处理时延.

    • 5. Delay-bandwidth product:
  • The maximum amount of data that can be transmitted per unit time; just like a road, if it is full of cars, how many vehicles can it carry at most.

    • 6. Round-trip time-RTT (Round-Trip Time)
  • From the sender sending the data, to the sender receiving the receiver acknowledgment

    • 7. Utilization
    • Channel utilization rate: Indicates what percentage of the time a channel is used (with data passing through), and the utilization rate of a completely idle channel is zero.
    • Network utilization: the weighted average of the channel utilization of the entire network
  • As shown in the figure below, when the utilization rate is close to 1, after reaching a certain point, the delay will increase sharply, causing "blocking";

  • Just like a highway, there are usually not many vehicles and the utilization rate is not high, but the speed of the vehicle is fast and the operation is smooth; and during holidays, because of the free and increased travel, the utilization rate of the road may be greatly increased, but the smoothness of the peers is also Greatly reduced (I have experienced the painful experience of driving for 16 hours in a normal four or five hour drive~~, the delay is too long)

  • here:

  • Program developers mainly consider the first three layers: application layer - presentation layer - session layer

  • Network engineers mainly consider: transport layer - network layer - data link layer

    • The meaning and necessity of stratification
    • The layers are directly independent of each other
    • good flexibility
    • structurally separable
    • Easy to implement and maintain
    • can promote standardization
    • real life example
  • Here is an example from real life:

    • For example, there is a product that needs to be packed and sent from Beijing to Shanghai. The following steps are required:
  • Merchant packs the goods - the courier packs the goods - the goods are transported to the railway station by car - the goods are then sent to Shanghai by train

    • There are many ways to improve the efficiency of goods delivery here:
    • Then we found that no matter which method is used, it is an independent step and does not affect other steps; management optimization can be carried out in its own "layers", and each layer has its own way of working.
    • Merchant packaging is accelerated
    • The courier brother is more skilled in packing
    • Build more viaducts and expressways for urban traffic
    • train speeding up
  • For the relationship between protocol layers, since the content of this article is based on Xie Xiren's "Computer Network", the explanation in the book is directly borrowed here, as follows:

  • Host 1 sends data to Host 2

    • Host 2 receives data from Host 1
  • The process of receiving is just the opposite of sending, and the first part will be removed and decapsulated.

  • For specific drawings, refer to the above

  • 1. Application layer (data): Determine the nature of communication between processes to meet user needs and provide network and user applications

  • 2. Presentation layer (data): mainly solves the problem of grammatical representation of support information, such as encryption and decryption

  • 3. Session layer (data): Provides mechanisms for establishing and maintaining communication between applications, including access authentication and session management.

  • If the server authenticates the user login, it is done by the session layer

  • 4. Transport layer (segment): realize data communication between user processes on different hosts on the network, reliable

  • with unreliable transport, error detection at the transport layer, flow control, etc.

  • 5. Network layer (packet): Provide logical address (IP), routing, data from source to destination

  • transmission

  • 6. Data link layer (frame): encapsulate the upper layer data into frames, access the medium with the MAC address, error detection and correction

  • 7. Physical layer (bit stream): transmission of bit stream between devices, physical interface, electrical characteristics, etc.

  • 8. Gateway: application layer, transport layer (gateway is on the transport layer to realize network interconnection and is the most complex network interconnection device, only used for the interconnection of two different high-level protocols. The structure of the gateway is also similar to that of a router. , the difference is the interconnection layer. The gateway can be used for both WAN interconnection and LAN interconnection)

  • 9. Router: Network layer (routing, store and forward)

  • 10. Switch: data link layer, network layer (identify the MAC address information in the data packet, and enter the data according to the MAC address.

  • line forwarding, and record these MAC addresses and corresponding ports in an internal address table)

  • 11. Bridge: data link layer (connects two LANs and forwards frames based on MAC addresses)

  • 12. Hub: physical layer (pure hardware device, mainly used to connect network terminals such as computers)

  • 13. Repeater: Physical layer (regenerates and retimes network signals at the bit level so that they can

  • longer distances over the network)

  • This article mainly refers to Xie Xiren's textbook of "Computer Network", and the interview questions are related to the Internet.
    I recommend the Hogwarts "Python Test Development Practical Advanced" class, which may be the most in-depth test development course in the industry and closest to the first-line practice of major manufacturers.

Improve your core competitiveness

More technical articles to share

Guess you like

Origin blog.csdn.net/hogwarts_2022/article/details/124315445