Tampilkan postingan dengan label Switching. Tampilkan semua postingan
Tampilkan postingan dengan label Switching. Tampilkan semua postingan

Kamis, 09 Desember 2010

Configuring Cisco Catalyst Switch

Here I will explain about configuring a Cisco Catalyst Switch
  • Preparation to Configure a Switch
  • Basic Switch Configuration:
    • Management Interface Considerations
    • Configure Management Interface
    • Configure Default Gateway
    • Verify Configuration
    • Configure Duplex and Speed
    • Configure a Web Interface
Prepare to Configure the Switch
The initial startup of a Catalyst switch requires the completion of the following steps:
Step 1. Before starting the switch, verify the following:
All network cable connections are secure.
Your PC or terminal is connected to the console port. Your terminal emulator application, such as HyperTerminal is running and configured properly. The figure shows a PC connected to a switch using the console port.
The figure below shows the correct configuration of HyperTerminal, which can be used to view the console of a Cisco device. In here I'm using a USB-to-RS232 converter the driver make a new Serial Port COM 15. If your PC or Laptop already has a Serial Port it should be COM 1.



















Step 2. Attach the power cable plug to the switch power supply socket. The switch will start. Some Catalyst switches, including the Cisco Catalyst 2960 series, do not have power buttons.
Step 3. Observe the boot sequence as follows:
When the switch is on, the POST begins. During POST, the LEDs blink while a series of tests determine that the switch is functioning properly. When the POST has completed, the SYST LED rapidly blinks green. If the switch fails POST, the SYST LED turns amber. When a switch fails the POST test, it is necessary to repair the switch.
Observe the Cisco IOS software output text on the console.

The Boot Process on console should be like this:
Copyright (c) 1986-2006 by Cisco Systems, Inc,.
Compiled Fri 28-Jul-06 04:33 by yenanh
Image text-base: 0x0o003000, data—base: OxOOAA2F34
flashfs[l]: 602 files, 19 directories
flashfs[1]: 0 orphaned files, 0 orphaned directories flashfs[1r]: Tota1 bytes: 32514048
flashfs[1]: Bytes used: 7715328
flashfs[1]: Bytes available: 24798720
flashfs[1]: flashfs fsck took 1 seconds.
flashfs[1]: Initia1ization complete....done Initia1izing flashfs.
POST: CPU MIC register Tests : Begin
POST: CPU MIC register Tests : End, status Passed
POST: PortASIC Memory Tests : Begin
POST: PortASIC Memory Tests : End, Status Passed
POST: CPU MIC PostASIC interface Loopback Tests : Begin
POST: CPU MIC PostASIC interface Loopback Tests : End, Status Passed
POST: PostASIC RingLoopback Tests : Begin
POST: PostASIC RingLoopback Tests : End, Status Passed
POST: PostASIC CAM Subsystem Tests: Begin
During the initial startup of the switch, if POST failures are detected, they are reported to the console and the switch does not start. If POST completes successfully, and the switch has not been configured before, you are prompted to configure the switch.


Management Interface Considerations
An access layer switch is much like a PC in that you need to configure an IP address, a subnet mask, and a default gateway. To manage a switch remotely using TCP/IP, you need to assign the switch an IP address. In the figure, you want to manage S1 from PC1, a computer used for managing the network. To do this, you need to assign switch S1 an IP address. This IP address is assigned to a virtual interface called a virtual LAN (VLAN), and then it is necessary to ensure the VLAN is assigned to a specific port or ports on the switch.

The default configuration on the switch is to have the management of the switch controlled through VLAN 1. However, a best practice for basic switch configuration is to change the management VLAN to a VLAN other than VLAN 1. The implications and reasoning behind this action are explained in the next chapter. The figure illustrates the use of VLAN 99 as the management VLAN; however, it is important to consider that an interface other than VLAN 99 can be considered for the management interface.


