Commit Graph

65 Commits

Author SHA1 Message Date
Ulf Lamping 974baa0485 slightly extend information about TCP checksum offloading problems (still far from being a real good way to handle this)
svn path=/trunk/; revision=18436
2006-06-12 19:27:05 +00:00
Ronnie Sahlberg 697974ae8d improve the tcp retransmission vs outoforder heuristics to address the issue in PeterBruno's email of may18
dont reply to mailinglist that issue has been resolved since "ethereal" is still in limbo


svn path=/trunk/; revision=18263
2006-05-31 11:15:45 +00:00
Ronnie Sahlberg feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00
Guy Harris 56728f40ed Have "pdu_store_sequencenumber_of_next_pdu()" return the newly-allocated
"struct tcp_multisegment_pdu"; that lets it be used in one case where
the code in it was duplicated.

Make "desegment_tcp()" loop rather than recursing - not all compilers
will necessarily recognize the tail recursion.

Catch heuristic dissectors that reject a packet but also request
(whether deliberately or accidentally) that more data be added.

svn path=/trunk/; revision=18050
2006-05-01 02:32:16 +00:00
Ronnie Sahlberg 0c1d1e600f tcp reassembly updates
use tcp_multisegment_pdu and se_tree_lookup32_le()   to track pdu boundaries for tcp reassembly just as this structure is used for the same purpose when reassembly is not enabled.

get rid of a hashtable and two memchunks we no longer need
tcp_segment_table    tcp_segment_key_chunk and   tcp_segment_address_chunk


This makes tcp reassembly work for out-of-order segments   as well as when reassembly completes in one segment and when the tail of the segment contains the head of the next pdu  which we did not handle before.


tcp reassembly should be much better and efficient now    modulo introduced regressions.




svn path=/trunk/; revision=18046
2006-04-30 10:27:55 +00:00
Ronnie Sahlberg 703869d3d6 tcp analysis updates to prepare for later tcp reassembly updates
now that we have se_tree_lookup32_le   we can do the tracking of pdu boundaries much more efficiently.

track pdu boundaries by a new  tcp_multisegment_pdu  structure that is indexed by sequence numbers and let this structure replace the older tcp_next_pdu structure.

with se_tree_lookup32_le  we no longer need to track segment by segment and can get rid of the two hash tables
tcp_pdu_tracking_table
tcp_pdu_skipping_table
Neither do we need the tree   tcp_pdu_time_table anymore so that one is gone as well.

remove various other functions that are no longer needed due to removing the structure and the tables/tree


this part of the code shoul;d be much more readable now   and also a bit faster



svn path=/trunk/; revision=18024
2006-04-28 09:44:02 +00:00
Ronnie Sahlberg f331077a60 waste a couple of bytes per tcp conversation and make the tree for acked_packets (i.e. packets that have interesting tcp properties such as being retransmissions etc) hang off the per conversation tcpd struct instead of being global.
while this should improve performance by unmeasurably little it does have the sideeffect that once we finish the rewrite   tcp analysis might actually work and work well even for tcp over tcp tunnelling. 

this also means that if you include packet-tcp.h   you also need to include emem.h .




svn path=/trunk/; revision=17681
2006-03-20 10:52:53 +00:00
Ronnie Sahlberg cdf3a2b322 if tcp checksum validation is enabled
and if the checksum is wrong
and if the checksum field is 0x0000

mark the packet as [Checksum Offloaded] and still allow reassembly of
tcp segmetns


since it is most likely just a tco checksum offload engine and not a real checksum error



svn path=/trunk/; revision=17612
2006-03-13 20:50:50 +00:00
Ronnie Sahlberg 27de4cfd39 give se_trees names so that it is easier to debug and to log how often certain trees are accessed
svn path=/trunk/; revision=17587
2006-03-11 13:02:41 +00:00
Gerald Combs f99ad2e895 Handle a null pointer. Fixes bugs 778 and 787.
svn path=/trunk/; revision=17483
2006-03-06 19:49:34 +00:00
Ronnie Sahlberg 8ed89ff326 convert another hashtable for tcp into se_tree
svn path=/trunk/; revision=17470
2006-03-05 05:36:46 +00:00
Ronnie Sahlberg 0881211a12 initial implementation of binary tree support with se allocation scope
this is to test out a basic implementation of binary trees and the api required for the helpers


svn path=/trunk/; revision=17467
2006-03-05 04:01:34 +00:00
Ronnie Sahlberg 2808928c90 make the tcp_acked struct a pointer from the tcpd struct since we might need it hanging around.
only call subdissectors for packets that are NOT keepalives nor zerowindowprobes.


