Learning high-performance service system: load-balancing technology of LVS

About LVS technology

LVS technology , namely linux virtual servers, load balancing manager may establish presence on the network layer or data link layer by LVS.
LVS by link layer packets (via arp protocol), IP datagram (network layer), TCP packets (transport layer) to be modified, thereby achieving load balancing.

OSI hierarchy OSI: Open Systems Interconnection
first layer: the physical layer (medium transmitted through the bit, to determine the mechanical and electrical specifications, i.e., bits) of the network cable, hub RJ45, CLOCK, IEEE802.3
second layer: data link layer (the bit framing and assembly point to point transmission) cards, switches PPP, FR, HDLC, VALM, MAC
layer: a network layer (responsible for packet transmission and Internet connection) router (three switches) the IP , the ICMP, the ARP, the RARP, OSPF, IPX, RIP, IGRP
fourth layer: transport layer (providing end to end reliable packet delivery and error recovery) TCP , UDP, SPX
fifth floor: the session layer (build, manage and terminate sessions) NFS, SQL, NETBIOS , RPC
sixth floor: the presentation layer (data translation, encryption and compression) JPEG, MPEG, ASII
seventh layers: application layer (OSI allows access to environment) FTP, DNS, Telnet, SMTP , HTTP, WWW, NFS

The three modes LVS
LVS-NAT: requests and responses are through a proxy server. NAT address conversion technology
LVS-DR (most common): only modifies the link-layer packets, it does not change the original IP packets and TCP packets. Request is sent to the server specified by the MAC, the response will be sent back directly to the server. (Not cross-subnet)
LVS-TUN: the working mechanism similar to DR, but the use of IPIP tunneling protocol, can achieve cross-subnet.

Supplement of load balancing technology

Intelligent DNS and DNS
DNS (Domain the Name System, DNS), a distributed database as domain names and IP addresses mapped to each other on the World Wide Web, enabling users to more easily access the Internet, without having to remember the machine can be read directly IP number of strings.
Intelligent DNS resolution, DNS is based on pre-set the IP address back to the client. IP address returned will close off possible "near the user." (Similar Anhui Anhui user priority return IP)
Here Insert Picture Description

CDN network: content delivery network
scenarios: cache images, multimedia files and various static resource files.
Simple implementation of CDN Network: Smart DNS + cache components
simply expressed: the nearest available through DNS IP (similar to base station), load resources from this IP, if there is a direct return resources; without first cache, and then sent to the client.

Guess you like

Origin blog.csdn.net/weixin_40990818/article/details/86253148