Explain the difference between routers and switches _ Application Tips

Source: Internet
Author: User
Tags error handling switches
Computer networks are often connected by a number of different types of network interconnections. If several computer networks are physically connected and cannot communicate with each other, then this "interconnection" has little practical meaning. As a result, when it comes to "interconnection", it has been suggested that these interconnected computers are capable of communicating, that is to say, functionally and logically, these computer networks have already formed a large computer network, or Internet, or, for the short term, a network, an interconnection.
Connecting networks to each other uses intermediate devices (or intermediate systems), and ISO terminology is called a relay (relay) system. Depending on the level of the relay system, you can have the following five relay systems:

1. The physical layer (i.e. the first layer, the L1) relay system, i.e. the transponder (repeater).

2. Data link layer (i.e. second layer, layer L2), namely bridge or bridge.

3. Network layer (third layer, layer L3) relay system, that is, router (router).

4. Network bridge and Router mixture Bridge (brouter) has the function of Network bridge and router.

5. In the network layer above the relay system, that is, gateways (Gateway).

When a relay system is a forwarder, it is generally not called a network interconnect, because it is simply a network extension, and this is still a network. High-level gateways are less used because they are more complex. Therefore, the general discussion of network interconnection refers to the use of switches and routers to interconnect the network. This paper mainly expounds the switches and routers and their differences.

Switches and routers

"Exchange" is the most frequent word in the network today, from bridging to ATM to the telephone system, no matter what the situation can be applied, do not know exactly what is the real exchange. In fact, the exchange of the word first appeared in the telephone system, in particular, to achieve two different telephones between the voice signal exchange, the completion of the work of the equipment is the telephone exchange. So from the original point of view, Exchange is only a technical concept, that is, to complete the signal from the entrance to the export of equipment forwarding. As a result, all devices that are compatible with that definition can be referred to as switching devices. Thus, "Exchange" is a word with a wide meaning, when it is used to describe the device in the second layer of the data network, it actually refers to a bridging device, and when it is used to describe the device on the third layer of the data network, it refers to a routing device.

The Ethernet switch that we often talk about is actually a multi port second layer network device based on the bridge technology, which provides a low delay and low overhead channel for the forwarding of data frames from one port to another.

