Networking Forums

Networking Forums > Computer Networking > Linux Networking > client & server (socket) running on same machine, tcpdump can't dumpout any packet info, how?

Reply
Thread Tools Display Modes

client & server (socket) running on same machine, tcpdump can't dumpout any packet info, how?

 
 
GS
Guest
Posts: n/a

 
      12-07-2005, 02:29 PM
I am running client & server (socket based) on same machine, can I use
"tcpdump" (tcpdump -i eth0 udp port xxx) to dump the packet?. I tried,
I can't see any of packet based on the port number. How can I verify
this. My server and client can't able to communicate, Is There any
tools to verify client and server communications.

 
Reply With Quote
 
 
 
 
Toni Erdmann
Guest
Posts: n/a

 
      12-07-2005, 02:36 PM
GS wrote:

> I am running client & server (socket based) on same machine, can I use
> "tcpdump" (tcpdump -i eth0 udp port xxx) to dump the packet?. I tried,
> I can't see any of packet based on the port number. How can I verify
> this. My server and client can't able to communicate, Is There any
> tools to verify client and server communications.
>


Hello,

with '-i eth0' you will not see the communication.
The interface used is 'loopback' 'lo'.

Depends on your OS (Unix? Linux, Solaris, ...)

Try tcpdump without '-i xxx' option, at least without any option
and then try to apply more and more filters.

Toni
 
Reply With Quote
 
GS
Guest
Posts: n/a

 
      12-07-2005, 05:36 PM
It is on Linux(RH), I tried without "-i eth0" option, still it prints
"Listening on eth0", but I can't dump any packets "tcpdump udp port
15000", here I am using port 15000, nothing dumps, how can I dump.

 
Reply With Quote
 
Tauno Voipio
Guest
Posts: n/a

 
      12-07-2005, 06:59 PM
GS wrote:
> It is on Linux(RH), I tried without "-i eth0" option, still it prints
> "Listening on eth0", but I can't dump any packets "tcpdump udp port
> 15000", here I am using port 15000, nothing dumps, how can I dump.
>


Please read the previous response again:

If you're sending to *any* of the local IP addresses,
the Linux TCP/IP stack is smart enough to route the
packets via the loopback interface, lo. The packets
get to the eth0 queue only when they are going outside
or coming from outside. tcpdump (and friends, actually
the libpcap library) captures the packets from the
interface queue, and eth0 never sees the local packets.

--

Tauno Voipio
tauno voipio (at) iki fi
 
Reply With Quote
 
GS
Guest
Posts: n/a

 
      12-07-2005, 09:40 PM
Thanks, I got it with "lo",but I am using port 15000 on both sides, why
I am seeing "32806" (below is my capture), when I dump I can see like
this (I am using port 15000 on both sides). Here my hostname is
(panther). this dump using tcpdump:

server ----> client :
panther.15000 > panther.32806......
panther.32806 > panther.15000....

client ---> server
panther.32806 > panther.15000....
panther.15000 > panther.32806......

what is this 32806? when I am using port 15000 on both sides?. Thanks.

 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      12-08-2005, 12:12 AM

"GS" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...

> Thanks, I got it with "lo",but I am using port 15000 on both sides, why
> I am seeing "32806" (below is my capture), when I dump I can see like
> this (I am using port 15000 on both sides). Here my hostname is
> (panther). this dump using tcpdump:
>
> server ----> client :
> panther.15000 > panther.32806......
> panther.32806 > panther.15000....
>
> client ---> server
> panther.32806 > panther.15000....
> panther.15000 > panther.32806......
>
> what is this 32806? when I am using port 15000 on both sides?. Thanks.


