Why is it UDP and not RTP in Wireshark when I use jmf?

I want to record and transfer audio using JMF 2.1.1e in RTP format. I wrote a simple transmitter, I can send and receive audio. But when I saw in Wireshark, I saw packets as UDP. Can someone point me to a problem please.

And so my function is responsible for capturing and transmitting sound.

public void captureAudio(){ // Get the device list for ULAW Vector devices = captureDevices(); CaptureDeviceInfo captureDeviceInfo = null; if (devices.size() > 0) { //get the first device from the list and cast it as CaptureDeviceInfo captureDeviceInfo = (CaptureDeviceInfo) devices.firstElement(); } else { // exit if we could not find the relevant capturedevice. System.out.println("No such device found"); System.exit(-1); } Processor processor = null; try { //Create a Processor for the specified media. processor = Manager.createProcessor(captureDeviceInfo.getLocator()); } catch (IOException ex) { System.err.println(ex); } catch (NoProcessorException ex) { System.err.println(ex); } //Prepares the Processor to be programmed. //puts the Processor into the Configuring state. processor.configure(); //Wait till the Processor configured. while (processor.getState() != Processor.Configured){ try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } //Sets the output content-type for this Processor processor.setContentDescriptor(CONTENT_DESCRIPTOR); /** ContentDescriptor CONTENT_DESCRIPTOR = new ContentDescriptor(ContentDescriptor.RAW_RTP); */ //Gets a TrackControl for each track in the media stream. TrackControl track[] = processor.getTrackControls(); boolean encodingOk = false; //searching through tracks to get a supported audio format track. for (int i = 0; i < track.length; i++) { if (!encodingOk && track[i] instanceof FormatControl) { if (((FormatControl) track[i]).setFormat( new AudioFormat(AudioFormat.ULAW_RTP, 8000, 8, 1) ) == null) { track[i].setEnabled(false); } else { encodingOk = true; track[i].setEnabled(encodingOk); System.out.println("enc: " + i); } } else { // we could not set this track to ULAW, so disable it track[i].setEnabled(false); } } //If we could set this track to ULAW we proceed if (encodingOk){ processor.realize(); while (processor.getState() != Processor.Realized){ try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } DataSource dataSource = null; try { dataSource = processor.getDataOutput(); } catch (NotRealizedError e) { e.printStackTrace(); } try { String url= "rtp://192.168.1.99:49150/audio/1"; MediaLocator m = new MediaLocator(url); DataSink d = Manager.createDataSink(dataSource, m); d.open(); d.start(); System.out.println("transmitting..."); processor.start(); } catch (Exception e) { e.printStackTrace(); } } } 

And ask if you find something wrong or vague. Thanks in advance.:)

Clarification . I have C # code for streaming RTP. And when I take data using wireshark , I can see it as RTP , but the problem is that I grab the data stream from JMF wireshark to show it as UDP . And my question is: why?

I know the difference between UDP and RTP.

+6
source share
2 answers

If I understand your question correctly, you want to know why RTP packets are not recognized as RTP packets in wirehark. In my experience, this may be the case if wirehark does not have enough information about the RTP session.

For example: 1) if I sniff a RTP session that was configured using RTSP or SIP and SDP, then wirehark will show RTP detection. 2) However, in another application in which I configured the session using local SDP descriptions, packets are displayed as UDP. In the second scenario, wirehark sees RTP packets, but has no information to classify them as RTP. Since RTP is usually located on top of UDP, and wirehark can classify UDP packets, they are classified as such.

FYI, you can choose a package from the stream that you know RTP, and select "Decode as." Then select RTP from the list of protocols for the corresponding stream (and RTCP for another, if applicable), and then wirehark will show the packets as RTP, and you can see the packet information.

I'm not sure if this is the cause in your particular case, but maybe there is a different signaling between your JMF and your C # example? It looks like you can use SIP for a C # application, and there is nothing for JMF?

+5
source

RTP is the application layer, UDP is the transport layer, it is not the same layer! Wikipedia helps explain this in detail. This way your data is sent as an RTP stream to UDP "Frame"

A small review ...

Application Levels:

 * DHCP * DHCPv6 * DNS * FTP * HTTP * IMAP * IRC * LDAP * MGCP * NNTP * BGP * NTP * POP * RPC * RTP * RTSP * RIP * SIP * SMTP * SNMP * SOCKS * SSH * Telnet * TLS/SSL * XMPP * (more) 

Transport level

 * TCP * UDP * DCCP * SCTP * RSVP * (more) 

Internet level

 * IP o IPv4 o IPv6 * ICMP * ICMPv6 * ECN * IGMP * IPsec * (more) 

Link level

 * ARP/InARP * NDP * OSPF * Tunnels o L2TP * PPP * Media access control o Ethernet o DSL o ISDN o FDDI * (more) 
+8
source

Source: https://habr.com/ru/post/912229/


All Articles