DTP 抓包分析

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DTP 抓包分析相关的知识,希望对你有一定的参考价值。

# DTP(DynamicTrunking protocol)是思科私有协议为Trunk服务,前身是DISL。可以让交换机间的链路自动协商是否形成Trunk。
# TRUNK介绍过配置Trunk用switchporttrunk encapsulation dot1Q和switchportmode trunk这两条命令即可。
# 现在可以不用手动打这两条命令,而是用DTP来自动协商形成Trunk。另外DTP还可以协商Trunk链路的封装类型(802.1Q或ISL)。配置了DTP的交换机会发送DTP协商包,对方对DTP协商包进行响应,最终决定是否可以形成Trunk。
# 30s发送一次DTP的frame. 该协议仅在交换机间协商。

# DTP有4种模式分别是:auto,dersirable,trunk negotiate,trunk nonegotiate
# auto:被动协商,不主动发送DTP,但收到DTP后可以回复,回复后成功协商成Trunk链路
# desirable:期望把接口置于Trunk模式,会主动发送或回复DTP协商,只要对方能响应,就成功协商成Trunk链路
# negotiate:已经强制将端口配成Trunk模式了,会主动发送或回复DTP协商,只要对方能响应,就成功协商成Trunk链路
# nonegotiate:已经强制将端口配成Trunk模式了,但不主动发送或回复DTP协商。因此只有在对方端口已经是negotiate或nonegotiate,即对方端口已经配置成了Trunk的情况下,才能形成Trunk链路

--------------------------------------------------------------------
        |         SW1         |      |         SW2         | 
        |        trunk        |  --  |        trunk        |  
        |        none         |      |        none         |
--------------------------------------------------------------------      
                
IOU1(config)#do sh int e3/3 swi
Name: Et3/3
Switchport: Enabled
Administrative Mode: dynamic desirable
Operational Mode: trunk
Administrative Trunking Encapsulation: negotiate
Operational Trunking Encapsulation: isl
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none 
Administrative private-vlan mapping: none 
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Appliance trust: none
IOU1(config)#

IOU2(config)#do sh int e3/3 swi
Name: Et3/3
Switchport: Enabled
Administrative Mode: dynamic desirable
Operational Mode: trunk
Administrative Trunking Encapsulation: negotiate
Operational Trunking Encapsulation: isl
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none 
Administrative private-vlan mapping: none 
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Appliance trust: none
IOU2(config)#

Frame 5064: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: aa:bb:cc:00:04:33 (aa:bb:cc:00:04:33), Dst: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc)
    Destination: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc)       # 目的MAC地址 CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc) 
    Source: aa:bb:cc:00:04:33 (aa:bb:cc:00:04:33)
    Type: 802.1Q Virtual LAN (0x8100)
802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 1
    000. .... .... .... = Priority: Best Effort (default) (0)
    ...0 .... .... .... = CFI: Canonical (0)
    .... 0000 0000 0001 = ID: 1                                  # 802.1Q封装 vlan 1  
    Length: 34
    Padding: 0000000000000000
Logical-Link Control
    DSAP: SNAP (0xaa)
        1010 101. = SAP: SNAP
        .... ...0 = IG Bit: Individual
    SSAP: SNAP (0xaa)
        1010 101. = SAP: SNAP
        .... ...0 = CR Bit: Command
    Control field: U, func=UI (0x03)
        000. 00.. = Command: Unnumbered Information (0x00)
        .... ..11 = Frame type: Unnumbered frame (0x3)
    Organization Code: Cisco (0x00000c)                          # cisco 私有协议  
    PID: DTP (0x2004)                                            # 采用DTP协议
