Building a Packet to send.

ZeroEffect

Well-known member
Joined
Oct 24, 2004
Messages
180
Location
Detroit, MI
For an application I am building to convert an audio file, I am really passing data to Lame followed by mp3Gain for a small project but I need to trim the silence from the begining and the end. The files Ill be converting are wav files used by another software that can do this, I can also send the command via UDP packet. Now there is an application that allows this to be done and you get a response when the processe is done. This is all done by UDP. I made a test application to send the/a command to the other software I get the command to run but I dont get a response. I capatured two packes one from thier application and one from mine.

From Their App

0000 00 ff c7 43 2d f2 00 ff c6 43 2d f2 08 00 45 00 ...C-... .C-...E.
0010 00 5b 3e 9f 00 00 80 11 7d 82 c0 1e 0b 16 ac 1b .[>..... }.......
0020 07 21 06 5f 07 d2 00 47 18 b2 3c 44 41 44 43 4d .!._...G ..<DADCM
0030 44 3e 3c 49 44 3e 39 39 39 39 39 3c 2f 49 44 3e D><ID>99 999</ID>
0040 3c 43 4f 4d 4d 41 4e 44 3e 72 65 66 72 65 73 68 <COMMAND >refresh
0050 20 70 62 6b 31 3c 2f 43 4f 4d 4d 41 4e 44 3e 3c pbk1</C OMMAND><
0060 2f 44 41 44 43 4d 44 3e 00 /DADCMD> .

My Application


0000 00 ff c7 43 2d f2 00 ff c6 43 2d f2 08 00 45 00 ...C-... .C-...E.
0010 00 5b 3e a9 00 00 80 11 7d 78 c0 1e 0b 16 ac 1b .[>..... }x......
0020 07 21 05 5b 07 d2 00 47 19 b6 3c 44 41 44 43 4d .!.[...G ..<DADCM
0030 44 3e 3c 49 44 3e 39 39 39 39 39 3c 2f 49 44 3e D><ID>99 999</ID>
0040 3c 43 4f 4d 4d 41 4e 44 3e 72 65 66 72 65 73 68 <COMMAND >refresh
0050 20 70 62 6b 31 3c 2f 43 4f 4d 4d 41 4e 44 3e 3c pbk1</C OMMAND><
0060 2f 44 41 44 43 4d 44 3e 00 /DADCMD> .

there are only two differences in the packets on line 0010 & line 0020 in their app it goes(I end the lines with the differences)

0010 00 5b 3e 9f 00 00 80 11 7d 82

0020 07 21 06 5f

and in my app

0010 00 5b 3e a9 00 00 80 11 7d 78

0020 07 21 05 5b

Those are the only differences I see and that is where I believe the information is to tell the application where to send the response to. Can anyone help me with this? I need to get the response from the application so I know when to move to the next step in the application I am creating. I guess what I am asking is for help creating the packet header?

Thanks for any help you may be able to give me.

ZeroEffect
 
UDP port

Ive highlighted the mismatched pairs in red bold:

Code:
0000 00 ff c7 43 2d f2 00 ff c6 43 2d f2 08 00 45 00 ...C-... .C-...E.
0010 00 5b [color=red][b]3e 9f[/b][/color] 00 00 80 11 [color=red][b]7d 82[/b][/color] c0 1e 0b 16 ac 1b .[>..... }.......
0020 07 21 [color=red][b]06 5f[/b][/color] 07 d2 00 47 [color=red][b]18 b2[/b][/color] 3c 44 41 44 43 4d .!._...G ..<DADCM
0030 44 3e 3c 49 44 3e 39 39 39 39 39 3c 2f 49 44 3e D><ID>99 999</ID>
0040 3c 43 4f 4d 4d 41 4e 44 3e 72 65 66 72 65 73 68 <COMMAND >refresh
0050 20 70 62 6b 31 3c 2f 43 4f 4d 4d 41 4e 44 3e 3c pbk1</C OMMAND><
0060 2f 44 41 44 43 4d 44 3e 00 /DADCMD> .

Code:
0000 00 ff c7 43 2d f2 00 ff c6 43 2d f2 08 00 45 00 ...C-... .C-...E.
0010 00 5b [color=red][b]3e a9[/b][/color] 00 00 80 11 [color=red][b]7d 78[/b][/color] c0 1e 0b 16 ac 1b .[>..... }x......
0020 07 21 [color=red][b]05 5b[/b][/color] 07 d2 00 47 [color=red][b]19 b6[/b][/color] 3c 44 41 44 43 4d .!.[...G ..<DADCM
0030 44 3e 3c 49 44 3e 39 39 39 39 39 3c 2f 49 44 3e D><ID>99 999</ID>
0040 3c 43 4f 4d 4d 41 4e 44 3e 72 65 66 72 65 73 68 <COMMAND >refresh
0050 20 70 62 6b 31 3c 2f 43 4f 4d 4d 41 4e 44 3e 3c pbk1</C OMMAND><
0060 2f 44 41 44 43 4d 44 3e 00 /DADCMD> .


The only bytes I think you need worry about are the third mismatched pair (06 5f vs 05 5b), which correspond to the source port of the UDP header. Your application appears to be sending its UDP packets from port 1371, and the other application from port 1631.

The other mismatches correspond to the packet identification number, which is incidental, and checksums, which you need not worry about.

I suggest the reason you are not getting a response is that you are sending and/or receiving on the wrong UDP ports. The other mismatches are incidental.

Good luck :cool:
 
Last edited by a moderator:
Thanks MrPaul for your help. The two ports are different, but here is the unique thing. The source port will change on the thier app if the normal on is not availible. So it is getting the information from the packet that is being sent. I am still looking at it. Any more thoughts?

Thanks

ZeroEffect
 
Port numbers

Their client is sending packets to the server on port 1631.
Your client is sending packets to the server on port 1371.
The server is sending response packets back on some port Q.

You could find out what Q is by typing netstat -a -o in a command prompt window and see which UDP port(s) their client application is listening on.

You can then make your client send from port 1631 and listen on port Q.

Other than the source port number, your client is generating functionally identical packets to their client. If the server is using the source port number to determine what Q should be, then you need to find out what that relationship is. Is there any documentation for the server application?
 
Re: Port numbers

Their client is sending packets to the server on port 1631.
Your client is sending packets to the server on port 1371.
The server is sending response packets back on some port Q.

I think something is getting lost in translation.

My App = client A
Their App = Client B
Server listens for commands on port 2002

Client A sends string to servers listen port but send no response.
Client B sends string to servers listening port and receives a response.

Ok I agree when you look at it, it looks like client A is not listening for a response on the correct port. When Client B strats up if the default port is listens on is in use it takes the next availible port number. Server does not know what port that is. Whating the "conversation" between Client A and the server with ethereal the server sends no resopnse. Watching the "conersation" between client B and the server you see a response sent by the server. So there is something in the packet that tells the server where to send the response to.

Ill have to test somethings out mor to get more information.

There isnt any documentation to look at for this. I am kinda doing this blind.

Thanks for you help with this. Ill see if I can post the conversation of client A & B and the server from ethereal.

ZeroEffect
 

Similar threads

Back
Top