Skip to content

Instantly share code, notes, and snippets.

@kevinz
Created July 5, 2012 14:25
Show Gist options
  • Save kevinz/3053976 to your computer and use it in GitHub Desktop.
Save kevinz/3053976 to your computer and use it in GitHub Desktop.
mscgen script for lvs
#MSC for lvs in DR transparent mode
msc{
hscale = "2";
Client,LB,RS,OS;
Client=>Client [ label = "req(oip:oport)"];
Client=>Client [ label = "routeto(LB)"];
Client->LB [ label = "(cip:cport)->(oip:oport)"];
LB=>LB [ label = "iptable->fwmark(dst==oip,dst_port=oport)"];
LB=>LB [ label = "(cip:cport)->(oip:oport)+fwmark"];
LB=>LB [ label = "trick kernel to receive()"];
LB=>LB [ label = "is_match(LB->fwmark,packet->fwmark)"];
LB=>LB [ label = "belongs_to_an_active_conn?"];
LB=>LB [ label = "is_new_conn?"];
LB=>LB [ label = "is_persistent?"];
LB=>LB [ label = "do_schedule()"];
LB=>LB [ label = "decide_rs()"];
LB=>LB [ label = "modify-mac(vmac->rmac)"];
LB->RS [ label = "(cip:cport)->(oip:oport)"];
--- [ label = "Packet is delivered to real server"];
...;
RS=>RS [ label = "nf_hook->dnat(oip->rip,oport->rport)"];
RS=>RS [ label = "receive()"];
RS=>RS [ label = "proxy_www(URI)"];
RS->OS [ label = "(rip_www:rport_www)->(oip:oport)"];
--- [ label = "Packet is delivered to the original server"];
OS->RS [ label = "(oip:oport)->(rip_www:rport_www)"];
RS=>RS [ label = "route_to(LB or GW)"];
--- [ label = "Packet goes back to real server"];
RS->LB [ label = "(oip:oport)->(cip:cport)"];
RS>>Client [ label = "possible path:(oip:oport)->(cip:cport)"];
LB->Client [ label = "(oip:oport)->(cip:cport)"];
--- [ label = "Packet goes back to the client"];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment