[HCIA] 02. Network reference model

Application Implementation - Data

  • data generation
    • In the computer field, data is the carrier of various information.
  • data transmission
    • Data generated by most applications needs to be transferred between different devices.
  • People generate information, and applications generate data.
  • Computers can only recognize digital data consisting of 0 and 1. It does not have the ability to read all kinds of information, so the information needs to be translated into data through certain rules.
  • For humans, we do not have the ability to read electronic data, so when reading information, we need to convert the data into information that humans can understand.
  • For a network engineer, it is necessary to pay more attention to the end-to-end transmission process of data.

OSI reference model

  • Proposed by ISO (International Organization for Standardization).
  • Equipment such as Huawei or Cisco follow this protocol so that they can communicate with each other.
    • Similar to the way that all battery interfaces follow the universal charging method, then every mobile phone needs this charger.
  • The role of layering is to change only part when needed later, without changing all.
    • For example, IPv6 is widely used now, so you can only change the ipv4 of the network layer without changing all layers, so that it can also interact with adjacent layers normally after changing to v6 several times.
  • The upper three layers (application layer, presentation layer, and session layer) belong to the upper layer and are used to generate and manage data.
  • The next four layers (transport layer, network layer, data link layer, physical layer) belong to the lower layers and are used to transfer data.

  • The OSI model (Open Systems Interconnection Model) was included in the ISO 7489 standard by the International Organization for Standardization ISO (The International Organization for Standardization) and released in 1984.
  • The OSI reference model is also known as the seven-layer model, from bottom to top:

▫Physical layer: Transmits bit streams between devices, specifying physical characteristics such as level, speed, and cable pins.

▫Data link layer: Combine bits into bytes, then combine bytes into frames, use link layer addresses (Ethernet uses MAC addresses) to access media, and perform error detection.

▫Network layer: Define the logical address for the router to determine the path and be responsible for transmitting data from the source network to the destination network.

▫Transport layer: Provide connection-oriented or non-connection-oriented data transfer and error detection before retransmission.

▫Session layer: Responsible for establishing, managing and terminating communication sessions between presentation layer entities. Communication at this layer consists of service requests and responses between applications in different devices.

▫Presentation layer: Provide various encoding and conversion functions for application layer data to ensure that the data sent by the application layer of one system can be recognized by the application layer of another system.

▫Application layer: The layer closest to the user in the OSI reference model, which provides network services for applications.

1. Application layer

    • Provide an interactive interface for humans, information is generated by humans, and data is generated by the application layer
    • QQ, WeChat, Alipay, etc. belong to the application layer

2. Presentation layer

    • Generally, in the same format of binary encoding, they all have the same flag prefix and so on.
    • For example, drawing software and ps can open a picture because the picture is coded in a language that they can all recognize.
    • For example, Chinese bosses negotiate contracts with Japanese bosses and Korean bosses, and then they all write the contract language in English, so that they can all understand it.

3. Session layer

    • The role of the session layer in the chat application is to establish, manage and terminate the session connection with the server. It ensures reliable message delivery, handles errors and exceptions, and provides session control and management functions.
    • When the boss's secretary sent the contract, he first made a copy of the contract. After the other party received it, he tore up his spare contract. If the other party did not receive it, he made a copy of the contract and sent it to him.
    • The main concern is session management and control.
    • Session establishment depends on the transport layer
    • establish a session

4. Transport layer

    • To establish end-to-end is to control port-to-port. Protocols above this layer have port numbers.
    • You can control the speed of transmission and the order of transmitted data.
    • What the transport layer completes is the port-to-port channel establishment
    • Establish an end-to-end session
    • port

5. Network layer

    • Identify the logical address of the computer, identify the name of the broadcast domain, etc.
    • Responsible for network addressing
    • IP address

6. Data Link Layer

    • MAC address
    • Realize point-to-point or point-to-multipoint transmission in the link
    • Encapsulates a link layer header
    • There is an error checking function (calculate, if the check value is the same, start decapsulating, and discard it if it is different.)

7. Physical layer

    • Define the electrical specifications of the physical layer, such as which lines are used for sending and receiving.

TCP/IP Reference Model

  • Because the OSI protocol stack is relatively complex, and the two major protocols of TCP and IP are widely used in the industry, the TCP/IP reference model has become the mainstream reference model of the Internet.
  • Usually refers to the TCP/IP peer-to-peer model.

  • Two adjacent layers can exchange data. Cross-layer interaction is not possible.

