Re: howto receive and *understand* via UDP



Ender said:

Hi,

I've been asked to write an app that connects to a program that I know
nothing about. The only information I have is that it's sending data to
a specific IP via UDP. The data is likely to be small, just some
numbers. I've seen how to connect() via UDP but ...

My questions is, how do I go about writing for something like this if I
know nothing about the data sizes and how the other app is sending
them, other than the above info? How do you parse such data?

Start by looking for 8-character fields with the format 99-99-99 (where 9
represents any digit, and - is literal) - those will be the sort codes.
They are useful because they'll effectively give you the record length
(although they won't tell you where the record starts), because you can
measure the distance between successive occurrences.

Then look for 8-character fields with the format 99999999 (the actual bank
account numbers), and fields with the form A999999A (possibly spaced like
this: A 99 99 99 A), which are the NINOs (National Insurance Numbers) - A,
of course, stands for "upper case alphabetic character". You shouldn't
have any bother with the run-of-the-mill stuff like names and addresses,
although you should cater for the possibility that many of them will be
wrong.

You may find that the data has been password-protected, but we have it on
good authority that it has not been encrypted, so it turns out that
"password-protected" doesn't actually mean anything.

Technical aspects aside, though, do you really think you ought to be doing
this? Wouldn't it be better just to send a UDP reply back to the specific
IP address, saying something like "dear specific-IP-address, please do
everyone in Britain a favour by returning both CDs to the UK Government in
a plain brown envelope, and remember to destroy any copies of the data
that you've made".

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.



Relevant Pages

  • Re: howto receive and *understand* via UDP
    ... I've been asked to write an app that connects to a program that I know ... The only information I have is that it's sending data to a ... I've seen how to connectvia UDP but ... ... be able to see how the packet exchange is working. ...
    (comp.lang.c)
  • Re: howto receive and *understand* via UDP
    ... I've been asked to write an app that connects to a program that I know ... The only information I have is that it's sending data to ... I've seen how to connectvia UDP but ... ... raw binary octets if you have no idea what they are supposed to ...
    (comp.lang.c)
  • Re: how to get data accurately from UDP
    ... I've been asked to write an app that connects to a program that I know ... The only information I have is that it's sending data to ... I've seen how to connectvia UDP but ... ... Get a sniffer or other network monitor, ...
    (comp.programming)
  • Re: howto receive and *understand* via UDP
    ... Ender wrote: ... The only information I have is that it's sending data to a specific IP via UDP. ... My questions is, how do I go about writing for something like this if I know nothing about the data sizes and how the other app is sending them, other than the above info? ...
    (comp.lang.c)
  • Re: howto receive and *understand* via UDP
    ... I've been asked to write an app that connects to a program that I know ... The only information I have is that it's sending data to ... I've seen how to connectvia UDP but ... ... comp.programming might be a better place for general questions about ...
    (comp.lang.c)

Loading