When you say you are using port 15000 on both sides, what do you mean?
If you mean that one side is sending *to* 15000 and the other is receiving
*on* 15000, then what port is the first side receiving on and the other side
sending to? (Hint, it's probably 32806)

DS


 
Reply With Quote
 
GS
Guest
Posts: n/a

 
      12-08-2005, 12:52 AM
I configured on both sides port as 15000, I pasted code below, this
port 32806 is picked by system itself, Is that is not user
configurable?. I mean system can pickup any port?. Here it picked 32806
like that it can use any port right?. Is there anyway I can configure
receiving on server port?. (can I replce 32806 with any other port
number I like)?. Thanks.



server code
--------------
address.sin_family = AF_INET;
address.sin_addr.s_addr = INADDR_ANY;
address.sin_port = htons(15000);

client code
-------------
address.sin_family = AF_INET;
address.sin_port = htons(15000);

 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      12-08-2005, 12:57 AM

"GS" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...

>I configured on both sides port as 15000, I pasted code below,


That doesn't really show much, but I'm assuming you configured the
server side to listen on 15000 and the client side to send to 15000. That
still leaves the client to decide what port to receive on, which will be the
port the server will have to send to.

> this
> port 32806 is picked by system itself, Is that is not user
> configurable?. I mean system can pickup any port?. Here it picked 32806
> like that it can use any port right?. Is there anyway I can configure
> receiving on server port?. (can I replce 32806 with any other port
> number I like)?. Thanks.


Yes, you can 'bind' in the client. But it's usually a bad idea.

DS


 
Reply With Quote
 
GS
Guest
Posts: n/a

 
      12-12-2005, 10:53 AM
Here I have two clients, only one client can get the response the other
one is not getting the response, Do I have to do any modification to my
server incase if it wants to communicate two simultaneous clients?.
Both are using same port number. Only one client (first started one)
get the response always, the second clients never gets any response.

,/server (server)

../clien1 <ip-addr-of-serv> (first client)

../clie2 <ip-addr-of-sock> (second cli)

Thanks.





David Schwartz wrote:
> "GS" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
>
> >I configured on both sides port as 15000, I pasted code below,

>
> That doesn't really show much, but I'm assuming you configured the
> server side to listen on 15000 and the client side to send to 15000. That
> still leaves the client to decide what port to receive on, which will be the
> port the server will have to send to.
>
> > this
> > port 32806 is picked by system itself, Is that is not user
> > configurable?. I mean system can pickup any port?. Here it picked 32806
> > like that it can use any port right?. Is there anyway I can configure
> > receiving on server port?. (can I replce 32806 with any other port
> > number I like)?. Thanks.

>
> Yes, you can 'bind' in the client. But it's usually a bad idea.
>
> DS


 
Reply With Quote
 
Joseph2k
Guest
Posts: n/a

 
      01-15-2006, 02:34 AM
GS wrote:

> Here I have two clients, only one client can get the response the other
> one is not getting the response, Do I have to do any modification to my
> server incase if it wants to communicate two simultaneous clients?.
> Both are using same port number. Only one client (first started one)
> get the response always, the second clients never gets any response.
>
> ,/server (server)
>
> ./clien1 <ip-addr-of-serv> (first client)
>
> ./clie2 <ip-addr-of-sock> (second cli)
>
> Thanks.
>
>
>
>
>
> David Schwartz wrote:
>> "GS" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed) oups.com...
>>
>> >I configured on both sides port as 15000, I pasted code below,

>>
>> That doesn't really show much, but I'm assuming you configured the
>> server side to listen on 15000 and the client side to send to 15000. That
>> still leaves the client to decide what port to receive on, which will be
>> the port the server will have to send to.
>>
>> > this
>> > port 32806 is picked by system itself, Is that is not user
>> > configurable?. I mean system can pickup any port?. Here it picked 32806
>> > like that it can use any port right?. Is there anyway I can configure
>> > receiving on server port?. (can I replce 32806 with any other port
>> > number I like)?. Thanks.

>>
>> Yes, you can 'bind' in the client. But it's usually a bad idea.
>>
>> DS

>

IIRC there is a second ID type number for IP connection right after the port
number used to identify alternate clients from the same IP address. Don't
remember how to use it though.
--
JosephKK

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does tcpdump show few packet? Zheng Da Linux Networking 32 10-11-2006 05:35 AM
can tcpdump capture more than packet headers? eddie Linux Networking 3 09-24-2006 09:01 PM
Simple client/server socket program works on one Linux machine, it doesnot work on other machine GS Linux Networking 2 05-09-2006 12:55 PM
Getting client system info from server Mark Christensen Windows Networking 2 11-29-2005 12:36 PM
Fedora Core 2 NAT Router freezes when left running with Azurus running on a local machine. Lee Caves Linux Networking 0 11-01-2004 08:45 PM



1 2 3 4 5 6 7 8 9 10 11