A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service
The OSI Layer-7 model enables reliable communication between different networks of different systems through seven hierarchical structural models. Therefore, its most basic function is to help different types of hosts transmit data.
The node that completes the relay function is usually called a relay system. In the OSI Layer-7 model, the relay systems at different layers have different names.
The layer at which a device works depends on the Data header information used during its operation. When a bridge works, it determines the forwarding Port Based on the MAC header. Therefore, it is obviously a device at the data link layer.
Physical Layer: Nic, network cable, Hub, repeater, Modem
Data link layer: bridge, switch
Network Layer: vro
The gateway works on the layer 4 transmission layer and above.
A hub is a physical layer device that transmits information in the form of broadcast.
A vswitch is a machine used for Packet Exchange. Most of them are link layer devices (L2 switches). address learning is supported, and tokens exchange messages in the form of storage forwarding ..
A role of a router is to connect different networks, and a role is to select a line for information transmission. By selecting smooth and fast routes, You can greatly increase the communication speed, reduce the communication load of the network system, save network system resources, and improve the network system accessibility.
Differences between vswitches and vrouters
The vswitch has a very high-bandwidth back bus and an internal switching matrix. All the ports of the switch are attached to this bus. After the control circuit receives the data packet, the processing port searches for the address comparison table in the memory to determine the destination MAC address (the hardware address of the NIC) the port on which the NIC is attached. data packets are quickly transmitted to the destination port through the internal switching matrix. If the destination MAC does not exist, all ports are broadcast, after receiving the port response, the switch will "Learn" the new address and add it? Enter the internal MAC address table.
When using a vswitch, you can also segment the network. By comparing the MAC address table, the vswitch only agrees to pass the necessary network traffic through the vswitch. Through the filtering and forwarding of vswitches, the broadcast storm can be effectively isolated to reduce the occurrence of incorrect packets and wrong packets and avoid sharing conflicts.
A vswitch can transmit data between multiple port pairs at the same time. Each port can be considered as an independent network segment, and the network devices connected to it enjoy all the bandwidth alone, without competing with other devices. When node A sends data to node D, Node B can send data to node C at the same time, and both transmission enjoy all the bandwidth of the network and have their own virtual connection. If a 10 Mbps Ethernet switch is used here, the total traffic of the switch is 2*10 Mbps = 20 Mbps. When a 10 Mbps shared hub is used, the total traffic of a hub does not exceed 10 Mbps.
In short, a vswitch is a network device that can complete packet forwarding encapsulation Based on MAC address recognition. The switch can "Learn" the MAC address and store it in the internal address table. By creating a temporary exchange path between the initiator of the data frame and the Target receiver, the data frame can directly reach the destination address from the source address.
From the perspective of filtering network traffic, the role of a router is similar to that of a switch and a bridge. However, unlike switches that work on the physical layer and divide network segments physically, vrouters use specialized software protocols to logically divide the entire network. For example, a router that supports the IP protocol can divide the network into multiple sub-network segments, and only the network traffic directed to a Special IP Address can pass through the router. For each received packet, the router calculates its verification value again and writes it to a new physical address. Therefore, the speed of data forwarding and filtering by vro is usually slower than that of A vswitch that only views the physical address of a data packet. However, vrouters can improve the overall efficiency of networks with complex structures. Another obvious advantage of a vro is its ability to actively filter network broadcasts.
What are the functional differences between a hub and a router?
First, the hub, that is, the hub. Its function can be simply understood as connecting some machines to form a LAN. The switch (also known as the switch-type hub) works basically the same as the hub. However, there is a difference in the performance between the two: the shared bandwidth is used by the hub router, and the switch is the exclusive bandwidth. In this way, when the number of machines is very large or the data volume is very large, the two will be more obvious than the ratio. A vro differs significantly from the preceding two. Its function is to connect different network segments and find the most suitable path for data transmission in the network. A vro is generated after a vswitch, just as a vswitch is generated after a hub. Therefore, the vro and vswitch are also associated, rather than two completely independent devices. Vro mainly overcomes the problem that vswitches cannot route and forward data packets.
In general, the main differences between vrouters and vswitches are as follows:
(1) different levels of work
The original vswitch worked at the data link layer, and the router was designed at the network layer at the beginning. Because a vswitch works at the data link layer, its working principle is simpler than that of router. The vro works at the network layer and can obtain many other protocol information. The vro can make more intelligent forwarding decisions.
(2) Data Forwarding depends on different objects
A vswitch uses a physical address or a MAC address to determine the destination address for data forwarding. The router uses IP addresses to determine the data forwarding address. IP addresses are implemented in software, describing the network where the device is located. MAC addresses are generally provided by the hardware and allocated by the NIC manufacturer, and have been fixed to the NIC. Generally, they cannot be changed. The IP address is usually assigned by the network administrator or the system itself.
(3) Traditional vswitches can only cut conflicting domains, but cannot cut broadcast domains. vrouters can cut broadcast domains.
The CIDR Block connected by the vswitch still belongs to the same broadcast domain. broadcast packets are transmitted across all CIDR blocks connected by the vswitch. In some cases, communication congestion and security vulnerabilities may occur. The CIDR blocks connected to the vro are allocated to different broadcast domains, and the broadcast data does not pass through the vro. Although vswitches above Layer 3 Have VLAN functions and can also be used to cut broadcast domains, communication between subbroadcast domains is not allowed, and communication between them still requires routers.
(4) The router provides firewall services.
A vro only forwards data packets of a specific address. It does not support packet transmission through the routing protocol or unknown destination network, thus preventing broadcast storms.
In the OSI regression model, the physical layer is the lowest layer of the regression model and the first layer of the OSI model.
The main function of the physical layer is to use the transmission media to provide physical connections to the data link layer for transparent transmission of bit streams.
The role of the physical layer is to achieve transparent transmission of bit streams between adjacent computer nodes and eliminate the differences between detailed transmission media and physical devices as much as possible. So that the above data link layer does not have to consider the detailed transmission media of the network. The "transparent transfer bit stream" indicates that the bit stream transmitted by the actual circuit has not changed. This circuit seems invisible to the transmitted bit stream.
Data Link Layer
The data link layer is the second layer of the OSI model. It establishes and manages links between nodes. The main function of this layer is to convert erroneous physical channels into error-free and reliable data transmission frames through various control protocols.
In computer networks, physical links are unreliable due to various interference. Therefore, the main function of this layer is to convert erroneous physical lines into error-free data links based on the bit streams provided by the physical layer through error control and traffic control methods, it provides a reliable method for data transmission through physical media.
This layer is usually divided into two sub-layers: Media Traffic Control (MAC) and Logical Link Control (LLC.
The main task of the MAC Sub-layer is to solve the problem of multi-users competing with the channel in the shared network, and complete the problem control of the network medium;
The main task of the LLC sublayer is to establish and maintain network connections, RUN error verification, traffic control, and link control.
The detailed work of the data link layer is to receive data in the form of bitstream from the physical layer, encapsulate the data into frames, and transmit the data to the upper layer, data in the form of bit streams is moved to the physical layer. It is also responsible for processing the confirmation frame information sent from the receiving end to provide reliable data transmission.
The network layer is the third layer of the OSI model. It is the most complex layer of the OSI regression model and the highest layer of the Communication Subnet. It provides services to the resource subnet on the basis of the next two layers. The main task is to select the most appropriate path for packets or groups through the Communication Subnet through the routing selection algorithm. This layer controls information forwarding between the data link layer and the transport layer, and establishes, maintains, and terminates network connections. In details, data on the data link layer is converted into data packets at this layer, and then controlled by path selection, segmented combination, sequence, inbound/outbound routing, etc, transmits information from a network device to another network device.
Generally, the data link layer solves the communication between nodes in the same network, while the network layer mainly solves the communication between different subnets. For example, when communication between wide area networks (WANs), you must have a routing problem (that is, there may be multiple paths between two nodes.
The main problems to be solved when implementing the network layer functions are as follows:
Addressing: Physical addresses (such as MAC addresses) used in the data link layer only address the internal network. During communication between different subnets, to identify and find the devices in the network, the devices in each subnet are assigned a unique address. Because the physical technology used by each subnet may be different, the address should be a logical address (such as an IP address ).
Exchange: different information exchange methods are defined. Common exchange technologies include line exchange and storage and forwarding. The latter also includes Packet Exchange and group exchange technologies.
Routing Algorithm: when multiple paths exist between the source node and the target node, this layer can select the optimal path for the Data Group through the network based on the routing algorithm, and transmit the information from the sender to the receiver in the most appropriate path.
Connection Service: Unlike data link layer traffic control, the former controls traffic between adjacent nodes of the network, and the latter controls traffic between the source node and the target node. The purpose is to prevent congestion and perform error detection.
The main task at Layer 3 of OSI is data communication, and the task at Layer 3 is data processing. The transport layer is the 4th layer of the OSI model. Therefore, this layer serves as an interface and bridge between the Communication Subnet and the resource subnet.
The main task of this layer is to provide users with reliable end-to-end error and traffic control to ensure correct transmission of packets. The role of the transport layer is to shield the details of lower-layer data communication from the high-level layer, that is, to transparently transmit packets to users. Common protocols at this layer: TCP/IP protocol, SPX protocol in Novell Network, and Microsoft NETBIOS/netbeui protocol.
The transport layer provides transmission services between the Session Layer and the network layer. Such services obtain data from the Session Layer and cut data when necessary. The Transport Layer then passes the data to the network layer and ensures that the data is correctly transmitted to the network layer. Therefore, the transport layer is responsible for reliable data transmission between two nodes. When the connection between the two nodes is determined, the transport layer is responsible for monitoring. In summary, the main functions of the transport layer are as follows:
Transmission connection management: Provides the function of establishing, maintaining, and removing transmission connections. On the basis of the network layer, the transport layer provides "connection-oriented" and "connection-oriented" services for the top management.
Handle transmission errors: provides reliable connection-oriented and unreliable connection-free transmission data services, error control, and traffic control. When the connection-oriented service is provided, the data transmitted through this layer will be confirmed by the target device. If no confirmation information is received within the specified time, the data will be resold.
Monitor service quality.
Session Layer is the layer 5th of the OSI model. It is an interface between user applications and networks. Its main task is to provide the presentation layer of two entities with the method of establishing and using connections. The connection between presentation layers of different entities is called a session. Therefore, the Session Layer task is to organize and coordinate the communication between two session processes and manage the data exchange.
Users can establish sessions in half-duplex, single-work, and full-duplex mode. When you create a session, you must provide the remote address they want to connect. These addresses are different from MAC addresses or logical addresses at the network layer. They are designed for users to facilitate user memory. A domain name (DN) is a remote address used on the network. For example, www.3721.com is a domain name. The Session Layer has the following functions:
Session management: allows users to establish, maintain, and terminate sessions between two physical devices and supports data exchange between them. For example, you can provide a single-direction session or a two-way session at the same time, manage the sending sequence in the session, and the duration of the session.
Session traffic control: Provides session traffic control and cross-session functions.
Addressing: Use a remote address to establish a session connection. L
Error Control: logically speaking, the Session Layer is mainly responsible for establishing, maintaining, and terminating data exchanges. However, the actual work is to receive data from the transport layer and correct errors. Both session control and remote process invocation belong to this layer of functions. However, it should be noted that the errors detected at this layer are not communication media errors, but advanced errors of disk space, printer paper shortage, and other types.
The presentation layer (presentation layer) is the sixth layer of the OSI model. It interprets commands and data from the application layer, gives corresponding meanings to various syntaxes, and sends them to the Session Layer in a certain format. Its main function is to "handle user information representation problems, such as encoding, data format conversion, and encryption and decryption. The detailed features of the presentation layer are as follows:
Data format processing: negotiate and establish a data exchange format to resolve the differences in data format representation between applications.
Data Encoding: converts character sets and numbers. For example, because data types (integer or real, signed, or unsigned) and user IDs in a user program can all have different expressions, devices must have the function of converting between different character sets or formats.
Compression and decompression: to reduce the amount of data transmitted, this layer is also responsible for data compression and recovery.
Data encryption and decryption: improves network security.
The application layer is the top layer of the OSI test model. It is a computer user and an interface between various applications and networks. Its function is to provide services directly to users, all kinds of work that the user wants to finish on the network. On the basis of the other six layers of work, it completes the connection between applications in the network and the network operating system, and establishes the connection with end users, complete various protocols, such as supervision, management, and service, required for various network services and applications proposed by network users. In addition, this layer is responsible for coordinating the work between applications.
Services and protocols provided by the application layer include: file service, folder service, file transmission service (FTP), remote login service (Telnet), and email service (e-mail) print Service, Security Service, Network Management Service, database service, etc. The above various network services are completed by different application protocols and programs at this layer, different network operating systems vary greatly in terms of functions, interfaces, implementation technologies, hardware support, security and reliability, and various application interfaces. The main functions of the application layer are as follows:
User Interface: the application layer is a direct interface between users and networks, as well as between applications and networks, allowing users to interact with the network.
Implement various services: various applications at this layer can complete and implement various services requested by users.
Summary of osi7 Models
Because OSI is an ideal model, generally the network system only involves several layers. Few systems can have all 7 layers and fully follow its rules.
In a layer-7 model, each layer provides a special network function. From the perspective of network functions: the following four layers (physical layer, data link layer, network layer, and transmission layer) mainly provide data transmission and exchange functions, that is, communication between nodes is the main function; layer 4th serves as a bridge between the upper and lower layers, and is the most critical part of the entire network architecture. Layer 3 (Session Layer, presentation layer, and application layer) it mainly provides information and data processing functions between users and applications. In short, the next layer mainly completes the Communication Subnet function, and the last layer mainly completes the resource subnet function.
Below is the TCP/IP layered model
── ------ ── ─ ┐ ┌ ── ┬ ──-┐ ──
│ D │ F │ W │ F │ H │ g │ t │ I │ s │ U │
│ N │ I │ H │ t │ o │ e │ R │ M │ s │ its │
│ Layer 4, application layer │ s │ n │ o │ P │ t │ P │ l │ C │ t │ e │
│ G │ I │ P │ H │ n │ P │ n │
│ E │ s │ e │ it │
│ R │ t │
── ------ ─ ┘ └ ── ┴ ──-┴ ── ─ ┘
── ─ ----- ┐ ┌ ── ─ ------- ┬ ── -------- ── ─
│ Layer 3, transmission layer │ TCP │ UDP │
── ─ ------┘ └ ── ─ --------┴ ── ─ ---------┘
── ─ ------┐ ┌ ── ─ ---- ┬ ── ----┬ ── ─ ------- ──
│ ICMP │
│ Second layer, inter-network layer │ ── ─ ┘ │
│ IP │
└ ── ─ ----- ┘ └ ── ─ ------------
── ─ ----- ┐ ┌ ── ─ ------- ┬ ── -------- ── ─
│ Layer 1, network interface │ arp/RARP │ others │
── ------ ┘ └ ── ------ ┴ ── ─ -------- ── ─
Layer-4 TCP/IP Test Model
The TCP/IP protocol is organized into four conceptual layers, with three layers corresponding to the corresponding layers in the ISO Benchmark Model. The ICP/IP protocol family does not include the physical layer and data link layer. Therefore, it cannot independently complete the functions of the entire computer network system and must work with more protocols.
The following functions are completed at the four protocol layers of the TCP/IP layered model:
Layer 1: Network Interface Layer
It contains the protocol used to transfer the IP address data on an existing network medium. In fact, TCP/IP standards do not define functions that correspond to the ISO data link layer and physical layer. Instead, it defines a protocol like Address Resolution Protocol (ARP) that provides interfaces between the data structure of the TCP/IP protocol and the actual physical hardware.
Layer 2: inter-network layer
Corresponding to the network layer of the OSI Layer-7 test model. This layer includes the IP protocol and RIP Protocol, which are responsible for data packaging, addressing, and routing. At the same time, the inter-network Control Message Protocol (ICMP) is also included to provide network diagnostic information.
Layer 3: Transport Layer
Corresponding to the transport layer of the OSI Layer-7 regression model, it provides two end-to-end communication services. Among them, the TCP protocol (Transmission Control Protocol) provides reliable data stream transportation services, and the UDP protocol (use datainprotocol) provides unreliable User Datagram services.
Layer 4: Application Layer
Corresponding to the application layer and expression layer of the OSI Layer-7 regression model. The application layer protocols of the Internet include finger, Whois, FTP (file transfer protocol), Gopher, HTTP (Hypertext Transfer Protocol), Telent (Remote Terminal protocol), and SMTP (Simple Mail Transfer Protocol) IRC (Internet Relay Session), NNTP (network news transmission protocol), etc. This is also the focus of this book.
Start building with 50+ products and up to 12 months usage for Elastic Compute Service