Jan 30, 2010

A simple approach for Sun Message Queue Clustering

Introduction on Clustering

Today's enterprise depends on the availability of mail and web services. Failure is never far away, whether it be a hardware failure or a human error. We have to try to make an infrastructure as highly available as possible. No company would afford to lose a customer when the services they offer to be unreachable, especially since that downtime will almost undoubtedly cost them money. Clustering is the approach towards maintaining highly available Customer service.

What is Clustering & High Availability?

A cluster is two or more interconnected servers (sometimes called nodes) that create a solution to provide higher availability, higher scalability or both. The advantage of clustering servers for high availability is seen if one node fails, another node in the cluster can assume the workload of the failed node, and users see no interruption of access. The advantages of clustering servers for scalability include increased application performance and a greater number of users that can be supported. You can think of a cluster of servers as if they were a single, unified computing resource. With the total redundancy of multiple servers, the cluster can help achieve greater system uptime.

Clustering can be implemented at different levels of the system, including hardware, operating systems, middleware, systems management and applications. The more layers that incorporate clustering technology, the more reliable, scalable and manageable the cluster.

Sun MQ Introduction

Sun Message Queue is a messaging middleware product that implements the Java Message Service (JMS) standard.

Connects legacy and new applications, extending current IT assets

Minimizes application downtime through failover capabilities and high availability with Sun Cluster software.

Message server clusters enables the system to optimize network performance and throughput, providing performance that meets large-scale enterprise needs

Ensures only authorized individuals have access; messages are tamper-proof and confidential

Includes broker clustering as well as load distribution and scaling

Sun MQ Broker Introduction

In order to send or receive messages, a JMS(Java Messaging Service) client must first connect to a JMS message server (most often called a broker): the connection opens a channel of communication between the client and the broker. Next, the client must set up a session for creating, producing, and consuming messages. You can think of the session as a stream of messages defining a particular conversation between the client and the broker. The client itself is a message producer and/or a message consumer. The message producer sends a message to a destination that the broker manages. The message consumer accesses that destination to consume the message. The message includes a header, optional properties, and a body. The body holds the data; the header contains information the broker needs to route and manage the message; and the properties can be defined by client applications or by a provider to serve their own needs in processing messages. Connections, sessions, destinations, messages, producers, and consumers are the basic objects that make up a JMS application.

Using these basic objects, a client application can use two messaging patterns (or domains) to send and receive messages

Sun MQ Broker Architecture

image

Sun MQ Broker Architecture Explanation

Clients A and B are message producers, sending messages to clients C, D, E, and F by way of two different kinds of destinations.

Messaging between clients A, C, and D illustrates the point-to-point domain. Using this pattern, a client sends a message to a queue destination from which only one receiver may get it. No other receiver accessing that destination can get that specific message.

Messaging between clients B, E, and F illustrates the publish/subscribe domain. Using this broadcast pattern, a client sends a message to a topic destination from which any number of consuming subscribers can retrieve it. Each subscriber gets its own copy of the message.

Message consumers in either domain can choose to receive messages synchronously or asynchronously. Synchronous consumers make an explicit call to retrieve a message; asynchronous consumers specify a callback method that is invoked to pass a pending message. Consumers can also filter out messages by specifying selection criteria for incoming messages

Steps to Achieve SunMQ clustering

Pre-Requisites

Two Windows Machines running either Windows Xp or Windows 2000/2003 series Operating system.

Two machines should be in network and ping-able to each other.

MySQL is installed on these two machines and are highly available to each other

Note

Machine 1 IP address x.x.x.x and Machine 2 IP address y.y.y.y

Details regarding MySQL clustering can be found in the KM site. Document name is “MySQL Clustering

1) Download "mq4_1-installer“

2) Click on "installer.vbs“

3) It will open an installation window .Stick to all default values and install SUN MQ.

4) Go to path "C:\Program Files\Sun\MessageQueue\mq\lib\ext". Place JdbcOdbc.dll and mysql-connector-java-3.1.14-bin.jar file.

5) Go to path "C:\Program Files\Sun\MessageQueue\mq\ var\instances\imqbroker\props". Open config.properties in Machine1 and Machine 2 and copy the configuration in the next slides at the end of file in Machine 1 and Machine 2 respectively. Modify the values according to the required setup in the systems required

Machine 1 Configuration. Machine 1 IP address :x.x.x.x

