Current location - Quotes Website - Collection of slogans - What was the first Layer 2 switch? What is a Layer 3 switch? What is a Layer 4 switch?
What was the first Layer 2 switch? What is a Layer 3 switch? What is a Layer 4 switch?
A simple definition of Layer 4 switching is that it is a function, which determines that transmission is not only based on MAC address (Layer 2 network

Bridge) or source/destination IP address (Layer 3 routing), and the port number is applied according to TCP/UDP (Layer 4). Layer 4 switching work

Energy is like a virtual IP, pointing to a physical server. The services it transmits comply with various protocols, including HTTP, FTP and NFS.

Telnet or other protocols. These services require complex load balancing algorithms based on physical servers. In the field of intellectual property rights

The service type is determined by the TCP or UDP port address of the terminal, and the application interval in Layer 4 switching is determined by the source and the terminal.

The IP address, TCP and UDP ports * * * are the same.

Set a virtual IP address (VIP) for each server group used for searching in Layer 4 switching. Each server group supports

Some kind of application. Every application server address stored in the domain name server (DNS) is a VIP, not a real service.

Device address.

When a user applies for an application, a VIP connection request (such as TCP SYN package) with the target server group is sent.

To the server switch. The server switch selects the best server in the group and uses the VIP in the terminal address as the actual service.

IP server, and send a connection request to the server. In this way, all packets in the same time interval are mapped by the server switch.

Shooting, transmission between users and the same server.

Principle of Layer 4 switching

The fourth layer of OSI model is the transport layer. Transport layer is responsible for end-to-end communication, that is, coordination between network source and target system.

Communication. In the IP protocol stack, this is the protocol layer where TCP (a transport protocol) and UDP (user datagram protocol) are located.

At Layer 4, TCP and UDP headers contain port numbers, which can uniquely distinguish each packet.

Include which application protocols (such as HTTP, FTP, etc.). ). Endpoint systems use this information to distinguish data in packets, especially

The port number enables the receiving computer system to determine the type of IP packet it receives and pass it to the appropriate higher layer.

Software. The combination of port number and device IP address is often called "socket".

Port numbers between 1 and 255 are reserved, and they are called "well-known" ports, that is, in all host TCP/I.

In the implementation of P protocol stack, these port numbers are the same. In addition to the "well-known" ports, the standard UNIX service allocation is between 256 and 256.

Port range 1024. Custom applications generally assign port numbers above 1024.

The latest list of assigned port numbers can be found in RFC 1700 "Assigned Numbers". End of TCP/UDP

Additional information provided by slogans can be used by network switches, which is the basis of Layer 4 switching.

Examples of "familiar" port numbers:

Application protocol port number

FTP 20 (data)

2 1 (control)

TELNET 23

SMTP 25

HTTP 80

NNTP 1 19

NNMP 16

162(SNMP trap)

Additional information provided by TCP/UDP port numbers can be used by network switches, which is the basis of Layer 4 switching.

Switches with Layer 4 capabilities can act as a "virtual IP" (VIP) front end connected to the server.

Each server and server group that supports a single or public application is configured with a VIP address. This VIP address was sent out.

Go to the domain name system to register.

When sending a service request, the Layer 4 switch identifies the beginning of the session by judging the beginning of TCP. In that way

Then, it uses complex algorithms to determine the best server to handle the request. Once a decision is made, the switch will

The session is associated with a specific IP address, and the real IP address of the server is used to replace the VIP address on the server.

Address.

Each Layer 4 switch stores the source IP address and source TCP port that match the selected server.

Associated connection table. The Layer 4 switch then forwards the connection request to the server. All subsequent packages are on the client and server side.

The server is remapped and forwarded until the switch finds the session.

With Layer 4 switching, access can be connected to a real server to meet the rules set by users.

Then, for example, an equal number of accesses are made on each server, or transport streams are allocated according to the capacities of different servers.

How to choose the right Layer 4 switch?

First, the speed

In order to play a role in an enterprise network, Layer 4 switching must provide performance comparable to that of Layer 3 wire-speed routers. also

That is, Layer 4 switching must run at full speed on all ports, even on multiple Gigabit Ethernet connections.

So ... Gigabit Ethernet speed is equal to the maximum speed of 1488000 packets per second (assuming the worst case, that is

All packets are the minimum size defined by the network, 64 bytes long).

B, server capacity balance algorithm

According to the size of the expected capacity balancing interval, Layer 4 switches have many algorithms to allocate applications to servers.

It is simple to detect the latest connection of the loop, the loop delay or the closed-loop feedback of the server itself. Before that.

In the measurement, closed-loop feedback provides the most accurate detection reflecting the existing business volume of the server.

C. Table capacity

It should be noted that switches used for Layer 4 switching need to have the ability to distinguish and store a large number of sent items. switchboard

This is especially true in the core part of the enterprise network. Many Layer 2/Layer 3 switches often have the same send table size as network devices.

The quantity is proportional. For Layer 4 switches, this number must be multiplied by the number of different application protocols and sessions used in the network.

Quantity. Therefore, the size of the sending table increases rapidly with the increase of the number of endpoint devices and application types. Design of Layer 4 Switching Machine

Developers need to consider this growth when designing products. Large instrument capacity is very important for manufacturing the fourth layer flow supporting line-speed transmission.

High performance switch is very important.

D, redundancy

Layer 4 switch has the function of supporting redundant topology. When a dual-link NIC has a fault-tolerant connection, you can

A completely redundant system can be established from the server to the network card, link and server switch.