Appearance
Appearance
Wireless Session Protocol 提供了 HTTP 请求-响应范式,此外还提供了一项名为 Wap Push 的新服务,允许网络中的应用程序向移动设备上支持 push 的应用程序推送(未经请求的)数据。
Wireless Session Protocol 的设计出发点是认识到 Hyper_Text_Transfer_Protocol 中的许多 header 名称和值都是固定字符串。考虑到高效利用空中接口带宽,WSP 尝试以紧凑的二进制方式编码这些固定字符串。这样,header cache-control: no-cache 可以编码为 2 个字节:一个用于 header 名称(cache-control),一个用于其值(no-cache)。
WSP 有 2 种类型:
无连接 WSP(CL-WSP)只提供 WSP primitive 的不可靠传输,包括 pull(request 和 response)以及 push(单条 message)。
面向连接的 WSP(CO-WSP)提供与 CL-WSP 相同的服务,并扩展了 connection(session)管理、session capability negotiation、更大数据传输(segmentation 和 reassembly)以及可靠数据传输(acknowledgement 机制)。
在协议层面,CO-WSP 依赖 WTP 来实现这些附加功能。对于 CL-WSP,WTP 层被缩减为一个 one-byte transaction identifier,它作为 WSP 的第 1 个字节。这样在 WTP 中仍然可以将 response 与 request 匹配起来(相同的 WSP transaction identifier)。
⚠️ connection-oriented WSP 中的 “connection” 一词与实际的 bearer connection 无关。事实上,CO-WSP 可以看作 CL-WSP 的一种更有状态、更复杂的版本,而后者只提供基本功能。
在移动互联网早期(通过无线网络上的手持设备访问类似 Internet 的网络服务),人们已经认识到带宽是一种成本高昂的资源,并且往返时延通常显著长于传统计算机网络。这两点促成了 WAP Forum 创建一个高效的协议族。WAP Forum 定义了一个协议族,使具备有限能力和资源、作为无线网络一部分的移动设备能够访问类似 Internet 以及基于 Internet 的服务。
WAP Forum 的目标之一是定义一组协议,能够以更高效的方式提供类似 Hyper_Text_Transfer_Protocol 的传输。这最终形成了 Wireless Session Protocol(WSP)。
WAP transport protocol stack 如下所示:
根据 protocol stack,已经定义了 4 个不同的标准 WDP(UDP)端口:9200、9201、9202 和 9203。WSP 也可以运行在其他端口上。
WDP:在非 IP bearer 上,WSP 使用 WDP 作为其 transport protocol。
UDP:在支持 IP 的 bearer(如 GPRS 和 GSM CSD)上,WSP 使用 UDP 作为其 transport protocol。
WTLS:如果 bearer 不提供安全性,WSP 通常使用 WTLS 进行空中接口加密,以防止窃听。
WTP:当使用 WTP 时,我们讨论的是 Connection-Oriented WSP(CO-WSP),其中 WTP 提供 WSP connection(session)管理、session capability negotiation、更大数据传输(segmentation 和 reassembly,WTP SAR)以及可靠数据传输(acknowledgement 机制)。
No. Time Source Destination Protocol 669 193.049760 10.0.1.5 10.0.1.204 SMPPInfoWSP Push (0x06) (WBXML 1.2, Public ID: "-//WAPFORUM//DTD SI 1.0//EN (Service Indication 1.0)")Frame 669 (191 bytes on wire, 191 bytes captured) Arrival Time: Jan 7, 2005 11:11:29.444839000 Time delta from previous packet: 193.049760000 seconds Time since reference or first frame: 193.049760000 seconds Frame Number: 669 Packet Length: 191 bytes Capture Length: 191 bytesEthernet II, Src: 00:0b:cd:31:a1:2b, Dst: 00:40:f4:61:36:52 Destination: 00:40:f4:61:36:52 (CameoCom_61:36:52) Source: 00:0b:cd:31:a1:2b (CompaqHp_31:a1:2b) Type: IP (0x0800)Internet Protocol, Src Addr: 10.0.1.5 (10.0.1.5), Dst Addr: 10.0.1.204 (10.0.1.204) Version: 4 Header length: 20 bytes Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00) 0000 00.. = Differentiated Services Codepoint: Default (0x00) .... ..0. = ECN-Capable Transport (ECT): 0 .... ...0 = ECN-CE: 0 Total Length: 177 Identification: 0x01a1 (417) Flags: 0x04 (Don't Fragment) 0... = Reserved bit: Not set .1.. = Don't fragment: Set ..0. = More fragments: Not set Fragment offset: 0 Time to live: 128 Protocol: TCP (0x06) Header checksum: 0xe1d5 (correct) Source: 10.0.1.5 (10.0.1.5) Destination: 10.0.1.204 (10.0.1.204)Transmission Control Protocol, Src Port: 1054 (1054), Dst Port: 10001 (10001), Seq: 48, Ack: 48, Len: 137 Source port: 1054 (1054) Destination port: 10001 (10001) Sequence number: 48 (relative sequence number) Next sequence number: 185 (relative sequence number) Acknowledgement number: 48 (relative ack number) Header length: 20 bytes Flags: 0x0018 (PSH, ACK) 0... .... = Congestion Window Reduced (CWR): Not set .0.. .... = ECN-Echo: Not set ..0. .... = Urgent: Not set ...1 .... = Acknowledgment: Set .... 1... = Push: Set .... .0.. = Reset: Not set .... ..0. = Syn: Not set .... ...0 = Fin: Not set Window size: 64081 Checksum: 0x66e6 (correct)Short Message Peer to Peer, Command: Submit_sm, Seq: 19, Len: 137 Length : 137 Operation : Submit_sm (0x00000004) Sequence #: 19 Service type: (Default) Type of number (originator): Unknown (0x00) Numbering plan indicator (originator): ISDN (E163/E164) (0x01) Type of number (recipient): National (0x02) Numbering plan indicator (recipient): ISDN (E163/E164) (0x01) Recipient address: 0123456789 .... ..00 = Messaging mode: Default SMSC mode (0x00) ..00 00.. = Message type : Default message type (0x00) 01.. .... = GSM features : UDHI indicator (0x01) Protocol id.: 0x00 Priority level: GSM: None ANSI-136: Bulk IS-95: Normal (0x00) Scheduled delivery time: Immediate delivery Validity period: SMSC default validity period .... ..00 = Delivery receipt : No SMSC delivery receipt requested (0x00) .... 00.. = Message type : No recipient SME acknowledgement requested (0x00) ...0 .... = Intermediate notif: No intermediate notification requested (0x00) .... ...0 = Replace : Don't replace (0x00) Data coding: 0xf5 SMPP Data Coding Scheme: Unknown (0xf5) GSM SMS Data Coding 1111 .... = DCS Coding Group for SMS: SMS DCS: Data coding / message class (0x0f) .... 01.. = DCS Character set: 8-bit data (0x01) .... ..01 = DCS Message class: Class 1 - ME specific (0x01) GSM CBS Data Coding 1111 .... = DCS Coding Group for CBS: SMS DCS: Data coding / message class (0x0f) .... 01.. = DCS Character set: 8-bit data (0x01) .... ..01 = DCS CBS Message class: Class 1 - User defined (0x01) Predefined message: 0 Message length: 94 MessageGSM Short Message Service User Data UDH Length: 6 IE Id: SMS - Application port addressing scheme, 16 bit address (0x05): source port 9200, destination port 2948 Destination port: 2948 Source port: 9200Wireless Session Protocol, Method: Push (0x06), Content-Type: application/vnd.wap.sic Transaction ID: 0xd0 PDU Type: Push (0x06) Headers Length: 1 Content-Type: application/vnd.wap.sicWAP Binary XML, Version: 1.2, Public ID: "-//WAPFORUM//DTD SI 1.0//EN (Service Indication 1.0)" Version: 1.2 (0x02) Public Identifier (known): -//WAPFORUM//DTD SI 1.0//EN (Service Indication 1.0) (0x00000005) Character Set: utf-8 (0x0000006a) String table: 0 bytes Data representation Level | State | Codepage | WBXML Token Description | Rendering 0 | Tag | T 0 | Known Tag 0x05 (.C) | <si> 1 | Tag | T 0 | Known Tag 0x06 (AC) | <indication 1 | Attr | A 0 | Known attrStart 0x0C | href='http://' 1 | Attr | A 0 | STR_I (Inline string) | 'src.miel.com/imags/ wallpapers/xmas.jpg' 1 | Attr | A 0 | Known attrStart 0x07 | action='signal-medium' 1 | Tag | T 0 | END (attribute list) | > 1 | Tag | T 0 | STR_I (Inline string) | 'Merry xmas !!!! JO JO JO' 1 | Tag | T 0 | END (Known Tag 0x06) | </indication> 0 | Tag | T 0 | END (Known Tag 0x05) | </si>WSP dissector 功能完整,但有一个限制:Expect、Retry-After、Cookie 和 Set-Cookie headers 尚未解码。
Wireshark 还提供 WSP statistics。输出如下:
Wireshark 中没有 WSP 的偏好设置。
SampleCaptures/wap_google.pcap
可以在 display filter reference 中找到 WSP display filter fields 的完整列表
只显示基于 WSP 的流量:
wsp抓包时无法直接过滤 WSP 流量。不过,如果你知道所使用的 transport protocols(见上文),就可以按该方式进行过滤。
Imported from https://wiki.wireshark.org/Wireless_Session_Protocol on 2020-08-11 23:27:34 UTC