Dynamic Trunk Protocol:  (Operating/Administrative): Trunk/Desirable (0x83) (Operating/Administrative): ISL/Negotiated (0x40): aa:bb:cc:00:04:33
    Version: 1
    Domain
        Type: Domain (0x0001)
        Length: 5
        Domain: 
    Trunk Status
        Type: Trunk Status (0x0002)
        Length: 5
        Value: Trunk/Desirable (0x83)                            # Trunk Status :Trunk/Desirable 模式
            1... .... = Trunk Operating Status: Trunk (0x1)
            .... .011 = Trunk Administrative Status: Desirable (0x3)
    Trunk Type
        Type: Trunk Type (0x0003)
        Length: 5
        Value: ISL/Negotiated (0x40)                             
            010. .... = Trunk Operating Type: ISL (0x2)                # trunk 类型为 ISL
            .... .000 = Trunk Administrative Type: Negotiated (0x0)    # 管理配置类型:Negotiated
    Sender ID
        Type: Sender ID (0x0004)
        Length: 10
        Sender ID: aa:bb:cc:00:04:33 (aa:bb:cc:00:04:33)
        
Frame 5065: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: aa:bb:cc:00:06:33 (aa:bb:cc:00:06:33), Dst: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc)
    Destination: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc)        # 目的MAC地址 CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc)
    Source: aa:bb:cc:00:06:33 (aa:bb:cc:00:06:33)
    Type: 802.1Q Virtual LAN (0x8100)
802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 1
    000. .... .... .... = Priority: Best Effort (default) (0)
    ...0 .... .... .... = CFI: Canonical (0)
    .... 0000 0000 0001 = ID: 1
    Length: 34
    Padding: 0000000000000000
Logical-Link Control
    DSAP: SNAP (0xaa)
        1010 101. = SAP: SNAP
        .... ...0 = IG Bit: Individual
    SSAP: SNAP (0xaa)
        1010 101. = SAP: SNAP
        .... ...0 = CR Bit: Command
    Control field: U, func=UI (0x03)
        000. 00.. = Command: Unnumbered Information (0x00)
        .... ..11 = Frame type: Unnumbered frame (0x3)
    Organization Code: Cisco (0x00000c)
    PID: DTP (0x2004)
Dynamic Trunk Protocol:  (Operating/Administrative): Trunk/Desirable (0x83) (Operating/Administrative): ISL/Negotiated (0x40): aa:bb:cc:00:06:33
    Version: 1
    Domain
        Type: Domain (0x0001)
        Length: 5
        Domain: 
    Trunk Status
        Type: Trunk Status (0x0002)
        Length: 5
        Value: Trunk/Desirable (0x83)
            1... .... = Trunk Operating Status: Trunk (0x1)
            .... .011 = Trunk Administrative Status: Desirable (0x3)
    Trunk Type
        Type: Trunk Type (0x0003)
        Length: 5
        Value: ISL/Negotiated (0x40)
            010. .... = Trunk Operating Type: ISL (0x2)
            .... .000 = Trunk Administrative Type: Negotiated (0x0)
    Sender ID
        Type: Sender ID (0x0004)
        Length: 10
        Sender ID: aa:bb:cc:00:06:33 (aa:bb:cc:00:06:33)
        
        
--------------------------------------------------------------------------------------------------
        |                 SW1                 |      |                 SW2                 | 
        |                trunk                |  --  |                trunk                | 
        |switchport trunk encapsulation dot1q |      |switchport trunk encapsulation dot1q |
        |       switchport mode trunk         |      |       switchport mode trunk         | 
--------------------------------------------------------------------------------------------------

IOU1(config-if)#do sh int e3/3 swi
Name: Et3/3
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none 
Administrative private-vlan mapping: none 
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Appliance trust: none
IOU1(config-if)#

IOU2(config-if)#do sh int e3/3 swi
Name: Et3/3
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none 
Administrative private-vlan mapping: none 
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Appliance trust: none
IOU2(config-if)#

Frame 6159: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: aa:bb:cc:00:06:33 (aa:bb:cc:00:06:33), Dst: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc)
    Destination: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc)
    Source: aa:bb:cc:00:06:33 (aa:bb:cc:00:06:33)
    Type: 802.1Q Virtual LAN (0x8100)
802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 1
    000. .... .... .... = Priority: Best Effort (default) (0)
    ...0 .... .... .... = CFI: Canonical (0)
    .... 0000 0000 0001 = ID: 1
    Length: 34
    Padding: 0000000000000000
