OSI Layer-7 Model
Application Layer: Provides network application protocols
Presentation Layer: provides data conversion and representation services for users.
Session Layer: Provides session Control Service (Security Authentication) for users)
Transport Layer: Provides end-to-end data transmission services for users.
Network Layer: control the data transmission from the origin of the Communication Subnet to the destination point (Packet)
Data link layer: Provides error-free data transmission (Frame) over faulty physical lines)
Physical Layer: transmits original binary data bits on physical lines.
Layer-5 TCP/IP Model
Application Layer: Same as OSI
Transport Layer: Provides end-to-end data transmission services TCP and UDP
Network Layer: control the IP packet transfer from the Communication Subnet origin to the destination
Data link layer: Same as OSI
Physical Layer: Same as OSI
Differences between connection-oriented and connection-oriented
Connection orientation means that the communication parties must establish a complete channel between them before communication. This channel is the connection. During the communication process, the entire connection can be monitored and managed in real time.
For connectionless communication, you do not need to establish a connection with two communication nodes in advance. When communication is required, the sending node can send information to the network, it allows information to be transmitted over the network. Generally, it is not monitored during transmission, so that the information can be transmitted to the destination node as much as possible on the Internet.
TCP (TransmissionControl Protocol) is connection-oriented.
UDP (user data packet Protocol) is connectionless.
In the network, some services, such as HTTP and FTP, have high requirements on data reliability. When using these services, data packets must be completely delivered; other services, such as DNS and instant messaging tools, do not require such high reliability. They are concerned about high efficiency and real-time performance. According to the different needs of the two services, the connection-oriented TCP protocol and the connection-oriented UDP protocol were born.
Hubs and switches
The Hub collects and zooms in signals and transmits the signals to all other ports. That is, the transmission line is shared. In summary, the hub transmits data in the form of broadcast, and all ports compete for the bandwidth of a shared channel. Therefore, as the number of network nodes increases, the amount of data transmitted increases, the available bandwidth of each node is reduced accordingly. A shared device, such as a hub, cannot identify the destination address. When host a in the same network sends data to host B, data packets are transmitted in broadcast mode on a hub-based network, each terminal verifies the address information of the data packet header to determine whether to receive the data. At the same time, only one set of data frames can be transmitted over the network. This method shares the bandwidth.
Vswitches are faster than hubs, and can encapsulate and forward data based on mac address recognition. It can learn the mac address and place it in the internal address table. It establishes a temporary exchange path between the initiator and receiver of the data frame so that the data can reach the destination address from the source address. All ports have dedicated channel bandwidth to ensure fast and effective data transmission on each port. The vswitch provides exclusive, point-to-point connections for users. data packets are sent only to the destination port rather than to all ports.
Vro and vswitch
(1) different levels of work
The switch is the work data link layer, that is, the second layer,
The router works at the network layer.
(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. A vro uses the idnumber (IP address) of different networks to determine the data forwarding address. IP addresses are implemented in software and describe the network where the device is located. Sometimes these layer-3 addresses are also called protocol addresses or network addresses. The MAC address is usually provided by the hardware and allocated by the NIC manufacturer, and has been fixed to the NIC. Generally, it cannot be changed. The IP address is usually automatically assigned by the network administrator or the system.
(3) Traditional vswitches can only be divided into conflicting domains, but not broadcast domains. vrouters can be divided into 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 to 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 divided into 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.
Which layer does each device work on in the OSI model?
Network Adapter works on the Physical Layer
The repeater works on the physical layer to restore signals in the network and send them back to other network segments.
The hub works on the physical layer and is used to connect physical devices.
The bridge works on the Media Access Control (MAC) Sub-layer of the data link layer and is used to transmit data packets in multiple network segments that use the same communication protocol.
A switch also works on the data link layer, similar to a bridge.
The router works at the network layer.
The gateway is different. Some gateways use the complete layer-7 protocol, but generally the gateway is responsible for protocol conversion at the application layer.
What is ARP?
In TCP/IP, A sends an IP packet to B. in the header, the IP address of B must be set as the destination address. However, when the IP packet is transmitted over Ethernet, you also need to encapsulate an Ethernet package. In this Ethernet package, the destination address is the MAC address of B.
How does computer A know the MAC address of computer B? The key to solving the problem lies in the ARP protocol.
When A does not know the MAC address of B, A broadcasts an ARP request packet with the IP address of B (192.168.1.2) in the request packet. All Ethernet computers will receive the request, under normal circumstances, only B will give an ARP response packet, and the packet will be filled with the MAC address of B, and will reply to.
After receiving an ARP response, A puts the MAC address of B into the local cache for later use.
The local MAC cache has a lifetime. After the lifetime ends, the above process will be repeated again.
What is DNS?
DNS server, Chinese name: domain name resolution server, is a specialized server in the computer network, its function is to map the domain name of the computer network (such as: www.sina.com) to the corresponding
Ip address (for example, 61.172.201.229 ).
What is VPN?
Virtual Private Network (VPN)
Is a point-to-point connection across private networks or public networks (such as the Internet. VPN
The client uses TCP/IP-based
The special protocol (known as tunnel protocol) for VPN
The virtual port on the server for virtual call. In a typical VPN
The client is being deployed over the Internet.
Start the virtual point-to-point connection with the remote access server. The remote access server responds to the call, authenticates the caller, and
Data is transmitted between the client and the dedicated network of the Organization.
To simulate point-to-point links, use headers to encapsulate data. The header provides route information so that data can reach its endpoint through the shared network or public network. To simulate a dedicated link, encrypt the sent data to ensure confidentiality. Without an encryption key, it is difficult to identify data packets intercepted on the shared network or public network. The link that encapsulates and encrypts private data is called VPN
Connection.