The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
.
google unix.com



IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Dumping network packets smanu UNIX for Dummies Questions & Answers 1 08-01-2007 01:01 PM
Packets Getting Lost S.P.Prasad High Level Programming 4 11-24-2003 12:36 PM
Redirecting outgoing packets Seraph IP Networking 1 08-08-2003 10:40 PM
NAT Packets/Port Openine MartinD IP Networking 3 08-21-2002 05:04 AM
sending packets Avatar0fEvil UNIX for Dummies Questions & Answers 8 03-26-2002 04:03 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-16-2006
damn_bkb damn_bkb is offline
Registered User
  
 

Join Date: Nov 2006
Location: india
Posts: 16
counting the packets

there are a number of clients connected to a server.... how can i count that each clients recieve ...? how do i moniter the activity of the client..?
  #2 (permalink)  
Old 11-16-2006
!_30's Avatar
!_30 !_30 is offline
Registered User
  
 

Join Date: Sep 2006
Location: Romania
Posts: 37
Tcpdump , ethereal , not worthy ? Multithreaded aplication ?


If you wanna measure/count how many bytes does a client receive ( on the server side ) , you can easily implement a contor , for receive bytes.Suposing that all byte's receive by one client are send by the server , it's easy to make something like :


Code:
send(j,da,sizeof(da), 0);

Let's say da is the string passed to the client ( a client J ).You incremenent a contor so measure how many bytes are transfered to the client.

Let's say I send 4 bytes to the client ( once ) and then 3 .. I can do this.


Code:
int j;
int TRAFIC=0; /* start 0 bytes transfered to client j */
nbytes=send(da,sizeof(da),0);
TRAFIC=TRAFIC+nbytes;

So if all trafic to a specified client , is send by the server to that client , you can easily count how many bytes , are received by the client J .


Hope it help !
  #3 (permalink)  
Old 11-17-2006
damn_bkb damn_bkb is offline
Registered User
  
 

Join Date: Nov 2006
Location: india
Posts: 16
using C

i am planning to implement this in unix system and want to do this using C as that is the language that know well.... how doi start with it?
Closed Thread

Bookmarks

« Dns | NAT question »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On




All times are GMT -4. The time now is 09:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0