keepalives only contain garbage anyway
and zerowindowproes just contain a single byte of incomplete data so whats the point trying to dissect it further.



svn path=/trunk/; revision=17443
2006-03-02 09:33:49 +00:00
Ronnie Sahlberg f535b4cba1 tcp analysis
RST segments should not be checked for and not marked as
PREVIOUS_SEGMENT_LOST


svn path=/trunk/; revision=17246
2006-02-10 22:24:21 +00:00
Ronnie Sahlberg 63d4b418a6 make sure we actually get the tcpd structure pointer before we pass it as a parameter to a subroutine to dereference it.
fixes bug 719




svn path=/trunk/; revision=17133
2006-01-31 10:27:30 +00:00
Gerald Combs edabe5ed93 Make sure a pointer isn't null before we try to use it. Fixes a current
Buildbot failure.

svn path=/trunk/; revision=17129
2006-01-30 23:29:09 +00:00
Ronnie Sahlberg dab77d86f1 rewrite of the tcp sequence number analysis code to hopefully make it cleaner and easier to maintain and extend.
i have tested it with many captures   but this used to be fragile and delicate code  so there might be some regressions that will need to be addressed once identified.





svn path=/trunk/; revision=17107
2006-01-26 22:50:16 +00:00
Jörg Mayer 1900bf87fc done:
packet-ntp.c: Rather confused and incorrect use of g_snprintf return value
packet-pim.c: whitespace change
packet-icmpv6.c: g_snprintf takes trailing \0 into account, fix off by 1 error
packet-clnp.c: Fix incorrect use of g_snprintf return value
packet-isakmp.c: g_snprintf takes trailing \0 into account
packet-tr.c: Fix incorrect use of g_snprintf return value
packet-radius.c: Fix incorrect use of g_snprintf return value
packet-radius.h: constify a string variable
packet-ldap.c: The return value isn't needed, so don't use it incorrectly
packet-tcp.c: Fix incorrect use of g_snprintf return value
packet-windows-common.c: Remove unneeded DISSECTOR_ASSERT
packet-smb-sidsnooping.c: g_snprintf takes trailing \0 into account
packet-pvfs2.c: g_snprintf takes trailing \0 into account
packet-ptp.c: Remove #include snprintf
packet-ppp.c: Fix incorrect use of g_snprintf return value
packet-ospf.c: Fix incorrect use of g_snprintf return value
packet-mip6.c: snprintf -> g_snprintf
packet-bootp.c: Remove a commented out bad use of g_snprintf
packet-ber.c: snprintf -> g_snprintf, g_snprintf takes trailing \0 into account

2do:

     52 packet-ieee80211.c: 2DO
      2 packet-nfs.c: 2DO - too many side effects
     33 packet-bgp.c: 2DO
     18 packet-dns.c: 2DO
     14 packet-dcm.c: 2DO
     13 packet-x11.c: 2DO
     11 packet-kerberos.c: 2DO
     10 packet-diameter.c: 2DO
      9 packet-snmp.c: 2DO
      9 packet-pgm.c: 2DO
      7 packet-nbns.c: 2DO
      6 packet-fcswils.c: 2DO
      5 packet-wccp.c: 2DO
      5 packet-cops.c: 2DO
      4 packet-wtp.c: 2DO


svn path=/trunk/; revision=17038
2006-01-16 07:59:44 +00:00
Ronnie Sahlberg 9b61e75bb6 dunt put ACK number in COL_INFO or in the decode pane if the ACK bit is not set
svn path=/trunk/; revision=16884
2005-12-22 23:23:25 +00:00
Guy Harris b018becab3 Get rid of an unused variable.
svn path=/trunk/; revision=16531
2005-11-17 11:15:26 +00:00
Ronnie Sahlberg 117f754846 remove some strcpy and strcat
svn path=/trunk/; revision=16238
2005-10-16 01:41:48 +00:00
Ronnie Sahlberg 4e4f6d67fa in svn 15335 the tcp analysis was changed to do its stuff and to populate (prepend to) COL_INFO before callking the subdissectors
instead of calling the tcp analysis (and prepend colingo) eitehr after the subdissector returned normally  or if an exception caused by a subdissector was rised.

this as a sideffect caused tcp analysis data to be overwritten if the subdissector caused any output to the info column. (and made tcp analysis suboptimal)


this change adds a new function   col_prepend_fence_fstr()  that will prepend
the info column with the string and also, if there was no fence already defined, create a fence and set it after the prepended col info text.

This way, even if the subdissectors generate and rewrite col info, the tcp analysis data will still be displayed on the info column.