TCP/IP common protocol

Common Protocol Standardization Organization

•IETF(Internet Engineering Task Force)

▫ A voluntary organization responsible for the development and promotion of Internet protocols (especially the protocols that make up the TCP/IP protocol family), publishing new or replacing old protocol standards through RFC.

•IEEE(Institute of Electrical and Electronics Engineers)

▫IEEE has formulated about 30% of the world's electronics, electrical and computer science standards, the more well-known ones are IEEE802.3 (Ethernet), IEEE802.11 (WiFi) and so on.

•ISO(International Organization for Standardization)

▫ ISO is an international organization that plays a major role in formulating computer network standards, such as the OSI model, defined in ISO/IEC 7498-1.

application layer

  • The application layer provides an interface for application software, enabling applications to use network services. The application layer protocol specifies the corresponding transport layer protocol and the ports used by the transport layer.
  • The PDU of the application layer is called Data (data)
  • PDU (Protocol Data Unit) protocol data unit

  • Each layer of TCP/IP allows data to be transmitted through the network, and these layers use PDU (Packet Data Unit, Protocol Data Unit) to exchange information with each other to ensure that network devices can communicate.
  • PDUs of different layers contain different information, so PDUs are given different names in different layers.

Common Application Layer Protocols

FTP (File Transfer Protocol) is a protocol for transferring files from one host to another, used for "download" and "upload" of files, and it adopts C/S (Client/Server) structure.

Telnet is a standard protocol for providing remote login services in data networks. Telnet provides users with the ability to perform work on remote devices on their local computer.

HTTP (HyperText Transfer Protocol) is the most widely used network protocol on the Internet. HTTP was originally designed to provide a way to publish and receive HTML pages.

transport layer

  • The transport layer protocol accepts data from the application layer protocol, encapsulates the corresponding transport layer header, and helps it establish a "port to port" connection
  • The PDU of the transport layer is called a Segment (segment).

Transport layer - TCP and UDP port numbers

  • The source port used by the client is generally randomly assigned, and the destination port is specified by the server's application;
  • The source port number is generally not used in the system and is greater than 1023;
  • The destination port number is the listening port of the application (service) opened by the server, such as HTTP uses 80 by default;

Network layer

  • The transport layer is responsible for establishing process-to-process connections between hosts, while the network layer is responsible for transferring data from one host to another.
  • The PDU of the network layer is called Packet (packet)

Network layer protocol working process

  • When IP is used as the network layer protocol, both parties to the communication will be assigned a "unique" IP address to identify themselves. The IP address can be written as a 32-bit binary integer value, but for the convenience of people to read and analyze, it is usually written in the form of dotted decimal, that is, four bytes are separated in decimal and separated by dots, such as 192.168. 1.1.
  • Encapsulation and forwarding of IP packets:

▫When the network layer receives data from the upper layer (such as the transport layer) protocol, it will encapsulate an IP packet header, and add the source and destination IP addresses to the header.

▫The network devices (such as routers) that pass through in the middle will maintain a "map" that guides the forwarding of IP packets—the routing table. By reading the destination address of the IP data packet, the IP data packet is forwarded after searching the local routing table.

▫The IP data packet finally reaches the destination host, and the destination host determines whether to accept it by reading the destination IP address and proceeds to the next step.

  • In addition to the IP protocol, there are various routing protocols such as OSPF, IS-IS, and BGP in the network layer to help routers establish routing tables, and ICMP helps in network control and status diagnosis.

data link layer

  • The data link layer is located between the network layer and the physical layer, and can provide services to protocols such as IP and IPv6 at the network layer. The PDU of the data link layer is called Frame (frame)
  • Ethernet (Ethernet) is the most common data link layer protocol.

Ethernet and MAC addresses

  • A MAC address is 48 bits (6 bytes) long and consists of 12 hexadecimal numbers. Example: 48-A4-72-1C-8F-4F

  • Ethernet is a broadcast data link layer protocol that supports multi-point access
  • The network interface of the personal computer follows the Ethernet standard
  • Generally, a broadcast domain corresponds to an IP network segment.
  • The MAC address uniquely identifies a network card in the network, and each network card needs and will have a unique MAC address
  • MAC is used to find specific physical devices within an IP network segment
  • Devices that work at the data link layer. For example, an Ethernet switch maintains a MAC address table for knowing data frame forwarding

physical layer

  • After the data reaches the physical layer, the physical layer converts the digital signal into an optical signal, an electrical signal or an electromagnetic wave signal according to different physical media.
  • The PDU of the physical layer is called a bit stream (Bitstream)
  • For example, it defines which pin does what, such as receiving or sending

common transmission medium

  • Twisted pair: The most common transmission medium of Ethernet today, according to the ability to resist electromagnetic interference, it can be divided into:

▫STP-shielded twisted pair

▫UTP-unshielded twisted pair

  • Optical fiber transmission can be divided into:

▫ Optical fiber: Optical transmission medium, simply put, is a glass fiber used to confine the channel of optical transmission.

▫Optical module: A device that converts electrical signals and optical signals to generate optical signals.

  • Serial cables are widely used in WAN (Wide Area Network, wide area network). According to different types of WAN lines, the interface types of serial cables connected to devices are also different: different/synchronous serial ports, ATM interfaces, POS interfaces, CE1/PRI interfaces, etc. .
  • The transmission of wireless signals can be carried out through electromagnetic waves. For example, a wireless router sends data through modulation with electromagnetic waves, and the wireless network card of the mobile terminal demodulates the electromagnetic waves to obtain data and complete the data transmission from the wireless router to the mobile terminal.

sender data encapsulation

Assuming that you are visiting Huawei’s official website through a web browser, when you enter the URL and press Enter, the following things will happen inside the computer:

  1. The IE browser (application program) invokes HTTP (application layer protocol) to complete the encapsulation of application layer data (the DATA in the figure should also include the HTTP header, which is omitted here).
  2. HTTP relies on TCP at the transport layer for reliable data transmission, and delivers the encapsulated data to the TCP module.
  3. The TCP module adds corresponding TCP header information (source port, destination port, etc.) to the Data passed from the application layer. The PDU at this time is called a Segment.
  4. In the IPv4 network, the TCP module will pass the encapsulated Segment to the IPv4 module of the network layer (if in the IPv6 environment, it will be handed over to the IPv6 module for processing).
  5. After the IPv4 module receives the Segment delivered by the TCP module, it completes the encapsulation of the IPv4 header, and the PDU at this time is called a Packet.
  6. Since Ethernet is used as the data link layer protocol, after the IPv4 module completes encapsulation, the Packet will be handed over to the Ethernet module (such as an Ethernet card) of the data link layer for processing.
  7. After the Ethernet module receives the Packet delivered by the IPv4 module, it adds the corresponding Ethernet header information and FCS frame tail, and the PDU at this time is called a Frame (frame).
  8. After the Ethernet module is encapsulated, the data will be passed to the physical layer.
  9. Depending on the physical medium, the physical layer is responsible for converting digital signals into electrical signals, optical signals, electromagnetic wave (wireless) signals, etc.
  10. The signal that the conversion is complete begins to pass through the network.

Intermediate network data transmission

  • The encapsulated complete data will be transmitted in the network.

  • In general:

▫ Layer 2 devices in the network (such as Ethernet switches) will only decapsulate the Layer 2 header of the data, and perform corresponding "exchange" operations based on the information in the Layer 2 header.

▫ Layer-3 devices (such as routers) in the network will only decapsulate to the layer-3 header, and perform corresponding "routing" operations based on the information in the layer-3 header.

Receiver data decapsulation

  • After passing through the intermediate network, the data finally reaches the destination server. According to the information in different protocol headers, the data will be decapsulated layer by layer and processed and transmitted accordingly, and finally handed over to the application program on the WEB server for processing.

Summarize

  • Both the OSI reference model and the TCP/IP reference model adopt a layered design concept.

▫The division of labor and clear boundaries between each level is helpful for the development, design and troubleshooting of each component

▫ Encourage industry standardization by defining what functions are implemented at each layer of the model

▫By providing interfaces, various types of network hardware and software can communicate with each other and improve compatibility

  • The generation and transmission of data requires mutual cooperation among various modules, and at the same time, each module needs to "perform its own duties".

Supongo que te gusta

Origin blog.csdn.net/weixin_45988710/article/details/131482276
Recomendado
Clasificación