L2-study

L2 covers MAC address learning, VLAN. For me layer two is maily MAC layer.

If you want to get the MAC address of a host, ARP protocol will be used. For example, if A want to get the MAC address of B,  A broadcast  ARP request packets. If B receive the packets, it will reply ARP reply packets to A and then A learned MAC of B.

MAC

For thernet the priciple the MAC learning is CSMA/CD.  It is kind of difficult to understand the principle. But the cocept of collision domain must be understood.

MAC address is 6 Bytes, 48 bits in total. OUI is special part used to differentiate various factories. 

Broadcast addresses, unicast addresses and multicast addresses are divided. The port will learn the source MAC addresses of packets received.

VLAN

802.1Q tag is 2 Bytes in total. Priority, CFI, VLAN-ID are divided.

  1. The Priority comes from 0 to 7, 3bits. It is used for QoS such as bandwidth sheduling. For the switch different service flows are mapped into different queues. The sheduling method such as strict-priority, wrr can be used.
  2.  VLAN-ID comes from 0 to 4094, 12bits.

VLAN(802.1q) is used to separate the broadcast domains. One vlan is one broadcast domain. if  a L2 switch doesn't support VLAN,  broadcast packets from a port will be received by any other port. On the other hand, if the L2 switch support the VLAN, the ports only receive the packets from the same vlan.

if port isolation is enabled, the UNI ports will not receive the packets from other UNI ports even if  they are in the same broadcast domain.

Double tag services: The host such as PC send packets without tag to the switch ports. The ports add c-vlan to the packets received. When the upper class devices received the tagged packets another tag may also be added.  

 

collision domains all ports in the same collision domain

HUB             all ports in the same collision domain

L2 switch      all ports in the same broadcast domain

L3 switch     

router      

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值