HUB- switch - router

Hub HUB - Physical Layer

working principle:

Machine 1 transmits a data (broadcast transmission), the hub through hub, hub will be forwarded to all other machines, other machines received data, if the data is on their own to accept, if not discard their

The role of hubs? (Sub)

1. The signal amplification

2. The data is received from an interface, parts of N copies, transmitted from all other interfaces

3. The half-duplex (at the same time, can accept or transmit data)

As the half-duplex hub of the working mechanism, the network will create a conflict, the scope of the conflict involved is called the collision domain

Shortcoming

1. The low bandwidth utilization (broadcast)

2. Low efficiency (half duplex)

CSMA / CD

As the half-duplex hub of a small network at the same time there can be only one machine to send data, how to achieve it? So there is a carrier CSMA / CD technology, collision detection Sense Multiple Access technology, to solve the conflict

Switch - physical link layer

working principle

Internal switch has a MAC address and physical port mapping table, the machine 1 transmits data to be transmitted to a machine 3, the first switch receives a data mapping table will first query, if the MAC address of the machine 3 in the table, the data will be directly from the physical machine 3 transmits the access port 3 to the machine. If the machine is not in the table of Table 3, then it is broadcast to each port to send data, if the destination address of the machine, the machine will respond, this time the switch will record the MAC address of a port, constituting slowly a MAC address table.

Feature

1. Full-duplex

2. MAC address may correspond to a plurality of the same physical port (switch bridge)

Table 3. General mac can store thousands of records

Shortcoming

Suitable for small networks, there will be a large network message flood

Router - Network Layer

working principle

Mainly responsible for forwarding data between each network, the router has a routing table Zhang, the establishment of such a table is implemented by a variety of advanced algorithms

If 192.168.0.102 192.168.1.254 To send a data, the first data object, ip and ip source is constant, the data is first sent to 192.168.0.1 (gateway), the gateway ultimately mac address, data sent to the gateway, to the gateway send data to 1.52, this time into a source mac address, mac address purpose 0.1 becomes 1.52, 1.52 eventually found, this time into a source mac address, purpose of become a mac 1.52 1.254, and finally found machine complete data transfer this part related to the address Resolution protocol ARP

up主视频连接https://www.bilibili.com/video/av66929320

Guess you like

Origin www.cnblogs.com/zx125/p/11703321.html