All of lore.kernel.org
 help / color / mirror / Atom feed
* Path of network packet in kernel
@ 2014-07-15 14:37 Anil Joshi
  2014-07-15 14:53 ` Mohammad Merajul Islam Molla
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Anil Joshi @ 2014-07-15 14:37 UTC (permalink / raw)
  To: kernelnewbies

Hi All,

I am just new to all this,just wanted to trace the path of the packet since
it enter the system(inside the kernel (functions and system calls)) and
reaches the destination application.

How to do that.


Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140715/565ab021/attachment.html 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Path of network packet in kernel
  2014-07-15 14:37 Path of network packet in kernel Anil Joshi
@ 2014-07-15 14:53 ` Mohammad Merajul Islam Molla
  2014-07-15 14:54 ` Anand Moon
  2014-07-15 17:03 ` Jeff Haran
  2 siblings, 0 replies; 8+ messages in thread
From: Mohammad Merajul Islam Molla @ 2014-07-15 14:53 UTC (permalink / raw)
  To: kernelnewbies

This may help -
http://hsnlab.tmit.bme.hu/twiki/pub/Targyak/Mar11Cikkek/Network_stack.pdf


--
-Meraj

On Tue, Jul 15, 2014 at 8:37 PM, Anil Joshi <aj27744@gmail.com> wrote:
> Hi All,
>
> I am just new to all this,just wanted to trace the path of the packet since
> it enter the system(inside the kernel (functions and system calls)) and
> reaches the destination application.
>
> How to do that.
>
>
> Regards
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Path of network packet in kernel
  2014-07-15 14:37 Path of network packet in kernel Anil Joshi
  2014-07-15 14:53 ` Mohammad Merajul Islam Molla
@ 2014-07-15 14:54 ` Anand Moon
  2014-07-15 17:03 ` Jeff Haran
  2 siblings, 0 replies; 8+ messages in thread
From: Anand Moon @ 2014-07-15 14:54 UTC (permalink / raw)
  To: kernelnewbies

Hi Anil,


You can use trace-cmd to trace kernel function flow for any application


Below link will help you.

http://elinux.org/Ftrace

-Anand Moon


On Tuesday, July 15, 2014 8:07 PM, Anil Joshi <aj27744@gmail.com> wrote:



Hi All,

I am just new to all this,just wanted to trace the path of the packet since it enter the system(inside the kernel (functions and system calls)) and reaches the destination application.

How to do that.


Regards

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies? 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Path of network packet in kernel
  2014-07-15 14:37 Path of network packet in kernel Anil Joshi
  2014-07-15 14:53 ` Mohammad Merajul Islam Molla
  2014-07-15 14:54 ` Anand Moon
@ 2014-07-15 17:03 ` Jeff Haran
  2014-07-15 18:57   ` Anand Moon
  2014-07-16  3:51   ` Anupam Kapoor
  2 siblings, 2 replies; 8+ messages in thread
From: Jeff Haran @ 2014-07-15 17:03 UTC (permalink / raw)
  To: kernelnewbies

This helps me to see the forest for the trees. And it?s pretty current:

http://upload.wikimedia.org/wikipedia/commons/3/37/Netfilter-packet-flow.svg

Jeff Haran


From: kernelnewbies-bounces@kernelnewbies.org [mailto:kernelnewbies-bounces at kernelnewbies.org] On Behalf Of Anil Joshi
Sent: Tuesday, July 15, 2014 7:38 AM
To: kernelnewbies
Subject: Path of network packet in kernel

Hi All,

I am just new to all this,just wanted to trace the path of the packet since it enter the system(inside the kernel (functions and system calls)) and reaches the destination application.

How to do that.


Regards

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140715/6007fd2d/attachment-0001.html 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Path of network packet in kernel
  2014-07-15 17:03 ` Jeff Haran
@ 2014-07-15 18:57   ` Anand Moon
  2014-07-22 11:20     ` Anil Joshi
  2014-07-16  3:51   ` Anupam Kapoor
  1 sibling, 1 reply; 8+ messages in thread
From: Anand Moon @ 2014-07-15 18:57 UTC (permalink / raw)
  To: kernelnewbies

Hi Anil,

You need to use "trace-cmd record" command and run you client. For example.

I chose to write a tcp simple client server application.
Server running on remote machine listening on some port
I executed below command to connect to the server using trace-cmd record
Below command records all the event and function trace in the kernel, 

You can filter these function by passing "-e net:*"
this command will generate a report of all the function that kernel executed.
You can read the report afterwords. using trace-cmd report.

#sudo trace-cmd record -e all ./tcpc 10.0.0.28
#ls 
#tcpc? tcpc.c? trace.dat
#trace-cmd report

You can also user perf command to trace the kernel functions.

#sudo perf record -e probe:tcp_sendmsg 

#perf report

perf examples can be found below.

http://www.brendangregg.com/perf.html

-Anand Moon





On Tuesday, July 15, 2014 10:34 PM, Jeff Haran <Jeff.Haran@citrix.com> wrote:



