Wireshark解析PDCP-LTE

2015-02-18  本文已影响1777人  natsumi

老师说,做一点儿就得写一点儿,嗯。就从比较高层的PDCP做起吧~


1. 基本信息get√

“通过udpsocket编程来发送MAC层协议数据包,同时将RRC、PD-CP、RLC、MAC层的协议数据包通过udp socket编程抄送至网络封包捕获程序”

  1. 只支持ROHC负载.
  2. 支持从RLC-LTE SDUs、DCT2000 log files、packet-pdcp-lte.h中定义的UDP格式中读取PDCP框架。还给出了一个UDP封装的例子,pdcp_lte_logger.c
  3. Preference Settings
  • Show User-Plane uncompessed data as IP. Default is Off.
  • Show unciphered Signalling-Plane data as RRC. Default if Off.
  • Attempt to decode ROHC data. Default is Off.
  • Try Heuristic LTE-PDCP over UDP framing. Default is Off.
  • Which layer info to show in Info column. Default is RLC.
  • PDCP UE security keys. A table of (UEId, RRCKey, UPKeys) entries.
  • Attempt to decipher Signalling (RRC) SDUs. Default is Off.
    Attempt to decipher User-plane (IP) SDUs. Default is Off.

2 pdcp_lte_logger.c编译

--------------------so,亲测有效的蠢方法如下--------------------

//#include "../wireshark-1.99.2/epan/dissectors/packet-pdcp-lte.h"
/* Direction */
#define DIRECTION_UPLINK   0
#define DIRECTION_DOWNLINK 1
/* Signature.  Rather than try to define a port for this, or make the port number a preference, 
frames will start with this string (with no terminating NULL */
#define PDCP_LTE_START_STRING "pdcp-lte"
/* Fixed fields.  This is followed by the following 3 mandatory fields:
   - no_header_pdu (1 byte)
   - plane (1 byte)
   - rohc_compression ( byte)
   (where the allowed values are defined above) */
/* Conditional field. This field is mandatory in case of User Plane PDCP PDU. 
The format is to have the tag, followed by the value (there is no length field, 
it's implicit from the tag). 
The allowed values are defined above. */
#define PDCP_LTE_SEQNUM_LENGTH_TAG          0x02
/* 1 byte */
/* Optional fields. Attaching this info to frames will allow you to show you display/filter/plot/add-custom-columns on these fields, so should be added if available.
The format is to have the tag, followed by the value (there is no length field, it's implicit from the tag) */
#define PDCP_LTE_DIRECTION_TAG              0x03
/* 1 byte */
#define PDCP_LTE_LOG_CHAN_TYPE_TAG          0x04
/* 1 byte */
#define PDCP_LTE_BCCH_TRANSPORT_TYPE_TAG    0x05
/* 1 byte */
#define PDCP_LTE_ROHC_IP_VERSION_TAG        0x06
/* 2 bytes, network order */
#define PDCP_LTE_ROHC_CID_INC_INFO_TAG      0x07
/* 1 byte */
#define PDCP_LTE_ROHC_LARGE_CID_PRES_TAG    0x08
/* 1 byte */
#define PDCP_LTE_ROHC_MODE_TAG              0x09
/* 1 byte */
#define PDCP_LTE_ROHC_RND_TAG               0x0A
/* 1 byte */
#define PDCP_LTE_ROHC_UDP_CHECKSUM_PRES_TAG 0x0B
/* 1 byte */
#define PDCP_LTE_ROHC_PROFILE_TAG           0x0C
/* 2 bytes, network order */
#define PDCP_LTE_CHANNEL_ID_TAG             0x0D
/* 2 bytes, network order */
#define PDCP_LTE_UEID_TAG                   0x0E
/* 2 bytes, network order */
/* PDCP PDU. Following this tag comes the actual PDCP PDU (there is no length, the PDU
   continues until the end of the frame) */
#define PDCP_LTE_PAYLOAD_TAG                0x01
enum rohc_mode
{
  MODE_NOT_SET = 0,
  UNIDIRECTIONAL = 1,
  OPTIMISTIC_BIDIRECTIONAL = 2,
  RELIABLE_BIDIRECTIONAL = 3
};
enum pdcp_plane
{
    SIGNALING_PLANE = 1,
    USER_PLANE = 2
};
typedef enum LogicalChannelType
{
    Channel_DCCH=1,
    Channel_BCCH=2,
    Channel_CCCH=3,
    Channel_PCCH=4
} LogicalChannelType;
typedef enum
{
    BCH_TRANSPORT=1,
    DLSCH_TRANSPORT=2
} BCCHTransportType;
#define PDCP_SN_LENGTH_5_BITS  5
#define PDCP_SN_LENGTH_7_BITS  7
#define PDCP_SN_LENGTH_12_BITS 12
#define PDCP_SN_LENGTH_15_BITS 15

3. 运行小有成果

./test 127.0.0.1 10000运行,这里127.0.0.1和10000分别是UDP报文的目的IP和PORT,可以根据需求设定。
最后总算是出来了一些PDCP解析的样子~

capturecapture

具体代码过完年再研究吧~
记下这些东西不知不觉都已经除夕了新年快乐

上一篇 下一篇

猜你喜欢

热点阅读