Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. NAT Router Traversal

NAT Router Traversal

Scheduled Pinned Locked Moved Visual Basic
questionhelpcsharphardware
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stevenutt
    wrote on last edited by
    #1

    Guys, I have a NAT traversal issue that I need to solve using VB.Net and I can't do it with the .Net socket class. Here is an overview.... Remote client sends out a UDP packet from its internal IP on port 1234. The NAT router maps it to the external IP plus a mapped port (let's say 9999) My UDP listening software picks up the packet and I am able to find out the IP address and mapped port number (source port). The problem with NAT is that if I do not send a packet back from the same source port - it will be rejected (symmetric NAT). So, in my VB/net app, I connect and send back a response as follows.... udpClient.Connect(RemoteIP, SourcePort) 'code to send the packet goes here I use Ethereal to view the packet going out and the destination port is 9999 as expected, but the source port of the response gets mapped to a different port number. So, even though the packet hits the correct remote router port, it gets rejected because it came from a different source port. My question is, what hardware device is mapping the source port of my packet and how do I stop this from happening - or work around it ?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups