Traditional Culture Encyclopedia - Traditional festivals - What is a switch?

What is a switch?

Recently, I have seen many people asking what switches, hubs, and routers are, what their functions are, and what the differences are. The author will briefly answer these questions.

First let’s talk about HUB, which is the hub.

Its function can be simply understood as connecting some machines to form a local area network.

A switch (also known as a switching hub) functions roughly the same as a hub.

However, there are differences in performance between the two: the hub adopts a shared bandwidth working method, while the switch exclusive bandwidth.

In this way, when there are many machines or a large amount of data, the two will be more obvious.

The router is obviously different from the above two. Its function is to connect different network segments and find the most suitable path for data transmission in the network. It can be said that under normal circumstances, individual users have little demand.

Routers come after switches, just like switches come after hubs, so routers and switches are also related to each other and are not two completely independent devices.

Routers mainly overcome the shortcomings of switches that cannot route and forward data packets.

In general, the main differences between routers and switches are reflected in the following aspects: (1) Different working levels. The original switch worked at the data link layer of the OSI/RM open architecture, which is the second layer.

Routers are designed from the beginning to work at the network layer of the OSI model.

Since the switch works on the second layer of OSI (data link layer), its working principle is relatively simple, while the router works on the third layer of OSI (network layer), and can get more protocol information, and the router can make

Smarter forwarding decisions.

(2) Data forwarding is based on different objects. The switch uses the physical address or MAC address to determine the destination address of the forwarded data.

The router uses the ID numbers (i.e. IP addresses) of different networks to determine the address for data forwarding.

IP addresses are implemented in software and describe the network where the device is located. Sometimes these third-layer addresses are also called protocol addresses or network addresses.

The MAC address usually comes with the hardware and is assigned by the network card manufacturer. It has been solidified into the network card and generally cannot be changed.

IP addresses are usually assigned automatically by the network administrator or system.

(3) Traditional switches can only divide collision domains, but not broadcast domains; routers can divide broadcast domains. The network segments connected by the switch still belong to the same broadcast domain. Broadcast packets will be propagated on all network segments connected by the switch.

This can lead to traffic congestion and security breaches in some cases.

Network segments connected to the router will be assigned to different broadcast domains, and broadcast data will not pass through the router.

Although switches on the third layer and above have VLAN functions and can also divide broadcast domains, communication between sub-broadcast domains cannot be communicated, and communication between them still requires routers.

(4) The router provides a firewall service. The router only forwards data packets with specific addresses and does not transmit data packets that do not support routing protocols and unknown destination network data packets, thereby preventing broadcast storms.

Switches are generally used for LAN-WAN connections. Switches are classified as bridges and are devices at the data link layer. Some switches can also implement third-layer switching.

Routers are used for WAN-WAN connections. They can forward packets between heterogeneous networks and act on the network layer.

They simply accept input packets from one line and forward them to another line.

The two lines may belong to different networks and use different protocols.

In comparison, routers are more powerful than switches, but are relatively slow and expensive. Layer 3 switches have both the line-speed packet forwarding capability of switches and the good control functions of routers, so they are widely used.

Currently, the most popular broadband access method for individuals is ADSL, so I will briefly explain ADSL access.

Most of the ADSL cats purchased now have routing functions (manufacturers often block the routing function when leaving the factory, because most telecommunications installations do not enable the routing function, enable DHCP. Turn on the ADSL routing function), if an individual accesses the Internet or a small number of

A few computers can be connected through ADSL itself. If there are more computers, you only need to purchase one or more hubs or switches.

Considering that the price difference between hubs and switches is very small nowadays, please buy a switch for no special reason.

There is no need to pursue high prices, because nowadays product homogeneity is very serious, and my cheapest switch now has no problems.

To give you a reference quote, I suggest you buy an 8-port model to meet expansion needs. The general price is about 100 yuan.

Just connect the switch and connect all the computers to the switch.

The only thing left to do is to plug the network cables of each machine into the switch interface, and plug the cat's network cable into the uplink interface.

Then set the routing function, DHCP, etc., and you can enjoy the Internet.

After reading the above explanation, readers should have some understanding of switches, hubs, and routers. The current use is mainly based on the combination of switches and routers. The specific combination method can be determined according to the specific network conditions and needs.