Configure Management Interface
To configure an IP address and subnet mask on the management VLAN of the switch, you must be in VLAN interface configuration mode. Use the command interface vlan 99 and enter the ip address configuration command. You must use the no shutdown interface configuration command to make this Layer 3 interface operational. When you see "interface VLAN x", that refers to the Layer 3 interface associated with VLAN x. Only the management VLAN has an interface VLAN associated with it.

Note that a Layer 2 switch, such as the Cisco Catalyst 2960, only permits a single VLAN interface to be active at a time. This means that the Layer 3 interface, interface VLAN 99, is active, but the Layer 3 interface, interface VLAN 1, is not active.

Here is the Cisco IOS CLI Command Syntax:
S1#configure terminal
S1(config)#interface vlan 99
S1(config-if)#ip address 172.17.99.11 255.255.0.0
S1(config-if)#no shutdown
S1(config-if)#end
S1#configure terminal
S1(config)#interface fastethernet 0/18
S1(config-if)#switchport mode access
S1(config-if)#switchport acces vlan 99
S1(config-if)#end
S1#copy running-config startup-config

Configure Default Gateway
You need to configure the switch so that it can forward IP packets to distant networks. The default gateway is the mechanism for doing this. The switch forwards IP packets with destination IP addresses outside the local network to the default gateway. In the figure, router R1 is the next-hop router. Its IP address is 172.17.99.1.

To configure a default gateway for the switch, use the ip default-gateway command. Enter the IP address of the next-hop router interface that is directly connected to the switch where a default gateway is being configured. Make sure you save the configuration running on a switch or router. Use the copy running-config startup-config command to back up your configuration.


Verify Configuration
Here is an abbreviated screen output showing that VLAN 99 has been configured with an IP address and subnet mask, and Fast Ethernet port F0/18 has been assigned the VLAN 99 management interface:
S1#show running-config
...
!
interface FastEthernet0/18
switchport access vlan 99
switchport mode access
...
!
interface Vlan99
ip address 172.17.99.11 255.255.255.0
no-ip route cache
!
Show the IP Interfaces
Use the show ip interface brief to verify port operation and status. Y

The mdix auto Command

You used to be required to use certain cable types (cross-over, straight-through) when connecting between specific devices, switch-to-switch or switch-to-router. Instead, you can now use the mdix auto interface configuration command in the CLI to enable the automatic medium-dependent interface crossover (auto-MDIX) feature.

When the auto-MDIX feature is enabled, the switch detects the required cable type for copper Ethernet connections and configures the interfaces accordingly. Therefore, you can use either a crossover or a straight-through cable for connections to a copper 10/100/1000 port on the switch, regardless of the type of device on the other end of the connection.

The auto-MDIX feature is enabled by default on switches running Cisco IOS Release 12.2(18)SE or later. For releases between Cisco IOS Release 12.1(14)EA1 and 12.2(18)SE, the auto-MDIX feature is disabled by default.


Configure Duplex and Speed
You can use the duplex interface configuration command to specify the duplex mode of operation for switch ports. You can manually set the duplex mode and speed of switch ports to avoid inter-vendor issues with autonegotiation. Although there can be issues when you configure switch port duplex settings to auto, in this example, S1 and S2 switches have the same duplex settings and speeds. The figure describes the steps to configure the port F0/1 on the S1 switch.

Here is the Cisco IOS CLI Command Syntax:
S1#configure terminal

S1(config)#Interface fastethernet 0/1

S1(config-if)#duplex auto

S1(config-if)#speed auto

S1(config-if)#end

S1#copy running-config startup-config

Configure a Web Interface
Modern Cisco switches have a number of web-based configuration tools that require that the switch is configured as an HTTP server. These applications include the Cisco web browser user interface, Cisco Router and Security Device Manager (SDM), and IP Phone and Cisco IOS Telephony Service applications.