imq.instanceconfig.version=300
imq.persist.jdbc.dbVendor=mysql
imq.persist.jdbc.mysql.user=root
imq.cluster.ha=true
imq.persist.jdbc.mysql.password=database
imq.cluster.brokerlist=x.x.x.x\:7676,y.y.y.y\:7676
imq.cluster.heartbeat.interval=60
imq.cluster.heartbeat.port=7676
imq.persist.store=jdbc
imq.cluter.heartbeat.hostname=y.y.y.y\:7676
imq.persist.jdbc.mysql.property.url=jdbc\:mysql\://localhost\:3306/HDA3?
autoReconnect\=true&jdbcCompliantTruncation\=false&elideSetAutoCommits\=true&
useLocalSessionState\=true&maintainTimeStats\=false&
zeroDateTimeBehavior\=convertToNull
imq.instancename=imqbroker
imq.cluster.heartbeat.threshold=2
imq.cluster.hostname=x.x.x.x
imq.cluster.clusterid=mycluster
imq.persist.jdbc.hadb.property.serverList=x.x.x.x,y.y.y.y
imq.brokerid=ravi
imq.cluster_discovery.tcp=50004
imq.cluster.monitor.threshold=20
imq.cluster.monitor.interval=5
imq.portmapper.port=7676
imq.cluster.port=x.x.x.x\:7676
imq.persist.jdbc.mysql.tableoption=ENGINE\=NDBCLUSTER


Machine 2 Configuration. Machine 2 IP address :y.y.y.y



imq.instanceconfig.version=300
imq.persist.jdbc.dbVendor=mysql
imq.persist.jdbc.mysql.user=root
imq.cluster.ha=true
imq.persist.jdbc.mysql.password=database
imq.cluster.brokerlist=,y.y.y.y\:7676,x.x.x.x\:7676
imq.cluster.heartbeat.interval=60
imq.cluster.heartbeat.port=7676
imq.persist.store=jdbc
imq.cluter.heartbeat.hostname=x.x.x.x\:7676
imq.persist.jdbc.mysql.property.url=jdbc\:mysql\://localhost\:3306/HDA3?
autoReconnect\=true&jdbcCompliantTruncation\=false&elideSetAutoCommits\=true&
useLocalSessionState\=true&maintainTimeStats\=false&
zeroDateTimeBehavior\=convertToNull
imq.instancename=imqbroker
imq.cluster.heartbeat.threshold=2
imq.cluster.hostname=y.y.y.y
imq.cluster.clusterid=mycluster
imq.persist.jdbc.hadb.property.serverList=y.y.y.y,x.x.x.x
imq.brokerid=priya
imq.cluster_discovery.tcp=50004
imq.cluster.monitor.threshold=20
imq.cluster.monitor.interval=5
imq.portmapper.port=7676
imq.cluster.port=y.y.y.y\:7676
imq.persist.jdbc.mysql.tableoption=ENGINE\=NDBCLUSTER


Configuration Parameters Explained



  • Broker list specifies the IP address of the Machines to be added for SUN MQ high availability.


  • Heartbeat interval specifies interval in seconds for checking the other system status


  • Heartbeat port specifies the port on which heart beat functionality needs to be checked.


  • Heartbeat hostname specifies the hostname for which heartbeat functionality needs to be checked.


  • Mysql.property.url specifies the database which is used with their relevant details. In this case we are using clustered Mysql setup with HDA3 database.


  • Imq.brokerid specifies the Idname for the broker. This will be different for different systems that are being clustered. In the above configuration Machine 1 broker id is “tom” and Machine 2 broker id is “david”.


  • Imq.cluster.hostname specifies the hostip of the system.



6) Start Sun MQ by typing “Imqbrokerd” from command prompt in the path "C:\Program Files\Sun\MessageQueue\mq\bin" in both the machines. Message in next slide shows the establishment of clustered connection on machine x.x.x.x. Similar output will be generated on the other machine with IP address y.y.y.y.



Imqbrokerd command output on Machine x.x.x.x.



