Comparison between "switching" and "routing"

Source: Internet
Author: User
Tags network function

Routing and switching are two important concepts in the online world. Traditional switching occurs on the second layer of the network, that is, the data link layer, while routing occurs on the third layer and network layer. In the new network, intelligent routing and switching performance are organically combined. layer-3 switches and multi-layer switches are widely used in the campus network. This article introduces some basic concepts of routing and switching, which are divided into four parts: network hierarchy, switching, routing, and fully-switched campus network.
Network Hierarchy
The definition of the network reference model provides clear functional hierarchy. The iso osi reference model and TCP/IP protocol cluster are the most commonly mentioned.
The OSI reference model defined by the International Organization for Standardization divides the computer network into seven layers by function, which we often call a layer-7 model or layer-7 structure. The direct advantage of network function layering is that these layers can perform their respective duties, and different levels of hardware and software devices developed by different manufacturers can be used together. Device updates or software rewriting at one level do not affect other levels. Each layer in the TCP/IP protocol system corresponds to the reference model of ISO. As shown in:
 
The OSI intermediate layer, that is, Layer 4, implements the transmission function, which provides reliable data transmission from one computer to another. Transport Layer (Transport Layer) is a Layer connecting up and down. There are three layers below it, all of which are related to data transmission. There are also three layers above to provide functions related to network applications.

The lower layer of OSI. Physical Layer) is responsible for the actual transmission of Data signals. The Data Link Layer of the Data Link Layer is responsible for the transmission of frames within the Network, while the Network Layer is responsible for the computer addressing and Data transmission between networks.

OSI is in the upper layer. Application Layer) is the highest level. It provides user operation interfaces, commonly used email services on the Internet, and file transfer services. Presentation Layer) is responsible for data representation, such as data encryption before sending, decryption when receiving data, and translation between Chinese and English. Session Layer) is responsible for establishing and terminating network data transmission, and converting computer names to addresses is also completed at this Layer.

In the traditional sense, exchange is the second concept. The function of the data link layer is to transmit frames within the network. The so-called "inside the network" means that the transmission of this layer does not involve inter-network devices and inter-network addressing. Generally speaking, the data link layer is responsible for transmission over an Ethernet network and over a WAN leased line. The so-called "frame" refers to the structure of the transmitted data. Generally, the frame has a frame header and a frame tail, and the source object L2 address in the header, while the frame tail usually contains verification information, the content between the beginning and end is the user data.

The data Link layer provides many functions, so it is divided into two sub-layers: MACMedia Access Control and Media Access Control) layer and LLCLogical Link Control and logical Link Control layer. The common L2 standard for LAN and man is IEEE 802 protocol. In the wide area network, HDLCHigh-level Data Link Control, advanced Link Control), PPPPoint-to-Point Protocol, Point-to-Point Protocol), Frame Relay, and other protocols are widely used.

Routing is a layer-3 concept. The network layer is the most important in the Internet, and its function is end-to-end transmission. The meaning of end-to-end is no matter how far the two computers are, how many networks are separated between them, this layer ensures that they can communicate with each other. For example, the commonly used PING command is a network-layer command. If PING succeeds, the network-layer function is normal. Generally, the network layer does not guarantee the communication reliability. That is to say, although data can reach the destination under normal circumstances, even if an exception occurs, the network layer does not perform any correction and restoration work.

Common network-layer protocols include IP, IPX, and APPLETALK. IP is the cornerstone of Internet. In the TCP/IP protocol system, other third-level auxiliary protocols include ARP Address Resolution, RARP Reverse Address Resolution, ICMP internet packet control, and IGMP group management protocols. Because all network interconnection devices have the path selection function, we often discuss the RIP, OSPF, and other routing protocols at this layer.

Exchange 

When talking about exchange, in a broad sense, any data forwarding can be called exchange. Of course, we now refer to the narrow sense of exchange, which only includes data link layer forwarding. Most people who work on the Network understand that switching starts from switches. Circuit switches have been used in the communication network for decades, in particular, the large-scale use of Ethernet switches has occurred in recent years.

To understand the role of an Ethernet switch, we should also start with the principle of the bridge. Traditional Ethernet is shared. If there are four computers A, B, C, and D on the network segment, C and D can only be passively listened to when A communicates with B. If the cable segments are separated, that is, the segments A and B are in the same segment, and the segments C and D are in the other segment, C and D can communicate with each other at the same time, in this way, the original 10 M bandwidth is theoretically 20 m. At the same time, to ensure that the two network segments can communicate with each other, you need to use a bridge to connect them. The bridge is a computer with two NICs, as shown in:
 