To control who can access the HTTP services on the switch, you can optionally configure authentication. Authentication methods can be complex. You may have so many people using the HTTP services that you require a separate server specifically to handle user authentication. AAA and TACACS authentication modes are examples that use this type of remote authentication method. AAA and TACACS are authentication protocols that can be used in networks to validate user credentials. You may need to have a less complex authentication method. The enable method requires users to use the server's enable password. The local authentication method requires the user to use the login username, password, and privilege level access combination specified in the local system configuration (by the username global configuration command).

Here is the Cisco IOS CLI Command Syntax:
S1#configure terminal
S1(config)#ip http authentication enable
S1(config)#ip http server
S1(config)#end

Selasa, 03 Maret 2009

Switching - Introducing Spanning Tree Protocol (STP)

A loop avoidance mechanism called STP has been developed to alleviate the 3 issues above.

There are two varieties of Spanning Tree Protcol, STP (802.1d) and RSTP ('Rapid' 802.1w) both work in a similar way.

A Spanning Tree Algorithm examines the switched network, and, through a series of decisions (discussed below) places each port in the loop into either Forwarding or Blocking state, therefore breaking the loop.

Types of port in STP:

  1. Designated Port (DP) Closest to Root i.e. All Ports on the Root Switch.
  2. Route Port (RP) One Per Switch.
  3. Blocking Port.

The process the switches go through to decide which port they place in blocking or forwarding state is governed by the position of a 'Root Switch' (also known as 'Root Bridge'):

  • To decide which switch is the root switch, each switch begins by claiming to be the Root Switch they all send out an STP messages called BPDU's (Bridge Protocol Data Unit). A fight-off happens to determine the final root based on a unique BID (Bridge Identifier) contained within the BPDU, the BID is made up of two components; a priority value and the switch MAC address. By default each switch begins off with a priority of 32,768. The switch with the lowest BID wins the honor of being the Root Bridge.
  • All ports on the root switch are placed into forwarding state. These ports are known as 'Designated Ports' (DP). You can NOT have a Root Port or Blocking Port on the root switch.
  • All the remaining non-root switches determine which port is closest to the root switch and places the port with the least cost (based on hops and/or bandwidth) into forwarding state. These are known as 'Root Ports' (RP).
  • There can only ever be one RP per segment, and so if there are more than one paths with the same cost the decision is made based on the BID of the neighboring switches, the port connecting to the switch with the lowest BID becomes a RP.
  • All ports are placed in blocking state and the loops stopped.


Once the switches have all assigned ports then the switched network is said to be "Converged".

As discussed above the BID is made up of:

  • A Priority Value
  • MAC Address

The Priority Value of the BID can be manually changed by an administrator, this is useful of you want to force a switch in the middle of a network to be a Root Switch.

note: If a newer switch is plugged into a working network of a different manufacturer it may disrupt the network if manual BID priorities are not set. A Cisco Switch (MAC Vendor ID 00000C) will win over a 3COM switch (MAC Vendor ID 001AFC) because Cisco equipment has a lower MAC address.

STP is switched on in all Cisco switches by default, if you have no loops for example:



You could switch STP off on all the switches, but this is not advisable, as all it would take is someone to plug a cable in the wrong port to cause a loop.

note: If two links between two switches, the decision of which port to block can no longer be based on the BID because they would be the same for both links, the selection is therefore made on the lowest port number.



During the STP selection process ports can be in one of the following statuses:

  • Disabled
  • Blocked
  • Listening *
  • Learning *
  • Forwarding

* Ports in Listening & Learning state can take upto 30 seconds, during which no traffic will pass through the port. This may disrupt services such as DHCP and Network Neighborhood. Switching on 'portfast' by using the "spanning-tree portfast" command will skip the Listening and Learning stage. Do not set portfast on inter switch ports or branch ports, however you could set portfast on a leaf port (ports connected to hosts).

Switching - Problems that Occur in Redundant Switched Topologies

Issues in Switching

Although switches are said to be ?intelligent? they are not without their problems:

Broadcast Storms

When a unicast packets with an unknown destination MAC gets flooded to all ports AND two switches are connected with two links (for redundancy), for example:



