Sie sind auf Seite 1von 61

Layer 2 Devices

SWITCHES & BRIDGES

SWITCHES

Types of Switches
Unmanaged Switch Managed Switch

SWITCHES

Types of Switches
Layer 2 Switch Layer 3 and 4 Switch

Layer 2 Switch
Function :
1. It works in the Data-Link layer(Layer 2)

2. It looks at the Data link layer header of the frame(Hardware address)before forward or drop the frame. 3. These switches uses the ASIC (Application Specified Integrated Circuits)

Advantages

Low cost Wire Speed Low Latency MAC address based bridging

Disadvantages

Individual collision domain. Single large Broadcast domain.

BRIDGING Vs SWITCHING

Bridging
1.Software Based 2. Only one Spanning tree

Switching
1.Hardware Based 2. Many Spanning tree

3. Only 16 Ports

3. Many ports

Switch Function

Address Learning Forwarding and Filtering Loop Avoidance

Address Learning

Function.
Learn the MAC address from the received frame of a particular interface and store it into the MAC data base.

Forwarding and Filtering

It receives the frame from an interface. It compare the MAC address of the received frame with the MAC data base ,if it matches then it forward the frame,otherwise filter the frame.

Loop Avoidance
We have a second switch for the redundancy,because of this loop can occur,finally that will affect the entire network performance. This Loop can be avoided by implementing the Spanning Tree protocol.

Address Learning
Details:
1. While power ON the switch ,its MAC table is empty. 2. When it receives the data frame it stores source address information on to the MAC table with the interface through which it received. 3. It does not know the destination address. 4. So It floods this information,which ever reply back with its source address ,it store the source address of this frame also on to MAC table. 5. Now it will send the data frame to the destination.

Switch Function
Host A send a data to Host C
MAC Table
E0/0: 0000.8c01.1111 E0/0: 0000.8c01.2222 E0/0: 0000.8c01.3333

E0/0: 0000.8c01.4444

0000.8c01.1111

E0

E1

0000.8c01.3333

E3 E2

0000.8c01.2222

0000.8c01.4444

Forward and Filter action


1. Received the from from an interface with the source address. 2. Stores the MAC address in the MAC table. 3. Check the destination MAC address in the MAC table,if it is there then it forward the frame to that destination address. 4. If destination address is not in the MAC table then it broadcast the frame,which ever destination reply to this with its source address,it will store these information in the MAC table and send the frame to that destination.

Forward and Filter Action

5.This way it preserves the bandwidth. 6.This is known as Frame-Filtering.

Loop Avoidance
A

Segment 1

Switch A

Switch B

Segment 2

Loop Avoidance
For redundancy purpose the second switch implemented into the network. Which will cause the Loop problem if no loop mechanism implemented into the network. Without the loop avoidance mechanism,the frame will be broadcasted continuously throughout the network.This is known as Broadcast Storm.

Loop Avoidance
Single device can receive same frame from several segment. In this case MAC table can not forward the frame to a device,due to constant updating of the MAC table. This is known as THRASHING the MAC table. Several loops are developed within loops. Spanning Tree Protocol can avoid this LOOP forming.

Spanning Tree Protocol


A

100 BaseT

Designated Port (F)

Root Bridge
Designated Port (F)

Non root bridge


Non Designated Port (F)

100 Base T

Spanning Tree Protocol


Digital Equipment Corporation developed the STP version 802.1d. This will watch all the link to avoid the Loop and shutdown the Redundant link.

STP Operation
Depending on the MAC address and the priority number STP will elect one switch as the Root Bridge. The ports attached to this Root bridge are called designated port or Forwarding state ports. These ports will send and receive the frames. The other switch will be considered as the Non-Root bridge. The ports connected to this Non-Root bridge is known as non-designated ports,which will not send and receive the frame.

Selecting the Root-Bridge


They exchange their Ids by using the BPDU(Bridge Protocol Data Units) Each bridge ID is 8 byte length. Bridge ID is a combination of (MAC address and the priority number) Default priority number is 32768. Lowest ID is consider as the root bridge. Every 2 second it exchange their BPDUs.

Selecting the Designated Port.

STP determines the designated port by means of the lowest path cost. These ports can send and receive the layer 2 frames.

STP Port States


Blocking State Listening State Learning State Forwarding State

Blocking State
When power ON the switch ,it listen to BPDUs ,and all ports are in Blocking state.

Listening State
Before start sending the frames it will check that no loop occurred.

Learning State
It will learn the MAC address and built a Filter table.

Forwarding State
It will send and receive the all datas.

Convergence
It is important that all the devices should have the same data base. Convergence occurs when switches are in either blocking state or forwarding state. It takes 50 seconds to change from blocking to forwarding. This timer can be changed. The forward delay is the time taken from listening to learning and then to forwarding.

LAN Switch

Cut-through Fragment Free Store and Forward

Store and Forward


