IP/UDP/RTP header compression issue
Hi,
I am trying to compress IP/UDP/RTP packet .But i am only getting 2 bytes of header compression out of 40 bytes. The following is my program.Please check it and suggest me where i am going wrong.
I am using O RTP library for rtp packet generation .
#include "rohc_rtp.h"
int runcond=1;
void stophandler(int signum)
{
runcond=0;
}
static int gen_random_
{
return rand();
}
static bool rtp_detect(const unsigned char *const ip,
{
uint16_t udp_dport;
bool is_rtp;
/* check UDP destination port */
memcpy(
if(
{
/* we think that the UDP packet is a RTP packet */
is_rtp = true;
}
else
{
/* we think that the UDP packet is not a RTP packet */
is_rtp = false;
}
return is_rtp;
}
static void print_rohc_
{
va_list args;
}
int main()
{
char buffer[
int i;
FILE *infile;
char *ssrc;
uint32_t user_ts=0;
int clockslide=0;
int jitter=0;
mblk_t *m=NULL;
uint8_t rtp_buffer[
struct rohc_buf rtp_r_packet = rohc_buf_
uint8_t rohc_buffer[
struct rohc_buf rohc_packet = rohc_buf_
struct rohc_comp *compressor=NULL;
unsigned int *rtpheader = (unsigned int*)data;
RtpSession *rtp_session=NULL;
/*create ROHC compressor */
compressor = rohc_comp_
{
}
{
}
/* Compressor profile creation */
{
/* cleanup compressor, then leave with an error code */
}
/*Prepare Fake RTP packet */
/* Create the actual packet that we will be sending */
if (ssrc!=NULL) {
}
if (infile==NULL) {
}
while( ((i=fread(
{
m = rtp_session_
// rtp_r_packet.len = 5 * 4 + 8 + 12 ;
/* IPv4 header */
/* UDP header */
/* RTP header */
// rohc_buf_
// rohc_buf_
/* copy the payload just after the IP/UDP/RTP headers */
printf(" RTP detection Check uncompress \n");
{
}
{
}
}
// ortp_global_
/* Free compressor */
}
return 0;
}
The following is the answer i got.
RTP packet detected (expected UDP port)
[c_rtp.c:343 c_rtp_check_
[rohc_comp.c:4813 rohc_comp_
[rohc_comp.c:4843 rohc_comp_
[rohc_comp.c:1435 rohc_compress4()] compress the packet #355
[c_rtp.c:1441 rtp_changed_
[c_rtp.c:1573 rtp_changed_
[c_rtp.c:1577 rtp_changed_
[c_generic.c:1218 c_generic_
[c_generic.c:6310 detect_
[c_generic.c:6315 detect_
[c_generic.c:6357 detect_
[c_generic.c:5932 changed_
[c_generic.c:1283 c_generic_
[c_rtp.c:1008 rtp_decide_state()] 1 RTP dynamic fields changed, stay in IR state
[c_generic.c:6427 encode_
[c_generic.c:6432 encode_
[c_generic.c:6440 encode_
[c_generic.c:6455 encode_
[c_generic.c:6476 encode_
[c_generic.c:6484 encode_
[c_generic.c:6507 encode_
[scaled_
[scaled_
[scaled_
[scaled_
[c_rtp.c:1133 rtp_encode_
[c_rtp.c:1172 rtp_encode_
[c_generic.c:1498 decide_packet()] decide packet in IR state
[c_generic.c:1543 decide_packet()] packet 'IR' chosen
[c_generic.c:1720 code_IR_packet()] code IR packet (CID = 0)
[c_generic.c:1739 code_IR_packet()] small CID 0 encoded on 0 byte(s)
[c_generic.c:1751 code_IR_packet()] type of packet + D flag = 0xfd
[c_generic.c:1763 code_IR_packet()] profile ID = 0x01
[c_generic.c:1769 code_IR_packet()] CRC = 0x00 for CRC calculation
[c_generic.c:2090 code_ipv4_
[c_generic.c:2095 code_ipv4_
[c_generic.c:2104 code_ipv4_
[c_generic.c:2111 code_ipv4_
[c_udp.c:490 udp_code_
[c_udp.c:495 udp_code_
[c_rtp.c:1227 rtp_code_
[c_generic.c:2340 code_ipv4_
[c_generic.c:2347 code_ipv4_
[c_generic.c:2357 code_ipv4_
[c_generic.c:2378 code_ipv4_
[c_generic.c:2390 code_ipv4_
[c_rtp.c:1293 rtp_code_
[c_rtp.c:1314 rtp_code_
[c_rtp.c:1324 rtp_code_
[c_rtp.c:1331 rtp_code_
[c_rtp.c:1339 rtp_code_
[c_rtp.c:1345 rtp_code_
[c_generic.c:1809 code_IR_packet()] CRC (header length = 38, crc = 0x2f)
[rohc_comp.c:1563 rohc_compress4()] copy full 160-byte payload
[rohc_comp.c:1573 rohc_compress4()] ROHC size = 198 bytes (header = 38, payload = 160), output buffer size = 2048
SIZE OF ACTUAL RTP : < 172 > , RTP HEADER LENGTH : < 12 > , RTP PAYLOAD LENGTH : < 160 >
RTP detection Check uncompress
IP/UDP/RTP PACKET SIZE BEFORE COMPRESSION : HEADER : < 40 > , PAYLOAD : < 160 > , TOTAL PACKET SIZE : < 200 >
[net_pkt.c:75 net_pkt_parse()] outer IP header: 200 bytes
[net_pkt.c:77 net_pkt_parse()] outer IP header: version 4
[net_pkt.c:82 net_pkt_parse()] outer IP header: next header is of type 17
[net_pkt.c:87 net_pkt_parse()] outer IP header: next layer is of type 17
[rohc_comp.c:4608 c_get_profile_
[c_rtp.c:291 c_rtp_check_
RTP packet detected (expected UDP port)
[c_rtp.c:343 c_rtp_check_
[rohc_comp.c:4813 rohc_comp_
[rohc_comp.c:4843 rohc_comp_
[rohc_comp.c:1435 rohc_compress4()] compress the packet #356
[c_rtp.c:1441 rtp_changed_
[c_rtp.c:1573 rtp_changed_
[c_rtp.c:1577 rtp_changed_
[c_generic.c:1218 c_generic_
[c_generic.c:6310 detect_
[c_generic.c:6315 detect_
[c_generic.c:6357 detect_
[c_generic.c:5932 changed_
[c_generic.c:1283 c_generic_
[c_rtp.c:1008 rtp_decide_state()] 1 RTP dynamic fields changed, stay in IR state
[c_generic.c:6427 encode_
[c_generic.c:6432 encode_
[c_generic.c:6440 encode_
[c_generic.c:6455 encode_
[c_generic.c:6476 encode_
[c_generic.c:6484 encode_
[c_generic.c:6507 encode_
[scaled_
[scaled_
[scaled_
[scaled_
[c_rtp.c:1133 rtp_encode_
[c_rtp.c:1172 rtp_encode_
[c_generic.c:1498 decide_packet()] decide packet in IR state
[c_generic.c:1543 decide_packet()] packet 'IR' chosen
[c_generic.c:1720 code_IR_packet()] code IR packet (CID = 0)
[c_generic.c:1739 code_IR_packet()] small CID 0 encoded on 0 byte(s)
[c_generic.c:1751 code_IR_packet()] type of packet + D flag = 0xfd
[c_generic.c:1763 code_IR_packet()] profile ID = 0x01
[c_generic.c:1769 code_IR_packet()] CRC = 0x00 for CRC calculation
[c_generic.c:2090 code_ipv4_
[c_generic.c:2095 code_ipv4_
[c_generic.c:2104 code_ipv4_
[c_generic.c:2111 code_ipv4_
[c_udp.c:490 udp_code_
[c_udp.c:495 udp_code_
[c_rtp.c:1227 rtp_code_
[c_generic.c:2340 code_ipv4_
[c_generic.c:2347 code_ipv4_
[c_generic.c:2357 code_ipv4_
[c_generic.c:2378 code_ipv4_
[c_generic.c:2390 code_ipv4_
[c_rtp.c:1293 rtp_code_
[c_rtp.c:1314 rtp_code_
[c_rtp.c:1324 rtp_code_
[c_rtp.c:1331 rtp_code_
[c_rtp.c:1339 rtp_code_
[c_rtp.c:1345 rtp_code_
[c_generic.c:1809 code_IR_packet()] CRC (header length = 38, crc = 0x7e)
[rohc_comp.c:1563 rohc_compress4()] copy full 160-byte payload
[rohc_comp.c:1573 rohc_compress4()] ROHC size = 198 bytes (header = 38, payload = 160), output buffer size = 2048
Regards,
V Ravi Kumar
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- rohc Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
This question was reopened
- by Kumar