C:\Program Files\Sun\MessageQueue\mq\bin >imqbrokerd
[06/Oct/2009:12:19:10 IST]
================================================================================
Sun Java(tm) System Message Queue 4.1
Sun Microsystems, Inc.
Version: 4.1 (Build 36-e)
Compile: Thu 07/26/2007
Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
================================================================================
Java Runtime: 1.5.0_15 Sun Microsystems Inc. C:\Program Files\Java\jdk1.5.0_15\jre
[06/Oct/2009:12:19:10 IST] IMQ_HOME=C:\mq\mq
[06/Oct/2009:12:19:10 IST] IMQ_VARHOME=C:\mq\mq\var
[06/Oct/2009:12:19:10 IST] Windows XP 5.1 x86 host1 (2 cpu) tom
[06/Oct/2009:12:19:10 IST] Java Heap Size: max=194432k, current=16256k
[06/Oct/2009:12:19:10 IST] Arguments:
[06/Oct/2009:12:19:10 IST] [B1060]: Loading persistent data...
[06/Oct/2009:12:19:10 IST] Using plugged-in persistent store:
version=410
brokerid=tom
database connection url=jdbc:mysql://localhost:3306/HDA3?autoReconnect=true&jdbcCompliantTruncation=false&am
p;elideSetAutoCommits=true&useLocalSessionState=true&maintainTimeStats=false&zeroDateTimeBehavior=convertToN
ull database user=root
[06/Oct/2009:12:19:18 IST] [B1039]: Broker "imqbroker@host1:7676" ready.
[06/Oct/2009:12:19:31 IST] [B1071]: Established cluster connection to broker mq://y.y.y.y:7676/?instName=imqbroker
&brokerID=david&brokerSessionUID=7928908375671418112&ha=true&storeSessionUID=7928908375671418112[/y.y.y.y:2989]
[06/Oct/2009:14:22:07 IST] [B1072]: Closed cluster connection to broker mq://y.y.y.y:7676/?instName=imqbroker&brok
erID=david&brokerSessionUID=7928908375671418112&ha=true&storeSessionUID=7928908375671418112
[06/Oct/2009:14:22:13 IST] WARNING [B2105]: Attempting to initiate a cluster connection to mq://y.y.y.y:7676/?inst
Name=imqbroker&brokerID=david&brokerSessionUID=7928908375671418112&ha=true&storeSessionUID=7928908375671418112 failed: [
B4256]: Unable to get cluster service port from broker mq://y.y.y.y:7676/?instName=imqbroker&brokerID=david&broker
SessionUID=7928908375671418112&ha=true&storeSessionUID=7928908375671418112
[06/Oct/2009:14:22:25 IST] [B1071]: Established cluster connection to broker mq://y.y.y.y:7676/?instName=imqbroker
&brokerID=david&brokerSessionUID=2593831668997720320&ha=true&storeSessionUID=7928908375671418112[/y.y.y.y:4448]


Working with IMQ Admin for Creating Brokers


1)Type imqadmin in command prompt at “C:\Program Files\Sun\MessageQueue\mq\bin”.



2)Window as shown below will be opened



image



Right click on Broker and give "Add Broker". It gives a window as shown below. Give password as "admin " .Click "OK"



image



Right click on the broker added and select option "Connect to Broker"



image



After the broker got connected, six elements in the Service could be seen (refer to the picture below)



image



Right click on the destination and select option "Add New Broker Destination".  A new window will open up as shown below



image



6) Choose the destination type as topic or a Queue and give the destination Name



7) Generate Message using pre configured application.



8) Make any one of the Sun MQ machine down. The other working Sun MQ machine will show the messages that were there in the Sun MQ which went down. This happens after predefined interval of time. This interval can be set in configuration file.



Conclusion


When a Non-clustered Sun MQ goes down, the entire Message stored is unavailable until the server is brought back up. Any Message that is stored is lost and will have high impact on business performance. The clustered configuration provides uninterrupted service and Message data persistence by providing failover



Following sites can be referred for further information.



http://docs.sun.com/app/docs/doc/820-4917/aerap?a=view



http://docs.sun.com/app/docs/doc/820-4916/geciv?a=view



http://docs.sun.com/source/819-2571/quick-start.html

A simple approach for Sun Message Queue Clustering

Introduction on Clustering

Today's enterprise depends on the availability of mail and web services. Failure is never far away, whether it be a hardware failure or a human error. We have to try to make an infrastructure as highly available as possible. No company would afford to lose a customer when the services they offer to be unreachable, especially since that downtime will almost undoubtedly cost them money. Clustering is the approach towards maintaining highly available Customer service.

What is Clustering & High Availability?

A cluster is two or more interconnected servers (sometimes called nodes) that create a solution to provide higher availability, higher scalability or both. The advantage of clustering servers for high availability is seen if one node fails, another node in the cluster can assume the workload of the failed node, and users see no interruption of access. The advantages of clustering servers for scalability include increased application performance and a greater number of users that can be supported. You can think of a cluster of servers as if they were a single, unified computing resource. With the total redundancy of multiple servers, the cluster can help achieve greater system uptime.

Clustering can be implemented at different levels of the system, including hardware, operating systems, middleware, systems management and applications. The more layers that incorporate clustering technology, the more reliable, scalable and manageable the cluster.

Sun MQ Introduction

Sun Message Queue is a messaging middleware product that implements the Java Message Service (JMS) standard.

Connects legacy and new applications, extending current IT assets

