USNavalResearchLaboratory / mgen

Multi-Generator (MGEN) traffic generation tool
https://www.nrl.navy.mil/itd/ncs/products/mgen
Other
83 stars 25 forks source link

Sending large TCP messages loop issue #11

Closed jordanauge closed 4 years ago

jordanauge commented 4 years ago

Hello,

We observe an issue with the master branch (which interests us because of analytics functionalities) when generating large TCP messages through the following :

Client:

$ cat client.conf 
0.0 ON 1 TCP DST 192.168.2.2/5000 PERIODIC [1 10000000] COUNT 1
$ mgen input client.conf txlog debug 99

Server:

$ cat server.conf 
0.0 LISTEN TCP 5000
$ mgen input server.conf output server.drc 

The output is:

$ mgen input client.conf txlog debug 99
[...]
enter ProtoSocket::Connect() ...
06:46:40.792108 ON flow>1 srcPort>38151 dst>192.168.2.2/5000 
06:46:40.804052 CONNECT flow>1 srcPort>38151 dst>192.168.2.2/5000 
Proto Debug: MgenFlow::SendMessage() error sending message flow>1 seq>0.
06:46:41.792286 SEND proto>TCP flow>1 seq>0 srcPort>38151 dst>192.168.2.2/5000 size>10000000 
Proto Debug: MgenFlow::SendMessage() error sending message flow>1 seq>0.
06:46:42.140386 SEND proto>TCP flow>1 seq>0 srcPort>38151 dst>192.168.2.2/5000 size>10000000 
[...]

and the pattern repeats indefinitely.

It seems the issue is related to MgenTcpTransport::SendMessage returning MSG_SEND_BLOCKED. It does not trigger with shorter messages (eg. with [1 1000000]), as the socket buffer likely absorbs the burst of traffic and the MgenTcpTransport::SendMessage() functions returns MSG_SEND_OK, nor when testing version 5.02.c.

Thanks

ljt-git commented 4 years ago

jordanauge - am currently looking into these issues you have reported, fyi.

ljt-git commented 4 years ago

This bug has been fixed.