The basic principle and configuration switches

The data link layer:
                             establishing a data link, maintenance and removal of
                             frame packing, frame transmission, frame synchronization
                             frame error recovery
                             flow control


MAC address

     Communications, to address to identify the host identity is made on the card's hardware address. After each card in produced, in addition to the basic functions, has a globally unique number to identify yourself, this address is the MAC address, that is, the physical address of the network card. MAC address consists of 48-bit binary number, usually divided into six sections, by hexadecimal notation, such as 00-D0-09-A1-D7-B7. Wherein the first 24 bits is the manufacturer number of manufacturers apply to the IEEE, after 24 serial number is a network interface card. MAC address bit 8 is 0, indicating that the MAC address is a unicast address; when 1, indicates that the MAC address is a multicast MAC address. A physical network card address must be a unicast address, i.e. constant bit 8 is 0; multicast address is a logical address, used to represent a group of recipients rather than a recipient

Screenshot micro-channel _20190803094816.png

Ethernet frame format

Screenshot micro-channel _20190803094816.png

1, a preamble (a Preamble) contains 8 bytes. 7 before the byte is 0xAA, and the last byte is 1 0xAB. In Ethernet DIX, the preamble is considered to be part of the physical layer of the package, rather than encapsulating the data link layer.

2, the destination address (DA) contains 6 bytes. DA identifies the MAC address of the destination station of the frame. DA may be a unicast address (single destination), a multicast address (destination group) or a broadcast address.  

3, source address (SA) contains 6 bytes. SA identifies the MAC address of the sending frame site. SA must be a unicast address (which is the 8th bit is 0).

4, comprises a 2-byte type field, used to identify the upper layer protocol type, such as for IP 0800H.

5,数据域包含 46~1500 字节。数据域封装了通过以太网传输的高层协议信息。由于 CSMA/CD 算法的限制,以太网帧不能小于某个最小长度。高层协议要确保这个域至 少包含 46 字节。如果实际数据不足 46 字节,则高层协议必须执行某些(未指定) 填充算法。数据域长度的上限是任意的,但已经被设置为 1500 字节。

6,帧校验序列(FCS)包含 4 字节。FCS 是从 DA 开始到数据域结束这部分的校验和。 校验和的算法是 32 位的 CRC(Cyclic Redundancy Check,循环冗余校验法)。


交换机的设备简介

Screenshot micro-channel _20190803094816.png


交换机以太网接口的工作模式


1,单工:只能沿单一的方向传输数据,例如广播只能单一方向

2,半双工:数据站之间可以双向数据传输,但是不能同时进行,例如对讲机可以双向,但是不能同时进行

3,全双工:数据站之间可以双向且同时进行数据传输,例如手机可以同时进行收听和讲话

以太网的接口速率:接口连接时进行协商,协商失败则不能通信

Screenshot micro-channel _20190803100743.png


交换机的工作原理

交换机并不会把收到的每个数据信息都以广播的方式发给客户端,是由于交换机可以根 据 MAC 地址智能地转发数据帧。交换机存储的 MAC 地址表将 MAC 地址和交换机的接口编号对 应在一起,每当交换机收到客户端发送的数据帧时,它就会根据 MAC 地址表的信息判断该如 何转发。

1,MAC地址的学习

假设 A 主机发送数据帧(源 MAC 地址为 00-00-00-11-11-11,目标 MAC 地址为 00-00-00-22-22-22)到交换机的 1 号接口,交换机首先查询 MAC 地址表中 1 号接口 对应的源 MAC 地址条目。如果条目中没有数据帧的源 MAC 地址,交换机就会将这个帧的源地 址和收到该数据帧的接口编号(1 号口)对应起来,添加到 MAC 地址表(老化时间:300s删除未通信的MAC地址)中。

2. Unknown broadcast data frame if the switch does not find the destination address of the data frame corresponding to the entry in the MAC address table, the switch can not determine from the interface which forwards the data frame, then it was forced to choose a broadcast manner, i.e., in addition to No. 1 All interfaces are outside forwards this data frame, shown in Figure 3.5. Thus, the network Hosts B and C will receive the data frame.

 3. Response message recipient host B will respond to this broadcast, and a response data frame (00-00-00-22-22-22 source MAC address, destination MAC address is 00-00-00-11-11-11), this will switch the source MAC address and the interface numbers (No. 2) in association with, added to the MAC address table, shown in Figure 3.6.

Now, the communication between the host A and B do not broadcast means, because the MAC address table has an entry thereof, the target address of host A transmits a data frame is 00-00-00-22-22-22, the switch discovery interface corresponding to the address designated 2, then the switch will only forward data frame to the number two.

Screenshot micro-channel _20190803101707.png

Screenshot micro-channel _20190803104231.png


Four modes command line switch

.Png hierarchy of command line

Switches Command Line Help

Command line help .png




Guess you like

Origin blog.51cto.com/14080162/2426157
Recommended