Minimizes application downtime through failover capabilities and high availability with Sun Cluster software.

Message server clusters enables the system to optimize network performance and throughput, providing performance that meets large-scale enterprise needs

Ensures only authorized individuals have access; messages are tamper-proof and confidential

Includes broker clustering as well as load distribution and scaling

Sun MQ Broker Introduction

In order to send or receive messages, a JMS(Java Messaging Service) client must first connect to a JMS message server (most often called a broker): the connection opens a channel of communication between the client and the broker. Next, the client must set up a session for creating, producing, and consuming messages. You can think of the session as a stream of messages defining a particular conversation between the client and the broker. The client itself is a message producer and/or a message consumer. The message producer sends a message to a destination that the broker manages. The message consumer accesses that destination to consume the message. The message includes a header, optional properties, and a body. The body holds the data; the header contains information the broker needs to route and manage the message; and the properties can be defined by client applications or by a provider to serve their own needs in processing messages. Connections, sessions, destinations, messages, producers, and consumers are the basic objects that make up a JMS application.

Using these basic objects, a client application can use two messaging patterns (or domains) to send and receive messages

Sun MQ Broker Architecture

image

Sun MQ Broker Architecture Explanation

Clients A and B are message producers, sending messages to clients C, D, E, and F by way of two different kinds of destinations.

Messaging between clients A, C, and D illustrates the point-to-point domain. Using this pattern, a client sends a message to a queue destination from which only one receiver may get it. No other receiver accessing that destination can get that specific message.

Messaging between clients B, E, and F illustrates the publish/subscribe domain. Using this broadcast pattern, a client sends a message to a topic destination from which any number of consuming subscribers can retrieve it. Each subscriber gets its own copy of the message.

Message consumers in either domain can choose to receive messages synchronously or asynchronously. Synchronous consumers make an explicit call to retrieve a message; asynchronous consumers specify a callback method that is invoked to pass a pending message. Consumers can also filter out messages by specifying selection criteria for incoming messages

Steps to Achieve SunMQ clustering

Pre-Requisites

Two Windows Machines running either Windows Xp or Windows 2000/2003 series Operating system.

Two machines should be in network and ping-able to each other.

MySQL is installed on these two machines and are highly available to each other

Note

Machine 1 IP address x.x.x.x and Machine 2 IP address y.y.y.y

Details regarding MySQL clustering can be found in the KM site. Document name is “MySQL Clustering

1) Download "mq4_1-installer“

2) Click on "installer.vbs“

3) It will open an installation window .Stick to all default values and install SUN MQ.

4) Go to path "C:\Program Files\Sun\MessageQueue\mq\lib\ext". Place JdbcOdbc.dll and mysql-connector-java-3.1.14-bin.jar file.

5) Go to path "C:\Program Files\Sun\MessageQueue\mq\ var\instances\imqbroker\props". Open config.properties in Machine1 and Machine 2 and copy the configuration in the next slides at the end of file in Machine 1 and Machine 2 respectively. Modify the values according to the required setup in the systems required

Machine 1 Configuration. Machine 1 IP address :x.x.x.x

imq.instanceconfig.version=300
imq.persist.jdbc.dbVendor=mysql
imq.persist.jdbc.mysql.user=root
imq.cluster.ha=true
imq.persist.jdbc.mysql.password=database
imq.cluster.brokerlist=x.x.x.x\:7676,y.y.y.y\:7676
imq.cluster.heartbeat.interval=60
imq.cluster.heartbeat.port=7676
imq.persist.store=jdbc
imq.cluter.heartbeat.hostname=y.y.y.y\:7676
imq.persist.jdbc.mysql.property.url=jdbc\:mysql\://localhost\:3306/HDA3?
autoReconnect\=true&jdbcCompliantTruncation\=false&elideSetAutoCommits\=true&
useLocalSessionState\=true&maintainTimeStats\=false&
zeroDateTimeBehavior\=convertToNull
imq.instancename=imqbroker
imq.cluster.heartbeat.threshold=2
imq.cluster.hostname=x.x.x.x
imq.cluster.clusterid=mycluster
imq.persist.jdbc.hadb.property.serverList=x.x.x.x,y.y.y.y
imq.brokerid=ravi
imq.cluster_discovery.tcp=50004
imq.cluster.monitor.threshold=20
imq.cluster.monitor.interval=5
imq.portmapper.port=7676
imq.cluster.port=x.x.x.x\:7676
imq.persist.jdbc.mysql.tableoption=ENGINE\=NDBCLUSTER


Machine 2 Configuration. Machine 2 IP address :y.y.y.y



