i'm doing icmp implementation in vc++.net 2003.when i receive icmp packets, it comes from the different system..what is the reason?is it correct?
6 1916
The icmp packet should be coming from someone else yes.
Did you look at the docs on icmp?
Reply comes from the node different from what i am expected.
When i gave ping 172.20.20.23, reply comes from other system...is it correct
or not?
Well they get changed.
If a series of devices are connected, where lowercase is a computer and uppercase are routers:
a - B - C - d
If you ping d from a, your icmp response will come from B, since each packet gets stopped on the way I believe.
I *think* this is what you are seeing. Another explanation could be a byte order mistake, like you think you're pinging one address but really it's different one due to a byte order mistake?
Thanks for your reply.. -
iphe =Dns::Resolve(s);
-
Console::WriteLine(S"Host Entry :{0}",iphe->HostName->ToString());
-
IPAddress* ipad = __try_cast<IPAddress*>(iphe->AddressList[0]);
-
-
Console::WriteLine(S"IP Address : {0}",ipad->ToString());
-
IPEndPoint* ipe = new IPEndPoint(ipad,80);
-
EndPoint* senderRemote = __try_cast<EndPoint*>(ipe);
-
Console::WriteLine(S"Sender Remote :{0}",senderRemote->ToString());
-
-
DateTime dt=DateTime::Now;
-
int iRet;
-
st->SetSocketOption(SocketOptionLevel::Socket,SocketOptionName::IpTimeToLive,32);
-
st->SetSocketOption(SocketOptionLevel::Socket,SocketOptionName::SendTimeout,500000);
-
Byte RecvByte[]=new Byte[256];
-
iRet=st->ReceiveFrom(RecvByte,RecvByte->Length,SocketFlags::None,&senderRemote);
-
TimeSpan ts=DateTime::Now -dt;
-
if(iRet==-1)
-
{
-
Console::WriteLine(S"Error Getting Data");
-
}
-
Console::WriteLine(S"Reply From :IP={0,-20} TTL={1,-10} Time={2,3}ms",senderRemote->ToString(),RecvByte[8].ToString(),ts.Milliseconds.ToString());
-
this is my code..here before i got reply from the destination,the IP address is printed correctly.But after i getting reply the destination address has changed..
My assumption is.. the packet from the destination comes through different node..the actual reply is from the actual destination..
Another problem is i am getting very late response...even i ping my node response is very late.what is the reason for that?can i minimize the response time?
i'm awaiting for your reply..
What happens when you ping with a regular ping command in windows?
Or use the actual ping implementation in .NET?
If you do a traceroute to that same address, does the "next hop" have the ip address you are seeing on the return of YOUR ping?
In Regular ping commad, the response comes immediatly.I used the actual ping implementaion.
When i checked the IP datagram header,the TTL always 128.If the packet comes from the different node, TTL field might be decremented by 1 or 2.but in my case the TTL always 128.
Here is my output of my program.I displayed first 60 bytes of the returning IP packet.when i send ping 172.20.20.24,the reply comes from 172.20.20.6 which is the server.Sometimes the reply comes from other IP address
IP Address : 172.20.20.24
Data Sending to 172.20.20.24:80
Reply From :IP=172.20.20.6:0 TTL=128 Time=213ms
69 0 0 60 148 184 0 0 128 1 37 190 172 20 20 6 172 20 20 28 0 0 65 94 2 0 20 0 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 65 66 67 68 69 70 71 72 73
Data Sending to 172.20.20.24:80
Reply From :IP=172.20.20.6:0 TTL=128 Time=213ms
69 0 0 60 148 186 0 0 128 1 37 188 172 20 20 6 172 20 20 28 0 0 64 94 2 0 21 0 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 65 66 67 68 69 70 71 72 73
Data Sending to 172.20.20.24:80
Reply From :IP=172.20.20.6:0 TTL=128 Time=758ms
69 0 0 60 244 161 0 0 128 1 197 212 172 20 20 6 172 20 20 28 0 0 63 94 2 0 22 0 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 65 66 67 68 69 70 71 72 73
Data Sending to 172.20.20.24:80
Reply From :IP=172.20.20.6:0 TTL=128 Time= 71ms
69 0 0 60 244 163 0 0 128 1 197 210 172 20 20 6 172 20 20 28 0 0 62 94 2 0 23 0 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 65 66 67 68 69 70 71 72 73
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Alexandre Plennevaux |
last post by:
hello !
I would like to measure the time a user needs to connect to my website.
In other words, to perform a ping between my website and the user's
computer.
I'm scratching my head as to how...
|
by: Mike Mallory |
last post by:
Can Java perform two pings at one time and display the best ping time
with the best result?
Also, can Java perform two trace routes at one time and display the
trace with the fewest hops?
...
|
by: Jason Rodman |
last post by:
I have downloaded every example on how to create a ping utility in .Net in
both VB and C#, but have been disappointed with the results. I have YET to
find an example that returns consistent results...
|
by: Eric Wenger |
last post by:
I'm pretty new to C# and I'm trying to do what I believe should be a
simple thing. I want to modify a program that is using the
System.Net.NetworkInformation.Ping class to have some custom...
|
by: Neel |
last post by:
I am trying to "ping" a remote host in my C++/Redhat Linux code to
check whether that host is connected or not.
if (0 == system("ping -w 2 192.168.0.2))
But, in both cases...
|
by: luvwknd |
last post by:
Hi all,
I am attempting to utilize MS's article I.D. #828993 found at:
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B828993
In an effort to create a GUI Ping utility that...
|
by: Sonda |
last post by:
how to ping ip address from c language ?
|
by: bngboun |
last post by:
How can I write a remote ping code in C#?
I have tried some basic ping codes, but the thing I am required to is I think different than the simple ping. I think I have to make an IP(can be my IP,...
|
by: Mauro \Baba\ Mascia |
last post by:
Hi, this is my question:
I want to know if several switch (about 50) in a big lan are up and then
know their MAC addresses to do a list that contains host name, ip and mac.
I know only the range...
|
by: somsub |
last post by:
Can any one help me on ping command .
for this line of code
($ret, $duration, $ip) = $p->ping ($line)
If i give any
1> invalid entry as a parameter ($line) in ping command
or
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |