Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F122663358
tcpanalyzer.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jul 21, 10:43
Size
2 KB
Mime Type
text/x-c++
Expires
Wed, Jul 23, 10:43 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27537516
Attached To
R6591 HyMAB
tcpanalyzer.hh
View Options
#ifndef CLICK_TCPANALYZER_HH
#define CLICK_TCPANALYZER_HH
#include <click/element.hh>
#include <clicknet/tcp.h>
#include <click/error.hh>
#include <click/timer.hh>
#include "util.hh"
CLICK_DECLS
class
TcpAnalyzer
:
public
Element
{
public
:
TcpAnalyzer
();
~
TcpAnalyzer
();
// analyze a TCP flows (timeouts, duplicate acks, etc.)
// it assumes that sequence number will not wrap, so do not run it too long!
const
char
*
class_name
()
const
{
return
"TcpAnalyzer"
;
}
const
char
*
port_count
()
const
{
return
"1-2/1-2"
;
}
int
configure
(
Vector
<
String
>
&
,
ErrorHandler
*
);
int
initialize
(
ErrorHandler
*
);
void
push
(
int
,
Packet
*
);
void
run_timer
(
Timer
*
);
// Handlers
void
add_handlers
();
static
int
debug_handler
(
const
String
&
,
Element
*
,
void
*
,
ErrorHandler
*
);
static
int
active_handler
(
const
String
&
,
Element
*
,
void
*
,
ErrorHandler
*
);
static
int
freq_print_debug_handler
(
const
String
&
,
Element
*
,
void
*
,
ErrorHandler
*
);
void
set_active
(
bool
b
)
{
_active
=
b
;}
void
set_debug
(
bool
b
)
{
_debug
=
b
;}
void
set_verb_debug
(
bool
b
)
{
_verb_debug
=
b
;}
void
set_print_retransmission
(
bool
b
)
{
_print_retransmission
=
b
;}
void
set_freq_print_debug
(
int
n
)
{
_freq_print_debug
=
n
;}
private
:
// TODO: replace IPAddress with flow information (e.g. src_ip:src_port, dst_ip_dst:port)
bool
_debug
;
bool
_verb_debug
;
bool
_active
;
bool
_print_retransmission
;
bool
_check_retransmission
;
int
_freq_print_debug
;
// in ms
Timer
_timer
;
Timer
_end_timer
;
Timestamp
_now
;
IPAddress
_my_ip
;
int
alpha_ts
;
// alpha for EWMA
HashTable
<
IPAddress
,
HashTable
<
uint32_t
,
Timestamp
>
>
_seq2ts
;
HashTable
<
IPAddress
,
HashTable
<
uint32_t
,
int
>
>
_count_dup_acks
;
HashTable
<
IPAddress
,
HashTable
<
uint32_t
,
int
>
>
_repeated_transmissions
;
HashTable
<
IPAddress
,
uint32_t
>
_next_seq
;
HashTable
<
IPAddress
,
int
>
_packets_sent
;
HashTable
<
IPAddress
,
int
>
_packets_sent_iteration
;
HashTable
<
IPAddress
,
int
>
_acks_received
;
HashTable
<
IPAddress
,
int
>
_acks_received_iteration
;
HashTable
<
IPAddress
,
int
>
_amb_acks
;
// ambiguous acks
HashTable
<
IPAddress
,
int
>
_timeouts
;
// timeouts
HashTable
<
IPAddress
,
int
>
_timeouts_iteration
;
// timeouts
HashTable
<
IPAddress
,
int
>
_count_dup_acks_iteration
;
HashTable
<
IPAddress
,
int
>
_repeated_transmissions_iteration
;
HashTable
<
IPAddress
,
Timestamp
>
_rtt_est
;
// estimation of RTT
HashTable
<
IPAddress
,
Timestamp
>
_rtt_std_est
;
// estimation of RTT std dev
};
CLICK_ENDDECLS
#endif
Event Timeline
Log In to Comment