This helps me to see the forest for the trees. And it?s pretty current:

http://upload.wikimedia.org/wikipedia/commons/3/37/Netfilter-packet-flow.svg

Jeff Haran


From:kernelnewbies-bounces at kernelnewbies.org [mailto:kernelnewbies-bounces at kernelnewbies.org] On Behalf Of Anil Joshi
Sent: Tuesday, July 15, 2014 7:38 AM
To: kernelnewbies
Subject: Path of network packet in kernel

Hi All,

I am just new to all this,just wanted to trace the path of the packet since it enter the system(inside the kernel (functions and system calls)) and reaches the destination application.

How to do that.


Regards


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Path of network packet in kernel
  2014-07-15 17:03 ` Jeff Haran
  2014-07-15 18:57   ` Anand Moon
@ 2014-07-16  3:51   ` Anupam Kapoor
  1 sibling, 0 replies; 8+ messages in thread
From: Anupam Kapoor @ 2014-07-16  3:51 UTC (permalink / raw)
  To: kernelnewbies

a 'slightly' more indepth look:
http://www.linuxfoundation.org/images/1/1c/Network_data_flow_through_kernel.png

kind regards
anupam

On Tue, Jul 15, 2014 at 10:33 PM, Jeff Haran <Jeff.Haran@citrix.com> wrote:
> This helps me to see the forest for the trees. And it's pretty current:
>
>
>
> http://upload.wikimedia.org/wikipedia/commons/3/37/Netfilter-packet-flow.svg
>
>
>
> Jeff Haran
>
>
>
>
>
> From: kernelnewbies-bounces at kernelnewbies.org
> [mailto:kernelnewbies-bounces at kernelnewbies.org] On Behalf Of Anil Joshi
> Sent: Tuesday, July 15, 2014 7:38 AM
> To: kernelnewbies
> Subject: Path of network packet in kernel
>
>
>
> Hi All,
>
>
>
> I am just new to all this,just wanted to trace the path of the packet since
> it enter the system(inside the kernel (functions and system calls)) and
> reaches the destination application.
>
>
>
> How to do that.
>
>
>
>
>
> Regards
>
>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
In the beginning was the lambda, and the lambda was with Emacs, and
Emacs was the lambda.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Path of network packet in kernel
  2014-07-15 18:57   ` Anand Moon
@ 2014-07-22 11:20     ` Anil Joshi
  2014-07-22 18:23       ` Anand Moon
  0 siblings, 1 reply; 8+ messages in thread
From: Anil Joshi @ 2014-07-22 11:20 UTC (permalink / raw)
  To: kernelnewbies

Hi Anand,

I did what you said but i am getting a strange output
 [root at machine0 Desktop]#ls
cli              trace.dat.cpu11  trace.dat.cpu2  trace.dat.cpu7
client.c         trace.dat.cpu12  trace.dat.cpu3  trace.dat.cpu8
trace.dat.cpu0   trace.dat.cpu13  trace.dat.cpu4  trace.dat.cpu9
trace.dat.cpu1   trace.dat.cpu14  trace.dat.cpu5
trace.dat.cpu10  trace.dat.cpu15  trace.dat.cpu6
[root at hwcentos10 Desktop]# cat trace.dat.cpu
cat: trace.dat.cpu: No such file or directory
[root at machine0 Desktop]# cat trace.dat.cpu0
[root at machine0 Desktop]# tcpc client.c trace.dat.cpu1
-bash: tcpc: command not found

why am i getting so much trace.dat.cpu files and tcpc command not found can
you please help me out....

cli is the executable file for client

---Anil



On Wed, Jul 16, 2014 at 12:27 AM, Anand Moon <moon.linux@yahoo.com> wrote:

> Hi Anil,
>
> You need to use "trace-cmd record" command and run you client. For example.
>
> I chose to write a tcp simple client server application.
> Server running on remote machine listening on some port
> I executed below command to connect to the server using trace-cmd record
> Below command records all the event and function trace in the kernel,
>
> You can filter these function by passing "-e net:*"
> this command will generate a report of all the function that kernel
> executed.
> You can read the report afterwords. using trace-cmd report.
>
> #sudo trace-cmd record -e all ./tcpc 10.0.0.28
> #ls
> #tcpc  tcpc.c  trace.dat
> #trace-cmd report
>
> You can also user perf command to trace the kernel functions.
>
> #sudo perf record -e probe:tcp_sendmsg
>
> #perf report
>
> perf examples can be found below.
>
> http://www.brendangregg.com/perf.html
>
> -Anand Moon
>
>
>
>
>
> On Tuesday, July 15, 2014 10:34 PM, Jeff Haran <Jeff.Haran@citrix.com>
> wrote:
>
>
>
> This helps me to see the forest for the trees. And it?s pretty current:
>
>
> http://upload.wikimedia.org/wikipedia/commons/3/37/Netfilter-packet-flow.svg
>
> Jeff Haran
>
>
> From:kernelnewbies-bounces at kernelnewbies.org [mailto:
> kernelnewbies-bounces at kernelnewbies.org] On Behalf Of Anil Joshi
> Sent: Tuesday, July 15, 2014 7:38 AM
> To: kernelnewbies
> Subject: Path of network packet in kernel
>
> Hi All,
>
> I am just new to all this,just wanted to trace the path of the packet
> since it enter the system(inside the kernel (functions and system calls))
> and reaches the destination application.
>
> How to do that.
>
>
> Regards
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140722/35e6daa3/attachment.html 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Path of network packet in kernel
  2014-07-22 11:20     ` Anil Joshi
@ 2014-07-22 18:23       ` Anand Moon
  0 siblings, 0 replies; 8+ messages in thread
