03-08-2009
Yes, it is really essential!!
For one thing, consider a socket that has sent the final packet which is an ACK to acknowledge the final FIN packet. If everything works right, this is the end of the connection. But what if that final ACK packet gets lost? The other side will timeout and retransmit the final FIN. A socket in TIME_WAIT will be able to retransmit that final ACK, thus allowing the other side to close down.
The other problem is wandering duplicates, packets which seemed to have disappeared, but really just got lost for a while and then finally arrived. A socket in TIME_WAIT has enough information to recognize them for what they are, and simply discard them. If the socket was destroyed somehow and a new connection is established that looks like the old connection, wandering duplicates from the first connection will be delivered to the second connection, possibly injecting garbage into the data stream.
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
My machine is Enterprise 250, solaris 2.6, with Oracle 9iApplication Server( 1022) and Apache 1.3 running.
The problem is the machine appears to be slow when accessed from remote. when we login, it takes time to connect, when we type it appears after some time and so on...
I have... (3 Replies)
Discussion started by: shibz
3 Replies
2. IP Networking
Why would I get TIME_WAIT when i netstat a port?? What would be some scenarios of this situation?? (1 Reply)
Discussion started by: eloquent99
1 Replies
3. UNIX for Advanced & Expert Users
What is the maximum number of TCP ports that can be consumed at any one time? How can I determine what the number is or increase it?
I was under the impression that with our system (UnixWare 7.1.1) 1024 was the maximum under our current Kernel tuning parms, but I think that is really just... (4 Replies)
Discussion started by: dlkox
4 Replies
4. Solaris
One of my zone is stuck in down state, not able to boot it or halt it .. not even detach .. is there any way to recover without rebooting the whole system ( global zone ) ? (3 Replies)
Discussion started by: fugitive
3 Replies
5. Red Hat
Hi,
I want to kill TCP connections which have status as TIME_WAIT & no PID
(as per the output of the "netstat - p" command).
Is there any command/utility available to kill connections to a specific port or IP address.
The problem is that these connections don't have process ID (see... (4 Replies)
Discussion started by: Davinder31may
4 Replies
6. UNIX for Dummies Questions & Answers
Server has more TIME_WAIT connections in Apache(port 80) Hi,
My webserver has 16GB of RAM and CentOS 5.5, Apache 2.2.3, It's shared webserver used of for webhosting. I have optmized the server as :
<IfModule prefork.c>... (4 Replies)
Discussion started by: chandranjoy
4 Replies
7. Solaris
Hi all,
One of my zone is stuck in down state, not able to boot it or halt it
root@xpm9ka1 # zoneadm list -iv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
2 bsmrxdb4 down /zones/bsmrxdb4 native shared
root@xpm9ka1 # zoneadm -z bsmrxdb4 boot
zoneadm: zone... (6 Replies)
Discussion started by: peppeunz
6 Replies
8. AIX
Hi Admins,
I am having a whole system lpar in open firmware state on HMC.
How can I bring it to running state ?
Let me know. Thanks. (2 Replies)
Discussion started by: snchaudhari2
2 Replies
9. Web Development
Here is very good video from Evan You, founder of Vue.js, on the state of Vue.js
State of Vuenation with Evan You
Here is a nice PDF report on Vue.js
Update State of Vue.js Report
Vue.js is now the second most starred project on GitHub, recently surpassing Bootstrap.
These two... (0 Replies)
Discussion started by: Neo
0 Replies
LEARN ABOUT LINUX
adjtimex
ADJTIMEX(2) Linux Programmer's Manual ADJTIMEX(2)
NAME
adjtimex - tune kernel clock
SYNOPSIS
#include <sys/timex.h>
int adjtimex(struct timex *buf);
DESCRIPTION
Linux uses David L. Mills' clock adjustment algorithm (see RFC 1305). The system call adjtimex() reads and optionally sets adjustment
parameters for this algorithm. It takes a pointer to a timex structure, updates kernel parameters from field values, and returns the same
structure with current kernel values. This structure is declared as follows:
struct timex {
int modes; /* mode selector */
long offset; /* time offset (usec) */
long freq; /* frequency offset (scaled ppm) */
long maxerror; /* maximum error (usec) */
long esterror; /* estimated error (usec) */
int status; /* clock command/status */
long constant; /* pll time constant */
long precision; /* clock precision (usec) (read-only) */
long tolerance; /* clock frequency tolerance (ppm)
(read-only) */
struct timeval time; /* current time (read-only) */
long tick; /* usecs between clock ticks */
};
The modes field determines which parameters, if any, to set. It may contain a bitwise-or combination of zero or more of the following
bits:
#define ADJ_OFFSET 0x0001 /* time offset */
#define ADJ_FREQUENCY 0x0002 /* frequency offset */
#define ADJ_MAXERROR 0x0004 /* maximum time error */
#define ADJ_ESTERROR 0x0008 /* estimated time error */
#define ADJ_STATUS 0x0010 /* clock status */
#define ADJ_TIMECONST 0x0020 /* pll time constant */
#define ADJ_TICK 0x4000 /* tick value */
#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime() */
Ordinary users are restricted to a zero value for mode. Only the superuser may set any parameters.
RETURN VALUE
On success, adjtimex() returns the clock state:
#define TIME_OK 0 /* clock synchronized */
#define TIME_INS 1 /* insert leap second */
#define TIME_DEL 2 /* delete leap second */
#define TIME_OOP 3 /* leap second in progress */
#define TIME_WAIT 4 /* leap second has occurred */
#define TIME_BAD 5 /* clock not synchronized */
On failure, adjtimex() returns -1 and sets errno.
ERRORS
EFAULT buf does not point to writable memory.
EINVAL An attempt is made to set buf.offset to a value outside the range -131071 to +131071, or to set buf.status to a value other than
those listed above, or to set buf.tick to a value outside the range 900000/HZ to 1100000/HZ, where HZ is the system timer interrupt
frequency.
EPERM buf.mode is nonzero and the caller does not have sufficient privilege. Under Linux the CAP_SYS_TIME capability is required.
CONFORMING TO
adjtimex() is Linux-specific and should not be used in programs intended to be portable. See adjtime(3) for a more portable, but less
flexible, method of adjusting the system clock.
SEE ALSO
settimeofday(2), adjtime(3), capabilities(7), time(7)
COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2004-05-27 ADJTIMEX(2)