TCP File Transfer behind NAT

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Saurabh

    TCP File Transfer behind NAT

    Dear All,

    Can anyone tell me, how to write such a program that can transfer
    files (either binary or text) behind NAT devices( such as for
    computers behind firewalls and routers and other NAT devices) using
    TCP socket programming.

    I have a mechanism through which the public IP of the router and Port
    number will be forwarded to me. But after that I am not sure that
    simple TCP/IP socket programming will suffice or I need to do
    something more for that.

    If you have any article link or article or any example that shows how
    the File Transfer can be done for such a case then please help me
    regarding this.

    Any sought of help or idea will be appreciated from you all.

    from-
    Saurabh Srivastava
  • Walter Roberson

    #2
    Re: TCP File Transfer behind NAT

    In article <e31e2eb9-7b46-4d1a-939a-132e35f6bbcf@u1 0g2000prn.googl egroups.com>,
    Saurabh <sendsaurabh@gm ail.comwrote:
    >Can anyone tell me, how to write such a program that can transfer
    >files (either binary or text) behind NAT devices( such as for
    >computers behind firewalls and routers and other NAT devices) using
    >TCP socket programming.
    The C standards do not know anything about networking, let alone
    NAT. Networking matters are platform dependant. You should ask
    in a development newsgroup that supports your operating system.
    --
    "History is a pile of debris" -- Laurie Anderson

    Comment

    • Antoninus Twink

      #3
      Re: TCP File Transfer behind NAT

      On 3 Apr 2008 at 10:11, Saurabh wrote:
      Dear All,
      >
      Can anyone tell me, how to write such a program that can transfer
      files (either binary or text) behind NAT devices( such as for
      computers behind firewalls and routers and other NAT devices) using
      TCP socket programming.
      >
      I have a mechanism through which the public IP of the router and Port
      number will be forwarded to me. But after that I am not sure that
      simple TCP/IP socket programming will suffice or I need to do
      something more for that.
      No, you don't need to do anything unusual: from the outside, NAT is
      completely transparent, so you can just deal with whatever port number
      on the external-facing router and it will take care of forwarding it
      within its internal network as required.

      The only problems that might arise are if you're using some complicated
      secure tunneling arrangement that confuses the NAT front end.

      Comment

      • Richard Tobin

        #4
        Re: TCP File Transfer behind NAT

        In article <slrnfvaitk.9v2 .nospam@nospam. invalid>,
        Antoninus Twink <nospam@nospam. invalidwrote:
        >No, you don't need to do anything unusual: from the outside, NAT is
        >completely transparent, so you can just deal with whatever port number
        >on the external-facing router and it will take care of forwarding it
        >within its internal network as required.
        >
        >The only problems that might arise are if you're using some complicated
        >secure tunneling arrangement that confuses the NAT front end.
        Or if you're using a protocol such as FTP, which sends addresses
        (port numbers) as part of the data itself. Then the NAT device
        doesn't know to set up a mapping, and even if it did the port
        number carried in the message would be wrong.

        NAT implementations usually know about a handful of protocols of
        this kind, and inspect and munge the data accordingly. Alternatively
        the program may use some other protocol such as upnp to inform
        the router.

        -- Richard
        --
        :wq

        Comment

        • Antoninus Twink

          #5
          Re: TCP File Transfer behind NAT

          On 3 Apr 2008 at 21:44, Richard Tobin wrote:
          In article <slrnfvaitk.9v2 .nospam@nospam. invalid>,
          Antoninus Twink <nospam@nospam. invalidwrote:
          >
          >>No, you don't need to do anything unusual: from the outside, NAT is
          >>completely transparent, so you can just deal with whatever port number
          >>on the external-facing router and it will take care of forwarding it
          >>within its internal network as required.
          >>
          >>The only problems that might arise are if you're using some complicated
          >>secure tunneling arrangement that confuses the NAT front end.
          >
          Or if you're using a protocol such as FTP, which sends addresses
          (port numbers) as part of the data itself. Then the NAT device
          doesn't know to set up a mapping, and even if it did the port
          number carried in the message would be wrong.
          >
          NAT implementations usually know about a handful of protocols of
          this kind, and inspect and munge the data accordingly. Alternatively
          the program may use some other protocol such as upnp to inform
          the router.
          You're right, of course, but I think modern NAT devices handle many
          common protocols transparently to outside users - this will almost
          certainly be the case for FTP or whatever protocol the OP intends to use
          to transfer his files.

          Comment

          Working...