imq.instanceconfig.version=300
imq.persist.jdbc.dbVendor=mysql
imq.persist.jdbc.mysql.user=root
imq.cluster.ha=true
imq.persist.jdbc.mysql.password=database
imq.cluster.brokerlist=,y.y.y.y\:7676,x.x.x.x\:7676
imq.cluster.heartbeat.interval=60
imq.cluster.heartbeat.port=7676
imq.persist.store=jdbc
imq.cluter.heartbeat.hostname=x.x.x.x\:7676
imq.persist.jdbc.mysql.property.url=jdbc\:mysql\://localhost\:3306/HDA3?
autoReconnect\=true&jdbcCompliantTruncation\=false&elideSetAutoCommits\=true&
useLocalSessionState\=true&maintainTimeStats\=false&
zeroDateTimeBehavior\=convertToNull
imq.instancename=imqbroker
imq.cluster.heartbeat.threshold=2
imq.cluster.hostname=y.y.y.y
imq.cluster.clusterid=mycluster
imq.persist.jdbc.hadb.property.serverList=y.y.y.y,x.x.x.x
imq.brokerid=priya
imq.cluster_discovery.tcp=50004
imq.cluster.monitor.threshold=20
imq.cluster.monitor.interval=5
imq.portmapper.port=7676
imq.cluster.port=y.y.y.y\:7676
imq.persist.jdbc.mysql.tableoption=ENGINE\=NDBCLUSTER


Configuration Parameters Explained



  • Broker list specifies the IP address of the Machines to be added for SUN MQ high availability.


  • Heartbeat interval specifies interval in seconds for checking the other system status


  • Heartbeat port specifies the port on which heart beat functionality needs to be checked.


  • Heartbeat hostname specifies the hostname for which heartbeat functionality needs to be checked.


  • Mysql.property.url specifies the database which is used with their relevant details. In this case we are using clustered Mysql setup with HDA3 database.


  • Imq.brokerid specifies the Idname for the broker. This will be different for different systems that are being clustered. In the above configuration Machine 1 broker id is “tom” and Machine 2 broker id is “david”.


  • Imq.cluster.hostname specifies the hostip of the system.



6) Start Sun MQ by typing “Imqbrokerd” from command prompt in the path "C:\Program Files\Sun\MessageQueue\mq\bin" in both the machines. Message in next slide shows the establishment of clustered connection on machine x.x.x.x. Similar output will be generated on the other machine with IP address y.y.y.y.



Imqbrokerd command output on Machine x.x.x.x.



C:\Program Files\Sun\MessageQueue\mq\bin >imqbrokerd
[06/Oct/2009:12:19:10 IST]
================================================================================
Sun Java(tm) System Message Queue 4.1
Sun Microsystems, Inc.
Version: 4.1 (Build 36-e)
Compile: Thu 07/26/2007
Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
================================================================================
Java Runtime: 1.5.0_15 Sun Microsystems Inc. C:\Program Files\Java\jdk1.5.0_15\jre
[06/Oct/2009:12:19:10 IST] IMQ_HOME=C:\mq\mq
[06/Oct/2009:12:19:10 IST] IMQ_VARHOME=C:\mq\mq\var
[06/Oct/2009:12:19:10 IST] Windows XP 5.1 x86 host1 (2 cpu) tom
[06/Oct/2009:12:19:10 IST] Java Heap Size: max=194432k, current=16256k
[06/Oct/2009:12:19:10 IST] Arguments:
[06/Oct/2009:12:19:10 IST] [B1060]: Loading persistent data...
[06/Oct/2009:12:19:10 IST] Using plugged-in persistent store:
version=410
brokerid=tom
database connection url=jdbc:mysql://localhost:3306/HDA3?autoReconnect=true&jdbcCompliantTruncation=false&am
p;elideSetAutoCommits=true&useLocalSessionState=true&maintainTimeStats=false&zeroDateTimeBehavior=convertToN
ull database user=root
[06/Oct/2009:12:19:18 IST] [B1039]: Broker "imqbroker@host1:7676" ready.
[06/Oct/2009:12:19:31 IST] [B1071]: Established cluster connection to broker mq://y.y.y.y:7676/?instName=imqbroker
&brokerID=david&brokerSessionUID=7928908375671418112&ha=true&storeSessionUID=7928908375671418112[/y.y.y.y:2989]
[06/Oct/2009:14:22:07 IST] [B1072]: Closed cluster connection to broker mq://y.y.y.y:7676/?instName=imqbroker&brok
erID=david&brokerSessionUID=7928908375671418112&ha=true&storeSessionUID=7928908375671418112
[06/Oct/2009:14:22:13 IST] WARNING [B2105]: Attempting to initiate a cluster connection to mq://y.y.y.y:7676/?inst
Name=imqbroker&brokerID=david&brokerSessionUID=7928908375671418112&ha=true&storeSessionUID=7928908375671418112 failed: [
B4256]: Unable to get cluster service port from broker mq://y.y.y.y:7676/?instName=imqbroker&brokerID=david&broker
SessionUID=7928908375671418112&ha=true&storeSessionUID=7928908375671418112
[06/Oct/2009:14:22:25 IST] [B1071]: Established cluster connection to broker mq://y.y.y.y:7676/?instName=imqbroker
&brokerID=david&brokerSessionUID=2593831668997720320&ha=true&storeSessionUID=7928908375671418112[/y.y.y.y:4448]


