google / seesaw

Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform.
Apache License 2.0
5.63k stars 511 forks source link

Question on seesaw #35

Closed johntwei closed 6 years ago

johntwei commented 6 years ago

Hello, I was reading code and documentation on seesaw and have few questions.

1. In README.md, it said --- "Direct Server Return (DSR)" is used. To my knowledge, DSR means the backend server send response to the original server who sent request to VIP. But, I saw the code in "ncc/iptables.go" ---

      // Rewrite source address for NAT'd packets so backend reply traffic comes
     // back to the load balancer.
    natPostrouting := "POSTROUTING -t nat -m ipvs -p {{.Proto}}{{with .Port}} --vport {{.}}{{end}} " +
            "--vaddr {{.ServiceVIP}} -j SNAT --to-source {{.ClusterVIP}} --random"

Can someone clarify if seesaw backend server response to original server or to load balancer node?

2 In README.rd, it said -- "Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform."

How LVS is used by seesaw? I noticed that ip_vs module is needed. But, seesaw is not using ipvsadm CLI.

Thanks for the help. John

4a6f656c commented 6 years ago

Re (1) - Seesaw is capable of both DSR and NAT, depending on configuration (see config.proto). In DSR mode the replies will be delivered from the load balancer to the backend, then returned directly from the backend to the client.

Re (2) - Seesaw controls IPVS directly via netlink - see the ipvs and netlink packages.

johntwei commented 6 years ago

Re (1) - Thanks for the info that Seesaw can support either NAT or DSR. For DSR mode, can I assume that we also need to configure backend real server to deal with the ARP issue (e.g configuring VIP on loopback, and hide loopback)?

New question #3: One VIP can run on just one of the two seesaw server (master/slave), is this correct? I saw a Google Maglev paper, "N+1" redundancy was mentioned in the paper. It seems that, with Maglev, same VIP an be served by multiple Maglev load balancer.

John