It receives the entire frame,stores into the buffer . Then check for the CRC error. Latency is depend on the length of the frame. If CRC error is occur ,it discard the frame. If the frame size is less than 64bytes or greater than 1518 bytes then also it discard the frame. If no error occur then it look the Switching table,then forward to the destination.

Cut-through Switch
It receives the frame,and check only the Destination address. It stores the destination address into the buffer. It check the switching table and then it forward the frame to the destination .

Fragment Free Switching


It receives the frame of 64 byte. Then If error occurs it should be within the first 64 byte. Then it forward the frame.

VLAN
Why VLAN?
To increase the Network performance. To create many broadcast domain. VLAN can be created on the basis of function,department etc.,

Layer 2 Switch Disadvantages


It has to handle the large number of collision and broadcast packets. Security is another problem,each device receives the packet.

VLAN Advantages
You can have the control over the broadcast. You can create small small broadcast domain,doing so packet meant for one broadcast domain is not visible to the other VLAN. This can be done by VLAN concepts.

VLAN Advantages
You can have the control on security,by using the VLAN you can control the port and users. Doing so no one can plug the workstation to a switch port.

VLAN Types

Static VLAN Dynamic VLAN

Static VLAN

Administrator can add nodes to a particular VLAN.

Dynamic VLAN
In this case VLAN can determine the node. Using a software you can enable the port MAC address,protocols or even application.(VMPS)

Identifying the VLAN


VLAN can be identified by Frame Tagging. Frame Tagging assign user defined ID to each frame,this is known as VLAN ID.

Links
Access LINK
Links that are only part of one VLAN(Native VLAN) Which will understand the other VLAN membership.

Trunk LINK
Links which can carry many VLANs

Function of FRAME Tagging


Frame tagging will be used when a frame travels in trunked link,same way it will be removed when the frame exist the trunked link. Each switch receive the frame with VLAN ID,and compares with the filter table,if the frame is meant for another trunked link,then the frame will be forwarded out the trunk link. When the frame reaches exist ac access link,the switch remove the VLAN ID,then the end device receive the frame without knowing the VLAN identification.

VLAN to VLAN
To communicate between one VLAN to another VLAN layer 3 device is needed to route the packet.(Router can be used)

VTP
This is used to administrate the VLAN. You can add VLAN You can delete a VLAN You can name the VLAN This can be propogated to all VLANs

VTP Operation

Three modes of Operation:


Server Mode Client Transparent

Server Mode
Single server should be there in a VTP domain to propagate the VLAN information. Switch should be in a Server mode. Any changes like add,delete has to advertised to the entire domain.

Client Mode
You can not make any changes. The switch can receive any updates from server. To convert a Switch into a server mode,first configure the switch in a client mode so that it can receive all the information from server then convert it into a Server mode.

Transparent Mode
This will not participate in a VTP domain It maintains its own data base. It can add or delete VLANs but will not share it with other switch.

VTP Pruning

Pruning :
Configuring the VTP in such a way that it can reduce the amount of broadcast,multicast and unicast packet. By default it is disabled.

VLAN Configuration
When you power ON the Switch you will get the following message. 1 User(s) now acting on Management Console User Interface Menu [M] Menus [K] Command Line [I] IP Configuration Enter Selection : (Select K to enter into Command Line Then the following prompt will appear. >

Configuration:
* >En (press) * # config t * (config t)# At this configuration mode,you can set the password ,assign the hostname and assign the IP address. Then assign the default gateway.

Configuration :
(config t)#ip add 172.16.1.225 255.255.255.0 (config t)# ip default gateway 172.16.1.1 Then you can configuring the ethernet interface by using the following command. (config t)#int ethernet 0/1
Then you configure the IP for this particular interface

Configuration :
* VLAN Configuration :
1.Select K from the main screen to enter into command line. 2. You will get a prompt like > 3. Here press en to come to hash prompt. 4. At the # prompt type config t 5. It will go to the Global configuration mode (config t)# 6.At the global configuration mode use the following to create VLANs.

Configuration :
(config t)#vlan 2 name ADMIN (config t)#vlan 3 name HRD (config t)#vlan 4 name ACCT

Configuration :
Now come out to privileged mode by pressing EXIT. Just execute the show command to view the created VLANs. # sh vlan This will display you the VLANs created.

Assigning Ports to the VLAN


(config t )# int e0/2 (config t-if)#vlan-membership static 2 (config t )# int e0/4 (config t-if)#vlan-membership static 3 (config t )# int e0/5 (config t-if)#vlan-membership static 4 (config t-if)#exit #

Assigning Ports to the VLAN


# sh vlan It will display the complete VLANs and the port assigned to the concerned VLAN. You can view the particular VLAN also by entering the following command. #sh vlan 2

Configuring Trunk Port


#config t (config t)#int f0/26 (config t-if)#trunk on Now all the VLANs are in the trunkedport.To erase trunklink use (config t-if)# no trunk-vlan 5

Useful Show Commands


Show run Show ip Show inter e0 Show version Show vlan Show trunk A Show trunk B Show cdp Show VTP

Das könnte Ihnen auch gefallen