Working with IMQ Admin for Creating Brokers


1)Type imqadmin in command prompt at “C:\Program Files\Sun\MessageQueue\mq\bin”.



2)Window as shown below will be opened



image



Right click on Broker and give "Add Broker". It gives a window as shown below. Give password as "admin " .Click "OK"



image



Right click on the broker added and select option "Connect to Broker"



image



After the broker got connected, six elements in the Service could be seen (refer to the picture below)



image



Right click on the destination and select option "Add New Broker Destination".  A new window will open up as shown below



image



6) Choose the destination type as topic or a Queue and give the destination Name



7) Generate Message using pre configured application.



8) Make any one of the Sun MQ machine down. The other working Sun MQ machine will show the messages that were there in the Sun MQ which went down. This happens after predefined interval of time. This interval can be set in configuration file.



Conclusion


When a Non-clustered Sun MQ goes down, the entire Message stored is unavailable until the server is brought back up. Any Message that is stored is lost and will have high impact on business performance. The clustered configuration provides uninterrupted service and Message data persistence by providing failover



Following sites can be referred for further information.



http://docs.sun.com/app/docs/doc/820-4917/aerap?a=view



http://docs.sun.com/app/docs/doc/820-4916/geciv?a=view



http://docs.sun.com/source/819-2571/quick-start.html

Spanning tree protocol

  • Most of the industries depend on the performance of the Ethernet networks.
  • What would happen if the network failures?
  • Reasons of the failure?
  • Cable redundancy is tried by configuring the network in either ring or parallel branches.
  • Redundancy networks.

image 

  • If first cable fails second cable will take over. smile_regular

Fault tolerance through Redundancy

Switch is used to connect two networks or segments

image

Disadvantages of the Redundancy networks.

-- Broadcast storms

-- Multi frame copies

-- MAC address table instability

-- Loops

Switch MAC address table building

Switches/Bridges will learn the hosts location based on the Source address in the receiving frames.

Switches will broadcast

-- Unknown unicast frames

-- Broadcast frames

-- Multi cast frames

MAC address database instability

In a redundant switched N/W it is possible for switches to learn wrong information.

Host X sends a frame direct to router Y.

Initially switches will learn the MAC address of host X on their port 0.

image

Multi Frame copies

Host X sends a unicast frame to Router Y.

image

The solution is “to allow physical loops” but “to create a logical loop free topology”.

The idea of connecting networks in redundant way is ?

The only disadvantage is Loops, how it would be if we can disable the loops??

How to disable the loops???

Note: Redundancy eliminates a single point of hardware failure in a network. Whenever switch redundancy is present in a network, there is a loop. smile_regular

Spanning tree protocol
  • STP is a link management protocol for MAC bridges.
  • It is defined in IEEE 802.1D standard.
  • STP provides path redundancy while preventing undesired active loops in a N/W.
  • STP allows only one active path at a time between any two network devices (this prevents the loops) but establishes the redundant links as a backup if the initial link fails.
  • The logical loop free topology created is called a tree.
  • This tree is called a spanning tree because all the switches in the network are reachable or spanned.
  • The algorithm used to create this loop free topology is “spanning tree algorithm”.

How does STP works?

  • In a STP bridged environment, the switches exchange information amongst themselves using a layer 2 frame called bridge protocol data units (BPDU).
  • STP software will elect a root bridge.
  • Once the root bridge is delegated, it will then calculate all redundant paths from the lower bridges back to itself.
  • Each port on every bridge in the STP tree will be assigned a weighted metric called a path cost.
  • The path cost is used to determine which port provides the best path for data flow.

