Duplicate ping error with network bonding driver in Linux
Starting with version 3.0.2, the bonding driver has logic to suppress duplicate packets, which should largely eliminate this problem. The following description is kept for reference.
It is not uncommon to observe a short burst of duplicated traffic when the bonding device is first used, or after it has been idle for some period of time. This is most easily observed by issuing a “ping” to some other host on the network, and noticing that the output from ping flags duplicates (typically one per slave).
For example, on a bond in active-backup mode with two slaves all connected to one switch, the output may appear as follows:
This is not due to an error in the bonding driver, rather, it is a side effect of how many switches update their MAC forwarding tables. Initially, the switch does not associate the MAC address in the packet with a particular switch port, and so it may send the traffic to all ports until its MAC forwarding table is updated. Since the interfaces attached to the bond may occupy multiple ports on a single switch, when the switch (temporarily) floods the traffic to all ports, the bond device receives multiple copies of the same packet (one per slave device).
The duplicated packet behavior is switch dependent, some switches exhibit this, and some do not. On switches that display this behavior, it can be induced by clearing the MAC forwarding table (on most Cisco switches, the privileged command “clear mac address-table dynamic” will accomplish this).
Would anyone be so kind to explain to me the function of dup() in UNIX? As far as I am concerned, it duplicates a file descriptor. Under what circumstances would we need to duplicate a file descriptor in a UNIX environment?
Thank you.
vinchen (3 Replies)
I have met this code:
switch(fork()) {
case 0:
close(1);
dup(p);
close(p);
close(p);
execvp(<whatever>);
perror("Exec failed");
}
Can anyone tell me what this piece of code does?
Thx alot.. (1 Reply)
I'm having difficulty understanding the purposes of using dup/dup2 when involving forks.
for example, if we call fork() once, that is, we are creating a child process. In what cases would we need to use dup or dup2 to duplicate the file descriptors for standard output and standard error? What... (1 Reply)
Hi, I use this function (now modified with elif) for check if a pc is up: check_pc() {
$PING $PC 1 2> /dev/null
if ; then
check_dir #Other function
echo "Begin backup operation for $PC"
echo "$SMBTAR -s $PC -u $USER -p $PASS -x $SHARE$EXCL -t - | gzip -c >... (3 Replies)
when i want to replace standard output with output file
int out;
out = open("out", O_WRONLY)p;
dup2(out,1);
What Shall I do in case of appending??? I am using here O_WRONLY TO WRITE.BUT IF i wanna append, whats the word? (5 Replies)
Hi,
I have a requirement where I have to identify duplicates from a file based on the first 6 chars (It is fixed width file of 12 chars length) and whenever a duplicate row is found, its original and duplicate row's last 2 chars should be updated to all 0's if they are not same. (I mean last 2... (3 Replies)
Hi Gurus,
I need to count the duplicate records in file
file
abc
abc
def
ghi
ghi
jkl
I want to get below result:
abc ,2
abc, 2
def ,1
ghi ,2
ghi, 2
jkl ,1
or
abc ,2
def ,1 (3 Replies)
help with bash script!
im am working on this script to make sure my server will stay online, so i made this script..
HOSTS="192.168.138.155"
COUNT=4
pingtest(){
for myhost in "$@"
do
ping -c "$COUNT" "$myhost" &&return 1
done
return 0
}
if pingtest $HOSTS
#100% failed... (4 Replies)
The problematic directory is the following:
/root/.cache/deja-dup
This directory grows until my "/" is full and then the restoring activity fails.
I already tried to create a symbolic link with origin another partition where I have more space. However during the restoring activity ... (4 Replies)