UDP socket query!!! - TCP-IP

This is a discussion on UDP socket query!!! - TCP-IP ; Hello to all, I m working on the product which will send the data to the central machine periodically by using TCP/IP protocol suite.The product is similar to some hand held device. Now as per the communication protocol, 1. The ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: UDP socket query!!!

  1. UDP socket query!!!

    Hello to all,

    I m working on the product which will send the data to the central
    machine periodically by using TCP/IP protocol suite.The product is
    similar to some hand held device. Now as per the communication
    protocol,
    1. The hand held device will first Poll for central machine (IP
    address, Port number) on a defined port ( udp socket ). Validate
    whether received packet destination address is same with hand held
    device IP address. On validation failure ignore the packet. (Packet
    source addr is central machine IP addr and destination address is hand
    held device IP address)

    Could any one please let me know how to write the code in C to acheive
    the above requirement?
    Pleae help me, as this is the first time i m dealing with n/w
    programing.

    Waiting for ur guidence.

    Thanks in advance.

    Nutty


  2. Re: UDP socket query!!!

    On Wed, 06 Jun 2007 02:14:24 -0700, Nutty wrote:
    > Hello to all,
    >
    > I m working on the product which will send the data to the central
    > machine periodically by using TCP/IP protocol suite.The product is
    > similar to some hand held device. Now as per the communication
    > protocol,
    > 1. The hand held device will first Poll for central machine (IP
    > address, Port number) on a defined port ( udp socket ). Validate
    > whether received packet destination address is same with hand held
    > device IP address. On validation failure ignore the packet. (Packet
    > source addr is central machine IP addr and destination address is hand
    > held device IP address)
    >
    > Could any one please let me know how to write the code in C to acheive
    > the above requirement?
    > Pleae help me, as this is the first time i m dealing with n/w
    > programing.


    The requirements were a bit weirdly phrased, but (assuming it's really
    sockets you will use):

    - To listen for UDP packets and ignore those that are not addressed to
    addressort A, simply don't listen anywhere else. With the sockets
    API, you give this information in the bind() call.

    - To listen for UDP packets and ignore all but those from addressort B,
    pick up the packets using a function which also tells you where they
    come from, for example recvfrom(). You'll need to do that anyway, if
    you want to be able to respond to the packets.

    - Try to get a book on sockets, e.g. Stevens' Unix Network Programming.
    Otherwise, read the API documentation carefully.

    /Jorgen

    --
    // Jorgen Grahn \X/ snipabacken.dyndns.org> R'lyeh wgah'nagl fhtagn!

  3. Re: UDP socket query!!!

    In article <1181121264.731917.61210@z28g2000prd.googlegroups.c om>,
    Nutty wrote:

    > Hello to all,
    >
    > I m working on the product which will send the data to the central
    > machine periodically by using TCP/IP protocol suite.The product is
    > similar to some hand held device. Now as per the communication
    > protocol,
    > 1. The hand held device will first Poll for central machine (IP
    > address, Port number) on a defined port ( udp socket ). Validate
    > whether received packet destination address is same with hand held
    > device IP address. On validation failure ignore the packet. (Packet
    > source addr is central machine IP addr and destination address is hand
    > held device IP address)


    Why do you need to do this validation? The IP layer will not process a
    packet unless the destination address belongs to this machine or is a
    broadcast address.

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    *** PLEASE don't copy me on replies, I'll read them in the group ***

+ Reply to Thread