This can cause frames to loop around, because each switch will flood the packet back out the opposite port back to where it came from.

This is not good because Ethernet frames do not contain a TTL (Time To Live) field, the frames would therefore build up and go round and round forever. As the looping frames build up the performance of the switch will decrease and eventually result in a crash, typical behavior will be as follows:



The switch will work but will degrade in performance until it eventually gets too much and the switch crashes, it will then reboot and performance will be OK for a while until it starts to degrade and crash again.

  • Because of these same loops as discussed above multiple copies of the same frame may be delivered to a destination.

  • The MAC address table could get confused when multiple copies of the same frame are received on different ports. Frame forwarding could get impaired and CPU resources tied up in constantly updating the CAM table.

Switching - Configuring a Catalyst Switch

Port Security

You can use the port security feature of Cisco switches to restrict limited MAC addresses to be able to use a port. This is useful for security purposes. To configure port security use the ?switchport port-security? interface command where you can enter a specific MAC address or set it to learn the first MAC address and only allow access from that MAC.

Switch Port Modes


Trunk

Access

Dynamic Desirable

Dynamic Auto

Trunk

Trunk

N/A

Trunk

Trunk

Access

N/A

Access

Access

Auto

Dynamic Desirable

Trunk

Access

Trunk

Trunk

Dynamic Auto

Trunk

Access

Trunk

Auto

note: Full Duplex = No Collisions, used when Point to Point e.g Switch to Switch or Switch to Router.

Switching - Switched Networks with Virtual LAN?s

VLAN's (Virtual Local Area Networks) are a way to structure a network logically; put simply a VLAN is a collection of nodes which are grouped together in a single broadcast domain (address range) that is based on something other than physical location. If a host in a particular VLAN sends a message to a switch it will only forward the message to hosts within the same VLAN.

Another way to think of VLAN's is to think that when you split a switch into 2 VLAN's and assign half the ports to VLAN 1 and the other half to VLAN 2, this is the same as if it was two totally separate unlinked switches.

  • A switches internal TCP/IP software resides in VLAN 1
  • By default all ports belong to VLAN 1
  • Different VLAN's would also be different broadcast domains

VLAN Trunking

If you have two switches with VLAN's configured on both you could link the VLANs on individually but this means you need lots of cables and take up lots of switch ports:

or You could use 1 cable and one port on each switch to be a 'Trunk' which carries information from multiple VLAN's:

There are 3 Trunking protocols:

  1. Cisco ISL (Inter Switch Link)
  2. 802.1q (aka dot1q)
  3. 802.1p (newer prioritized ? for voice, not widespread)

There is not much difference between the way ISL and dot1q work.

  • ISL tags traffic in VLAN's by encapsulating the Ethernet frames with a 26-byte Header and 4 Byte CRC footer, the 26-byte header contains a 15-bit VLAN ID, only the lower 10-bits are used for 1,024 VLANs.
  • dot1q tags traffic by inserting a tag in the middle of the Ethernet frame in between the Source and Length fields. The dot1q VLAN ID is 12-bits and can have 4,096 VLAN's.

VLAN's ? VTP (VLAN Trunking Protocol)

Where you have multiple switches linked with trunks it is important you ensure VLAN consistency across all the switches. You need to make sure each VLAN exists on each switch.

In the diagram above the two computers will not be able to talk because the VLAN does not exist on the middle switch.

Cisco have come up with VTP (VLAN Trunking Protocol) which automatically distributes VLAN's across switches

* VTP does not assign ports *

* VTP only works down trunk ports (ISL or 802.1q)

There are 3 modes to VTP

- Server ? Add any VLAN on any switch, forwards VTP messages

- Transparent ? Act as though cant hear VTP messages, cant send VTP messages

- Client ? Read Only, Forwards VTP messages

VTP servers create, modify and delete VLAN's and other configuration parameters fot the entire VTP domain; this information, in turn, is propagated to the VTP clients in the same domain.