Thus, there should be an exchange matrix within the core of the switch, providing a path for communication between any two ends of the port, or a fast switching bus so that data frames received by any port are sent from other ports. In the actual equipment, the function of the Exchange matrix is usually done by a special chip (ASIC). In addition, Ethernet switches have an important assumption in the design mindset that the switching core is so fast that the usual large flow data does not cause congestion, in other words, the ability to exchange is infinitely larger than the amount of information being transmitted (in contrast, the ATM switch is designed with the idea that The ability to exchange is considered to be limited relative to the amount of information transmitted.

While the second tier Ethernet switch is based on a multiport bridge, Exchange has a richer feature that makes it not the best way to get more bandwidth but also makes the network more manageable.

The router is a packet switching device (or network layer relay device) in the network layer of the OSI protocol model, and the basic function of the router is to transfer the data (IP packets) to the correct network, including:

1.IP datagram forwarding, including the search and transmission of the datagram;

2. Subnet isolation, suppression of broadcast storms;

3. Maintenance of the road by the table, and with other routers to exchange routing information, which is the basis of IP message forwarding.

Error handling of 4.IP datagram and simple congestion control;

5. The implementation of the IP datagram filtering and accounting.

For different scale networks, the role of routers is different.

In the backbone network, the main role of routers is routing. Routers on the backbone network must know the path to all the underlying networks. This requires maintaining a large routing table and responding as quickly as possible to changes in the state of the connection. The failure of a router can cause serious information transfer problems.

In the regional network, the main function of the router is network connection and routing, that is to connect the lower level of the basic network units-Park network, while responsible for the data forwarding between the lower network.

Within the campus network, the main role of routers is to separate subnets. The early interconnection grassroots unit is the local area network (LAN) where all the hosts are in the same logical network. With the expansion of the network scale, the LAN evolved into a network of multiple subnets connected by high-speed backbone and router. In this, the subnets are logically independent, and routers are the only devices that can separate them, which are responsible for message forwarding and broadcast isolation between subnets, and routers on the border are responsible for connecting to the upper network.

The difference between a second tier switch and a router

The traditional switch is developed from the Network Bridge, which belongs to the OSI second layer, the data link layer equipment. It is based on the MAC address, select routing through the station table, the establishment and maintenance of the station table is automatically carried out by the switch. The router belongs to the OSI third layer, the network layer device, which is addressed according to the IP address and is generated by routing protocol. The biggest advantage of the switch is fast, because the switch only needs to identify the MAC address in the frame, directly based on the MAC address to generate a selection of the algorithm is simple, easy ASIC implementation, so the forwarding speed is very high. But the working mechanism of the switch also poses some problems.

1. Loop: According to the switch address learning and station table building algorithm, the switch does not allow the existence of circuit. Once the loop is present, a spanning tree algorithm must be started to block out the ports that generate the loop. Router routing protocol does not have this problem, routers can have more than one path to balance the load, improve reliability.

2. Load concentration: There is only one path between the switches, so that information is concentrated in a communication link, can not be dynamically allocated to balance the load. The routing protocol algorithm of routers can avoid this, the OSPF routing protocol algorithm can not only produce multiple routes, but also choose the best route for different network applications.

3. Broadcast control: Switches can only narrow the conflict domain, but not the broadcast domain. The whole switching network is a large broadcast domain, the broadcast message scattered to the entire switched network. While routers can isolate broadcast domains, broadcast messages cannot continue to be broadcast through routers.

4. Subnet Division: Switches can only recognize MAC addresses. The MAC address is the physical address, and it uses a flat address structure, so the subnet cannot be divided according to the MAC address. But the router recognizes the IP address, the IP address is assigned by the network administrator, is the logical address and the IP address has the hierarchy structure, is divided into the network number and the host number, can be very convenient to divide the subnet, the router main function is uses for the connection different network.

5. Confidentiality: Although the switch can also be based on the frame of the source MAC address, the purpose of the MAC address and other frame content to filter the frame, but the router based on the message source IP address, Destination IP address, TCP port address and other content of the message implementation of filtering, more intuitive and convenient.

6. Media-Related: Switches as bridging equipment can also be completed between the different link layer and physical layer of the conversion, but this conversion process is more complex, not suitable for ASIC implementation, it is bound to reduce the forwarding speed of the switch. Therefore, the current switch mainly completes the same or similar physical media and Link protocol network interconnection, and will not be used in physical media and Link layer protocol difference between the network interconnection. Routers, however, are mainly used for interconnection between different networks, so that they can connect different physical media, link layer protocols and network layer protocols. Although the router occupies the advantage in the function, but the price is expensive, the message forwarding speed is low.

In recent years, switches have done a lot to improve performance, with the most notable improvements being virtual networks and three-tier switching.

Dividing the subnet can narrow the broadcast domain and reduce the influence of the broadcast storm on the network. Each interface of the router is connected to a subnet, the broadcast message can not be broadcast through the router, the subnet connected to different interfaces of the router belongs to different subnets, and the subnet range is divided by the router physics. For the switch, each port corresponds to a network segment, because the subnet consists of several network segments, through the combination of switch ports, you can logically divide the subnet. Broadcast messages can only be broadcast in the subnet, can not spread to other subnets, through a reasonable division of the logical subnet, to control the purpose of broadcasting. Because a logical subnet is any combination of switch ports and has no physical dependencies, it is called a virtual subnet, or virtual network. The virtual network technology solves the problem of the broadcast message isolation without the router, and the virtual network segment has nothing to do with its physical location, that is, the adjacent network segment can belong to different virtual networks, while the two segments which are far apart may belong to different virtual networks, while the two segments which are far apart may belong to the same virtual network. The terminals in different virtual networks cannot communicate with each other, which enhances the access control of the data within the network.

Switch and router are the contradictory of performance and function, the switch speed is fast, but the control function is weak, the router control performance is strong, but the message forwarding speed is slow. The solution to this paradox is the three-layer switch, which has the capability of switching the speed of the forwarding message and the good control function of the router.

The difference between a third tier switch and a router

Before the advent of the third-tier switching technology, there was little need to differentiate between routing features and routers, and they were all the same: Providing routing functionality was being done at the router, but now the third tier switches are fully capable of performing most of the traditional router's functions. As a network interconnection device, the third layer switch has the following characteristics:

1. Forwarding business flows based on third-tier addresses;

2. Full Exchange function;

3. Can complete special services, such as packet filtering or certification;

4. Perform or do not perform routing processing.

Third-tier switches have the following advantages over traditional routers:

1. Transmission bandwidth between subnets can be arbitrarily distributed: traditional routers each interface to connect a subnet, the subnet through the router transmission rate is limited by the bandwidth of the interface. And the three-tier switch is different, it can be defined as a virtual network of multiple ports, the virtual network as a virtual network interface, the virtual network information can be composed of virtual network of ports to the three-tier switch, because the number of ports can be arbitrarily specified, the transmission bandwidth between the subnet is unlimited.

2. Reasonable allocation of information resources: due to access to the resource rate in the subnet and access to the global network, there is no difference in resource rate, the subnet set up a separate server is not significant, by setting up a server group in the global network not only save costs, but also reasonable configuration of information resources.

3. Reduce costs: the usual network design with the switch to form a subnet, using routers to interconnect between subnets. At present, three-layer switch is used to design the network, which can be divided by any virtual subnet, and the communication can be done through the three-layer routing function of the switch, thus saving the expensive router.

4. Flexible connection between switches: As a switch, they do not allow the existence of a circuit, as a router, but also have more than one path to improve reliability, balance load. The three-layer switch blocks the port that causes the loop with the spanning tree algorithm, but when routing is chosen, the blocked path is still taken as an optional path to participate in routing.

5 Conclusion

To sum up, switches are generally used for lan-wan connections, the switch to the Network Bridge, is the data link layer of equipment, some switches can also achieve the third layer of exchange. Routers are used for connections between Wan-wan, which can be used to resolve the forwarding groupings between opposite-sex networks, and to use the network layer. They just accept the input grouping from one line, and then forward to another line. These two lines may belong to different networks and use different protocols. By comparison, routers are more powerful than switches, but they are relatively slow

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.