When the entire network was just started, the bridge knew nothing about the topology of the network. At this time, assume that A sends data to B, because the network is broadcast-type, so the bridge also receives the data, but the bridge does not know whether B is on its own left or right, and it will forward the data by default, this message is sent to another ENI. Although A useless Forwarding is done, through this process, the bridge learns that the data sender A is on its own left. After each computer on the network sends data, the bridge is intelligent. It knows where each computer is located. When A sends data to B again, the bridge does not forward the data. At the same time, C can send data to D.

From the above example, we can see that the bridge can reduce the probability of network conflicts, which is the main purpose of using the bridge, called to reduce the conflict domain. However, the bridge cannot prevent broadcasting. The isolation of broadcast information depends on a layer-3 connected device and router.

The more cable segments, the higher the available bandwidth. The limit is that each computer is in an independent cable segment. If there are ten computers on the network, a bridge with ten ports is required to connect them. However, it is unrealistic to implement such a bridge, and the speed of software forwarding cannot be kept up, so with a switch, the switch is to convert the above multi-port bridge hardware or firmware, to achieve lower costs and higher performance.

An important function of a vswitch is to avoid switching loops, which involves STPSpanning Tree Protocol and branch Tree Protocol ). The function of the branch Tree Protocol is to avoid repeated transmission of data frames in a network composed of switches. As shown in, if there are redundant links in the network, the STP protocol selects the root switch Route Bridge), and then determines the path between each non-root switch and the root switch. Finally, sets all links on this path to the Forward status. connections between other switches are redundant links and Block connections.
 
Another important feature of a vswitch is VLANVirtual LAN (Virtual LAN ). There are three main benefits of VLAN:

Port separation. Even on the same vswitch, ports in different VLANs cannot communicate. Such a physical switch can be used as multiple logic switches.
Network security. Different VLANs cannot communicate directly, eliminating the insecure broadcast information.
Flexible Management. To change the network to which the user belongs, you do not have to change the port and line. You only need to configure the software.

VLAN can be divided by port or MAC address.
Sometimes, we need to maintain VLAN configuration consistency on the network composed of switches. This requires the switch to communicate VLAN information according to the VTPVLAN Trunk Protocol and VLAN backbone Protocol. The VTP protocol only runs on the backbone Port Trunk Port), that is, the Port between switches.

Routing
A router is a connection device between networks. One of its important tasks is path selection. This function is the core of router intelligence. It is implemented by the Administrator's configuration and a series of routing algorithms.

Static Routing is a special route that is manually set by the Administrator. Although manual configuration of all routes can make the network work normally, it also brings some limitations. After the network topology changes, the static route does not change automatically. Therefore, the network administrator must intervene. The default route is a static route and is also set by the Administrator. If the route table of the target network is not found, the router sends the information to the default router gateway of last resort ). Dynamic algorithms, as the name suggests, are routes automatically calculated by routers. RIP and OSPF are typical examples of dynamic algorithms.

In addition, you can divide routing algorithms into DV and LS. DVDistance (Distance Vector) algorithm transmits the route information of the current router to the adjacent router. The adjacent router adds the information to its route table. LSLink State (link State) algorithms transmit the link State information to all routers in the domain. The receiving router uses this information to construct a network topology and uses the Shortest Path Priority Algorithm in graph theory to determine the route. In contrast, the Distance Vector Algorithm is relatively simple, while the link state algorithm is more complex, occupying more CPU and memory. However, because the link status algorithm uses its own computing results, it is not easy to generate a route loop. RIP is a typical representative of DV algorithms, while OSPF is a representative protocol of LS.

The four most common routing protocols are RIP, IGRP, OSPF, and OSPF.

RIPRouting Information Protocols is the most widely used distance vector protocol, which was developed by Xerox in 1970s. At that time, RIP was part of the XNSXerox Network Service, Xerox Network Service) protocol cluster. The TCP/IP version of RIP is the license version of Xerox protocol. The biggest feature of RIP is that the implementation principle and configuration method are very simple. RIP is based on the number of hops and regularly sends update messages to the neighbor router.