From: Anand Moon @ 2014-07-22 18:23 UTC (permalink / raw)
  To: kernelnewbies

Hi Anil,

I had written TCP client (tcpc.c) and TCP server (tcps.c) programs for demo and testing purpose.
Note : "./tcpc" is the application running under trace-cmd record command.


If you want to record the kernel flow for application you can use


# trace-cmd record -e all command.

# trace-cmd report???????????? /* to see the output. */


See the man page of trace-cmd record for example for more details.

Please find below link for more details how to filter the output.

http://elinux.org/images/3/35/Kernelshark-tut-elc-2011.pdf


-Anand Moon


On Tuesday, July 22, 2014 4:51 PM, Anil Joshi <aj27744@gmail.com> wrote:
 


Hi Anand,

I did what you said but i am getting a strange output
?[root at machine0 Desktop]#ls
cli????????????? trace.dat.cpu11? trace.dat.cpu2? trace.dat.cpu7
client.c???????? trace.dat.cpu12? trace.dat.cpu3? trace.dat.cpu8
trace.dat.cpu0?? trace.dat.cpu13? trace.dat.cpu4? trace.dat.cpu9
trace.dat.cpu1?? trace.dat.cpu14? trace.dat.cpu5
trace.dat.cpu10? trace.dat.cpu15? trace.dat.cpu6
[root at hwcentos10 Desktop]# cat trace.dat.cpu
cat: trace.dat.cpu: No such file or directory
[root at machine0 Desktop]# cat trace.dat.cpu0
[root at machine0 Desktop]# tcpc client.c trace.dat.cpu1
-bash: tcpc: command not found

why am i getting so much trace.dat.cpu files and tcpc command not found can you please help me out....

cli is the executable file for client

---Anil





On Wed, Jul 16, 2014 at 12:27 AM, Anand Moon <moon.linux@yahoo.com> wrote:

Hi Anil,
>
>You need to use "trace-cmd record" command and run you client. For example.
>
>I chose to write a tcp simple client server application.
>Server running on remote machine listening on some port
>I executed below command to connect to the server using trace-cmd record
>Below command records all the event and function trace in the kernel,
>
>You can filter these function by passing "-e net:*"
>this command will generate a report of all the function that kernel executed.
>You can read the report afterwords. using trace-cmd report.
>
>#sudo trace-cmd record -e all ./tcpc 10.0.0.28
>#ls
>#tcpc? tcpc.c? trace.dat
>#trace-cmd report
>
>You can also user perf command to trace the kernel functions.
>
>#sudo perf record -e probe:tcp_sendmsg
>
>#perf report
>
>perf examples can be found below.
>
>http://www.brendangregg.com/perf.html
>
>-Anand Moon
>
>
>
>
>
>
>On Tuesday, July 15, 2014 10:34 PM, Jeff Haran <Jeff.Haran@citrix.com> wrote:
>
>
>
>This helps me to see the forest for the trees. And it?s pretty current:
>
>http://upload.wikimedia.org/wikipedia/commons/3/37/Netfilter-packet-flow.svg
>
>Jeff Haran
>
>
>From:kernelnewbies-bounces at kernelnewbies.org [mailto:kernelnewbies-bounces at kernelnewbies.org] On Behalf Of Anil Joshi
>Sent: Tuesday, July 15, 2014 7:38 AM
>To: kernelnewbies
>Subject: Path of network packet in kernel
>
>Hi All,
>
>I am just new to all this,just wanted to trace the path of the packet since it enter the system(inside the kernel (functions and system calls)) and reaches the destination application.
>
>How to do that.
>
>
>Regards
>
>
>
>_______________________________________________
>Kernelnewbies mailing list
>Kernelnewbies at kernelnewbies.org
>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140722/e8c8188a/attachment-0001.html 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-07-22 18:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-15 14:37 Path of network packet in kernel Anil Joshi
2014-07-15 14:53 ` Mohammad Merajul Islam Molla
2014-07-15 14:54 ` Anand Moon
2014-07-15 17:03 ` Jeff Haran
2014-07-15 18:57   ` Anand Moon
2014-07-22 11:20     ` Anil Joshi
2014-07-22 18:23       ` Anand Moon
2014-07-16  3:51   ` Anupam Kapoor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.