OSPF报文头格式
有5种OSPF报文,这五种报文具有相同的报文头格式。OSPF分为5种报文:Hello报文、DD报文、LSR报文、LSU报文和LSAck报文。这五种报文具有相同的报文头格式,长度为24字节。
一、OSPF报文头格式
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+---------------+---------------+-------------------------------+
| Version | Type | Packet length |
+---------------+---------------+-------------------------------+
| Router ID |
+---------------------------------------------------------------+
| Area ID |
+-------------------------------+-------------------------------+
| Checksum | AuType |
+-------------------------------+-------------------------------+
| Authentication |
+---------------------------------------------------------------+
| Authentication |
+---------------------------------------------------------------+
二、OSPF报文头格式解释
字段 | 长度 | 含义 |
---|---|---|
Version | 1字节 | 版本,OSPF的版本号。对于OSPFv2来说,其值为2。 |
Type | 1字节 | 类型,OSPF报文的类型,有下面几种类型:
|
Packet length | 2字节 | OSPF报文的总长度,包括报文头在内,单位为字节。 |
Router ID | 4字节 | 发送该报文的路由器标识。 |
Area ID | 4字节 | 发送该报文的所属区域。 |
Checksum | 2字节 | 校验和,包含除了认证字段的整个报文的校验和。 |
AuType | 2字节 |
验证类型,值有如下几种表示:
|
Authentication | 8字节 |
鉴定字段,其数值根据验证类型而定:
MD5验证数据添加在OSPF报文后面,不包含在Authenticaiton字段中。 |
三、OSPF报文示例
Frame 1: 66 bytes on wire (528 bits), 66 bytes captured (528 bits)
Encapsulation type: Ethernet (1)
Arrival Time: Mar 24, 2005 14:21:26.066746000
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1111645286.066746000 seconds
[Time delta from previous captured frame: 0.000000000 seconds]
[Time delta from previous displayed frame: 0.000000000 seconds]
[Time since reference or first frame: 0.000000000 seconds]
Frame Number: 1
Frame Length: 66 bytes (528 bits)
Capture Length: 66 bytes (528 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ip:ospf]
[Coloring Rule Name: OSPF State Change]
[Coloring Rule String: ospf.msg != 1]
Ethernet II, Src: 00:e0:fc:48:90:4e (00:e0:fc:48:90:4e), Dst: 00:e0:fc:48:07:a0 (00:e0:fc:48:07:a0)
Destination: 00:e0:fc:48:07:a0 (00:e0:fc:48:07:a0)
Address: 00:e0:fc:48:07:a0 (00:e0:fc:48:07:a0)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: 00:e0:fc:48:90:4e (00:e0:fc:48:90:4e)
Address: 00:e0:fc:48:90:4e (00:e0:fc:48:90:4e)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: IP (0x0800)
Internet Protocol Version 4, Src: 10.4.4.1 (10.4.4.1), Dst: 10.4.4.2 (10.4.4.2)
Version: 4
Header Length: 20 bytes
Differentiated Services Field: 0xc0 (DSCP 0x30: Class Selector 6; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
1100 00.. = Differentiated Services Codepoint: Class Selector 6 (0x30)
.... ..00 = Explicit Congestion Notification: Not-ECT (Not ECN-Capable Transport) (0x00)
Total Length: 52
Identification: 0x0f32 (3890)
Flags: 0x00
0... .... = Reserved bit: Not set
.0.. .... = Don't fragment: Not set
..0. .... = More fragments: Not set
Fragment offset: 0
Time to live: 1
[Expert Info (Note/Sequence): "Time To Live" only 1]
["Time To Live" only 1]
[Severity level: Note]
[Group: Sequence]
Protocol: OSPF IGP (89)
Header checksum: 0x9975 [validation disabled]
[Good: False]
[Bad: False]
Source: 10.4.4.1 (10.4.4.1)
Destination: 10.4.4.2 (10.4.4.2)
[Source GeoIP: Unknown]
[Destination GeoIP: Unknown]
Open Shortest Path First
OSPF Header
Version: 2
Message Type: DB Description (2)
Packet Length: 32
Source OSPF Router: 10.1.1.1 (10.1.1.1)
Area ID: 0.0.0.0 (0.0.0.0) (Backbone)
Checksum: 0xad21 [correct]
Auth Type: Null (0)
Auth Data (none): 0000000000000000
OSPF DB Description
Interface MTU: 0
Options: 0x02 (E)
0... .... = DN: Not set
.0.. .... = O: Not set
..0. .... = DC: Demand Circuits are NOT supported
...0 .... = L: The packet does NOT contain LLS data block
.... 0... = NP: NSSA is NOT supported
.... .0.. = MC: NOT Multicast Capable
.... ..1. = E: External Routing Capability
.... ...0 = MT: NO Multi-Topology Routing
DB Description: 0x00
.... 0... = R: OOBResync bit is NOT set
.... .0.. = I: Init bit is NOT set
.... ..0. = M: More bit is NOT set
.... ...0 = MS: Master/Slave bit is NOT set
DD Sequence: 19642
四、OSPF报文协议栈结构
OSPF DD报文用IP报文直接封装协议报文,协议号为89。
+-------------------------------------+
| OSPF |
+-------------------------------------+
| IPv4 Header |
+-------------------------------------+
| L2 |
+-------------------------------------+
| L1 |
+-------------------------------------+
发表评论