SCTP(流控制传输协议)是Internet协议套件传输层中的计算机网络通信协议。最初该协议用于电信网络中的七号信令系统(SS7)消息传输,提供用户数据报协议(UDP)的面向消息特性,同时确保可靠、按顺序传输具有拥塞控制的消息如传输控制协议(TCP)。与UDP和TCP不同,SCTP支持多宿主和冗余路径以提高弹性和可靠性。SCTP由Internet工程任务组(IETF)在RFC4960中标准化。 在4G和5G移动蜂窝通信系统中SCTP是eNB与MME(4G),eNB与eNB之间通信使用的协议连接;在5G网络中SCTP是gNB与AMF,gNB与gNB之间使用的协议连接。 图1.4G和5G中SCTP链路图 一、SCTP协议栈 在4G和5G网络中SCTP用于X2和S1,Xn与NG之间接口,它们使用的协议栈结构分别如下。 图2.4G和5G中SCTP协议栈结构 二、SCTP数据结构 SCTP数据在4G和5G中结构相同,通过接口进行数据包捕获(如Wireshark捕获)后您将看到它们由:IP+SCTP+S1AP(or NGAP)+承载数据(Payload)构成。 图3.4G和5G中SCTP数据结构 三、SCTP建立 SCTP需要初始握手来建立两个端点之间连接。如下表所示SCTP要经过4步握手(TCP经过3次握手)完成SCTP初始设置过程。 图4.5G中SCTP建立流程 四、SCTP建立报文 4.1 INIT(初始建立请求) Internet Protocol Version 4, Src: 10.0.0.185, Dst: 10.0.0.162 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x02 (DSCP: CS0, ECN: ECT(0)) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..10 = Explicit Congestion Notification: ECN-Capable Transport codepoint '10' (2) Total Length: 68 Identification: 0x0000 (0) Flags: 0x40, Don't fragment 0... .... = Reserved bit: Not set .1.. .... = Don't fragment: Set ..0. .... = More fragments: Not set Fragment Offset: 0 Time to Live: 64 Protocol: SCTP (132) Header Checksum: 0x24da [validation disabled] [Header checksum status: Unverified] Source Address: 10.0.0.185 Destination Address: 10.0.0.162 Stream Control Transmission Protocol, Src Port: 48041 (48041), Dst Port: 38412 (38412)---SCTP源端口号(48041),目的地端口号(38412) Source port: 48041 Destination port: 38412 Verification tag: 0x00000000 [Association index: 65535] Checksum: 0x0ffaab98 [unverified] [Checksum Status: Unverified] INIT chunk (Outbound streams: 8, inbound streams: 65535) Chunk type: INIT (1)(链路类型--初始建立) 0... .... = Bit: Stop processing of the packet .0.. .... = Bit: Do not report Chunk flags: 0x00 Chunk length: 36 Initiate tag: 0x8d10a6cf Advertised receiver window credit (a_rwnd): 106496 Number of outbound streams: 8 Number of inbound streams: 65535 Initial TSN: 3757580128 Supported address types parameter (Supported types: IPv4) Parameter type: Supported address types (0x000c) 0... .... .... .... = Bit: Stop processing of chunk .0.. .... .... .... = Bit: Do not report Parameter length: 6 Supported address type: IPv4 address (5) Parameter padding: 0000 ECN parameter Parameter type: ECN (0x8000) 1... .... .... .... = Bit: Skip parameter and continue processing of the chunk .0.. .... .... .... = Bit: Do not report Parameter length: 4 Forward TSN supported parameter Parameter type: Forward TSN supported (0xc000) 1... .... .... .... = Bit: Skip parameter and continue processing of the chunk .1.. .... .... .... = Bit: Do report Parameter length: 4 4.2 INIT_ACK(初始建立应答) Internet Protocol Version 4, Src: 10.0.0.162, Dst: 10.0.0.185 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x02 (DSCP: CS0, ECN: ECT(0)) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..10 = Explicit Congestion Notification: ECN-Capable Transport codepoint '10' (2) Total Length: 292 Identification: 0x0000 (0) Flags: 0x40, Don't fragment 0... .... = Reserved bit: Not set .1.. .... = Don't fragment: Set ..0. .... = More fragments: Not set Fragment Offset: 0 Time to Live: 64 Protocol: SCTP (132) Header Checksum: 0x23fa [validation disabled] [Header checksum status: Unverified] Source Address: 10.0.0.162 Destination Address: 10.0.0.185 Stream Control Transmission Protocol, Src Port: 38412 (38412), Dst Port: 48041 (48041)---SCTP源端口号(38412),目的地端口号(48041) Source port: 38412 Destination port: 48041 Verification tag: 0x8d10a6cf [Association index: 65535] Checksum: 0x30678470 [unverified] [Checksum Status: Unverified] INIT_ACK chunk (Outbound streams: 8, inbound streams: 8) Chunk type: INIT_ACK (2)(链路类型--初始建立) 0... .... = Bit: Stop processing of the packet .0.. .... = Bit: Do not report Chunk flags: 0x00 Chunk length: 260 Initiate tag: 0x790ad620 Advertised receiver window credit (a_rwnd): 106496 Number of outbound streams: 8 Number of inbound streams: 8 Initial TSN: 4169966867 State cookie parameter (Cookie length: 228 bytes) Parameter type: State cookie (0x0007) 0... .... .... .... = Bit: Stop processing of chunk .0.. .... .... .... = Bit: Do not report Parameter length: 232 State cookie: 4124569d7e0548bdbfbc4c54e0af0c95e938d9f500000000000000000000000000000000… ECN parameter Parameter type: ECN (0x8000) 1... .... .... .... = Bit: Skip parameter and continue processing of the chunk .0.. .... .... .... = Bit: Do not report Parameter length: 4 Forward TSN supported parameter Parameter type: Forward TSN supported (0xc000) 1... .... .... .... = Bit: Skip parameter and continue processing of the chunk .1.. .... .... .... = Bit: Do report Parameter length: 4 4.3 COOKIE_ECHO(COOKIE应答) Internet Protocol Version 4, Src: 10.0.0.185, Dst: 10.0.0.162 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x02 (DSCP: CS0, ECN: ECT(0)) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..10 = Explicit Congestion Notification: ECN-Capable Transport codepoint '10' (2) Total Length: 264 Identification: 0x0000 (0) Flags: 0x40, Don't fragment 0... .... = Reserved bit: Not set .1.. .... = Don't fragment: Set ..0. .... = More fragments: Not set Fragment Offset: 0 Time to Live: 64 Protocol: SCTP (132) Header Checksum: 0x2416 [validation disabled] [Header checksum status: Unverified] Source Address: 10.0.0.185 Destination Address: 10.0.0.162 Stream Control Transmission Protocol, Src Port: 48041 (48041), Dst Port: 38412 (38412)---SCTP源端口号(48041),目的地端口号(38412) Source port: 48041 Destination port: 38412 Verification tag: 0x790ad620 [Association index: 65535] Checksum: 0xa00fe0f7 [unverified] [Checksum Status: Unverified] COOKIE_ECHO chunk (Cookie length: 228 bytes) Chunk type: COOKIE_ECHO (10)(链路类型--COOKIE应答) 0... .... = Bit: Stop processing of the packet .0.. .... = Bit: Do not report Chunk flags: 0x00 Chunk length: 232 Cookie: 4124569d7e0548bdbfbc4c54e0af0c95e938d9f500000000000000000000000000000000… 4.4 COOKIE_ACK(COOKIE反馈) Internet Protocol Version 4, Src: 10.0.0.162, Dst: 10.0.0.185 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x02 (DSCP: CS0, ECN: ECT(0)) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..10 = Explicit Congestion Notification: ECN-Capable Transport codepoint '10' (2) Total Length: 36 Identification: 0x0000 (0) Flags: 0x40, Don't fragment 0... .... = Reserved bit: Not set .1.. .... = Don't fragment: Set ..0. .... = More fragments: Not set Fragment Offset: 0 Time to Live: 64 Protocol: SCTP (132) Header Checksum: 0x24fa [validation disabled] [Header checksum status: Unverified] Source Address: 10.0.0.162 Destination Address: 10.0.0.185 Stream Control Transmission Protocol, Src Port: 38412 (38412), Dst Port: 48041 (48041)---SCTP源端口号(38412),目的地端口号(48041) Source port: 38412 Destination port: 48041 Verification tag: 0x8d10a6cf [Association index: 65535] Checksum: 0xa018cd9c [unverified] [Checksum Status: Unverified] COOKIE_ACK chunk Chunk type: COOKIE_ACK (11)(链路类型--COOKIE反馈) 0... .... = Bit: Stop processing of the packet .0.. .... = Bit: Do not report Chunk flags: 0x00 Chunk length: 4 |
|