OSPF Hello 报文格式
Hello报文是最常用的一种报文,其作用为建立和维护邻接关系,周期性的在使能了OSPF的接口上发送。
报文内容包括一些定时器的数值、DR、BDR以及自己已知的邻居。
一、OSPF Hello报文格式
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 | 1 | Packet length |
+---------------+---------------+-------------------------------+
| Router ID |
+---------------------------------------------------------------+
| Area ID |
+-------------------------------+-------------------------------+
| Checksum | AuType |
+-------------------------------+-------------------------------+
| Authentication |
+---------------------------------------------------------------+
| Authentication |
+---------------------------------------------------------------+
| Network Mask |
+-------------------------------+---------------+---------------+
| HelloInterval | Options | Rtr Pri |
+-------------------------------+---------------+---------------+
| RouterDeadInterval |
+---------------------------------------------------------------+
| Designated Router |
+---------------------------------------------------------------+
| Backup Designated Router |
+---------------------------------------------------------------+
| Neighbor |
+---------------------------------------------------------------+
| ... |
二、OSPF Hello报文格式解释
字段 |
长度 |
含义 |
---|---|---|
Version |
1字节 |
版本,OSPF的版本号。对于OSPFv2来说,其值为2。 |
Packet length |
2字节 |
OSPF报文的总长度,包括报文头在内,单位为字节。 |
Router ID |
4字节 |
发送该报文的路由器标识。 |
Area ID |
4字节 |
发送该报文的所属区域。 |
Checksum |
2字节 |
校验和,包含除了认证字段的整个报文的校验和。 |
AuType |
2字节 |
验证类型,值有如下几种表示:
|
Authentication |
8字节 |
鉴定字段,其数值根据验证类型而定:
MD5验证数据添加在OSPF报文后面,不包含在Authenticaiton字段中。 |
Network Mask |
32比特 |
发送Hello报文的接口所在网络的掩码。 |
HelloInterval |
16比特 |
发送Hello报文的时间间隔。 |
Options |
8比特 |
可选项:
|
Rtr Pri |
8比特 |
DR优先级。默认为1。如果设置为0,则路由器不能参与DR或BDR的选举。 |
RouterDeadInterval |
32比特 |
失效时间。如果在此时间内未收到邻居发来的Hello报文,则认为邻居失效。 |
Designated Router |
32比特 |
DR的接口地址。 |
Backup Designated Router |
32比特 |
BDR的接口地址。 |
Neighbor |
32比特 |
邻居,以Router ID标识。 |
三、OSPF Hello报文示例
Frame 1: 82 bytes on wire (656 bits), 82 bytes captured (656 bits)
Encapsulation type: Ethernet (1)
Arrival Time: Jun 7, 2014 18:06:20.627341000
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1402135580.627341000 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: 82 bytes (656 bits)
Capture Length: 82 bytes (656 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ip:ospf]
[Coloring Rule Name: Routing]
[Coloring Rule String: hsrp || eigrp || ospf || bgp || cdp || vrrp || carp || gvrp || igmp || ismp]
Ethernet II, Src: Novell_40:64:00 (1b:00:00:40:64:00), Dst: 01:00:5E:00:00:05 (01:00:5E:00:00:05)
Destination: 01:00:5E:00:00:05 (01:00:5E:00:00:05)
Address: 01:00:5E:00:00:05 (01:00:5E:00:00:05)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: Novell_40:64:00 (1b:00:00:40:64:00)
[Expert Info (Warn/Protocol): Source MAC must not be a group address: IEEE 802.3-2002, Section 3.2.3(b)]
[Source MAC must not be a group address: IEEE 802.3-2002, Section 3.2.3(b)]
[Severity level: Warn]
[Group: Protocol]
Address: Novell_40:64:00 (1b:00:00:40:64:00)
.... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
.... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast)
Type: IP (0x0800)
Internet Protocol Version 4, Src: 10.81.0.1 (10.81.0.1), Dst: 224.0.0.5 (224.0.0.5)
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: 68
Identification: 0x00e5 (229)
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
Protocol: OSPF IGP (89)
Header checksum: 0x3665 [validation disabled]
[Good: False]
[Bad: False]
Source: 10.81.0.1 (10.81.0.1)
Destination: 224.0.0.5 (224.0.0.5)
[Source GeoIP: Unknown]
[Destination GeoIP: Unknown]
Open Shortest Path First
OSPF Header
Version: 2
Message Type: Hello Packet (1)
Packet Length: 48
Source OSPF Router: 10.0.10.2 (10.0.10.2)
Area ID: 0.0.0.0 (0.0.0.0) (Backbone)
Checksum: 0xcec3 [correct]
Auth Type: Null (0)
Auth Data (none): 0000000000000000
OSPF Hello Packet
Network Mask: 255.255.255.0 (255.255.255.0)
Hello Interval [sec]: 1
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
Router Priority: 0
Router Dead Interval [sec]: 4
Designated Router: 10.81.0.40 (10.81.0.40)
Backup Designated Router: 0.0.0.0 (0.0.0.0)
Active Neighbor: 10.96.0.40 (10.96.0.40)
发表评论