2.1 # HOW DOES LAYER2 & LAYER3 SWITCH WORK ?
Layer 2 and Layer 3 switches are network devices used to manage traffic in different ways. Here’s a breakdown of how they work:
Layer 2 Switches:
1. Function: Operate primarily at the Data Link layer (Layer 2) of the OSI model.
2. MAC Address Table: They use MAC (Media Access Control) addresses to forward data. Each port on the switch is associated with a MAC address table (or forwarding table) that maps MAC addresses to specific ports.
3. Frame Forwarding: When a frame (data packet) arrives at a port, the switch looks at the destination MAC address and checks its MAC address table. It then forwards the frame only to the port associated with that MAC address, reducing unnecessary traffic on other ports.
4. Learning: If the MAC address of the destination device is not in the table, the switch floods the frame to all ports (except the incoming port). Once the destination device responds, the switch learns its MAC address and updates the table.
5. Switching Loop Prevention: Protocols like Spanning Tree Protocol (STP) are used to prevent switching loops in networks with redundant paths.
Layer 3 Switches :
1. Function: Operate at both the Data Link layer (Layer 2) and the Network layer (Layer 3) of the OSI model.
2. Routing Capability: Unlike Layer 2 switches, Layer 3 switches can perform routing functions. They use IP addresses to make forwarding decisions and can route traffic between different VLANs (Virtual LANs) or subnets.
3. Routing Tables: They maintain routing tables that contain information about different IP networks. This allows them to make decisions on how to forward packets based on their destination IP address.
4. Inter-VLAN Routing: Layer 3 switches are often used to route traffic between VLANs in a network. VLANs are logical partitions of a network that segment traffic, and Layer 3 switches can route traffic between these segments.
5. Performance: Layer 3 switches are designed to handle both switching and routing with high performance, often incorporating hardware-based forwarding to improve speed.
Comparison :
- Layer 2 Switches: Focus on MAC addresses, operate within a single broadcast domain, and do not handle IP routing.
- Layer 3 Switches: Handle both MAC addresses and IP routing, can route traffic between different subnets or VLANs, and are used in more complex network architectures.
In summary, Layer 2 switches manage traffic within a single network segment using MAC addresses, while Layer 3 switches add routing capabilities, allowing them to manage traffic across multiple segments or VLANs. witch will broadcast to find the MAC address in case of first time. The MAC aging time specifies the time before an entry ages and is discarded from the MAC address table. The range is from 0 to 1000000; The default value is 300 seconds. Entering the value 0 disables MAC aging. If a VLAN is not specified, the age specification applies to all VLANs. Otherwise it will works as a unicast. Switch will work as a broadcast mode in three positions : -
- Normal broadcasting in case of first time when it will find the MAC address.
- Broadcast address sends the message to all the users. It send like this from (Broadcast MAC address: FFFF.FFFF.FFFF).
- Content of group when it will send the message to multicast like this from (Multicast MAC address: 01.00.5E.40.10.01).
2.2 # FRAME SWITCHING & FLODDING
It is defined as uses MAC addresses of the sender and receiver devices to process the frame. When a switch receives a frame, it reads the source address of that frame and stores it into a table known as the CAM table. And procedure followed by a switch in which the switch forwards the Ethernet frame received by it to all the ports except the incoming port. Although the process seems identical to another procedure known as an Ethernet Broadcast.
Frame of switches.
6 bytes | 6 bytes | 2 bytes | 64 - 1500 bytes | 2 bytes |
---|---|---|---|---|
Destination address | Source address | Type or Length | Data packet | FCS |
2.3 # SWITCHES ARE TO PERFORM THE THREE FUNCTION
- Address learning: Layer 2 switches and bridge remember the source hardware of each frame received on the interface in the MAC database called forward/filter table.
E0/0: 0000.8C01.000A E0/1: 0000.8C01.0008 - Forward/Filter decisions: When a frame is received on an interface, the switch look at the destination hardware address and finds the exit interface in the MAC database. The frame is only forwarded out the specified destination port
Example – MAC forward/ filter table of “decisions”
VLAN MAC address Ports
10 70-71-bc-c2-d9-8c E0/0
20 70-71-cc-c1-ab-bc E0/1 - Loop avoidance: It multiple connect between switches are created for redundancy process, network looks can occur, STP is used to stop network look while still permitting redundancy. Example – Loop avoidance of “broadcast storm”
2.4 # BOOT PROCESS OF SWITCH (STARTUP MODE)
Layer2 switch to cross the four state of boot processing, so that connect to the machine. And four states are given below: -
- Blocking process mode: In this case, the switch can received the BPDU value of the switch cross the network which is already functioning in startup mode. Switch takes 30 second for functioning.
- Listening mode: In this case, the switch can generate its own BPDU value and compare its BPDU value with other switch for the selection of root – bridge as well as non – root bridge.
- Forwarding mode: In this case, the switch is capable for communication among machine.
- Store and forward: The switch buffers (store the errors in own buffers and check it) and verify each frame before forwarding it. Series | 2950 & 3560
- Cut and through: The switch reads only up-to the frame hardware address before starting to forward it and there is no error checking with this method. Series | 1800 & 5600
- Fragment free: The method that attempts to retain the benefits of both store, forward and cut through. And it checks the first 64 bytes of the frame. Where addressing information is stored. Series | 1900
- Adoptive switching: The method of automatically selecting between the other three modes.
- Managed switching: You can enable to manage, configure and monitor the network in many ways and also provide greater control over how data travels over the network and who can access that data.
- Unmanaged switching: You cannot make any changes to, often used for small networks or to add temporary groups of systems to a larger network.
- Modular switching: It is standard by chassis switch is a type of network switch which can be configured using field-replaceable units. This units, often referred to as blades, can add more ports, bandwidth, and capabilities to a switch.
- Stackable switchig: It is a network switch that is fully functional operating standalone but which can also be set up to operate together with one or more other network switches, with this group of switches showing the characteristics of a single switch but having the port capacity of the sum of the combined switches.
Switch keep learning from incoming frames.
- Layer 2 forwarding table: It takes a first decision on Content Addressable Memory (CAM). The CAM table is a system memory construct used by Ethernet switch logic to different MAC addresses of stations to the ports on which they connect to the switch. These allow switches to facilitate communication between connected stations at high speed regardless of how many devices are connected to the switch. The CAM table is consulted to make the frame forwarding decision. It will read the MAC address for 30 sec. without second time connected and where regardless contain 1 or 0 two states memory.
- Security ACL’s: It takes a second decision on Ternary Content Addressable Memory (TCAM). It can perform a wide search in memory in a very short fixed period of time, typically less than 20 ns. ACL & QOS tables are stored in a high-speed table so that forwarding decisions and restriction can be made in high-speed hardware. There are TCAM for binary searches where registers contain 1 or 0 or X (Don’t care) three station memory. It will take a 15W/search.
- Lookup in hardware: Two hardware designs are present, the first design is for unicast forwarding based on destination addresses and second design is for identifier lookup used for multicast addresses and for packet flows.
- Cisco Express Forwarding (CEF): It uses a Forwarding Information Based (FIB) to make IP destination prefix-based switching decisions. The FIB is conceptually similar to a routing table or information base. It maintains a mirror image of the forwarding information contained in the IP routing table.
- Forwarding Information Base (FIB): When routing or topology changes occur in the network, the IP routing table is updated and those changes are reflected in the FIB. The FIB maintains next hop address information base based on the information in the IP routing table.Note: Some protocols are not coming in the CEF such as ARP, NAT, Encryption and IP-helper. They are only come in the switch processor.
2.5 # DEFINE THE FOLLOWING BASIC CONFIGURATION IN SWITCH
1) What is the mean of startup – configuration ?
“Set of configuration in NVRAM”
2) What is the mean of running – configuration ?
“Running configuration in RAM”
3) How to convert the show configuration from clear text into encryption form ?
Switch (config) #service password-encryption
Switch (config) #exit
4) How to disable the log synchronous configuration ?
Switch (config) #line con 0
Switch (config) #logging synchronous
Switch (config) #exit
5) Which command to resolve the annoying issue in switch ?
Switch (config) #no ip domain lookup
6) How does change the name of switch name ?
Switch (config) #hostname Sw_Jammu
7) How does set the message of the day banner ?
Switch (config) #banner motd #
8) How to do set the password of switch ?
Switch #configure terminal
Switch (config) #enable secret password_ccna
Switch (config) #exit
9) How to configure the telnet ?
Switch (config) #line vty 0 4
Switch (config-line) #speed 9200
Switch (config-line) #password password_teln et
Switch (config- line) #login
Switch (config-line) #exec-timeout 5 0
Switch (config- line) #exit
{ (conf)# clear line 3 (Terminating) }
10) How to configure the console line ?
Switch (config) #line con 0
Switch (config- line) #password password_teln et
Switch (config-line) #exec-timeout 5 0
Switch (config- line) #end
11) How to do set the password of SSH ?
Switch (config) #line vty 0 4
Switch (config-line) #transport input ssh
Switch (config-line) #end
Switch (config) #username Prabhjot
Switch (config-if) #ip domain-name ssm.in
Switch (config-if) #crypto key generate rsa
Switch (config-if) #ip ssh version 1/2
Switch (config-if) #ip ssh timeout 90 authentication-retries 2
Switch (config-if) #exit
Client computer: PC>SSH –L senior 192.168.1.11
12) How to login the NX-OS device from SSH but throught vrf (Mgmt) and Access-list ?
Switch (config) #interface GigabitEthernet0
Switch (config-if) #vrf forwarding Mgmt-intf
Switch (config-if) #ip address 192.169.1.44 255.255.255.0
Switch (config-if) #negotiation auto
Switch (config-if) #exit
Switch (config) #ip access-list extended ssh
Switch (config-ext-nacl) #permit tcp host 192.168.2.116 any
Switch (config-ext-nacl) #permit tcp host 192.168.1.111 any
Switch (config-ext-nacl) #permit tcp host 192.168.3.122 any
Switch (config-ext-nacl) #exit
Switch (config) #line vty 0 4
Switch (config-line) #access-class ssh in vrf-also
Switch (config-line) #login authentication PRIV_15
Switch (config-line) #rotary 1
Switch (config-line) #length 0
Switch (config-line) #transport preferred ssh
Switch (config-line) #transport input ssh
Switch (config-line) #end
13) How to assign the IP address of vlan interface ?
You can’t assign the IP address to Layer 2 switch-port but assign the IP address to VLAN and Layer 3 switch-port. Let’s see assign the IP address to VLAN: -
Switch (config) #interface vlan 10
Switch (config-if) #ip address 192.168.1.11 255.255.255.0
Switch (config-if) #no shutdown
Switch (config-if) #exit
Be updated into yourself and improve lives through DIT
0 Comments