Networking Forums

Networking Forums > Computer Networking > Linux Networking > tcp time measure

Reply
Thread Tools Display Modes

tcp time measure

 
 
Stephan Absmeier
Guest
Posts: n/a

 
      09-29-2003, 10:51 AM
Hi,

I did some time measure on tcp. I used SO_LINGER.

linger lingervalue;
lingervalue.l_onoff=1;
lingervalue.l_linger=32767;
setsockopt(mySocket,SOL_SOCKET,SO_LINGER,(char*)&l ingerwert,sizeof(lingerwert));

then I did:

typedef long long s64;
inline s64 getRealTime() {
s64 result;
__asm__ __volatile__ ("rdtsc" : "=A" (result));
return result;
}
s64 start64, end64;
tcpSender testSender2=tcpSender(argv[1],line,length);
testSender2.init(option); //socket,SO_LINGER, bind and connect
start64=getRealTime();
testSender2.work(); //send data
do
closeid=testSender2.end();//close socket
while(closeid<0);
end64 = getRealTime();

I used a 100MBit Ethernet, sitched and Red Hat Linux 9. I did this 10
times and used the middle of the values

I have these problems:
* sending 80000 bytes (17ms) is faster than sending 10240 bytes (40ms)
* sending 800000 bytes is faster then the network (fastest value:2 ms
but it can't be faster then 64 ms)

What did I wrong? SO_LINGER wait til the queue has been send sucessfully.

Any idea is good. I go nuts over this.

Thanks
Stephan

 
Reply With Quote
 
 
 
 
Stephan Absmeier
Guest
Posts: n/a

 
      09-29-2003, 11:14 AM


Arkady Frenkel schrieb:
> But Linger option used only in the case of close of socket


But I closed the socket in the do-while-loop ( end() returns the value
of close(socket) )
0: OK
-1: error


> Arkady
>
> "Stephan Absmeier" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>>Hi,
>>
>>I did some time measure on tcp. I used SO_LINGER.
>>
>>linger lingervalue;
>>lingervalue.l_onoff=1;
>>lingervalue.l_linger=32767;
>>

>
> setsockopt(mySocket,SOL_SOCKET,SO_LINGER,(char*)&l ingerwert,sizeof(lingerwer
> t));
>
>>then I did:
>>
>>typedef long long s64;
>>inline s64 getRealTime() {
>> s64 result;
>> __asm__ __volatile__ ("rdtsc" : "=A" (result));
>> return result;
>>}
>>s64 start64, end64;
>>tcpSender testSender2=tcpSender(argv[1],line,length);
>>testSender2.init(option); //socket,SO_LINGER, bind and connect
>>start64=getRealTime();
>>testSender2.work(); //send data
>>do
>> closeid=testSender2.end();//close socket
>>while(closeid<0);
>>end64 = getRealTime();
>>
>>I used a 100MBit Ethernet, sitched and Red Hat Linux 9. I did this 10
>>times and used the middle of the values
>>
>>I have these problems:
>>* sending 80000 bytes (17ms) is faster than sending 10240 bytes (40ms)
>>* sending 800000 bytes is faster then the network (fastest value:2 ms
>>but it can't be faster then 64 ms)
>>
>>What did I wrong? SO_LINGER wait til the queue has been send sucessfully.
>>
>>Any idea is good. I go nuts over this.
>>
>>Thanks
>>Stephan
>>

>
>
>

Stephan

 
Reply With Quote
 
Arkady Frenkel
Guest
Posts: n/a

 
      09-29-2003, 12:06 PM
But Linger option used only in the case of close of socket
Arkady

"Stephan Absmeier" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I did some time measure on tcp. I used SO_LINGER.
>
> linger lingervalue;
> lingervalue.l_onoff=1;
> lingervalue.l_linger=32767;
>

setsockopt(mySocket,SOL_SOCKET,SO_LINGER,(char*)&l ingerwert,sizeof(lingerwer
t));
>
> then I did:
>
> typedef long long s64;
> inline s64 getRealTime() {
> s64 result;
> __asm__ __volatile__ ("rdtsc" : "=A" (result));
> return result;
> }
> s64 start64, end64;
> tcpSender testSender2=tcpSender(argv[1],line,length);
> testSender2.init(option); //socket,SO_LINGER, bind and connect
> start64=getRealTime();
> testSender2.work(); //send data
> do
> closeid=testSender2.end();//close socket
> while(closeid<0);
> end64 = getRealTime();
>
> I used a 100MBit Ethernet, sitched and Red Hat Linux 9. I did this 10
> times and used the middle of the values
>
> I have these problems:
> * sending 80000 bytes (17ms) is faster than sending 10240 bytes (40ms)
> * sending 800000 bytes is faster then the network (fastest value:2 ms
> but it can't be faster then 64 ms)
>
> What did I wrong? SO_LINGER wait til the queue has been send sucessfully.
>
> Any idea is good. I go nuts over this.
>
> Thanks
> Stephan
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
measure time on internet ..?? Mr. X Linux Networking 7 12-13-2007 06:28 PM
how to measure ? prototype_nsx Wireless Internet 3 08-26-2007 03:34 AM
Measure the Accept Queueing Time! Benjamin Chu Linux Networking 0 01-26-2006 06:31 PM
measure time linda Linux Networking 1 09-19-2003 09:26 PM
how to accurately measure processing time Ramy Asselin Linux Networking 0 09-01-2003 04:23 AM



1 2 3 4 5 6 7 8 9 10 11