svn path=/trunk/; revision=16116
2005-10-04 13:34:52 +00:00
Anders Broman 0f2584c4d2 - Make the reassemble TCP preference default TRUE.
- in dissect_tpkt_encap() only check the desegment flag passed in the function.


svn path=/trunk/; revision=16016
2005-09-27 05:39:58 +00:00
Guy Harris b7b80d94be Move a pile of protocol-related headers from the top-level source
directory to the epan directory.  Some of them should perhaps ultimately
be moved to epan/dissectors, if they pertain only to stuff exported by a
particular dissector.

Fix Gerald's e-mail address in files we're moving.

svn path=/trunk/; revision=15844
2005-09-17 00:02:31 +00:00
Guy Harris 51875708f2 Add some braces to squelch a compiler warning.
Fix up indentation.

svn path=/trunk/; revision=15759
2005-09-11 22:19:41 +00:00
Ulf Lamping 642467ad5c I'm adding the "Expert Info" prototype now, as it seems to be in a state where others might have a look and probably already find it useful :-). Anyway, we can easily disable it at one or two places in the code if it get's in our way of a new release.
Please see: http://wiki.ethereal.com/Development/ExpertInfo for a complete overview of the intended feature and it's current state of implementation.

While I'm working on this, I've also added some more status result codes to the DCE/RPC and DCOM dissectors.

svn path=/trunk/; revision=15754
2005-09-11 16:55:34 +00:00
Ronnie Sahlberg 00a6b757ac There will be a lot of tcp_unacked data structures we only need to keep
around until they have been acked.
Use a slab allocator for these structs so that we dont keep the structs around in memory longer than we need to.



svn path=/trunk/; revision=15546
2005-08-26 23:05:38 +00:00
Ulf Lamping 6f43fbb2f0 EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry!
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ...

What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere.

As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon.

Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way...

As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number...

svn path=/trunk/; revision=15520
2005-08-24 21:31:56 +00:00
Ulf Lamping 06c86303e7 The protocol item in the protocol tree will have a gray background now, which makes it much better visible.
Add some more optional flags to the protocol items, so more "special cases" can be marked in the protocol tree.

New flags:
/** The protocol field has a bad checksum */
FI_CHECKSUM_ERROR
/** The protocol field has an unusual sequence (e.g. TCP window is zero) */
FI_SEQUENCE_WARNING
/** The protocol field has a bad sequence (e.g. TCP segment is lost) */
FI_SEQUENCE_ERROR

svn path=/trunk/; revision=15499
2005-08-21 15:23:48 +00:00
Guy Harris ccbb97ed45 Do the sequence number analysis *before* dissecting the payload, so we
don't have to worry about catching exceptions in the payload dissection
and doing the sequence number analysis - we weren't doing so in one
place.  That also puts the sequence number analysis *before* the "TCP
payload" entry for payload being reassembled into a later packet.

XXX - should we do the tapping before dissecting the payload, too, so
that it gets done even if we throw an exception?

svn path=/trunk/; revision=15335
2005-08-13 07:30:57 +00:00
Ronnie Sahlberg 5eda7935dd some gmemchunk -> se_alloc() improvements for tcp
svn path=/trunk/; revision=15325
2005-08-12 23:46:46 +00:00
Jörg Mayer 2b2506f0f6 More char -> const char warning fixes
svn path=/trunk/; revision=15222
2005-08-05 13:10:58 +00:00
Guy Harris 0c5af0dde6 If we do reassembly and hand the packet to the dissector, and the
dissector says "sorry, I need even more data in this packet", don't flag
that packet as being reassembled in that frame.  Indicate that we should
perhaps do all the "partial reassembly" stuff in
"fragment_set_partial_assembly()", which would obviate the need for the
hack in the TCP dissector.

Clean up indentation.

svn path=/trunk/; revision=15139
2005-07-29 07:14:32 +00:00
Ronnie Sahlberg 85f38ef5fa For packets flagged as Retransmission
calculate RTO as the delta between the retransmitted frame and the last previous frame seen for this session (in the same direction).

while this is technically not the RTO  this delta is in most cases more important/useful than the tru RTO anyway since this measure represents the amount of thiime that the link went idle  while waiting for an RTO.




It would be nice with a statistics tap for TCP where one couls see, seeion by session :
Length in time of the session.
Total bytes transferred
Number of retransmissions
Time spent waiting for an RTO
Time spent waiting for an RTO in % of the total time.




svn path=/trunk/; revision=14890
2005-07-10 05:27:38 +00:00
Ulf Lamping 2c30357c48 checksum messages: use "[correct]" instead of "(correct)" and other "alike" messages
svn path=/trunk/; revision=14880
2005-07-08 22:11:13 +00:00
Ulf Lamping fdb5b1af02 just to get things straight: a dissector should *never* do any g_assert() calls!
in a simple approach, I've replaced all g_assert() and g_assert_not_reached() calls by their exception throwing counterparts DISSECTOR_ASSERT() and DISSECTOR_ASSERT_NOT_REACHED()