IGRP is a CISCO proprietary protocol and is only implemented in a CISCO router. It is also a distance vector protocol, so it has something in common with RIP in many places, such as broadcast update. The biggest difference between it and RIP is in the measurement method, load balancing, and other aspects. IGRP supports weighted load balancing on multiple paths, so that the network bandwidth can be used more rationally. In addition, unlike RIP, which uses only the number of hops as the measurement basis, IGRP uses multiple parameters to form a composite measurement value, which may include the following factors: bandwidth, latency, load, reliability, and MTU maximum transmission unit.

The OSPF protocol was developed in late 1980s S and became an industrial standard in Early 1990s S. It is a typical Link Status Protocol. The main features of OSPF include: support for subnet mask with a longer VLSM length), fast convergence, low bandwidth usage, and so on. The OSPF protocol exchanges the link status information between neighbors so that the router can establish the link status database LSD). Then, the router uses the SPFShortest Path First (Shortest Path First) algorithm to calculate the route table based on the information in the database, the main reason for selecting a path is bandwidth.

It is an enhanced version of IGRP and is also a proprietary routing protocol of CISCO. To some extent, it is similar to the distance vector algorithm, but it has a shorter convergence time and better operability. As an extension of IGRP, VPN supports multiple routing protocols, such as IP, IPX, and AppleTalk. When running in an IP environment, you can also perform a smooth connection with IGRP because their measurement methods are consistent.

The above four routing protocols are both intra-Domain Routing Protocols, which are usually used within the autonomous system. When connecting Autonomous Systems, Inter-Domain Routing Protocols such as BGPBorder Gateway Protocols and border routing protocol) and EGPExternal Gateway Protocols and external routing protocol are often used. Currently, the Inter-Domain Routing Protocol used on the Internet is the fourth version of BGP.

Convergence is an important issue in routing algorithm selection. Convergence time refers to the time required to know the change from the change of the network topology to the change of all related routers on the network, and to make the change accordingly. The shorter the time, the smaller the network disturbance to the whole network. If the convergence time is too long, the routing cycle will appear.

Among the preceding domain routing algorithms, the convergence time of RIP and IGRP is relatively long, which is an order of magnitude in minutes. OSPF is shorter and can be converged in dozens of seconds, after the network topology changes, the convergence status can be reached in a few seconds.

Fully-switched Campus Network  

The traditional campus network is composed of routers and switches. As shown in, a vswitch is responsible for internal network transmission and VLAN Division to ensure the security and flexibility of the Layer 2. The vro completes addressing and data forwarding between networks.
 

Generally, the performance of a vro is worse than that of A vswitch, because the vro is a software-based look-up table forwarding, And the vswitch can implement hardware-based pass-through forwarding. However, in a traditional campus network, routers do not become the network bottleneck. Because 80% of the data volume is communication within the network, only 20% of the data is for remote access. That is to say, most of the information transmitted through the vswitch does not pass through the vro. This is the 80/20 traffic model of traditional networks.

In recent years, due to the rise of the Internet/Intranet computing model, applications have been centrally managed, rather than being dispersed in networks of various departments as before. The traffic model of campus networks has undergone great changes. A large amount of network access is remote, that is, through the router. This is called the New 20/80 traffic model. As a result, routers gradually become network bottlenecks.

To solve this problem technically, the network vendor has developed a layer-3 Switch, also known as a route switch. It is a combination of the performance of traditional switches and the intelligence of routers. The route selection is still completed by the vro, but the routing result is retained by the vswitch in its own route cache. In this way, the first data packet in a data stream passes through the router, and all subsequent data packets are directly forwarded by the switch table. Thanks to hardware forwarding, layer-3 switches can achieve line rate routing, as shown in.

The layer-3 switches produced by many manufacturers are the combination of vswitches and vrouters. For example, vswitches of Cisco 6500, and series can select routing modules to implement layer-3 functions.

As a result, the campus network is dominated by switches and layer-3 switches. the fully-switched campus network adapts to the new traffic model and completely overcomes the router bottleneck of the traditional network, this greatly improves network efficiency. At the same time, vrouters are not unemployed and are still used for remote connections and dial-up access.

The first part of this article reviews the layered structure of the network. Next we will talk about the principles of traditional routing and switching, finally, it introduces how to combine the advantages of routing and switching in the current campus network to better meet the user's traffic model.

Routing, switching, and Routing Switching are three main issues in this article.
Due to space limitations, we will not go into details about specific protocols. Sometimes, we will understand the Protocol workflow and specific devices, such as Cisco routers and switches, it is helpful to understand the network principle.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.