Differences in Routing and switching

Source: Internet
Author: User

1.intuitive, simple and clear distinction

swap: Using MAC address forwards the data frame According to the MAC Address Table .

The functionality of the data link layer in the OSI seven-layer reference model is implemented by having a switching device, such as a switch .

Routing: Uses IP addresses to forward packets based on the routing table .

The ability to implement a network layer through a routing device , such as a router .


2, the realization principle to differentiate

Switch: Three stages , learning, forwarding, filtering.

Learning: Learning the source of its header information based on the source frame MAC, and switch port that receives the source Frame

numbers are stored together in MAC the Address table.

forwarding: For a received data frame, view The purpose of its header information MAC , according to MAC to

The Address table is forwarded from the corresponding port, if MAC The Address table does not have a purpose MAC Phase

The data frame from the ( except for ports that receive this frame ) all ports forwarded out

go to ( flooding ) .

filtering: For the target in the original data frame, after MAC after matching the Address table and the switch settings

Other policies will only be forwarded from certain ports, not from all ports

Even after filtering, the data frame is discarded directly.

Router: I use four words to summarize its core essence of the task: routing Route .

As for how to choose, the result of the choice is what, that is something. MAC maintained with the switch

to corresponding to the Address table, the router maintains a single routing table.

Routing table formation process is divided into two, first: the person is manually specified, that is, static routing, its default

Management distance of 1 ( the standard for measuring routing confidence ), with higher priority than dynamic routing; second: dynamic

Routing, routers Exchange routing information with each other according to different routing protocols, and eventually converge to a single

Dynamic routing table.


3,MAC and IP connection

The Mac is a physical address that has been cured in the network interface card ROM and cannot be changed.

IP is the logical address , all network interconnection devices and terminal devices whose IP address can always change.

when communicating and forwarding data, various network devices will be based on IP address gets the corresponding MAC address on the

Data for forwarding.


Chestnuts: The switch is connected to two PCA and PCB, when the switch wants to communicate with the PCB , first know PCB

ip address, and then get PCB . mac Address because it is logically used to communicate, physically use

mac to communicate . At this point, PCA queries the locally cached mac Address Table in can be arp-a

Command View ). If the MAC Address table for the PCB is not available locally, then PCA encapsulates an ARP request Packet

Send it to the switch, after the switch receives the request, it Hongzhi the request in addition to the receiving request

of other ports. So the PCB after receiving the request to see and their own IP is corresponding, then put their own MAC rang

should be given to PCA. Finally, the PCA can communicate with the PCB .

The data that is forwarded between the routers, each hop ( a network segment ) also needs to be changed from source and destination IP to Source and

Target mac, which is forwarded according to Mac .


4. Different Technologies involved

At the data link layer are VLANs,trunks,VTP ( Cisco private ),STP, link aggregation, port security, etc.

In the network layer there are dynamic routing protocols,ACLs,NAT , and so on.


This blog post on the contents of the content if there is not correct or unreasonable, but also please Bo friends pointed out, thank you.


This article is from the "Li Gaoquan" blog, make sure to keep this source http://lgq258.blog.51cto.com/9766325/1787614

Differences in Routing and switching

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.