Logical-Link Control
    DSAP: SNAP (0xaa)
        1010 101. = SAP: SNAP
        .... ...0 = IG Bit: Individual
    SSAP: SNAP (0xaa)
        1010 101. = SAP: SNAP
        .... ...0 = CR Bit: Command
    Control field: U, func=UI (0x03)
        000. 00.. = Command: Unnumbered Information (0x00)
        .... ..11 = Frame type: Unnumbered frame (0x3)
    Organization Code: Cisco (0x00000c)
    PID: DTP (0x2004)
Dynamic Trunk Protocol:  (Operating/Administrative): Trunk/On (0x81) (Operating/Administrative): 802.1Q/802.1Q (0xa5): aa:bb:cc:00:06:33
    Version: 1
    Domain
        Type: Domain (0x0001)
        Length: 5
        Domain: 
    Trunk Status
        Type: Trunk Status (0x0002)
        Length: 5
        Value: Trunk/On (0x81)
            1... .... = Trunk Operating Status: Trunk (0x1)              # 
            .... .001 = Trunk Administrative Status: On (0x1)
    Trunk Type
        Type: Trunk Type (0x0003)
        Length: 5
        Value: 802.1Q/802.1Q (0xa5)
            101. .... = Trunk Operating Type: 802.1Q (0x5)               # Trunk Type : 802.1Q 
            .... .101 = Trunk Administrative Type: 802.1Q (0x5)          # 管理配置类型: 802.1Q         
    Sender ID
        Type: Sender ID (0x0004)
        Length: 10
        Sender ID: aa:bb:cc:00:06:33 (aa:bb:cc:00:06:33)
        
Frame 6160: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: aa:bb:cc:00:04:33 (aa:bb:cc:00:04:33), Dst: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc)
    Destination: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc)
    Source: aa:bb:cc:00:04:33 (aa:bb:cc:00:04:33)
    Type: 802.1Q Virtual LAN (0x8100)
802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 1
    000. .... .... .... = Priority: Best Effort (default) (0)
    ...0 .... .... .... = CFI: Canonical (0)
    .... 0000 0000 0001 = ID: 1
    Length: 34
    Padding: 0000000000000000
Logical-Link Control
    DSAP: SNAP (0xaa)
        1010 101. = SAP: SNAP
        .... ...0 = IG Bit: Individual
    SSAP: SNAP (0xaa)
        1010 101. = SAP: SNAP
        .... ...0 = CR Bit: Command
    Control field: U, func=UI (0x03)
        000. 00.. = Command: Unnumbered Information (0x00)
        .... ..11 = Frame type: Unnumbered frame (0x3)
    Organization Code: Cisco (0x00000c)
    PID: DTP (0x2004)
Dynamic Trunk Protocol:  (Operating/Administrative): Trunk/On (0x81) (Operating/Administrative): 802.1Q/802.1Q (0xa5): aa:bb:cc:00:04:33
    Version: 1
    Domain
        Type: Domain (0x0001)
        Length: 5
        Domain: 
    Trunk Status
        Type: Trunk Status (0x0002)
        Length: 5
        Value: Trunk/On (0x81)
            1... .... = Trunk Operating Status: Trunk (0x1)
            .... .001 = Trunk Administrative Status: On (0x1)
    Trunk Type
        Type: Trunk Type (0x0003)
        Length: 5
        Value: 802.1Q/802.1Q (0xa5)
            101. .... = Trunk Operating Type: 802.1Q (0x5)
            .... .101 = Trunk Administrative Type: 802.1Q (0x5)
    Sender ID
        Type: Sender ID (0x0004)
        Length: 10
        Sender ID: aa:bb:cc:00:04:33 (aa:bb:cc:00:04:33)


以上是关于DTP 抓包分析的主要内容,如果未能解决你的问题,请参考以下文章

使用wireshark抓包分析-抓包实用技巧

如何用wireshark分析抓包

抓包怎么分析数据

fiddler抓包后怎么分析

TCP抓包分析

抓包工具 Fiddler抓包之后的数据分析