Network Load Balancing Overview (قسمت سوم)
برای درک کامل کار سرویس NLB باید پشت صحنه کار این سرویس را درک کرد . در این قسمت چگونگی ارتباط آن با Hardware Switch را بررسی می کنیم .
برای برقراری ارتباط بین یک یا چند Client با کلیه Host های یک Cluster در سرویس NLB باید یک جور Broadcast Traffic ایجاد شود.
قبلا گفتیم که Client Request به همه عضو ها ارسال می شود اما فقط یکی از آنها به آن درخواست مدنظر جواب می دهد .بدلبل نوع ترافیک شما نمی توانید از Switch Layer 3 استفاده کنید .
شما یا باید از یک Hub استفاده کنید یا یک Switch L2 استفاده کنید .
Figure 1 Network Load Balancing cluster running in unicast mode with MaskSourceMAC enabled
سوئیچ رابط میانه و یا واسطه بین Computer ها
و Server ها و نیز دیگرسوئیچ ها می باشد
اگر شما توسط یک سوئیچ به یک Cluster
وصل شده اید باید یک سوئیچ لایه دو داشته باشید
و نه سوئیچ لایه 3 و یا بالا تر بدلیل اینکه تمامی
Host های شما به اشتراک گذاشته شده اند با
یک Virtual IP Address یکسان
و برای این هدف شما حتما باید یک سوئیچ لایه 2
داشته باشید .تذکر سوئیچ لایه 3 رفتارش با لایه 2
فرق می کند و در سرویس NLB کاربردی ندارد .
MaskSourceMAC is enabled
در حالت Unicast Mode تمامی MAC Address های کارت شبکه های Host های
عضو Cluster تغییر کرده و به یک MAC مجازی و یکسان تغییر می کند .
در این حالت تمامی Host عضو به عنوان مقصد Client Request ها می شود چون
دارای MAC Address های یکسان شده اند این روش NLB می باشد و بدین گونه عمل می کند.
همانطور که در شکل بالا می بینید در حالت Incoming هر دو سرور یا Host دارای MAC Address:02-bf-01-02-03-04 می باشند
و سوئیچ Packet ها را بدلیل وجود
دو Port دارای MAC Address های یکسان به هر دو ارسال می کند در اینجا منظور Port1,2 می باشد.در واقع Virtual IP Address شما
دارای این MAC Address مجازی می باشد.
MaskSourceMAC is disabled
در روش بالا که NLB از آن برای کار خود استفاده می کند یک مشکل جدی وجود دارد وآن به شرح زیر می باشد
زمانی که Packet Outgoing برای جواب به Client ها از یکی از Host ها خارج بشود و دوباره
Client ها درخواست ارسال کنند سوئیچ نمی تواند آن Packet ها را برسمیت بشناسد چون
سوئیچ برای هر Port خود یک MAC Address Unique و یا ثابت درنظر می گیرد
و دو Port با یک MAC برای سوئیچ تعریف نشده به همین دلیل Switch Flooding رخ می دهد
بدین صورت که عکس العمل آن در برابر این مشکل بدین گونه می باشد که آن Packet را
که MAC آدرسش را نمی شناسد برای تمامی Port های خود ارسال می کند این عمل باعث
می شود که ترافیک شبکه بسیار بالا برود و سوئیچ از حداکثر قدرت خود برای ارسال Packet ها استفاده
کند البته این مشکل را خود سرویس NLB ایجاد می کند برای اینکه بتواند از حداکثر قدرت انتقال شبکه استفاده کند
ولی مشکل اینجا می باشد که ترافیک کاری دیگر سیستم های شبکه
که ربطی به Cluster ندارند بسیار کم می شود و Packet ها برای آنها هم ارسال می شود .
برای جلوگیری از این مشکل می توان همانند شکل زیر از یک Hub استفاده کرد.
Figure 2 Network Load Balancing cluster running in unicast mode with MaskSourceMAC Disabled
در این حالت قانون سوئیچ نیز رعایت شده و هر Port دارای یک MAC Address Unique می باشد در این حالت دیگر
Switch Flooding رخ نمی دهد .وجود Hub موجب کاهش ترافیک نمی شود اما برای اینکه شما ترافیک Outgoing
خود را بهتر عبور دهید می توانید برای هر یک از Host های خود یک کارت شبکه دیگر نیز نصب کنید تا ترافیک روانتر و با
سرعت بالاتری عبور کند .این کار باعث می شود کنجایش Hub با ترافیک Outgoing پر نشود و نیز موجب می شود مسیر های
ورودی وخروجی Cluster شما در Switch دارای Port های متفاوت باشد در نتیجه به Switch نیز فشار نمی آید و می تواند
راحتر و با سرعت بالاتری کار کند .
در این قسمت بعضی دلایلی را که سرویس NLB را محبوب کرده برای استفاده را شرح می دهیم .
IIS Server (Web Farm)
معمولا از سرویس NLB برای سایت ها و یرور های IIS استفاده می شود چون ترافیک بالاتری نسبت به دیگر سرویس ها دارند .
در زیر تنظیمات مربوط به یک Cluster را که دارای Host های مربوط به Web می باشد و سرویس IIS را بر روی خود دارند ملاحظه می کنید .
Port-rule Settings
Filtering Mode: Multiple Hosts.
Affinity: None, unless session state must be maintained; to maintain session state, either Single or Class C.
Load Weight/Equal load distribution: Equal. However, if one host has a greater capacity than the others, you can use this parameter to increase its share of the client requests.
بدلیل وجود چندین وب سرور باید در حالت Multiple Hosts باشد و گزینه None بهترین انتخاب برای توزيع ترافیک بین کلیه عضوها می باشد البته موارد دیگر نیز توضح داده شده .
Servicing Multiple Web Sites (Multihoming)
همانطور که در شکل 1 ملاحضه می کنید یک Cluster با 4 عضو وجود دارد که بر روی
هر عضو یک IIS نصب می باشد .در اینجا 3 وب سایت با آدرس های مختلف در دل Cluster پیکربندی شده.
برای وب شماره 1 هر چهار عضو جوابگو می باشند و برای وب سایت شماره 2 عضو های شماره 1و2 جوابگو می باشند.
و برای وب سایت شماره 3 عضوهای شماره 3و4 جوابگو می باشند .
تذکر این Cluster دارای سه Virtual IP Address می باشد .
Figure 1 Multiple virtual IP addresses
درشکل 2 چگونگی تقسیم درصد کاری هر سرور یا Host را برای هر یک از Web Site ها مشخص شده .
Figure 2 Multiple virtual IP addresses and Load Percentage
شما می توانید تفاوت درصد کاری را در قسمت Networking در Windows Task Manager بخوبی احساس کنید بر روی هر Host .
شما می توانید همانند شکل 3 در قسمت Cluster Properties در NLB Manager Console در Tab مربوطه یعنی Cluster IP Address آدرسهای مد نظر را اضافه کنید .
To host multiple Web sites with different IP addresses on a Network Load Balancing cluster
Click the Start menu, point to Settings, and then open Network and Dial-up Connections.
Click the Local Area Connection for which Network Load balancing is enabled, and then, in the Local Area Connection Status dialog box, click Properties.
In the Local Area Connection Properties dialog box, click Internet Protocol (TCP/IP), and then click Properties.
Click Advanced.
The list under IP Addresses should already contain the host's dedicated IP address and the cluster's primary IP address. This cluster IP address corresponds to the cluster's primary IP address that you entered in the Network Load Balancing Properties dialog box under Cluster parameters.
For each additional virtual IP address that your cluster needs in order to run a multihomed server, click Add, and then enter the cluster IP address, followed by the appropriate subnet mask.
Figure 3 Cluster IP addresses Tab (NLB Manager) "NLBmgr.exe"
Servicing a Web Site with Active Server Pages
Web sites that use Active Server Pages (ASP) can maintain session state across client connections. Network Load Balancing helps preserve client access to session information by ensuring that all TCP/IP connections from a single client are directed to the same cluster host. To do so, set Affinity to either Single or Class C.
There are, however, situations in which a client can connect with one cluster host, and then have subsequent connections load-balanced to different hosts. Such situations include the following:
A host is added to the cluster, and Network Load Balancing load-balances new connections from this client to the host.
Note that existing connections are unaffected.
Multiple client-side proxy servers cause multiple connections from the same client to originate from different IP addresses.
If either of the preceding situations arises, ASP applications must provide a means to retrieve and manage session state even if a client connects to multiple cluster hosts as part of a single session. The following are two strategies for addressing this issue:
Use a means at the ASP level, such as a cookie, to retrieve the ASP client state across the Network Load Balancing cluster nodes.
Encapsulate in a client-side cookie the state from a specific client request. The cookie gives the server the context for subsequent client requests. This solution works only if there is a relatively small amount of state associated with each client transaction. As state grows larger, it becomes increasingly difficult to have the client forward a large cookie to the server with every request.
For more information about port-rule settings, see "IIS Server (Web Farm)," earlier in this chapter.
Servicing a Web Site That Uses Secure Sockets Layer
If you service a Web site that uses Secure Sockets Layer (SSL) to build secure connections with clients, whether in conjunction with unsecured connections or not, create the following port rules.
Port-rule Settings
Port Range: 443, or use the default (0-65535).
Filtering Mode: Multiple Hosts
Affinity: Single
If you are load-balancing for a particular Class C address space, such as a corporate proxy array, or firewall, set Affinity to Class C.
Load Weight/Equal load distribution: Use the default.
Creating a Virtual Private Network (VPN)
This scenario's discussion applies to setting up a virtual private network (VPN) by using the Point-to-Point Tunneling Protocol (PPTP).
When using Network Load Balancing with VPN servers to load-balance PPTP clients, it is important to configure the TCP/IP properties correctly to ensure compatibility with clients running earlier versions of Windows (such as Microsoft® Windows® 98 and Windows NT 4.0). To do this, assign only a single virtual IP address to the network adapter used by Network Load Balancing, and do not assign another IP address on any network adapter on this subnet. This restriction does not apply for Windows 2000 clients. Assigning only a single virtual IP address to the network adapter used by Network Load Balancing ensures that network traffic returning from the host to the client originates from the virtual IP address to which the client sent the request.
Set bindings so that Network Load Balancing is enabled for the cluster network adapter (the network adapter with the cluster's virtual address).
Note
If a particular host fails, client sessions handled by that host handle will also break. Clients are prompted to log on again; their new session is handled by one of the remaining hosts.
Port-rules Settings
To provide load-balancing for virtual private network clients, use the default port rule for all hosts, as follows:
Port Range: Set the range to 0-65535, (the default). Setting the range to the default covers all the ports, so the port rule remains valid even if there is a change in the port numbers you want to cover.
Filtering Mode: Accept the default
Affinity: Single (default)
Load Weight/Equal load distribution: Accept the default
Streaming Media
You can use Network Load Balancing to distribute client requests among several streaming media servers.
If you add a host to the cluster, the statistical-mapping algorithm in Network Load Balancing maps some clients to the new host. Because Network Load Balancing cannot detect the start and termination of streams that use the UDP protocol, active streams for clients that are mapped to the new host mid-stream are interrupted. (This behavior does not occur for streams that use the TCP protocol.) As much as possible, add hosts to the cluster only at times that minimize possible disruptions to clients.
Port-rules Settings
Port Range: 0–65535
Filtering Mode: Multiple Hosts
Affinity: Single
Load Weight/Equal load distribution: Equal
برای برقراری ارتباط بین یک یا چند Client با کلیه Host های یک Cluster در سرویس NLB باید یک جور Broadcast Traffic ایجاد شود.
قبلا گفتیم که Client Request به همه عضو ها ارسال می شود اما فقط یکی از آنها به آن درخواست مدنظر جواب می دهد .بدلبل نوع ترافیک شما نمی توانید از Switch Layer 3 استفاده کنید .
شما یا باید از یک Hub استفاده کنید یا یک Switch L2 استفاده کنید .
Figure 1 Network Load Balancing cluster running in unicast mode with MaskSourceMAC enabled
سوئیچ رابط میانه و یا واسطه بین Computer ها
و Server ها و نیز دیگرسوئیچ ها می باشد
اگر شما توسط یک سوئیچ به یک Cluster
وصل شده اید باید یک سوئیچ لایه دو داشته باشید
و نه سوئیچ لایه 3 و یا بالا تر بدلیل اینکه تمامی
Host های شما به اشتراک گذاشته شده اند با
یک Virtual IP Address یکسان
و برای این هدف شما حتما باید یک سوئیچ لایه 2
داشته باشید .تذکر سوئیچ لایه 3 رفتارش با لایه 2
فرق می کند و در سرویس NLB کاربردی ندارد .
MaskSourceMAC is enabled
در حالت Unicast Mode تمامی MAC Address های کارت شبکه های Host های
عضو Cluster تغییر کرده و به یک MAC مجازی و یکسان تغییر می کند .
در این حالت تمامی Host عضو به عنوان مقصد Client Request ها می شود چون
دارای MAC Address های یکسان شده اند این روش NLB می باشد و بدین گونه عمل می کند.
همانطور که در شکل بالا می بینید در حالت Incoming هر دو سرور یا Host دارای MAC Address:02-bf-01-02-03-04 می باشند
و سوئیچ Packet ها را بدلیل وجود
دو Port دارای MAC Address های یکسان به هر دو ارسال می کند در اینجا منظور Port1,2 می باشد.در واقع Virtual IP Address شما
دارای این MAC Address مجازی می باشد.
MaskSourceMAC is disabled
در روش بالا که NLB از آن برای کار خود استفاده می کند یک مشکل جدی وجود دارد وآن به شرح زیر می باشد
زمانی که Packet Outgoing برای جواب به Client ها از یکی از Host ها خارج بشود و دوباره
Client ها درخواست ارسال کنند سوئیچ نمی تواند آن Packet ها را برسمیت بشناسد چون
سوئیچ برای هر Port خود یک MAC Address Unique و یا ثابت درنظر می گیرد
و دو Port با یک MAC برای سوئیچ تعریف نشده به همین دلیل Switch Flooding رخ می دهد
بدین صورت که عکس العمل آن در برابر این مشکل بدین گونه می باشد که آن Packet را
که MAC آدرسش را نمی شناسد برای تمامی Port های خود ارسال می کند این عمل باعث
می شود که ترافیک شبکه بسیار بالا برود و سوئیچ از حداکثر قدرت خود برای ارسال Packet ها استفاده
کند البته این مشکل را خود سرویس NLB ایجاد می کند برای اینکه بتواند از حداکثر قدرت انتقال شبکه استفاده کند
ولی مشکل اینجا می باشد که ترافیک کاری دیگر سیستم های شبکه
که ربطی به Cluster ندارند بسیار کم می شود و Packet ها برای آنها هم ارسال می شود .
برای جلوگیری از این مشکل می توان همانند شکل زیر از یک Hub استفاده کرد.
Figure 2 Network Load Balancing cluster running in unicast mode with MaskSourceMAC Disabled
در این حالت قانون سوئیچ نیز رعایت شده و هر Port دارای یک MAC Address Unique می باشد در این حالت دیگر
Switch Flooding رخ نمی دهد .وجود Hub موجب کاهش ترافیک نمی شود اما برای اینکه شما ترافیک Outgoing
خود را بهتر عبور دهید می توانید برای هر یک از Host های خود یک کارت شبکه دیگر نیز نصب کنید تا ترافیک روانتر و با
سرعت بالاتری عبور کند .این کار باعث می شود کنجایش Hub با ترافیک Outgoing پر نشود و نیز موجب می شود مسیر های
ورودی وخروجی Cluster شما در Switch دارای Port های متفاوت باشد در نتیجه به Switch نیز فشار نمی آید و می تواند
راحتر و با سرعت بالاتری کار کند .
در این قسمت بعضی دلایلی را که سرویس NLB را محبوب کرده برای استفاده را شرح می دهیم .
IIS Server (Web Farm)
معمولا از سرویس NLB برای سایت ها و یرور های IIS استفاده می شود چون ترافیک بالاتری نسبت به دیگر سرویس ها دارند .
در زیر تنظیمات مربوط به یک Cluster را که دارای Host های مربوط به Web می باشد و سرویس IIS را بر روی خود دارند ملاحظه می کنید .
Port-rule Settings
Filtering Mode: Multiple Hosts.
Affinity: None, unless session state must be maintained; to maintain session state, either Single or Class C.
Load Weight/Equal load distribution: Equal. However, if one host has a greater capacity than the others, you can use this parameter to increase its share of the client requests.
بدلیل وجود چندین وب سرور باید در حالت Multiple Hosts باشد و گزینه None بهترین انتخاب برای توزيع ترافیک بین کلیه عضوها می باشد البته موارد دیگر نیز توضح داده شده .
Servicing Multiple Web Sites (Multihoming)
همانطور که در شکل 1 ملاحضه می کنید یک Cluster با 4 عضو وجود دارد که بر روی
هر عضو یک IIS نصب می باشد .در اینجا 3 وب سایت با آدرس های مختلف در دل Cluster پیکربندی شده.
برای وب شماره 1 هر چهار عضو جوابگو می باشند و برای وب سایت شماره 2 عضو های شماره 1و2 جوابگو می باشند.
و برای وب سایت شماره 3 عضوهای شماره 3و4 جوابگو می باشند .
تذکر این Cluster دارای سه Virtual IP Address می باشد .
Figure 1 Multiple virtual IP addresses
درشکل 2 چگونگی تقسیم درصد کاری هر سرور یا Host را برای هر یک از Web Site ها مشخص شده .
Figure 2 Multiple virtual IP addresses and Load Percentage
شما می توانید تفاوت درصد کاری را در قسمت Networking در Windows Task Manager بخوبی احساس کنید بر روی هر Host .
شما می توانید همانند شکل 3 در قسمت Cluster Properties در NLB Manager Console در Tab مربوطه یعنی Cluster IP Address آدرسهای مد نظر را اضافه کنید .
To host multiple Web sites with different IP addresses on a Network Load Balancing cluster
Click the Start menu, point to Settings, and then open Network and Dial-up Connections.
Click the Local Area Connection for which Network Load balancing is enabled, and then, in the Local Area Connection Status dialog box, click Properties.
In the Local Area Connection Properties dialog box, click Internet Protocol (TCP/IP), and then click Properties.
Click Advanced.
The list under IP Addresses should already contain the host's dedicated IP address and the cluster's primary IP address. This cluster IP address corresponds to the cluster's primary IP address that you entered in the Network Load Balancing Properties dialog box under Cluster parameters.
For each additional virtual IP address that your cluster needs in order to run a multihomed server, click Add, and then enter the cluster IP address, followed by the appropriate subnet mask.
Figure 3 Cluster IP addresses Tab (NLB Manager) "NLBmgr.exe"
Servicing a Web Site with Active Server Pages
Web sites that use Active Server Pages (ASP) can maintain session state across client connections. Network Load Balancing helps preserve client access to session information by ensuring that all TCP/IP connections from a single client are directed to the same cluster host. To do so, set Affinity to either Single or Class C.
There are, however, situations in which a client can connect with one cluster host, and then have subsequent connections load-balanced to different hosts. Such situations include the following:
A host is added to the cluster, and Network Load Balancing load-balances new connections from this client to the host.
Note that existing connections are unaffected.
Multiple client-side proxy servers cause multiple connections from the same client to originate from different IP addresses.
If either of the preceding situations arises, ASP applications must provide a means to retrieve and manage session state even if a client connects to multiple cluster hosts as part of a single session. The following are two strategies for addressing this issue:
Use a means at the ASP level, such as a cookie, to retrieve the ASP client state across the Network Load Balancing cluster nodes.
Encapsulate in a client-side cookie the state from a specific client request. The cookie gives the server the context for subsequent client requests. This solution works only if there is a relatively small amount of state associated with each client transaction. As state grows larger, it becomes increasingly difficult to have the client forward a large cookie to the server with every request.
For more information about port-rule settings, see "IIS Server (Web Farm)," earlier in this chapter.
Servicing a Web Site That Uses Secure Sockets Layer
If you service a Web site that uses Secure Sockets Layer (SSL) to build secure connections with clients, whether in conjunction with unsecured connections or not, create the following port rules.
Port-rule Settings
Port Range: 443, or use the default (0-65535).
Filtering Mode: Multiple Hosts
Affinity: Single
If you are load-balancing for a particular Class C address space, such as a corporate proxy array, or firewall, set Affinity to Class C.
Load Weight/Equal load distribution: Use the default.
Creating a Virtual Private Network (VPN)
This scenario's discussion applies to setting up a virtual private network (VPN) by using the Point-to-Point Tunneling Protocol (PPTP).
When using Network Load Balancing with VPN servers to load-balance PPTP clients, it is important to configure the TCP/IP properties correctly to ensure compatibility with clients running earlier versions of Windows (such as Microsoft® Windows® 98 and Windows NT 4.0). To do this, assign only a single virtual IP address to the network adapter used by Network Load Balancing, and do not assign another IP address on any network adapter on this subnet. This restriction does not apply for Windows 2000 clients. Assigning only a single virtual IP address to the network adapter used by Network Load Balancing ensures that network traffic returning from the host to the client originates from the virtual IP address to which the client sent the request.
Set bindings so that Network Load Balancing is enabled for the cluster network adapter (the network adapter with the cluster's virtual address).
Note
If a particular host fails, client sessions handled by that host handle will also break. Clients are prompted to log on again; their new session is handled by one of the remaining hosts.
Port-rules Settings
To provide load-balancing for virtual private network clients, use the default port rule for all hosts, as follows:
Port Range: Set the range to 0-65535, (the default). Setting the range to the default covers all the ports, so the port rule remains valid even if there is a change in the port numbers you want to cover.
Filtering Mode: Accept the default
Affinity: Single (default)
Load Weight/Equal load distribution: Accept the default
Streaming Media
You can use Network Load Balancing to distribute client requests among several streaming media servers.
If you add a host to the cluster, the statistical-mapping algorithm in Network Load Balancing maps some clients to the new host. Because Network Load Balancing cannot detect the start and termination of streams that use the UDP protocol, active streams for clients that are mapped to the new host mid-stream are interrupted. (This behavior does not occur for streams that use the TCP protocol.) As much as possible, add hosts to the cluster only at times that minimize possible disruptions to clients.
Port-rules Settings
Port Range: 0–65535
Filtering Mode: Multiple Hosts
Affinity: Single
Load Weight/Equal load distribution: Equal
+ نوشته شده در یکشنبه پانزدهم آبان ۱۳۹۰ ساعت 2:0 توسط محمد یاسر کبیری
|
شبکه های کامپیوتری امنیت برنامه نویسی سخت افزار نرم افزار طراحی وب