UlFaTyAnG
UlFaTyAnG

Reputation: 17

How to know the size of a packet

Suppose I start a TCP session and close it after some times, now how can I know how much or the size of packets that have been used in the overall session?

Upvotes: 0

Views: 175

Answers (2)

theLeanDeveloper
theLeanDeveloper

Reputation: 391

Adding to above : Tshark is a tool to sniff packets on the linux machine:

Here is an example :

cmd : tshark -n -T fields -e ip.src -e tcp.seq -e tcp.len -i

ip.src = source ip |
tcp-seq = sequence |
**tcp.len = lenght of tcl packets** 

Here is the snapshot: third column is the length of tcp packets

198.252.206.140 14766   117
192.168.1.2 2583    0
192.168.1.2 2583    632
190.93.245.58   1   679
192.168.1.2 522 0
198.252.206.140 0   0
192.168.1.2 1   0
198.252.206.140 1   1440
192.168.1.2 580 0
198.252.206.140 1441    1283
192.168.1.2 580 0
198.252.206.140 14883   145
192.168.1.2 1   556
192.168.1.2 3215    0
192.168.1.2 522 564
190.93.245.58   680 0
190.93.245.58   680 1440
192.168.1.2 1086    0
190.93.245.58   2120    1095
192.168.1.2 1086    0
198.252.206.17  1   1440
^C192.168.1.2   557 0
198.252.206.17  1441    208
192.168.1.2 557 0
192.168.1.2 557 585
192.168.1.2 1086    607
190.93.245.58   3215    343
192.168.1.2 1693    0
198.252.206.17  1649    270

Upvotes: 1

Chris Ryding
Chris Ryding

Reputation: 1533

You'll have to use a packet sniffer like WireShark. Even if you have very structured data that sends out at sufficiently delayed intervals it's not really possible to pre-compute how that data will be sent. There's too many variables over which you have minimal, or no, control.

Upvotes: 0

Related Questions