## 3 Simulation of Underwater Electric Field Communication  
### Underwater Electric Field Communication Simulation Flow Setup  
Based on the calculation of underwater electric field communication parameters, a simulation of underwater electric field communication multi-node networking was conducted based on CSMA/CA protocol. The simulation process for the underwater multi-node electric field communication network structure based on CSMA/CA is shown in Figure 3. Firstly, the simulation parameters for the multi-node network structure of underwater electric field communication were given, and the nodes and network models participating in the communication were created by setting up links to connect each node to the network model. Secondly, bridge devices were created, protocol stacks were installed, and IP addresses were allocated to all mobile nodes. Then, transmitter and receiver applications were installed, and the configuration of the application packet monitor and device packet monitor was completed. Finally, the port sending and receiving packets for each node were created, data statistics and collection were completed, and the statistical results were output for the entire script simulation run [28]. The parameters for underwater electric field communication were established as shown in Table 1.  
The text describes the installation of a server-side listener on port 9, named echoServer (9). The UdpEchoServerHelper object has an Install method that connects the application to a node. The Install method takes the NodeContainer as a parameter, with an implicit C++ conversion using the result of nodes.Get(1) as the argument. The unnamed NodeContainer is then passed to the Install method. echoServer.Install will install a UdpEchoServerApplication on the node with index \(1\) in the NodeContainer of the manager node. The installation returns a container that includes pointers to all the applications created by the helper. Similarly, the client-side application is set up using a UdpEchoClientHelper to manage the UdpEchoClientApplication. It sends a 14 kbit UDP packet to port 9 of the node after the simulation starts and stops after 10 s.  
By running the NS-3.31-based CSMA/CA visualization interface code via a visualization program, the visualization interface for communication between five nodes of the underwater electric field, Node 0, Node 1, Node 2, Node 3, and Node 4, based on \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Simulation environment & NS-3.31 (version3.31) \\ Operating system & GNU/Linux (Ubuntu18.04.4) \\ Simulation region & \(60\) m \(\times\)\(60\) m \\ Conductivity & \(4\) Sm\({}^{-1}\) \\ Permeability & \(1.257\times 10^{-6}\) Hm\({}^{-1}\) \\ Communication frequency & \(14\) kHz \\ Transmission speed & \(1.871\times 10^{5}\) m/s \\ Number of nodes & \(5\) \\ Propagation loss model & LogDistancePropagationLossModel \\ Propagation delay model & ConstantSpeedPropagationDelayModel \\ CCAModeThreshold & \(-6.9686\) dBm \\ Transmitting power & \(16.0206\) dBm \\ Channel & CSMA/CA \\ Transport protocol & OLSR, AODV \\ Simulation time & \(10\) s \\ Transmission rate & \(14\) kbit/s \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters. the CSMA/CA protocol in a simulation area of 60 m in length and 60 m in width, can be obtained. The NS-3.31 simulator was used to test the simulation output of underwater electric field communication based on CSMA/CA, which included five nodes and underwent 20 simulation runs. The simulation results showed that the same results were obtained for communication data transmission. The simulation results indicated that a data transmission rate of 13.92 kbit/s could be achieved for communication data transfer from one node to four nodes in the CAMA/CA underwater electric field communication channel.