STP Algorithm

  • STP establishes a root node called root bridge.
  • STP constructs a topology that has one path to reach every network node.
  • Resulting tree originates from the root bridge.
  • Redundant links that are not part of the shortest path tree are blocked.
  • As certain paths are blocked loop free topology is possible.
  • Basically links that will cause a loop are put into a blocking state. BPDU continue to be received on blocked ports.
  • STA chooses a reference point called root bridge and then determines the available paths to that reference point.
  • If more than one path exists, STA picks up the best path and blocks the rest.
  • Loop free topology calculations makes extensive use of two components.
    • Bridge ID
    • Path cost
  • STP Loop free topology Convergence sequence.
    • Step 1: Elect one root bridge
    • Step 2: Elect root ports
    • Step 3: Elect designated ports

Loop Free Topology

  • STA always uses the 4 step decision sequence to find out loop free topology.
    • Step 1 : Lowest BID
    • Step 2: Lowest path cost to root bridge.
    • Step 3: Lowest sender BID
    • Step 4: Lowest Port ID

Bridges use the configuration BPDU in this four step sequence.

Bridge ID

  • BID is used identify each bridge.

image

  • BID is used to elect the root bridge, lowest BID is the root bridge.
  • Bridges use the concept of cost to evaluate how close they are to other bridges.

image image

Example

image image

Step 1: Elect one root bridge

  • At the beginning all the bridges assume they are at the center and declare them selves as the root bridge.

Step 2: Elect root ports

  • Root port is the port closest to the root bridge. Bridges use the path cost to determine the closeness.
  • Every non root bridge will select one root port.

image

Step 3: Elect Designated ports

  • Loop preventions part of the STP becomes evident in this step.
  • A designated port functions as the single bridge port that both sends and receive traffic to and from that segment and the root bridge.
  • Switch containing the designated port is considered as the designated bridge for that segment.
  • STP always go through the 4 step sequence to elect designated ports.
  • Non designated ports will be blocked to avoid loops.
  • Loop free topology is re configured again whenever there is topology change in the network or any failure.
  • If one network segment in the Spanning-Tree Protocol becomes unreachable, or if Spanning-Tree Protocol costs change, the spanning-tree algorithm reconfigures the spanning-tree topology and reestablishes the link by activating the standby path.
  • While re configuring loop free topology STA uses port states.

STP port statesimage

1. Disabled

2. Blocked

3. Listening

4. Learning

5. Forwarding

Blocked state

  • Data frames are discarded and no addresses are learned.
  • It may take up to 20 seconds to change from this state.
  • If there are no other shorter paths to the root bridge will change to the listening state.

Listening state

  • Path that is not the least cost path to the root bridge goes back to the blocked state.
  • Listening period is called the forward delay and lasts for 15 seconds.
  • In this state user data is not being processed and MAC addresses are not being learned but BPDU are processed.
  • User data is not learned, but MAC addresses are learned from any traffic that is seen.
  • Learning state lasts for 15 seconds and is also called the forward delay.
  • BPDUs are still processed.

Forwarding state

  • A switch port is allowed to transition to the forwarding state only if no redundant links are detected and if the port has the best path to the root bridge as the root port or designated port.
  • User data is forwarded and MAC addresses continue to be learned.
  • BPDUs are still processed.

Rapid spanning tree protocol

  • Clarifications of port states and roles.
  • Definition of link types that can go to forwarding state rapidly.
  • Link types have been defined as point to point, edge type and shared.
  • Point to point and edge type links can go to the forwarding state immediately.
  • The new states defined in this are only discarded, learning and forwarding.

Spanning tree protocol

  • Most of the industries depend on the performance of the Ethernet networks.
  • What would happen if the network failures?
  • Reasons of the failure?
  • Cable redundancy is tried by configuring the network in either ring or parallel branches.
  • Redundancy networks.

image 

  • If first cable fails second cable will take over. smile_regular

Fault tolerance through Redundancy

Switch is used to connect two networks or segments

image

Disadvantages of the Redundancy networks.

-- Broadcast storms

-- Multi frame copies

-- MAC address table instability

-- Loops

Switch MAC address table building

Switches/Bridges will learn the hosts location based on the Source address in the receiving frames.

Switches will broadcast

-- Unknown unicast frames

-- Broadcast frames

-- Multi cast frames

MAC address database instability

In a redundant switched N/W it is possible for switches to learn wrong information.

Host X sends a frame direct to router Y.

Initially switches will learn the MAC address of host X on their port 0.

image

Multi Frame copies

Host X sends a unicast frame to Router Y.

image

The solution is “to allow physical loops” but “to create a logical loop free topology”.

The idea of connecting networks in redundant way is ?

The only disadvantage is Loops, how it would be if we can disable the loops??

How to disable the loops???

Note: Redundancy eliminates a single point of hardware failure in a network. Whenever switch redundancy is present in a network, there is a loop. smile_regular