VTP Clients can not creat, change or delete VLAN's. They can only receive them from a server.

VTP Transparent can create, delete and modify its own VLAN's only and does not transmit them or receive transmissions.

VLAN's ? Communicating Between VLAN's

To communicate between VLAN's you need a router:

You can buy a Layer 3 switch, which has a router built into it.

Switching - Configuring VLAN?s

To setup 2 switches with VLAN's 4 and 5 and link with a trunk in 802.1q mode, for example:

conf t   vlan 4 name jim   vlan 5 name claire   int fa0/1      switchport access vlan 4   int fa0/2      switchport access vlan 5   int fa0/11      switchport mode trunk      switchport trunk encapsulation dot1q   exit

On older IOS:

vlan database   vlan 4 name jim   vlan 5 name claire   exit

To view VLAN's use "sh vlan".

note: In the example above if Switch 1 is in VTP server mode and switch 2 in client mode, the VLAN information shoud be transmitted on the trunk and appear on switch 2.

Senin, 02 Maret 2009

Switching - Configuring VLAN?s

To setup 2 switches with VLAN's 4 and 5 and link with a trunk in 802.1q mode, for example:

conf t   vlan 4 name jim   vlan 5 name claire   int fa0/1      switchport access vlan 4   int fa0/2      switchport access vlan 5   int fa0/11      switchport mode trunk      switchport trunk encapsulation dot1q   exit

On older IOS:

vlan database   vlan 4 name jim   vlan 5 name claire   exit

To view VLAN's use "sh vlan".

note: In the example above if Switch 1 is in VTP server mode and switch 2 in client mode, the VLAN information shoud be transmitted on the trunk and appear on switch 2.

Switching - Switched Networks with Virtual LAN?s

VLAN's (Virtual Local Area Networks) are a way to structure a network logically; put simply a VLAN is a collection of nodes which are grouped together in a single broadcast domain (address range) that is based on something other than physical location. If a host in a particular VLAN sends a message to a switch it will only forward the message to hosts within the same VLAN.

Another way to think of VLAN's is to think that when you split a switch into 2 VLAN's and assign half the ports to VLAN 1 and the other half to VLAN 2, this is the same as if it was two totally separate unlinked switches.

  • A switches internal TCP/IP software resides in VLAN 1
  • By default all ports belong to VLAN 1
  • Different VLAN's would also be different broadcast domains

VLAN Trunking

If you have two switches with VLAN's configured on both you could link the VLANs on individually but this means you need lots of cables and take up lots of switch ports:

or You could use 1 cable and one port on each switch to be a 'Trunk' which carries information from multiple VLAN's:

There are 3 Trunking protocols:

  1. Cisco ISL (Inter Switch Link)
  2. 802.1q (aka dot1q)
  3. 802.1p (newer prioritized ? for voice, not widespread)

There is not much difference between the way ISL and dot1q work.

  • ISL tags traffic in VLAN's by encapsulating the Ethernet frames with a 26-byte Header and 4 Byte CRC footer, the 26-byte header contains a 15-bit VLAN ID, only the lower 10-bits are used for 1,024 VLANs.
  • dot1q tags traffic by inserting a tag in the middle of the Ethernet frame in between the Source and Length fields. The dot1q VLAN ID is 12-bits and can have 4,096 VLAN's.

VLAN's ? VTP (VLAN Trunking Protocol)

Where you have multiple switches linked with trunks it is important you ensure VLAN consistency across all the switches. You need to make sure each VLAN exists on each switch.

In the diagram above the two computers will not be able to talk because the VLAN does not exist on the middle switch.

Cisco have come up with VTP (VLAN Trunking Protocol) which automatically distributes VLAN's across switches

* VTP does not assign ports *

* VTP only works down trunk ports (ISL or 802.1q)

There are 3 modes to VTP

- Server ? Add any VLAN on any switch, forwards VTP messages

- Transparent ? Act as though cant hear VTP messages, cant send VTP messages