this will replace application crash by showing a dissector bug, which is the desired behaviour

there were some g_assert calls in the protocol registering functions, which might not be acting as expected now, but to be able to simply search for g_assert in the future I've replaced that calls too

one g_assert remained, the one when someone throws an unknown exception "into" packet_frame.c, but IMHO this one should remain.

svn path=/trunk/; revision=14608
2005-06-10 18:28:22 +00:00
Anders Broman bd44e72c95 From Mike Duigou:
A minor change to the prototype of tcp_dissect_pdus() 
which uses the function pointer type from packet.h

svn path=/trunk/; revision=14535
2005-06-03 06:31:58 +00:00
Ulf Lamping e2c3b60280 add a generated toplevel line between the TCP protocol and the desegmented content, to better understand what's going on while desegmenting.
We'll have to add similar mechanisms for other protocols as well...

svn path=/trunk/; revision=14527
2005-06-02 18:52:55 +00:00
Ulf Lamping 4929e662b8 [CHECKSUM INCORRECT] -> [TCP CHECKSUM INCORRECT]
svn path=/trunk/; revision=14056
2005-04-12 21:07:48 +00:00
Ulf Lamping fd61b593c0 buildbot bugfix: add another tvb_ensure_bytes_exist()
svn path=/trunk/; revision=13932
2005-03-27 10:53:14 +00:00
Ronnie Sahlberg 9378b4f6b4 in sack options only look for tcp session metadata if both tcp_analysis and tcp_relative preferences are set. relative depends on analysis
svn path=/trunk/; revision=13398
2005-02-14 19:34:59 +00:00
Lars Roland ec9ca01616 Move the following files from /trunk to /trunk/epan:
asn1.[ch]
follow.[ch]
ptvcursor.[ch]
reassemble.[ch]
xmlstub.[ch]

fix #include statements accordingly.

svn path=/trunk/; revision=13366
2005-02-09 23:38:00 +00:00
Anders Broman 851ecd2ac4 From Jon Ringle:
1) Added a setup_frame parameter to conversation_t
2) Used the conversation_t next to maintain a list of conversations with the 
same src/dest tuple but different setup_frame number.
3) Changed the signature of find_conversation() and conversation_new() to pass 
in the frame number.
4) Adjusted packet-sdp to select RTP conversation if both m=audio and m=image 
are present, and T.38 conversation if only m=image is present. I expect that 
RTP/T.38 dissecting to be better, but I don't have a way to generate T.38 
packets.

svn path=/trunk/; revision=13243
2005-02-02 20:07:03 +00:00
Guy Harris 1dcecc733a Get rid of an extra space after the edge value of a SACK item if
relative sequence numbers aren't being used.

svn path=/trunk/; revision=13164
2005-01-24 00:18:13 +00:00
Ronnie Sahlberg 91548c85da SACK prettyfication
svn path=/trunk/; revision=13141
2005-01-20 13:19:11 +00:00
Ronnie Sahlberg 85c7eb84fd make TCP SACK option handle relative sequence numbers
svn path=/trunk/; revision=13140
2005-01-20 12:29:11 +00:00
Ulf Lamping 5a89cfc00b Again, some warnings removed.
svn path=/trunk/; revision=12834
2004-12-25 18:35:21 +00:00
Ulf Lamping 78ff68d4b5 a lot of warnings removed, most of them about pointer to int casts without using the appropriate GLib macros
svn path=/trunk/; revision=12832
2004-12-25 13:49:30 +00:00
Ronnie Sahlberg 6b8c77703e RST segmetns are never WindowFull segments.
svn path=/trunk/; revision=12823
2004-12-23 19:56:29 +00:00
Ronnie Sahlberg d0fbb2596a add detection to TCP Analysis to detect and flag segments that will completely fill the window advertized from the other side.
I.e. when a segment is seen that would (as far as ethereal can tell from the ACKs it has seen in the other direction) fill the window completely.

It is similar to but not exactly the same as the XeroWindow detection since there are many instances where ZeroWindow detection would not work (i.e. an ACK where win==0    since many many situations occur where the window is full but no zerowindowack is ever generated)


Someone that has good english could, please, update the Wiki with this option.
It is very very useful to spot performance issues where the tcp window size is too small to accomodate the enmd-to-end latency.





svn path=/trunk/; revision=12774
2004-12-19 07:18:04 +00:00