473,387 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

IP Address

MMA
Hi All,

How do I get the source IP of a packet, not knowing if NAT has taken place.

Thanks In Advance

Oct 20 '06 #1
4 1622
Hello, MMA!

Socket.RemoteEndpoint gives the source address of the received packet.

You wrote on Fri, 20 Oct 2006 06:31:02 -0700:

MHow do I get the source IP of a packet, not knowing if NAT has taken
Mplace.

MThanks In Advance
--
With best regards, Vadym Stetsyak.
Blog: http://vadmyst.blogspot.com
Oct 20 '06 #2
Hi,

But won't RemoteEndpoint only give the address of a router and not the LAN IP
of the source machine? (which I suspect MMA is after)

If I'm correct, then maybe knowing why you want the source IP would be useful.
You might get a more appropriate response if you let us know.

--
Dave Sexton

"Vadym Stetsyak" <va*****@ukr.netwrote in message
news:uR**************@TK2MSFTNGP04.phx.gbl...
Hello, MMA!

Socket.RemoteEndpoint gives the source address of the received packet.

You wrote on Fri, 20 Oct 2006 06:31:02 -0700:

MHow do I get the source IP of a packet, not knowing if NAT has taken
Mplace.

MThanks In Advance
--
With best regards, Vadym Stetsyak.
Blog: http://vadmyst.blogspot.com

Oct 21 '06 #3
Hello, Dave!

DSBut won't RemoteEndpoint only give the address of a router and not
DSthe LAN IP
DSof the source machine? (which I suspect MMA is after)

AFAIK no. When you're connecting to the remote host, you do not
know if there is any router out there ( or if there is route to this
machine ).

you can open microsoft.com, and then use "netstat -an -p tcp" command,
you'll observe that you're connected to MS endpoint and not the router.

DSIf I'm correct, then maybe knowing why you want the source IP would
DSbe useful.
DSYou might get a more appropriate response if you let us know.

DS--
DSDave Sexton

DS"Vadym Stetsyak" <va*****@ukr.netwrote in message
DSnews:uR**************@TK2MSFTNGP04.phx.gbl...
>Hello, MMA!
>Socket.RemoteEndpoint gives the source address of the received packet.
>You wrote on Fri, 20 Oct 2006 06:31:02 -0700:
>MHow do I get the source IP of a packet, not knowing if NAT has
taken
Mplace.
>MThanks In Advance
--
With best regards, Vadym Stetsyak.
Blog: http://vadmyst.blogspot.com
Oct 21 '06 #4
Hi Vadym,

I wasn't clear in my response. I was referring to a "remote" router, not
local NAT.

I believe I just took the OP's question too literally. I guess "NAT" means
"local NAT" in the OP :)

Thanks for the reply.

--
Dave Sexton

"Vadym Stetsyak" <va*****@ukr.netwrote in message
news:uk*************@TK2MSFTNGP05.phx.gbl...
Hello, Dave!

DSBut won't RemoteEndpoint only give the address of a router and not
DSthe LAN IP
DSof the source machine? (which I suspect MMA is after)

AFAIK no. When you're connecting to the remote host, you do not
know if there is any router out there ( or if there is route to this
machine ).

you can open microsoft.com, and then use "netstat -an -p tcp" command,
you'll observe that you're connected to MS endpoint and not the router.

DSIf I'm correct, then maybe knowing why you want the source IP would
DSbe useful.
DSYou might get a more appropriate response if you let us know.

DS--
DSDave Sexton

DS"Vadym Stetsyak" <va*****@ukr.netwrote in message
DSnews:uR**************@TK2MSFTNGP04.phx.gbl...
>>Hello, MMA!
>>Socket.RemoteEndpoint gives the source address of the received packet.
>>You wrote on Fri, 20 Oct 2006 06:31:02 -0700:
>>MHow do I get the source IP of a packet, not knowing if NAT has
taken
Mplace.
>>MThanks In Advance

--
With best regards, Vadym Stetsyak.
Blog: http://vadmyst.blogspot.com
Oct 21 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Alexander N. Spitzer | last post by:
If I have a machine with 3 virtual IP addresses (192.168.1.), how can I start 3 instances of the same RMI application (each started with different properties/configs), each listening on the port...
8
by: YAN | last post by:
Hi, I want to get the mac address from a machine, which i have the IP address of that machine, how can i do that? I know how to get the mac address of the local machine from the following code: ...
7
by: Privacy Advocate | last post by:
//crossposted to: comp.lang.javascript, alt.comp.lang.javascript in an effort to get factual answers from JavaScript experts// Simply put; Is it possible to obtain the real (actual) IP address of...
33
by: baumann.Pan | last post by:
hi all, i want to get the address of buf, which defined as char buf = "abcde"; so can call strsep(address of buf, pointer to token);
4
by: andreas.w.h.k. :-\) | last post by:
How do I change the address location in the wsdl <wsdl:port name="SearchSoap12" binding="tns:SearchSoap12"> <soap12:address location="http://searchservices/engine/search.asmx" /> </wsdl:port> ...
1
by: Phoenix_ver10 | last post by:
I have a mailing list with multiple names going to the same addresses. I need one address with all the names for that address on it. I checked out the example on microsoft's site, but A: It doesn't...
1
by: Jamie J. Begin | last post by:
I'm very new to the world of Python and am trying to wrap my head around it's OOP model. Much of my OOP experience comes from VB.Net, which is very different. Let's say I wanted to create an...
6
by: Nicolas Noakes | last post by:
Hello, I would like to convert to following process to code. Any advice is welcome. I have a hardware device which requires the this procedure to set it's IP address. First create an static...
36
by: Julienne Walker | last post by:
Ignoring implementation details and strictly following the C99 standard in terms of semantics, is there anything fundamentally flawed with describing the use of a (non-inline) function as an...
1
by: saravanatmm | last post by:
I need javascript code for validate the email address. Email address field cannot allowed the capital letters, special characters except '@' symbol. But can allowed the small letters, numeric...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.