Linux network cable/network card/interface/hub/switch/router and other functions and underlying structure, architecture diagram, working principle

  1. Network cable and network card

Network cables and network cards are the most basic physical and hardware devices in computer networks, which are used to connect computers and networks. The underlying structure of the network card includes the physical layer, data link layer and network layer. The physical layer is responsible for converting data into electrical signals and sending them to the network cable. The data link layer is responsible for dividing the data into frames and adding MAC addresses. The network layer is responsible for adding IP addresses and other network protocols to the data. They have a wide range of usage scenarios and can be applied to various scenarios such as homes, offices, and data centers. For example, in a home network, multiple computers can be connected in the same local area network by connecting network cables and network cards to realize the functions of sharing files and printers.

  1. Network Interface

A network interface is a software interface used to connect to a network in a computer network, usually provided by an operating system. In the Linux system, the underlying structure of the network interface includes the network card driver, network protocol stack and socket interface. The network card driver is responsible for controlling the hardware of the network card, the network protocol stack is responsible for processing network protocols, and the socket interface is responsible for providing network services. Their usage scenarios include network configuration, network management, network diagnosis, etc. For example, in a Linux system, you can use the ifconfig command to configure parameters such as the IP address, subnet mask, and gateway of the network interface.

  1. Hub

Hub is a network device used to connect multiple devices in a computer network, also known as a hub. The underlying structure of Hub includes physical layer and data link layer. The physical layer is responsible for connecting multiple network cables together to form a logical network, and the data link layer is responsible for broadcasting data to all connected devices. Their usage scenarios are relatively simple and are usually applied in small networks. For example, in a home network, you can use the Hub to connect multiple computers in the same LAN to share files and printers.

  1. switch

A switch is a network device used to connect multiple devices in a computer network, and can forward a data packet to a specific device according to the destination address of the data packet. The underlying structure of the switch includes the physical layer, data link layer and network layer. The physical layer is responsible for converting data into electrical signals and sending them to the network cable. The data link layer is responsible for dividing the data into frames and adding MAC addresses. The network layer is responsible for adding IP addresses and other network protocols to the data. A switch increases the efficiency and security of a network because it prevents packets from being received and processed by unrelated devices. They are used in a wider range of scenarios and are usually used in small and medium-sized networks. For example, in an enterprise's internal network, switches can be used to connect computers in different departments to different VLANs to improve network manageability and security.

  1. router

A router is a network device used to connect multiple networks in a computer network, and can forward data packets to a specific network according to the destination address. The underlying structure of a router includes the physical layer, data link layer, network layer, and transport layer. The physical layer is responsible for converting data into electrical signals and sending them to the network cable. The data link layer is responsible for dividing the data into frames and adding MAC addresses. The network layer is responsible for adding IP addresses and other network protocols to the data. The transport layer is responsible for providing end-to-end reliable transmission. A router can realize the interconnection between different networks, such as connecting a local area network to the Internet. Their usage scenarios are usually applied in large-scale networks, such as the Internet and data center networks. For example, in an enterprise network, routers can be used to connect LANs in different regions together to realize remote office and data sharing functions.

The following is a schematic diagram of the underlying structure and working principle of various network devices:

  1. The underlying structure and working principle of network cables and network cards:
+-------------------+              +-------------------+
|                   |              |                   |
|     Computer      |              |     Computer      |
|                   |              |                   |
+--------+----------+              +--------+----------+
         |                                   |
         |                                   |
+--------+----------+              +--------+----------+
|                   |              |                   |
|      Network      |<-------------|      Network      |
|                   |              |                   |
+--------+----------+              +--------+----------+
         |                                   |
         |                                   |
+--------+----------+              +--------+----------+
|                   |              |                   |
|     Network Card   |<-------------|     Network Card   |
|                   |              |                   |
+-------------------+              +-------------------+
  1. The underlying structure and working principle of the network interface:
+-------------------+
|                   |
|      Operating     |
|        System       |
|                   |
+------+------------+
       | 
       | 
+------+------------+
|                   |
|     Network     |
|       Stack       |
|                   |
+------+------------+
       | 
       | 
+------+------------+
|                   |
|   Network Interface |
|      Controller   |
|                   |
+-------------------+
  1. The underlying structure and working principle of the Hub:
+-------------------+              +-------------------+
|                   |              |                   |
|     Computer      |              |     Computer      |
|                   |              |                   |
+--------+----------+              +--------+----------+
         |                                   |
         |                                   |
+--------+----------+              +--------+----------+
|                   |              |                   |
|                   |              |                   |
|        Hub        |<-------------|        Hub        |
|                   |              |                   |
|                   |              |                   |
+--------+----------+              +--------+----------+
         |                                   |
         |                                   |
+--------+----------+              +--------+----------+
|                   |              |                   |
|     Network      |              |     Network      |
|                   |              |                   |
+-------------------+              +-------------------+
  1. The underlying structure and working principle of the switch:
+-------------------+              +-------------------+
|                   |              |                   |
|     Computer      |              |     Computer      |
|                   |              |                   |
+--------+----------+              +--------+----------+
         |                                   |
         |                                   |
+--------+----------+              +--------+----------+
|                   |              |                   |
|       Switch      |<-------------|       Switch      |
|                   |              |                   |
+--------+----------+              +--------+----------+
         |                                   |
         |                                   |
+--------+----------+              +--------+----------+
|                   |              |                   |
|     Network      |              |     Network      |
|                   |              |                   |
+-------------------+              +-------------------+
  1. The underlying structure and working principle of the router:
+-------------------+              +-------------------+
|                   |              |                   |
|     Computer      |              |     Computer      |
|                   |              |                   |
+--------+----------+              +--------+----------+
         |                                   |
         |                                   |
+--------+----------+              +--------+----------+
|                   |              |                   |
|      Router       |<-------------|      Router       |
|                   |              |                   |
+--------+----------+              +--------+----------+
         |                                   |
         |                                   |
+--------+----------+              +--------+----------+
|                   |              |                   |
|     Network      |              |     Network      |
|                   |              |                   |
+-------------------+              +-------------------+

references:

  1. Detailed Explanation of TCP/IP Protocol Volume 1: Protocol (Second Edition), Author: W. Richard Stevens, Publisher: Machinery Industry Press, 2006.

  2. "Computer Network" (7th Edition), author: Xie Xiren, publisher: Electronic Industry Press, 2015.

  3. Author of "A Top-Down Approach to Computer Networks" (6th Edition)

    : James F. Kurose, Keith W. Ross, Publisher: Machinery Industry Press, 2013.

  4. "Linux Network Programming" (2nd Edition), Authors: Keir Davis, John Turner, Nathan Yocom, Publisher: Machinery Industry Press, 2014.

  5. "Linux Kernel Design and Implementation" (3rd Edition), Author: Robert Love, Publisher: Machinery Industry Press, 2011.

  6. "TCP/IP Protocol Detailed Explanation Volume 1: Protocol" (3rd Edition), Author: W. Richard Stevens, Gary R. Wright, Publisher: People's Posts and Telecommunications Press, 2012.

  7. "TCP/IP Detailed Explanation Volume 1: Protocol" (Second Edition), Author: W. Richard Stevens, Publisher: Machinery Industry Press, 2006.

  8. "How the Network is Connected" (2nd Edition), Author: Honda Ken, Publisher: People's Posts and Telecommunications Press, 2016.

  9. "Network Security Technology Foundation" (Second Edition), Authors: Liu Shifeng, Wang Rui, Publisher: Machinery Industry Press, 2016.

  10. "Computer Network Experiment Course" (3rd Edition), Authors: Li Jianxun, Chen Jianghua, Han Weiguo, Publisher: Higher Education Press, 2018.

Guess you like

Origin blog.csdn.net/feng1790291543/article/details/131832465