- Client ? Read Only, Forwards VTP messages

VTP servers create, modify and delete VLAN's and other configuration parameters fot the entire VTP domain; this information, in turn, is propagated to the VTP clients in the same domain.

VTP Clients can not creat, change or delete VLAN's. They can only receive them from a server.

VTP Transparent can create, delete and modify its own VLAN's only and does not transmit them or receive transmissions.

VLAN's ? Communicating Between VLAN's

To communicate between VLAN's you need a router:

You can buy a Layer 3 switch, which has a router built into it.

Switching - Configuring a Catalyst Switch

Port Security

You can use the port security feature of Cisco switches to restrict limited MAC addresses to be able to use a port. This is useful for security purposes. To configure port security use the ?switchport port-security? interface command where you can enter a specific MAC address or set it to learn the first MAC address and only allow access from that MAC.

Switch Port Modes


Trunk

Access

Dynamic Desirable

Dynamic Auto

Trunk

Trunk

N/A

Trunk

Trunk

Access

N/A

Access

Access

Auto

Dynamic Desirable

Trunk

Access

Trunk

Trunk

Dynamic Auto

Trunk

Access

Trunk

Auto

note: Full Duplex = No Collisions, used when Point to Point e.g Switch to Switch or Switch to Router.

Switching - Introducing Spanning Tree Protocol (STP)

A loop avoidance mechanism called STP has been developed to alleviate the 3 issues above.

There are two varieties of Spanning Tree Protcol, STP (802.1d) and RSTP ('Rapid' 802.1w) both work in a similar way.

A Spanning Tree Algorithm examines the switched network, and, through a series of decisions (discussed below) places each port in the loop into either Forwarding or Blocking state, therefore breaking the loop.

Types of port in STP:

  1. Designated Port (DP) Closest to Root i.e. All Ports on the Root Switch.
  2. Route Port (RP) One Per Switch.
  3. Blocking Port.

The process the switches go through to decide which port they place in blocking or forwarding state is governed by the position of a 'Root Switch' (also known as 'Root Bridge'):

  • To decide which switch is the root switch, each switch begins by claiming to be the Root Switch they all send out an STP messages called BPDU's (Bridge Protocol Data Unit). A fight-off happens to determine the final root based on a unique BID (Bridge Identifier) contained within the BPDU, the BID is made up of two components; a priority value and the switch MAC address. By default each switch begins off with a priority of 32,768. The switch with the lowest BID wins the honor of being the Root Bridge.
  • All ports on the root switch are placed into forwarding state. These ports are known as 'Designated Ports' (DP). You can NOT have a Root Port or Blocking Port on the root switch.
  • All the remaining non-root switches determine which port is closest to the root switch and places the port with the least cost (based on hops and/or bandwidth) into forwarding state. These are known as 'Root Ports' (RP).
  • There can only ever be one RP per segment, and so if there are more than one paths with the same cost the decision is made based on the BID of the neighboring switches, the port connecting to the switch with the lowest BID becomes a RP.
  • All ports are placed in blocking state and the loops stopped.


Once the switches have all assigned ports then the switched network is said to be "Converged".

As discussed above the BID is made up of:

  • A Priority Value
  • MAC Address

The Priority Value of the BID can be manually changed by an administrator, this is useful of you want to force a switch in the middle of a network to be a Root Switch.

note: If a newer switch is plugged into a working network of a different manufacturer it may disrupt the network if manual BID priorities are not set. A Cisco Switch (MAC Vendor ID 00000C) will win over a 3COM switch (MAC Vendor ID 001AFC) because Cisco equipment has a lower MAC address.

STP is switched on in all Cisco switches by default, if you have no loops for example:



You could switch STP off on all the switches, but this is not advisable, as all it would take is someone to plug a cable in the wrong port to cause a loop.

note: If two links between two switches, the decision of which port to block can no longer be based on the BID because they would be the same for both links, the selection is therefore made on the lowest port number.



