The difference between a switch and a router

Source: Internet
Author: User
Tags definition switches

The difference between routers and switches: The main switch is to achieve the Internet through a network of wire, but everyone on the internet is dialed separately, each using their own broadband, everyone has no impact on the internet, even if other people in the download, the Internet has no impact on their own, and all the use of the same switch computer is in the same LAN. Routers than the switch more than a virtual dial-up function, the Internet through the same router computer is sharing a broadband account, the Internet is the interaction between everyone, such as a computer in the download, then the same router on the other computers will be very obvious to feel the speed is very slow. Computers on the same router are also within a local area network.

= = = From the point of view of ordinary user use:

The switch is used to turn a network cable into multiple roots, and if you need to log in, you can log in individually.

Routers are used to turn a network into multiple, divided network bandwidth of multiple networks sharing the main lines.

Here to the general user perspective, the use of inaccurate words, declined to hit the face

The reality is that most home routing consists of routers and switches, which are used for internal network data transmission, and routers use NAT to forward data to communicate with external networks.

= = = from the definition of the textbook:

Switch

For fast transmission of data within the same network

Forwarding decision by viewing the two-layer head finish

Forwarding does not require data frames to be modified

Work in the TCP/IP protocol two-layer-data link layer

Simple work, direct use of hardware processing

Router

Cross-network transmission for data between different networks

Forwarding decision by viewing the three-layer head finish

Forwarding needs to be modified TTL, IP header checksum needs to be recalculated, data frames need to be encapsulated

Working on the three layer of TCP/IP protocol--Network layer

Complex work, using software processing

It should be said that this definition is already obsolete, the three-tier (multilayer) switch has long been widely used, but God knows what reason, at least I have a book in hand to say so.

This is the standard answer in many textbooks and is traditionally true.

Since the switch only needs to view the two-layer data frame of the head can be the decision forwarding address, the strategy is very simple, can be directly through the hardware chip to achieve the corresponding functions, so you can do low-cost high-speed, is a large number of applications in the access layer.

and routers because of the need to deal with the connection across the network, must receive the full IP packets before forwarding data, routing protocols and more complex, so only use the software to achieve the corresponding functions, to achieve high performance can only pay a higher price.

In addition, because the two-tier forwarding only needs to view the frame head to start forwarding, but also make (two-layer) switch has a piece of work: pass-through forwarding. Simply to receive the data frame head to start forwarding, so as to achieve higher performance.

= = = From the point of view of the forwarding mode:

Tips: Only three layers (multilayer) switches are discussed here, two levels above

Switch

Hardware processing Exchange (forwarding) process

One route (seek), multiple Exchange (forwarding)

Router

Software processing Exchange (forwarding) process

One route (seek), one exchange (forwarding)

It is said that there is a pure software forwarding three-layer switch, not discussed

Although the above is written on the difference between the software/hardware, in fact more is the difference in working mode:

The three-tier (multilayer) switch is not pure hardware work, instead of having a separate routing engine, the routing engine does not work all the time, but instead queries the routing table through the routing engine at the first communication, builds a forwarding post, and then the data is not routed through the routing engine, but is forwarded by a two-tier exchange engine.

Because of the simplicity of the work, the forwarding engine can use a dedicated hardware chip to achieve low performance.

and routers for each packet are routed query, occupy a lot of resources, so the search efficiency is low,

Because the routing protocol is complex and cannot be processed by pure hardware chip, the performance of data forwarding is less than three layers (multilayer) switch.

Tips: In fact routers have similar techniques, such as the Cisco Fast Forwarding mechanism (Cef-cisco Express forwarding)

It is also the difference in working patterns that results in some differences in their actual application:

A three-tier (multi-tier) switch has a weaker routing engine than a router-supported routing protocol.

Also because the routing engine of Layer three (multilayer) switch is weaker, and the forwarding is limited, it is not suitable for complex multiple network interconnection.

Because not every packet passes through the routing engine, the routing strategy for a three-tier (multi-tier) switch is weak.

Three-layer (multilayer) switch is more suitable for the network structure is simple, the exchange of data in a large number of scenarios to use (for example, Small network convergence layer)

Routers are more suitable for the core exchange areas of complex multiple network interconnection.

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.