Spanning tree protocol
  • STP is a link management protocol for MAC bridges.
  • It is defined in IEEE 802.1D standard.
  • STP provides path redundancy while preventing undesired active loops in a N/W.
  • STP allows only one active path at a time between any two network devices (this prevents the loops) but establishes the redundant links as a backup if the initial link fails.
  • The logical loop free topology created is called a tree.
  • This tree is called a spanning tree because all the switches in the network are reachable or spanned.
  • The algorithm used to create this loop free topology is “spanning tree algorithm”.

How does STP works?

  • In a STP bridged environment, the switches exchange information amongst themselves using a layer 2 frame called bridge protocol data units (BPDU).
  • STP software will elect a root bridge.
  • Once the root bridge is delegated, it will then calculate all redundant paths from the lower bridges back to itself.
  • Each port on every bridge in the STP tree will be assigned a weighted metric called a path cost.
  • The path cost is used to determine which port provides the best path for data flow.

STP Algorithm

  • STP establishes a root node called root bridge.
  • STP constructs a topology that has one path to reach every network node.
  • Resulting tree originates from the root bridge.
  • Redundant links that are not part of the shortest path tree are blocked.
  • As certain paths are blocked loop free topology is possible.
  • Basically links that will cause a loop are put into a blocking state. BPDU continue to be received on blocked ports.
  • STA chooses a reference point called root bridge and then determines the available paths to that reference point.
  • If more than one path exists, STA picks up the best path and blocks the rest.
  • Loop free topology calculations makes extensive use of two components.
    • Bridge ID
    • Path cost
  • STP Loop free topology Convergence sequence.
    • Step 1: Elect one root bridge
    • Step 2: Elect root ports
    • Step 3: Elect designated ports

Loop Free Topology

  • STA always uses the 4 step decision sequence to find out loop free topology.
    • Step 1 : Lowest BID
    • Step 2: Lowest path cost to root bridge.
    • Step 3: Lowest sender BID
    • Step 4: Lowest Port ID

Bridges use the configuration BPDU in this four step sequence.

Bridge ID

  • BID is used identify each bridge.

image

  • BID is used to elect the root bridge, lowest BID is the root bridge.
  • Bridges use the concept of cost to evaluate how close they are to other bridges.

image image

Example

image image

Step 1: Elect one root bridge

  • At the beginning all the bridges assume they are at the center and declare them selves as the root bridge.

Step 2: Elect root ports

  • Root port is the port closest to the root bridge. Bridges use the path cost to determine the closeness.
  • Every non root bridge will select one root port.

image

Step 3: Elect Designated ports

  • Loop preventions part of the STP becomes evident in this step.
  • A designated port functions as the single bridge port that both sends and receive traffic to and from that segment and the root bridge.
  • Switch containing the designated port is considered as the designated bridge for that segment.
  • STP always go through the 4 step sequence to elect designated ports.
  • Non designated ports will be blocked to avoid loops.
  • Loop free topology is re configured again whenever there is topology change in the network or any failure.
  • If one network segment in the Spanning-Tree Protocol becomes unreachable, or if Spanning-Tree Protocol costs change, the spanning-tree algorithm reconfigures the spanning-tree topology and reestablishes the link by activating the standby path.
  • While re configuring loop free topology STA uses port states.

STP port statesimage

1. Disabled

2. Blocked

3. Listening

4. Learning

5. Forwarding

Blocked state

  • Data frames are discarded and no addresses are learned.
  • It may take up to 20 seconds to change from this state.
  • If there are no other shorter paths to the root bridge will change to the listening state.

Listening state

  • Path that is not the least cost path to the root bridge goes back to the blocked state.
  • Listening period is called the forward delay and lasts for 15 seconds.
  • In this state user data is not being processed and MAC addresses are not being learned but BPDU are processed.
  • User data is not learned, but MAC addresses are learned from any traffic that is seen.
  • Learning state lasts for 15 seconds and is also called the forward delay.
  • BPDUs are still processed.

Forwarding state

  • A switch port is allowed to transition to the forwarding state only if no redundant links are detected and if the port has the best path to the root bridge as the root port or designated port.
  • User data is forwarded and MAC addresses continue to be learned.
  • BPDUs are still processed.

Rapid spanning tree protocol

  • Clarifications of port states and roles.
  • Definition of link types that can go to forwarding state rapidly.
  • Link types have been defined as point to point, edge type and shared.
  • Point to point and edge type links can go to the forwarding state immediately.
  • The new states defined in this are only discarded, learning and forwarding.

Jan 27, 2010

Text Widget

Copyright © Vinay's Blog | Powered by Blogger

Design by | Blogger Theme by