During the STP selection process ports can be in one of the following statuses:

  • Disabled
  • Blocked
  • Listening *
  • Learning *
  • Forwarding

* Ports in Listening & Learning state can take upto 30 seconds, during which no traffic will pass through the port. This may disrupt services such as DHCP and Network Neighborhood. Switching on 'portfast' by using the "spanning-tree portfast" command will skip the Listening and Learning stage. Do not set portfast on inter switch ports or branch ports, however you could set portfast on a leaf port (ports connected to hosts).

Switching - Problems that Occur in Redundant Switched Topologies

Issues in Switching

Although switches are said to be ?intelligent? they are not without their problems:

Broadcast Storms

When a unicast packets with an unknown destination MAC gets flooded to all ports AND two switches are connected with two links (for redundancy), for example:



This can cause frames to loop around, because each switch will flood the packet back out the opposite port back to where it came from.

This is not good because Ethernet frames do not contain a TTL (Time To Live) field, the frames would therefore build up and go round and round forever. As the looping frames build up the performance of the switch will decrease and eventually result in a crash, typical behavior will be as follows:



The switch will work but will degrade in performance until it eventually gets too much and the switch crashes, it will then reboot and performance will be OK for a while until it starts to degrade and crash again.

  • Because of these same loops as discussed above multiple copies of the same frame may be delivered to a destination.

  • The MAC address table could get confused when multiple copies of the same frame are received on different ports. Frame forwarding could get impaired and CPU resources tied up in constantly updating the CAM table.

Switching - Switching and Bridging Functions

MAC Address Learning

Switches operate at Layer 2 of the OSI reference model, they are more intelligent than hubs. The reason why switches are more intelligent is because they learn which ports hosts are connected to by examining the frames which enter into it.

The switch holds a table of its findings called a CAM table (Content Addressable Memory, also known as ?Forwarding Table? or ?MAC Address Table?); this table maps MAC addresses to Port mappings.

On powering up a switch the CAM table is empty, the switch learns which ports the hosts are connected to by reading the source address from frames which come into it. For example:

?If a frame comes into the switches Port 3 with a Source MAC Address A and Destination MAC Address B, the switch knows MAC Address A is connected to Port 3?

With this knowledge it populates the CAM table with the details. A timestamp is also recorded to record when the mapping was learned.

MAC Address Port

1

2
A 3

4

5

Using the CAM table above, for the time being the switch does not know where to send the frame, it therefore floods the frame out of all its ports (Bit for Bit, the TTL field is not changed), the only port is does not forward it out is the port it came in on.



When the unknown MAC Address B replies, the switch then learns which port it is connected to and populates the CAM table.

MAC Address Port

1

2
A 3

4
B 5

Over time the switch will populate the CAM table with a full compliment of connected MAC Addresses:

MAC Address Port
C 1
E 2
A 3
D 4
B 5


note: The CAM table records also have a timeout - the switch will remove any entries from its CAM table if it has not passed any traffic for 5 minutes (300 seconds).

note: You can see all traffic coming in and out of the switch by setting up a ?SPAN Port? (Switch Port Analyzer, also known as Mirrored Port or Diagnosis Port) and plugging it into an analyzer such as Etherreal.

Switching ? Frame Transmission Modes

When a switch receives a frame it can forward the frame on in one of three methods:

  • Store and Forward ? As a switch received a frame it will first store the frame until it is fully received and then check the frame against its CRC (Cyclic Redundancy Check) to determine if the frame is not corrupt. If it is corrupt the switch will drop the frame, if it is OK it will be forwarded.
  • Cut Through ? Immediately as the switch receives a frame it will start transmitting it out of the destination port, this reduces latency but allows for re-transmission of corrupt frames.
  • Fragment Free ? The switch will read the first 64 bytes of an incoming frame before forwarding it on. The reason why it reads this length is because 64 bytes is the minimum Ethernet frame size, but when a collision occurs, a fragment of less than 64 bytes is created. Fragment Free will remove such fragments.