This article needs additional citations for verification. (October 2009) (Learn how and when to remove this template message)
Switching technologies are crucial to network design, as they allow traffic to be sent only where it is needed in most cases, using fast, hardware-based methods. Switching uses different kinds of network switches. A standard switch is known as a layer 2 switch and is commonly found in nearly any LAN. Layer 3 or layer 4 switches require advanced technology (see managed switch) and are more expensive, and thus are usually only found in larger LANs or in special network environments.
Multi-layer switching combines layer 2, 3 and 4 switching technologies and provides high-speed scalability with low latency. Multi-layer switching can move traffic at wire speed and also provide layer 3 routing. There is no performance difference between forwarding at different layers because the routing and switching is all hardware based – routing decisions are made by specialized ASIC with the help of content-addressable memory.
Multi-layer switching can make routing and switching decisions based on the following
- MAC address in a data link frame
- Protocol field in the data link frame
- IP address in the network layer header
- Protocol field in the network layer header
- Port numbers in the transport layer header
The following 4 mappings are normally available in an MLS:
- From OSI layer 2, 3 or 4 to IP DSCP (for IP packets) or IEEE 802.1p
- From IEEE 802.1p to IP DSCP
- From IP DSCP to IEEE 802.1p
- From VLAN IEEE 802.1p to port egress queue.
Some MLSs are also able to route between VLANs and/or ports like a common router. The routing is normally as quick as switching (at wirespeed). According to Cisco, Layer 3 switches are basically routers that switch based on Layer 3 information, the basic difference being processing speed and/or the way they do the switching; Layer 3 switches use ASICs/hardware instead of the CPU/software that a router would.
Layer 2 switchingEdit
Layer 2 switching uses the media access control address (MAC address) from the host's network interface cards (NICs) to decide where to forward frames. Layer 2 switching is hardware-based, which means switches use application-specific integrated circuit (ASICs) to build and maintain filter tables (also known as MAC address tables or CAM tables). One way to think of a layer 2 switch is as multiport bridge.
Layer 2 switching provides the following
- Hardware-based bridging (MAC)
- Wire speed / non-blocking forwarding
- Low latency
Layer 2 switching is highly efficient because there is no modification to the data packet and the frame, encapsulation of the packet changes only when the data packet is passing through dissimilar media (such as from Ethernet to FDDI). Layer 2 switching is used for work group connectivity and network segmentation (breaking up collision domains). This allows a flatter network design with more network segments than traditional networks joined by repeater hubs and routers. Layer 2 switching has helped develop new components in the network infrastructure.
- Server farms — Servers need no longer be distributed to physical locations because virtual LANs can be created to create broadcast domains and network proximity in a switched internetwork. This means that all servers can be placed in a central location, yet a certain server can still be part of a workgroup in a remote branch, for example.
- Intranets — Allows organization-wide client/server communications based on a Web technology.
These new technologies allow more data to flow off from local subnets and onto a routed network, where a router's performance can become the bottleneck.
Bridged networks break up collision domains, but the network remains one large broadcast domain. Similarly, layer 2 switches (bridges) cannot break up broadcast domains, which can cause performance issues and limits the size of a network. Broadcast and multicasts, along with the slow convergence of spanning tree, can cause major problems as the network grows. Because of these problems, layer 2 switches cannot completely replace routers in the internet work.
Layer 3 switchingEdit
Layer 3 switching is solely based on (destination) IP address stored in the header of IP datagram (see layer 4 switching later on this page for the difference). The difference between a layer 3 switch and a router is the way the device is making the routing decision. Traditionally, routers use microprocessors to make forwarding decisions in software, while the switch performs only hardware-based packet switching (by specialized ASIC with the help of content-addressable memory). However, some traditional routers can have advanced hardware functions as well in some of the higher-end models.
The main advantage of layer 3 switches is the potential for lower network latency as a packet can be routed without making extra network hops to a router. For example, connecting two distinct segments (e.g. VLANs) with a router to a standard layer 2 switch requires passing the frame to the switch (first L2 hop), then to the router (second L2 hop) where the packet inside the frame is routed (L3 hop) and then passed back to the switch (third L2 hop). A layer 3 switch accomplishes the same task without the need for a router (and therefore additional hops) by making the routing decision itself, i.e. the packet is routed to another subnet and switched to the destination network port simultaneously.
Because many layer 3 switches offer the same functionality as traditional routers they can be used as cheaper, lower latency replacements in some networks. Layer 3 switches can perform the following actions that can also be performed by routers:
- determine paths based on logical addressing
- run layer 3 checksums (on header only)
- use Time to Live (TTL)
- process and respond to any option information
- update Simple Network Management Protocol (SNMP) managers with Management Information Base (MIB) information
- provide Security
The benefits of layer 3 switching include the following:
- fast hardware-based packet forwarding
- high-performance packet switching
- high-speed scalability
- low latency
- lower per-port cost
- flow accounting
- Quality of service (QoS)
The switching algorithm is relatively simple and is the same for most of the routed protocols: a host would like to send a packet to a host on another network. Having acquired a router's address by some means, the source host sends the packet directly to that router's physical (MAC) address. The protocol (network layer) address is that of the destination host.
The router examines the packet's destination protocol address and determines whether it knows how to forward the packet or not. If the router does not know how to forward the packet, it typically drops the packet. If it knows how to forward packet, it changes the destination physical address to that of the next hop router and transmits the packet.
The next hop may be the destination or the next router, which executes the same switching process. As the packet moves through the internetwork, its physical address changes, but its protocol address remains same.
IEEE has developed hierarchical terminology that is useful in describing this process. Network devices without the capability to forward packets between subnetworks are called end systems (ESs, singular ES), whereas network devices with these capabilities are called intermediate systems (ISs). ISs are further divided into those that communicate only within their routing domain (Intradomain IS) and those that communicate both within and between routing domains (Interdomains IS). A routing domain is generally considered as portion of an internetwork under common administrative authority and is regulated by a particular set of administrative guidelines. Routing domains are also called autonomous systems.
A layer-3 switch incorporates routing capability in addition to the layer-2 bridging found in a standard switch. The major difference between the packet forwarding operation of a router and that of a layer-3 switch is the actual implementation. In general-purpose routers, forwarding is usually implemented in software that runs on a microprocessor or a network processor, whereas a layer-3 switch performs the same operation using dedicated application-specific integrated circuit (ASIC) hardware.
Layer 4 switchingEdit
Layer 4 switching means hardware-based layer 3 switching technology that can also consider the type of network traffic (for example, distinguish between HTTP, FTP or VoIP). Layer 4 switching provides additional datagram inspection by reading the port numbers found in the Transport layer header to make routing decisions (i.e. ports used by UDP or TCP). These port numbers are found in RFC 1700 and reference the upper-layer protocol, program, or application.
The largest benefit of layer 4 switching is that the network administrator can configure a layer 4 switch to prioritize data traffic by application, which means a QoS can be defined for each user. For example, a number of users can be defined as a Video group and be assigned more priority, or band-width, based on the need for video conferencing.
Layer 4 information has been used to help make routing decisions for quite a while. For example, extended access lists can filter packets based on layer 4 port numbers. Another example is accounting information gathered by open standards using sFlow provided by companies like Arista Networks or proprietary solutions like NetFlow switching in Cisco's higher-end routers.
Layer 4–7 switch, web switch, or content switchEdit
Some switches can use up to OSI layer 7 packet information; these may be called layer 4–7 switches, content switches, content services switches, web switches or application switches.
Content switches are typically used for load balancing among groups of servers. Load balancing can be performed on HTTP, HTTPS, VPN, or any TCP/IP traffic using a specific port. Load balancing often involves destination network address translation so that the client of the load balanced service is not fully aware of which server is handling its requests. Some of the layer 4–7 switches can perform NAT at wirespeed. Also, content switches can often be used to perform standard operations such as SSL encryption/decryption to reduce the load on the servers receiving the traffic, or to centralise the management of digital certificates. Layer 7 switching is the base technology of a content delivery network.
Layer 4 load balancerEdit
A typical network router simply sends incoming packets onto the appropriate IP address on its network. A layer 4 router, more correctly a NAT with port and transaction awareness, usually performs a form of port translation for sending incoming packets to one or more machines that are hidden behind a single IP address.
The "layer 4" refers to the layer 4 or transport layer of the OSI model. The router operates on the transport layer and makes decisions on where to send the packets. Modern load balancing routers can use different rules to make decisions on where to route traffic. This can be based on least load, or fastest response times, or simply balancing requests out. This is also a redundancy method, so if one machine is not up, the router will not send traffic to it.
- Hucaby, David (Oct 24, 2003). "Switch Operation for the CCNP BCMSN Exam". ciscopress.com. Cisco Press. Retrieved 2015-02-05.
- tech soft computing.com/internet workdesign/nd2002.html#wp3310 Techsoft Computing Archived 2007-10-20 at the Wayback Machine
- "Multi-Layer Switching". Cisco Systems. Archived from the original on April 1, 2014. Retrieved 2011-02-11.