Presentation is loading. Please wait.

Presentation is loading. Please wait.

Content Switch Design Introduce Linux-2.2.16 networking source code. IP Masquerade techniques. LVS(Linux Virtual Server). Design of the Content Switch.

Similar presentations


Presentation on theme: "Content Switch Design Introduce Linux-2.2.16 networking source code. IP Masquerade techniques. LVS(Linux Virtual Server). Design of the Content Switch."— Presentation transcript:

1 Content Switch Design Introduce Linux-2.2.16 networking source code. IP Masquerade techniques. LVS(Linux Virtual Server). Design of the Content Switch.

2 Input/Output Processing in IP Layer Transport protocol Network interface Ip_input Ip_forward Ip_output Ip packet queue

3 IP Packet input Processing Ethernet Input - Ethernet device interrupted. - Ethernet driver receive packet and queue it. - Raise a software interrupt. Ip Input - Process ip packet, header,checksum. - Destination is local, deliver to upper layer. Use protocol field in ip header to decide witch upper layer input routine is called. - Otherwise send to ip_forward. TCP Input - Use tcp header information to locate the socket which is create by the according process. Signal the waiting process.

4 IP Masquerade 192.168.0.1 A-box C-box B-box Linux Masq_Gate 128.198.192.192 Internet 192.168.0.4 192.168.0.3 192.168.0.2 Configure as firewall of private network. How it works: - When first packet comes, create a ip_masq entry in hash table, which contains the information of the connection. - The following packet of the same connection can be masqueraded based on the ip_masq entry. Ip Masquerade is called in ip_input.

5 LVS(Linux Virtual Server) Based on IP Masquerade. Distribute incoming packet load to the different back servers. - rr, lwc, wc, lc. - Load balancing based on source ip address and source port. Fail over. In ip_masq entry contains the current load of each server.

6 Content Switch Design Based on IP Masquerade and LVS. Distribute load also based on payload(content) of the packet. Some problems need to be solved: - Delay Binding. - Sequence number changed. - Content Extraction. - Multiple http request within one tcp connection. - Timeout problem.

7 Flow Chart of Content Switch (NAT) packet from client input to ip_input connection established? TCP/SYN? Create ip_masq entry,Save the packet Return to upper masquerade ip addr port,seq. forward ip packet return choose server Get data from queue forward to server choose server masq UDP packet forward to server deliver to upper layer TCP/data/ack UDP? y n y yy nnn

8 Flow Chart of Content Switch(NAT) packet from back server Connection established? msaq packet forward it return SYN/ACK? Dequeue the saved data Return to ip_input forward as normal input to ip_forward y n n

9

10 ACK(DSEQ+lenD1+1) ACK(SSEQ+lenD1+1) Client Content SwitchServer1 Server2 DATA(CSEQ+lenR1+1) ACK(DSEQ+lenD1+1) R2 in this packet SYN(CSEQ+lenR1) SYN(S2EQ) ACK(CSEQ+lenR1+1) DATA(CSEQ+lenR1+1) ACK(S2EQ+1) Diff(DSEQ+lenD1,S2EQ) DATA(S2EQ+1) ACK(CSEQ+lenR1+lenR2+1) DATA(DSEQ+lenD1+1) ACK(CSEQ+lenR+lenR2+1) ACK(DSEQ+lenD+lenD2+1) FIN Apporach 1: Discard the first Request

11 ACK(DSEQ+lenD+1) ACK(SSEQ+lenD+1) Content SwitchServer1 Server2 DATA(CSEQ+lenR+1) ACK(DSEQ+lenD+1) SYN(CSEQ+lenR) SYN(S2EQ) ACK(CSEQ+lenR+1) DATA(CSEQ+lenR+1) ACK(S2EQ+1) Diff(DSEQ+lenD,S2EQ) DATA(S2EQ+1) ACK(CSEQ+lenR+lenR2+1) DATA(DSEQ+lenD+1) ACK(CSEQ+lenR+lenR2+1) ACK(DSEQ+lenD+lenD2+1) DATA(SSEQ+lenD+1) ACK(CSEQ+lenR+1) step8 DATA(DSEQ+lenD+1) ACK(CSEQ+lenR+1) ---------------------------------------------------------- DATA(DSEQ+lenD+D2+1) ACK(CSEQ+lenR+lenR2+1+1) Keep the latest passing packet’s seq and ack_seq. Return ack needs to be decided which server it belongs. Client Approach 2: Out of Order Delivery, Incorrect?

12 Approach 3: Preserve Request Sequence Require the later document to be buffered if it is returned earlier? Adjust the TCP sequence # and send it back before first response comes back. This requires the knowledge of the size of first response.


Download ppt "Content Switch Design Introduce Linux-2.2.16 networking source code. IP Masquerade techniques. LVS(Linux Virtual Server). Design of the Content Switch."

Similar presentations


Ads by Google