How to develop SoftRepeater in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • psargam
    New Member
    • Jan 2010
    • 4

    How to develop SoftRepeater in C#

    I want to develop an application which will act as a repeater between two computers in wireless network. for example if there are three computers in a wireless network A, B, and C, now if A wants to send some data to C, It sends it to B which then transfer it to C.

    Now I know it can be done using sockets, but i also need to receive all the acknowledgement sent by C to A through B only, I can't find anything in socket to recieve ACKs.

    So, I m confuse wether to use socket or some other APIs, may be some thing that communicate directly to the wireless adapter ????

    Thank in Advance,
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Do you really need to understand what is being sent?
    In reality it is all just bytes. If you get a byte from a, send it to c. If you get a byte from c, send it to a. Whether it eventually gets converted to text or a picture or an ACK really doesn't matter if the only purpose of the 'b' computer is to be a repeater: just repeat the byte array you receive

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      If you are talking about the TCP protocol's ACKs, then those are handled for you by the stack, just FIFO the bytes back and forth and you should be fine.

      Comment

      • psargam
        New Member
        • Jan 2010
        • 4

        #4
        Dear tlhintoq,

        First of all thanks for your reply,
        Well I know i just need to transfer byte from A to c and c to a, but what is the problem is I also need to handle ack from both machines.

        i. e. Suppose A is sending 5MB of data using TCP to C. It actually send it to B which will not send the ACK to A but only forwards it to C now C sends an ACK to B which forwards it to A.

        I know sockets and winsock 2 API are used to transfer data from one machine to another but as far as I know they do not have any tools to send and recieve ACKs, the protocol used in transmission can be any not just TCP and "I need to store all the ACKs for further use as it is research project, we need every bit transfered need to be stored".

        so if you can help then tell me if there is any free API that allows me to work at a level where I can recieve packets and ACKs intended to some other machine arriving at my wifi adapter and send it to desired machine by regenerating the packet.

        Comment

        • psargam
          New Member
          • Jan 2010
          • 4

          #5
          Dear Plater,

          Thanks for your reply,

          I know TCP it self manages ACKs, and that my problem is I want to manage ACKs my self.

          Consider the scenario, A is sending data to C through B, so what happens,
          A will send data to B so B will send ACK(1) to A. now B will send data to C which again send ACK(2) to B Which again send it to A.

          so for ACK I required three transfer if I use tools like socket or winsock API.
          as handling ACKs is there duty and we can not tell Bs socket that wait until C send you a reply and after it reply you send it as reply to A.

          Thanks again,

          Comment

          • tlhintoq
            Recognized Expert Specialist
            • Mar 2008
            • 3532

            #6
            An ack is nothing more than a hex 06

            So as you are repeating the bytes, check to see if the byte is a hex 06 and react how you like: Repeat it, log it "store it for future processing". Or if you feel it is being stripped out by TCP/ip protocol then add it back in.

            i. e. Suppose A is sending 5MB of data using TCP to C. It actually send it to B which will not send the ACK to A but only forwards it to C now C sends an ACK to B which forwards it to A.
            Right. You need the ACKs to be forwarded or you will never complete the 5mb transfer. After all that 5mb transfer is really going to be a lot of smaller packets each with their own ACKnowledgment. If the ACK is not received then the packet will be resent, and resent and resent until it is ACKnowledged.

            Consider the scenario, A is sending data to C through B, so what happens,
            A will send data to B so B will send ACK(1) to A. now B will send data to C which again send ACK(2) to B Which again send it to A.
            So you are saying that your softreapeter is not going to repeat the data in real time? That it is buffering the data before it re-sends it? That is going to seriously impact the speed of the transmission from A to C.

            Comment

            • psargam
              New Member
              • Jan 2010
              • 4

              #7
              thanx tlhintoq again for shwoing intrest in my thread,

              yes my software repeater needs to buffer data regardless of performance consideration.

              And please tell me what API should I use (Sockets, winsock kernel driver, windows filtering callout driver, network programming interface, NDIS or any other) to handle each and every packet and ACK from my softrepeater ???

              I know all therotically, which is similar to what you are understanding and saying.

              But, I m unaware of the programming tool to do it in C#, that's why I am asking it here.

              Thanx again
              Last edited by psargam; Jan 18 '10, 07:36 AM. Reason: change

              Comment

              • tlhintoq
                Recognized Expert Specialist
                • Mar 2008
                • 3532

                #8
                And please tell me what API should I use (Sockets, winsock kernel driver, windows filtering callout driver, network programming interface, NDIS or any other) to handle each and every packet and ACK from my softrepeater ???
                I don't have a deep enough knowledge of all these different scheme to be able to give you advice on where one would be better than another.

                Comment

                Working...