资源描述:
《【精品】vlan分析文档》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、RTLvlan分析文档1.底层实现部分1.1底层实现机制Vian工作流程图VLANFlowPacket—r—►1.ACLFlowBasedVLAN—►2.TaggedPacketIPSubnetbasedMACbasedApplicationbasedIngressVLANTranslationRSPANTaggedOuter/Inner/ExtraTaggedPacketVIDPacketPriorityForwardVID1.Protocolbased2.Portbased丿1.IngressVLANFilter2.VLAN
2、TableLookupValidSpanning>TreeLookupAddressEgressEgressSTPSourceMAC>Table—>VLAN—►PortStatePIEPhase#4LearningLookupLookupFilteringInvalid.>Drop图1-11.2功能实现数据包传过来的时候,会对其进行分析检测,共冇以上三种工作机制实现数据的传输:1.ACLFlowBasedVLAN2.TaggedPacket3.UntaggedPriorityTagged1.3暂时实现的功能UntaggedPri
3、orityTagged条件基于端口的vlan的工作机制。即数据包传来的吋候数据包要满足执行后面的操作,其具体流程如下:图1-21.4VLAN相关寄存器PORT_BASED_VLAN_CONTROL/**/PORT_VLAN_INGRESS_FILTER_CONTROL/*默认值为0x1,使能端口,vlan入口过滤*/PORT_FORWARDING_TAG_SELECT_CONTROL/*vlanid的内部或外部的学习和转发;0为内部,1为外部,默认0x0*/PORT_VLAN_EGRESS_FILTER_CONTROL/*vla
4、n出口过滤的开启/关闭;0为disable,1为enable,默认0x1*/PORT_EGRESS_TAG_STATUS_CONTROL/*端口出口的标记状态;00:内部和外部都标记、01:只有内部标记10:只有外部标记11:不标记默认0x3*/PORT_VLAN_TAG_SOURCE_CONTROL/*默认值为0x0*/PORT_VLAN_TAG_ORIGINAL_FORMAT_CONTROL/**默认值为0x0,donotkeep*/PORT_INNER_TAG_TPID_INDEX_CONTROL/*0:对数据包入口的格式
5、是内部未标记,而对出口格式是内部标记的1:所有的数据包都是从这个口被发岀的;默认为0x0*/PORT_EGRESS_VID_TRANSLATE_LOOKUP_CONTROL/*默认值为0x0,—般不做处理*/PORT_IGNORE_VLAN_TAG_CONTROL厂默认值为0x1,系统默认ignore,一般不做处理*/2.S冰接口函数2.1vlan相关结构体/不vlaninformationstructure*/typedefstructdal_esw_vlan_info_s/*countofvalidvlannumber/*v
6、alidbitforthistable/*tabicindexofvid,0:invaliduint32count;uint32*pValid_lists;uint!6*pVid2tblindcx;}dal_esw_vlan_info_t;/*vlanentry*/typedefstructdal_esw_vlan_data_s{rtk_vlan_tvid;rtk_fid_tfid;rtk_vlan_fwdModc_tvlan_basc_fwd;rtk_portmask_tmember_portmask;rtk_portmask
7、_tuntag_portmask;}dal_esw_vlan_data_t;typedefenumdal_esw_vlan_egrTagStatus_e{EGR_BOTH_TAG=0,EGR」NNER_TAG_ONLY,EGR_OUTER_TAG_ONLY,EGR.UNTAG,DAL_ESW_EGRTAGSTATUS_END}dal_csw_vlan_cgrTagStatus_t;typedefenumrtk_action_eACTION_FORWARD=0,ACTION_DROP,ACT1ON_TRAP2CPU,ACTION_
8、COPY2CPU,ACTIONTOGUESTVLAN,ACTIONFLOODINVLAN,ACTIONFLOODINALLPORT,ACTION_FLOOD_IN_ROUTER_PORTS,ACTION_END}rtk_action_t;typedefenumr