on Rac Environment UDP protocol is used for cache fusion. (BTW, UDP and RDS protocols are supported in UNIX platform --Exadata ; whereas Windows uses TCP protocol).
UDP : is an higher level protocol stack, and it is implemented over IP Protocol ( UDP/IP). Cache Fusion uses UDP protocol to send packets over the wire (Exadata uses RDS protocol though).
UDP protocol, fragmentation, and assembly
The Maximum Transmission Unit (MTU) size is the maximum packet size in bytes that a network interface can send over a network device. This size includes the protocol information, such as the TCP and IP headers. This size does not contain the Ethernet header. This study is concerned with the MTU settings that can be set in the configuration files in SLES, for example, in /etc/sysconfig/network/ifcfg-qeth-bus-ccw-0.0.0xxx for each device. The effective MTU size is also negotiated during the connection creation with the other end point, and the MTU can be reduced to the capacity of that device.
When the MTU is smaller than the packet size, the data must be divided into MTU sized packets. On the receiving side the packets must be reassembled, thus creating overhead that scales with the quantity of packages required. When the MTU is only slightly too small, there can also be wasted bandwidth. For example, when the MTU is slightly smaller than the average packet size the secondary packet can be almost empty.
An MTU size bigger than the packet size should have no impact on the network bandwidth, if all intermediate nodes on the path to the final destination support the MTU size, because only the real data are sent. But the number of packages processed in parallel is calculated with the TPC/IP windows size and the MTU size. When the window size stays constant and the MTU size is increased, this number is decreased, which might lead to a performance degradation, when the smaller MTU size would be appropriate as well.
Let us consider an example of MTU set to 3000 in a network interface. One 8K block transfer can not be performed with just one IP packet as the IP packet size (3000 bytes) is less than 8K. So, one transfer of UDP packet of 8K size is fragmented to 3 IP packets and sent over the wire. In the receiving side, those 3 packets are reassembled to create one UDP buffer of size 8K. After the assembly, that UDP buffer is delivered to an UDP port of a UNIX process. Usually, a foreground process will listen on that port to receive the UDP buffer.
Consider what happens If MTU is set to 9000 in the network interface: Then 8K buffer can be transmitted over the wire with just one IP packet. There is no need for fragmentation or reassembly with MTU=9000 as long as the block size is less than 8K. MTU=9000 is also known as jumbo frame configuration. ( But, if the database block size is greater than jumbo frame then fragmentation and reassembly is still required. For example, for 16KB size, with MTU=9000, there will three 1K IP packets and one 7K IP packet to be transmitted).
Fragmentation and reassembly is performed at OS Kernel layer level and hence it is the responsibility of Kernel and the stack below to complete the fragmentation and assembly. Oracle code simply calls the send and receive system calls, passes the buffers to populate.
UDP vs TCP
From RAC point of view, UDP is the right choice over TCP for cache fusion traffic. With TCP/IP, for every packet transfer has overhead, connection need to be setup, packet sent, and the process must wait for TCP Acknowledgement before considering the packet send as complete. In a busy RAC systems, we are talking about 2-3 milli-seconds for packet transfer and with TCP/IP, we probably may not be able to achieve that level of performance. With UDP, packet transfer is considered complete, as soon as packet is sent and error handling is done by Oracle code itself. As you know, reliable network is a key to RAC stability, if much of packets (closer to 100%) are sent without any packet drops, UDP is a good choice over TCP/IP for performance reasons.
If there are reassembly failures, then it is a function of unreliable network or kernel or something else, but nothing to do with the choice of UDP protocol itself. Of course, RDS is better than UDP as the error handling is offloaded to the fabric, but usually require, infiniband fabric for a proper RDS setup. For that matter, VPN connections use UDP protocol too.
What happens if an IP packet is lost, assuming MTU=3000 bytes?
From the wireshark files with mtu3000, you will see that each of the packet have a Fragment offset. That fragment offset and IP identification is used to reassemble the IP packets to create 8K UDP buffer. Consider that there are 3 puzzle pieces, each puzzle piece with markings, and Kernel uses those markings( offset and IP ID) to reassemble the packets. Let’s consider the case, one of 3 packet never arrived, then the kernel threads will keep those 2 IP packets in memory for 64 seconds( Linux kernel parameter ipfrag_time controls that time) before declaring reassembly failure. Without receiving the missing IP packet, kernel can not reassemble the UDP buffer, and so, reassembly failure is declared.
Oracle foreground process will wait for 30 seconds (it used to be 300 seconds or so in older version of RAC) and if the packet is not arrived within that timeout period, FG process will declare a ("gc cr block lost" and/or "gc current block lost") and re-request the block. Of course, kernel memory allocated for IP fragmentation and assembly is constrained by Kernel parameter ipfrag_high_thres and ipfrag_low_thres and lower values for these kernel parameters can lead to reassembly failures too (and that’s why it is important to follow all best practices from RAC installation guides).
[root@west02 ~]# netstat -s |grep assem
453433 reassemblies required
43380 packets reassembled ok
3180797 packet reassembles failed --- if GC loss occurred and cluster wait increase
Oracle Clusterware & Oracle RAC instances rely on heartbeats for node memberships. If network Heartbeats are consistently dropped, Instance/Node eviction may occur. The Symptoms below are therefore relevant for Node/Instance evictions.
1. "gc cr block lost" / "gc current block lost" in top 5 or significant wait event
2. SQL traces report multiple gc cr requests / gc current request /
3. gc cr multiblock requests with long and uniform elapsed times
4. Poor application performance / throughput
5. Packet send/receive errors as displayed in ifconfig or vendor supplied utility
6. Netstat reports errors/retransmits/reassembly failures
SQL SCRIPT :
B.VALUE "GC BLOCKS CORRUPT 1",
C.VALUE "GC BLOCKS LOST 2",
D.VALUE "GC BLOCKS CORRUPT 2"
FROM GV$SYSSTAT A,
GV$SYSSTAT B,
GV$SYSSTAT C,
GV$SYSSTAT D
WHERE A.INST_ID = 1
AND A.NAME = 'gc blocks lost'
AND B.INST_ID = 1
AND B.NAME = 'gc blocks corrupt'
AND C.INST_ID = 2
AND C.NAME = 'gc blocks lost'
AND D.INST_ID = 2
AND D.NAME = 'gc blocks corrupt';
The parameters in /proc/sys/net/ipv4 control various aspects of the network, including a parameter that controlls the reassembly buffer size.
ipfrag_high_threshold specifies that maximum amount of memory used to reassemble IP fragments. When the memory used by fragments reaches ipfrag_high_threshold, old entries are removed until the memory used declines to ipfrag_low_threshold.
If the output of netstat shows increasing amounts of IP fragment reassembles failing, we recommend to increase ipfrag_high_threshold. The impact can be significant. In some use cases, increasing this buffer space improved throughput from 32MB/sec to 80MB/sec.
To temporarily change the value of ipfrag_high_threshold, use this command as root:
[root@west01 ~]# cat /proc/sys/net/ipv4/ipfrag_high_thresh
4194304
[root@west01 ~]# cat /proc/sys/net/ipv4/ipfrag_low_thresh
3145728
Change Parameter :
[root@west01 ~]#echo "Value" > /proc/sys/net/ipv4/ipfrag_high_threshold
OR
[root@west02 ~]# sysctl -a|grep ipfrag
net.ipv4.ipfrag_high_thresh = 4194304
net.ipv4.ipfrag_low_thresh = 3145728
net.ipv4.ipfrag_max_dist = 64
net.ipv4.ipfrag_secret_interval = 0
net.ipv4.ipfrag_time = 30
BTW, there are few other reasons for 'gc lost packets' too. High CPU usage also can lead to 'gc lost packets' failures too, as the process may not have enough cpu time to drain the buffers, network buffers allocated for that process becomes full, and so, kernel will drop incoming packets.
It is probably better to explain these concepts visually. So, I created a video. When you watch this video, notice that there is HD button on the top of the video. Play this in HD mode so that you will have better learning experience.
Oracle Enterprise Session Border Controller (E-SBC) : connects disparate Internet Protocol (IP) communications networks while mitigating security threats, curing interoperability problems, and ensuring reliable communications. It protects and controls real-time voice, video, and Unified Communications (UC) as they traverse IP network borders.
Errors :
Process termination requested for pid 6440 [source = rdbms], [info = 2] [request issued by pid: 52630, uid: 211819489]
Errors in file /opt/oracle/app/orcl/diag/rdbms/regtxndb/regtxndb1/trace/regtxndb1_m000_52909.trc (incident=121694) (PDBNAME=CDB$ROOT):
ORA-00603: ORACLE server session terminated by fatal error
ORA-27504: IPC error creating OSD context
ORA-27300: OS system dependent operation:sendmsg failed with status: 105
ORA-27301: OS failure message: No buffer space available
ORA-27302: failure occurred at: sskgxpsnd2
