IK2215 Programming reliable protocol

Swift Package Manager (SPM) 创建并集成本地库 Swift Package Manager (SPM) 在macOS 项目中创建并集成的完整步骤 阅读详情


IK2215 Programming 
Assignment Introduction
Voravit Tanyingyong
2024-09-05 1Programming assignment overview • Design and implement a reliable protocol for sending/receiving datagrams
• Guaranteed UDP (GUDP)
• Enabling reliable transport over UDP
• Based on the Go-Back-N (GBN) protocol
• Automatic repeat request (ARQ)
• Use acknowledgements and timeouts 
for reliable transmission
• Sliding window flow control 
• Multiple packets in flight
• Asynchronous communication
• Unlike TCP, GUDP is not connection-oriented
(no connection establishment)
2024-09-05 2
GUDP
Application
UDP
IP Network
Transport
ApplicationReliable data transfer and Go-Back-N • Computer Networking: a Top-Down Approach 
• Chapter 3.4 – 3.4.3
• Slides from the authors
• Slides 4 – 8 and 12 – 14
2024-09-05 3Principles of reliable data transfer • One of the most important challenges in networking
• Characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt)
2024-09-05 4Reliable data transfer: interfaces
2024-09-05 5
send
side
receive
side
rdt_send(): called from above, 
(e.g., by app.). Passed data to 
deliver to receiver upper layer
udt_send(): called by rdt,
to transfer packet over 
unreliable channel to receiver
rdt_rcv(): called when packet 
arrives on rcv-side of channel
deliver_data(): called by 
rdt to deliver data to upperPipelined protocols
• Pipelining: sender allows multiple, “in-flight”, yet-to-be-acknowledged pkts
• Range of sequence numbers must be increased
• Buffering at sender and/or receiver
• Two generic forms of pipelined protocols: Go-Back-N, selective repeat
2024-09-05 6Pipelining: increased utilization
2024-09-05 7
first packet bit transmitted, t = 0
sender receiver
RTT 
last bit transmitted, t = L / R
first packet bit arrives
last packet bit arrives, send ACK
ACK arrives, send next 
packet, t = RTT + L / R
last bit of 2nd packet arrives, send ACK
last bit of 3rd packet arrives, send ACK
3-packet pipelining increases
utilization by a factor of 3!
 
U 
sender 
= .0024 
30.008 = 0.00081 3L / R 
RTT + L / R 
= 
L: a packet size (8000 bits for 1000 bytes)
R: transmission rate (109 bps for 1 Gbps)
RTT: round-trip-time (~ 30 ms for speed-of-light )
Usender: fraction of time the sender is busy sending bits into the channel
L/R = 8 us (0.008 ms)Pipelined protocols: overview
Go-Back-N (GBN)
• Sender can have up to N unack’ed packets in 
pipeline
• Receiver only sends cumulative ack
• Doesn’t ack packet if there’s a gap
• Sender has timer for oldest unacked packet
• When timer expires, retransmit all unacked
packets
Selective Repeat
• Sender can have up to N unack’ed packets in 
pipeline
• Receiver sends individual ack for each packet
• Sender maintains timer for each unacked packet
• When timer expires, retransmit only that unacked
packet
2024-09-05 8GBN sliding window protocol
• Understand the details of a basic sliding window protocol
• An ACK is an ACK (and not a NACK)
• The receiver sends an ACK only if it receives the next packet in sequence*
• You cannot use an ACK to tell the sender that a packet has been lost (i.e., no NACK)
• No duplicate ACK detection
• The sender increases the window in accordance with the ACK
• Retransmissions are triggered by timeouts (and nothing else)
• Receiving an ACK with unexpected sequence number does not trigger a retransmission
2024-09-05 9
* There can be a problem in this case. We will this dicuss it later on.Sliding window flow control
2024
-09
-05 10
Sender Receiver
ACK
4
P
0
Window (size 3)
0 1 2 3
 
4
5
6
7
P
1P
2
0 1 2 3
 
4
5
6
7
0 1 2 3
 
4
5
6
7
P
3
0 1 2 3
 
4
5
6
7
0 1 2 3
 
4
5
6
7
0 1 2 3
 
4
5
6
7
0 1 2 3
 
4
5
6
7
0 1 2 3
 
4
5
6
7
ACK
2
ACK
3Problem when receiver only ACKs the next sequence
Problem:
• If the receiver sends an ACK only if it receives the next 
packet in sequence, a deadlock occurs when all ACKs 
(= number of window size) were lost
Solution:
• Receiver must send ACK with the expected sequence 
number when it receives a packet with a different 
sequence number than the expected sequence number
• Sender upon receiving an ACK can assume all packets with 
(ACK sequence number - 1) were received successfully
2024-09-05 11
Sender Receiver
P0
E0
ACK1
X
P1
E1
P2
E2
ACK2
X
ACK3
X
Timeout!
E3
P0
E3
P1
E3
P2
Timeout!
Send deadlock!
Window (size 3)Go-Back-N sender • k-bit seq # in pkt header (range of sequence numbers is [0, 2k - 1])
• “window” of up to N, consecutive unack’ed pkts allowed
• ACK(n): ACKs all pkts up to, including seq # n - “cumulative ACK”
• On receiving ACK(n): move window forward to begin at n+1
• Timer for oldest in-flight pkt
• Timeout(n): retransmit packet n and all higher seq # pkts in window
• TCP implementation sends the next expected sequence in the ACK, i.e., ACK(n) ack’ed all pkts up to n-1
• GUDP implementation will also send the expected sequence in the ACK
2024-09-05 12GBN sender extended FSM*
2024
-09
-05 13
Wait start_timer
udt_send
(sndpkt[base])
udt_send
(sndpkt[base+1])
…
udt_send
(sndpkt[nextseqnum
-1])
timeout
rdt_send(data)
if (nextseqnum < base+N) {
sndpkt
[nextseqnum] = make_pkt
(nextseqnum,data,chksum
)
udt_send
(sndpkt
[nextseqnum])
if (base == nextseqnum
)
start_timer
nextseqnum++ }
else
refuse_data(data)
base = getacknum
(rcvpkt)+1
If (base == nextseqnum
)
stop_timer
else
start_timer
rdt_rcv
(rcvpkt) && 
notcorrupt
(rcvpkt) 
base=1
nextseqnum=1
rdt_rcv(rcvpkt) 
&& corrupt(rcvpkt) Λ Λ
* See
 the course
 book
 chapter
 3.4.3, figure
 3.20GBN receiver extended FSM*
• ACK-only: always send ACK for correctly-received pkt with highest in-order seq #
• May generate duplicate ACKs
• Need only remember expectedseqnum
• out-of-order pkt: 
• Discard (don’t buffer): no receiver buffering!
• Re-ACK pkt with highest in-order seq #
2024-09-05 14
Wait
udt_send(sndpkt)
default
rdt_rcv(rcvpkt)
&& notcurrupt(rcvpkt)
&& hasseqnum(rcvpkt,expectedseqnum) 
extract(rcvpkt,data)
deliver_data(data)
sndpkt = make_pkt(expectedseqnum,ACK,chksum)
udt_send(sndpkt)
expectedseqnum++
expectedseqnum=1
sndpkt = make_pkt(0,ACK,chksum)
Λ
* See the course book chapter 3.4.3, figure 3.21GUDP implementation in java
• GUDP runs in user space, in the same process as the application
We provide:
• GUDPPacket.java: A class for GUDP protocol declarations with associated methods to access the 
GUDP packet header and payload
• GUDPSocketAPI.java: Well-defined API that you must use for your implementation
• GUDPEndPoint.java: A class for keeping track of remote endpoints
• GUDPSocket.java: A class for GUDP library
• SenderThread.java: A class that monitors send buffers and sends packets when they are in the buffer.
• ReceiverThread.java: A class that receives packets from remote endpoints and puts them in the buffers.
2024-09-05 15
UDP Application UDP GUDP Application
• ARQ
• Sliding window flow control
You are not allowed to modify these files!GUDP header
• Version: version of the GUDP protocol
• Use version 1!
• Type: packet type 
• DATA, BSN, ACK, and FIN
• How to use sequence numbers:
• DATA packets: increases by one for each packet sent
• BSN packets: random
• ACK packets: sequence number of next expected DATA packet
• FIN packets: sequence number of last DATA packet plus one
2024-09-05 16
0 7 8 15 16 32 
+--------+--------+--------+--------+ 
| Version | Type |
+--------+--------+--------+--------+
| Sequence number |
+--------+--------+--------+--------+GUDPSocketAPI.java – API you must use
• Your code must conform to this API
• Class/method declarations defined for the assignment
• You will write the GUDPSocket class that implements this API
• You may add variables, methods, and inner classes in GUDPSocket.java
2024-09-05 17
import java.net.DatagramPacket;
import java.io.IOException;
public interface GUDPSocketAPI {
public void send(DatagramPacket packet) throws IOException;
public void receive(DatagramPacket packet) throws IOException;
public void finish() throws IOException;
public void close() throws IOException;
}GUDPSocket.java – skeleton code for GUDP library
• The skeleton above is incomplete
• The actual file contains more variables and descriptions of what must be done in each method
2024-09-05 18
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.io.IOException;
public class GUDPSocket implements GUDPSocketAPI {
DatagramSocket datagramSocket;
public GUDPSocket(DatagramSocket socket) {
datagramSocket = socket;
}
public void send(DatagramPacket packet) throws IOException {}
public void receive(DatagramPacket packet) throws IOException {}
public void finish() throws IOException {}
public void close() throws IOException {}
}send()
• Send a packet
• The application put data in the DatagramPacket format
• The destination address/port included in the DatagramPacket
• Non-blocking – returns immediately
• Put application data in GUDP send buffer for future delivery
• The DatagramPacket must be encapsulate in GUDP format before putting in the send buffer
2024-09-05 19
public void send(DatagramPacket packet) throws IOException;receive()
• Receive a packet
• The application fetch the data from GUDP receive buffer, otherwise wait for the data to arrive
• GUDP receives incoming packets from remote endpoints independently from the application
• GUDP receive buffer stores packets in GUDP format, which must be decapsulated before sending it to the 
application
• The application handles packets from different senders (which can be differentiated based on the 
information in the packet)
2024-09-05 20
public void receive(DatagramPacket packet) throws IOException;finish()
• Finish sending
• The application calls this method to inform GUDP that it’s done sending
• GUDP completes the actual sending and return when it is done, otherwise report error/timeout by 
throwing the IOException
• Retransmission may occur due to packet lost or arriving out-of-order
• Clean up data structure that you use to track destination end points
2024-09-05 21
public void finish() throws IOException;close()
• Close the GUDP socket and gracefully terminate sender and receiver threads
• The application calls this method to terminate the GUDP socket
• GUDP cleans up, closes the socket, stop sender and receiver threads, and return.
2024-09-05 22
public void close() throws IOException;GUDP sender side
• Data transfer may happen after the application passed all packets to GUDP
• GUDP can send multiple packets (<= window size) before it receives any ACK
2024-09-05 23
send(packet)
Application GUDP Network
GUDP ACK
GUDP BSN
GUDP DATA
GUDP DATA
GUDP ACK
send(packet)
finish()
finish() return
GUDP ACK
GUDP FIN
GUDP ACK
close()
Application terminates after send completion
wait for GUDP to complete sendingGUDP receiver side
• Receive returns only after GUDP has DATA
• Receiver may keep socket open to receive more DATA
2024-09-05 24
receive(packet)
Application GUDP Network
GUDP DATA
GUDP ACK
GUDP ACK
receive(packet)
GUDP BSN
GUDP DATA
GUDP ACK
receive(packet) return
receive(packet) return
Fetch a packet from receive buffer
Otherwise, wait for an incoming packet
Application remains running to receive new connectionsProtocol control block
• An application can open multiple GUDP sockets
• Each GUDP socket can be used for communication 
with multiple peers
• Two levels
• Multiple GUDP sockets
• Multiple peers per socket
• Need to
• Maintain state for per-socket “peers”
• Have a way to look up peer state
• Maintain queues with outbound/inbound packets
2024-09-05 25
Program
Application
GUDP
Socket Socket
PeersSend
Queue
GUDP Implementation: Send and receive processes
2024-09-05 26
SEND
Application
- Handle destination endpoints
- Wrap app data in GUDP
- Put it in send queue
- Take GUDP from send queue
- Wrap it in UDP and send
- Handle timeout/retransmission
send() Send 
thread
Network
Network
receive 
thread
- Receive and process incoming packets
BSN: Create receive endpoint if not exist
DATA: Put GUDP DATA in the receive queue
ACK: Update send queue
FIN: Mark endpoint for removal
- Send ACKs for the received packets
Receive
Queue
receive()
Pick up GUDP from receive queue
Unwrap GUDP to get app data
Application
RECEIVEMain tasks
Part 1: GUDPSocket.java
• Implement core functionalities, including send(), receive(), finish(), and close() methods
• Assume SenderThread.java and ReceiverThread.java are already implemented as described in the 
comments in the files
Part 2: SenderThread.java
• Implement the send thread that monitors send queues and sends packets based on the GBN protocol 
when there are packets in the queues
• Assume GUDPSocket.java and ReceiverThread.java are implemented as described in the comments in 
the files
• GUDPSocket.java from the teacher, not from your part 1 submission!
• ReceiverThread.java handles ACK for the GBN sender, and it also calls FSMSender after it removes all ACKed
packet from the send buffer
2024-09-05 27Teacher implementation: SenderThread class
if senderList is empty, make it wait
while (runFlag)
synchronize senderList
for each endpoint in sendList
run FSMSender(endPoint)
if endpoint is finished, check if its send queue is empty, remove it from sendList otherwise proceed to next endpoint 
if sendList is empty, notify other threads. Otherwise if all endpoints' send queue are empty, make senderList wait
if (!runFlag), notifies other threads
sleep(50)
while (nextseqnum < base+N) && (nextseqnum < last)
get next GUDP packet from the send queue, pack and send it
if (base == nextseqnum) start_timer
nextseqnum++
2024-09-05 28Teacher implementation: FSMSender method
2024-09-05 29Teacher implementation: ReceiverThread class
When packet arrives, unpack it to GUDP format
if incoming packet is an ACK
synchronize senderList
remove all ACK'ed packets from senderList, update related parameters
move to RCV state and call FSMSender
notify senderList
if incoming packet is a BSN
synchronize receiverList
if new end point, add a new GUDPEndPoint, update all parameters, add it to receiverList, and send ACK
else if end point was finished
reset end point parameters and use the new expectedseqnum based on BSN (seq+1), and send ACK
else send ACK with the expectedseqnum
if incoming packet is a DATA
synchronize receiverList
if seq==expectedseqnum, add GUDP packet to end point receive buffer, update all parameters, and send ACK
else send ACK with the expectedseqnum
if incoming packet is a FIN
synchronize receiverList
if seq==expectedseqnum, update all parameters, set end point as finished, and send ACK
else send ACK with the expectedseqnum
2024-09-05 30Grading overview
The application should be able to:
• Send one or multiple files to one or more destinations
• Receive one or multiple files from one or more sources
• Handle unexpected situations gracefully
• Work with other implementations
• To pass, your submission must ensure that:
• The application can at least send and receive one file on one destination correctly
• GUDP must be used in data transmission (show on the wire correctly)
• Sliding window flow control is working correctly (multiple packets in-flight)
• ARQ mechanism is working correctly (handle packet loss correctly)
• Your scores meet the grading criteria (see details on the next two slides)
• Part 1: Deadline: Mon 23 Sep 17:00 sharp • Make-up deadline: Tue 1 Oct 17:00 sharp
• Part 2: Deadline: Mon 30 Sep 17:00 sharp • Make-up deadline: Tue 8 Oct 17:00 sharp
2024-09-05 31Part 1: Grading criteria
Score at least 3.5 points from the bold items and 5 out of 7 in total
1. Send multiple packets in-flight + check packet content (1)
2. Send and receive files with your code without loss (1)
3. Send one file to other receiver without loss (0.5)
4. Send one file to other receiver with loss (0.5)
5. Receive one file from other sender without loss (0.5)
6. Receive one file from other sender with loss (0.5)
7. Send one file to multiple receivers without loss (0.5)
8. Send one file to multiple receivers with loss (0.5)
9. Send multiple files to other receiver without loss (0.5)
10. Send multiple files to other receiver with loss (0.5)
11. Receive multiple files from other sender without loss (0.5)
12. Receive multiple files from other sender with loss (0.5)
2024-09-05 32
>=3.5 points
>=5 pointsPart 2: Grading criteria
Score at least 2.5 points from the bold items and 3.5 out of 5 in total
1. Send multiple packets in-flight + check packet content (1)
2. Send and receive files with your code without loss (1)
3. Send one file to other receiver without loss (0.5)
4. Send one file to other receiver with loss (0.5)
5. Receive one file from other sender without loss (0.5)
6. Receive one file from other sender with loss (0.5)
7. Send one file to multiple receivers without loss (0.5)
8. Send one file to multiple receivers with loss (0.5)
9. Send multiple files to other receiver without loss (0.5)
10. Send multiple files to other receiver with loss (0.5)
11. Receive multiple files from other sender without loss (0.5)
12. Receive multiple files from other sender with loss (0.5)
2024-09-05 33
>=2.5 points
>=3.5 pointsPlagiarism*
• Plagiarism in practical work and computing code
• “It is important that students ‘do their own work’ when they write computer code, when document an 
experiment, create a design or answer a mathematical problem. If they do not do these activities 
themselves, yet claim the results as their own, this is plagiarism.”
• Students who, with unauthorized aids or otherwise attempt to mislead the exam or when a student's 
performance is otherwise to be assessed, may lead to disciplinary action.
2024-09-05 34
* More information on KTH webpage about Cheating and plagiarismTesting
• We provide sample applications that you can use to run with your GUDP code
• VSFtp.java: A class for a simple file transfer protocol
• VSSend.java: An application for sending files over VSFtp
• VSRecv.java: An application for receiving files over VSFtp
• You are responsible for identifying relevant test cases and performing tests
• Need to complete GUDPSocket.java, SenderThread.java, and ReceiverThread.java
• Think through the protocol carefully and know how it should work exactly
• Think through the dynamic behaviour of the GUDP library
• What happens, and when?
• Define the protocol states and transitions
• <current state, event, action, new state>
• If you have question:
• Discussion forum: Q&A for lab activities
• Q&A sessions for verbal discussion or additional support
2024-09-05 35Test service on http://ik2215.ssvl.kth.se
• Only accessible within KTH network
• From outside KTH network, you must connect via KTH VPN-service
• Part 1: http://ik2215.ssvl.kth.se/prg1
• Part 2: http://ik2215.ssvl.kth.se/prg2
• You must provide:
• Your KTH account i.e., KTH email without the “@KTH.SE” part
• Your submission file 
• Part 1: GUDPSocket.java
• Part 2: SenderThread.java
• The test runs at 00:00 everyday
• Slow: 6-10 minutes per submission
• Results send to the KTH account you provided
2024-09-05 362024-09-05 37
### TEST6: receive one file from other sender with loss (0.5p)
OK: Your code can receive one file when first BSN is lost
OK: Your code can receive one file when first DATA is lost
OK: Your code can receive one file when first FIN is lost
OK: Your code can receive one file when first ACK is lost
OK: Your code can receive one file with random loss
TEST6: OK 0.5p ### TEST7: send one file to multiple receivers without loss (0.5p)
OK: Your code can send one file to multiple receivers
TEST7: OK 0.5p ### TEST8: send one file to multiple receivers with loss (0.5p)
OK: Your code can send one file to multiple receivers
TEST8: OK 0.5p ### TEST9: send multiple files to other receiver without loss (0.5p)
OK: Your code can send multiple files to other receiver
TEST9: OK 0.5p ### TEST10: send multiple files to other receiver with loss (0.5p)
OK: Your code can send multiple files to other receiver
TEST10: OK 0.5p ### TEST11: receive multiple files from other sender without loss (0.5p)
OK: Your code can receive one file from other sender
TEST11: OK 0.5p ### TEST12: receive multiple files from other sender with loss (0.5p)
OK: Your code can receive one file from other sender
TEST12: OK 0.5p
##########
IMPORTANT: You pass only if scores of TEST1-6 >=3.5 points and TEST1-12 >=5.0 points.
You get the scores only when you pass. Otherwise, you get 0 points
RESULTS: PASS
SCORE: 7.0
##########
OK: Code compiles without error.
### TEST1: Send multiple packets in-flight + check packet content (1.0p)
OK: GUDP version must be 1
OK: First packet is GUDP BSN (type 2)
OK: Sequence number is random and not zero or one
OK: BSN packet contains only GUDP header
OK: GUDP version must be 1
OK: Second packet is GUDP DATA (type 1)
OK: Sequence number should be random and not zero
OK: Second packet has an increment sequence number
OK: data packet seems to contain GUDP header + payload
TEST1: OK 1.0p ### TEST2: send and receive files with your code without loss (1.0p)
OK: Your code can send and receive one file
OK: Your code can send and receive multiple files
TEST2: OK 1.0p ### TEST3: send one file to other receiver without loss (0.5p)
OK: Your code can send one file to other receiver
TEST3: OK 0.5p ### TEST4: send one file to other receiver with loss (0.5p)
OK: Your code can send one file when first BSN is lost
OK: Your code can send one file when first DATA is lost
OK: Your code can send one file when first FIN is lost
OK: Your code can send one file when first ACK is lost
OK: Your code can send one file with random loss
TEST4: OK 0.5p ### TEST5: receive one file from other sender without loss (0.5p)
OK: Your code can receive one file from other sender
TEST5: OK 0.5p
Example test output for Part 12024-09-05 38
### TEST7: send one file to multiple receivers without loss (0.5p)
OK: Your code can send one file to multiple receivers
TEST7: OK 0.5p ### TEST8: send one file to multiple receivers with loss (0.5p)
OK: Your code can send one file to multiple receivers
TEST8: OK 0.5p ### TEST9: send multiple files to other receiver without loss (0.5p)
OK: Your code can send multiple files to other receiver
TEST9: OK 0.5p ### TEST10: send multiple files to other receiver with loss (0.5p)
OK: Your code can send multiple files to other receiver
TEST10: OK 0.5p
TEST11: SKIPPED 0.0p
TEST12: SKIPPED 0.0p
##########
IMPORTANT: You pass only if scores of TEST1-6 >=2.5 points and TEST1-12 >=3.5 points.
You get the scores only when you pass. Otherwise, you get 0 points
RESULTS: PASS
SCORE: 5.0
##########
OK: Code compiles without error.
### TEST1: Send multiple packets in-flight + check packet content (1.0p)
OK: GUDP version must be 1
OK: First packet is GUDP BSN (type 2)
OK: Sequence number is random and not zero or one
OK: BSN packet contains only GUDP header
OK: GUDP version must be 1
OK: Second packet is GUDP DATA (type 1)
OK: Sequence number should be random and not zero
OK: Second packet has an increment sequence number
OK: data packet seems to contain GUDP header + payload
TEST1: OK 1.0p ### TEST2: send and receive files with your code without loss (1.0p)
OK: Your code can send and receive one file
OK: Your code can send and receive multiple files
TEST2: OK 1.0p ### TEST3: send one file to other receiver without loss (0.5p)
OK: Your code can send one file to other receiver
TEST3: OK 0.5p ### TEST4: send one file to other receiver with loss (0.5p)
OK: Your code can send one file when first BSN is lost
OK: Your code can send one file when first DATA is lost
OK: Your code can send one file when first FIN is lost
OK: Your code can send one file when first ACK is lost
OK: Your code can send one file with random loss
TEST4: OK 0.5p
TEST5: SKIPPED 0.0p
TEST6: SKIPPED 0.0p
Example test output for Part 2Useful resources
• Course book: 8th and 7th edition
• Read Chapter 3.4 through Chapter 3.4.3 Go-Back-N (GBN)
• TCP Operational Overview and the TCP Finite State Machine (FSM)
• Producer-consumer in Java: Baeldung, geeksforgeeks
• Java queue implementations: Oracle, Baeldung, geeksforgeeks, 
• Java documentation for different classes:
• DatagramSocket, DatagramPacket, 
• LinkedList, ArrayDeque
• Java wait() and notify() methods
2024-09-05 39What you need to do • Read through relevant materials thoroughly
• Guaranteed UDP (GUDP) page on Canvas
• This programming introduction slides
• Read through the given source code template for the assignment
• Familiarize with java programming
• Plan early and work incrementally

【MATLAB代码】基于水声通信(ACOMMS)下的到达时间差(TDOA)定位的AUV自主导航例程,附完整代码 水下AUV导航系统仿真研究 本研究基于到达时间差(TDOA)技术实现了水下自主航行器(AUV)的三维导航仿真系统。系统采用四个声学信标作为定位基准,通过TDOA测量数据迭代求解AUV位置。仿真结果表明: 导航性能:系统能够有效跟踪AUV从起点(30,30,-20)到目标点(70,70,-20)的航行轨迹,定位误差保持在合理范围内。 误差分析:定位误差变化曲线显示系统具有稳定的定位精度,平均误差为0.5米左右。 技术特点:采用两步最小二乘迭代算法求解非线性TDOA方程,提高了定位精度和计算效率。 该仿真系统为 阅读详情

相关推荐

从波形图到参数调优:一次无感BLDC电机启动失败的深度解析

本文深入解析无感BLDC电机启动失败案例,通过波形分析揭示参数不匹配和IPM保护机制触发等关键问题。详细探讨了过零点检测、PWM周期设置及强拖参数调优的底层逻辑,并分享IPM模块保护机制与实战调优技巧,最终实现99.98%的启动成功率。

weixin_29182481的博客 823

五十三.网络(3)--区块同步getblocks消息

在节点互发了version消息后,就会发送getblocks消息,请求对方的区块以进行同步。

d3582077的专栏 202

从零开始:用Python实现AlphaZero五子棋AI(附完整代码)

本文详细介绍了如何从零开始使用Python实现AlphaZero五子棋AI。通过工程化实践,逐步构建蒙特卡洛树搜索(MCTS)、轻量化残差网络(ResNet)以及自博弈训练循环,并提供完整可运行的代码。文章旨在帮助开发者绕过复杂理论,聚焦实战,最终打造一个能够自我学习与对弈的智能体,是深度强化学习在游戏AI领域的一次完整项目实战。

weixin_29081703的博客 417

DPU安全组与ACL性能测试:从规则爆炸到线速卸载的实战指南

本文深入剖析DPU安全组与网络ACL的底层卸载架构,通过两个完整实战测试矩阵,量化评估规则复杂度、有状态连接跟踪(Conntrack)及OVS Offload协同对RoCEv2性能的影响。结合真实故障排查案例与工具输出矩阵,揭示大规模云环境中安全组性能跌落的根因,并给出基于规则聚合与硬件表项优化的最优配置指南。

专注分享DPU、RDMA智能网卡/SSD(固态硬盘)产品测试与优化 361

大白话讲解Numpy中什么是一维、二维、三维数组,以及5种创建方式

NumPy中提供了多种创建数组的方式,其中最基本的方式就是通过array()函数创建数组在使用该函数时直接传入列表或元组即可。 通过array()函数分别创建一维数组、二维组和三维数组,那么什么是维度呢?一维、二维、三维有什么区别? 1、什么是维度? 维度可以理解为描述数据的一种 “方向” 或者 “层次”。在数组中,维度的数量决定了我们需要用多少个索引来访问一个元素 2、一维、二维、三维的区别? (1)一维:一维数组就像是一条直线上排列的一组数据,例如: a = np.array([1, 2

1365

Arduino程序设计(八)LCD显示实验

本文主要介绍温度/温湿度传感器的LCD显示实验,分别是:1、LM35采集环境温度LCD显示;2、DS18B20采集环境温度LCD显示;3、DHT11采集环境温湿度LCD显示。(1)LM35介绍LM35特性特性说明基本功能LM35作为常用的温度传感器,可以检测周围的温度工作原理利用感温材料,通过内部电路将温度值转化为对应的电压信号工作电压4~30V,常用5V供电温度测量测量范围0~100℃ ,误差 ±0.5℃输出信号线性模拟信号输出,LM35输出电压和摄氏温度程线性关系。

Alice的博客 6714

AI 芯片片上网络 NoC 深度解析:flit、虚通道与拥塞控制如何决定 GPU/TPU/LPU 的算力利用率

AI芯片算力瓶颈不在FLOPS,而在片上网络(NoC)——数据搬运的能耗与延迟决定MFU上限。物理限制下,长线延迟不随工艺缩小,迫使NoC将全局布线拆为可流水的短链路;能量账显示,一跳传输耗能可达数十次乘加操作。拓扑选择直接影响性能:二维mesh虽布线可行,但均匀流量下每节点可用带宽按1/√N衰减,实测仅达标称值30%。虚通道、双网设计、静态调度(如Groq)等技术旨在突破此瓶颈。从总线到crossbar再到多跳NoC,本质是用延迟换可行性。未来趋势:专用通路(脉动阵列)、晶圆级集成(Cerebras)、跨

我的博客 125

深入浅出ISP:用RKISP2.x Tuner工具理解AWB、AE、HDR等核心模块的实战调参

本文深入解析RKISP2.x Tuner工具在ISP图像处理中的实战应用,重点探讨AWB、AE、HDR等核心模块的调参技巧。通过环境搭建、调试工具使用和实际案例,帮助开发者掌握如何在不同光照条件下优化图像质量,实现精准的白平衡、曝光控制和动态范围处理。

weixin_26802933的博客 492

网安产教融合思考:如何补齐高校实战能力评价短板

不少网安专业高校都面临这样现实的难题:网安人才培养持续推进,校内已经搭建完整的教学体系,但高校培养方案可能几年修一次,企业的技术栈和攻击手法却按季度在变,学校难落地最新的技术实战教学,学生难证明实战本领,企业一边喊人才紧缺,一边感慨招不到来了就能干的应届生。网安时代,实战为王。备考平台、7天免费直播培训、免费认证考试,期待更多高校加入 CCP 人才共育生态,组织本校学子参与本轮认证,以认证带动教学,以实战对接就业,共同为行业培养 “用得上、干得好” 的实战型网络安全人才。本次报名、培训、考试全程免费,

A19911511842的博客 199

DFX从芯片到系统:可制造性、可测试性与可靠性设计实战指南

DFX(Design for eXcellence)是一套面向产品全生命周期的设计方法论,涵盖可制造性(DFM)、可测试性(DFT)、可靠性(DFR)等维度。其核心原理是将制造、测试、维护等环节的约束前置到设计阶段,从而降低流片与量产风险。在芯片与系统硬件领域,DFX不仅是提升良率与测试效率的关键手段,更是保障车规、工控等严苛场景下长期稳定运行的基础。从芯片物理实现到PCB布局,再到系统级散热与维护设计,DFX的落地需要工具链、流程闸门与跨部门协作的体系化支撑。本文基于实际项目经验,分享DFX从设计决策到工

weixin_32349093的博客 351

全局子程序 参数调用

为什么要子程序: 为了实现程序结构化,我们尽量使用不同功能的功能块来实现一些特定的功能, 子程序接口: 使用过程的注意事项,尤其是数组使用时的注意事项 从一个主程序中可以将参数传递到局部或全局子程序和函数中。 怎样传递参数有 2 种方式: 作为 IN 参数 变量值在主程序中保持不变。 这种传递方式也称为“ 值传递 (Call by Value)”。 作为 OUT 参数 子程序读取并更改该值,然后将新值写回到主程序中。 这种传递方式也称为“Call by Reference”。 举例说明 1 DEF MY

Eric_Yang1024的博客 1095

台湾行情数据API接入教程

想用程序获取台股行情,很多人第一步会搜“台股资料 API 推荐”,结果发现选择不少:证交所有免费接口,Yahoo Finance 也能查,券商还有自己的 API。真正写代码时才发现,有的数据只到收盘,有的延迟 20 分钟,有的必须先开户。本文先梳理台湾行情数据的几种获取渠道,再用 Python 从零搭一个可以运行的台股数据脚本:查代码清单、取实时报价和盘口、拉历史K线、做复权、用 WebSocket 接收实时推送,最后结合台积电 ADR 和新台币汇率计算跨市场溢价。

qq_34102871的博客 328

操作系统实验一到实验九合集(哈工大李治军)

操作系统实验一到实验九合集(哈工大李治军) 有详细代码及注释,程序已在本地测试,均能跑通

leoabcd12的博客 5万+

【基于 WebSocket 的多用户网页五子棋】—— 数据管理模块

但行好事,莫问前程

qq_42996461的博客 260

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

Qt网络编程实战指南:从底层Socket到现代异步架构的选型与避坑

本文梳理Qt网络编程的核心模块与演进路线,对比QTcpSocket与QNetworkAccessManager的使用边界,结合HTTP请求与TCP长连接的完整示例,说明信号槽、内存管理与事件循环的配合方式。重点记录连接池设计、证书校验、线程亲和性等实际开发中的关键决策点,帮助读者在C/S或跨平台项目中建立稳定的网络层基座。

2402_83344867的博客 329

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

25.《Pwn 堆利用实战:House of Lore —— 从自出题 my_lore 到 getshell 全流程》

自出题 my_lore 打穿 House of Lore:UAF 泄露 libc,BSS 伪造 chunk 投毒 smallbin,两次 malloc 把 system 写进函数指针,附 gdb 动态验证全过程

2501_93884468的博客 475

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

从母钟到子钟:NTP 网络时钟系统架构与软件接口

本文从工程角度简要介绍公共场所的时间同步需求、NTP协议的定位,以及典型LED同步时钟的系统架构与硬件设计,以讯鹏科技4寸与5寸同步时钟为例。

SPZHCS的博客 196

正运动16轴脉冲网络型运动控制卡ECI1G38

16轴脉冲运动控制解决方案

weixin_57350300的博客 91

DPVS 报文黑匣子与 Crash 自动拉黑:给转发面装上“飞行记录仪“

谁打挂了我(crash dump)、他之前发了什么(慢路径环)、他还会再来(入口拉黑)。设计上我们始终坚持两条原则:记录与决策分离(黑匣子永远只说不做),以及误伤成本优先于漏放成本(三道闸门全部通过才拉黑,expire 到期自动解封)。性能上,全量快路径摘要 + 入口查表的综合开销低于 1.3%,在 FIP 网关的流量水位下不可感知。飞行记录仪的价值不在于飞机正常飞行的时候,而在于它让每一次事故都变成一次改进。对转发面来说,同样如此。

zyun360的博客 294

全球实时竞价 RTB 中 IP 定位数据应用:链路完整性与工程实践

全球实时竞价(RTB)中IP定位数据的应用,核心判断是:IP数据是RTB竞价决策的底层输入之一,但它的价值高度依赖于从IP捕获到OpenRTB序列化整条链路的完整性。大量定位误差并非源于IP库本身不准,而是发生在CDN边缘节点捕获了错误的IP、供应链各环节使用了不同版本的库、或者OpenRTB字段缺失导致买方无法判断数据可信度。对于DSP和SSP的工程团队而言,理解IP定位在RTB中的实际作用边界,比选一个更准的库更重要。

ITxiaobing2023的博客 281

HART转Modbus TCP利用月度维护窗口减少中药产线停机时长

中药制药洁净车间原用HART仪表因仅传输4-20mA信号,诊断信息无法上传,导致GMP审计难、运维频繁进出洁净区。项目采用捷米特JM-TCP-HART协议转换网关,将HART数字信号转为ModbusTCP以太网数据,实现仪表状态、标定记录等信息远程采集与追溯。改造不改动原有控制逻辑,无需停机,保障生产连续性,满足洁净区安全与合规要求,验证了协议转换在存量设备升级中的高效可行性。

weixin_66215183的博客 232

亚远景-欧盟 NIS2 与 CRA 双法规生效,车载出口企业网络安全与过程合规建设要点

亚远景结合法规要求与车载行业特性,梳理双法规对整车与零部件出口企业的核心影响,说明如何以 ISO/SAE 21434 为核心、以 ASPICE 为过程底座,搭建满足欧盟要求的网络安全与过程合规体系。

yayuanjingkeji的博客 236

23 网络性能与 QoS:带宽、时延、吞吐计算与保障机制

带宽是上限、不是实际速度;时延由传输、传播、处理、排队四段组成。一道题让你算端到端时延和吞吐,关键是先找到瓶颈在哪一跳。QoS 靠分类、标记、队列、调度四步保障,配一张瓶颈定位+容量规划图,再跟 3 道真题。

weixin_46316564的博客 315

机房温湿度传感器通讯协议应用实践:TCP IP 、UDP与SNMP的实战效果

本文基于320点机房实战,对比TCP/IP(ModbusTCP)、UDP与SNMPv3在温湿度传感器中的应用效果。结论:三协议分工明确——ModbusTCP负责控制与精准采集,UDP实现秒级越限告警,SNMPv3保障设备健康与网管集成。混合组网下,告警延迟从12~30s降至1~3s,连接数大幅降低,离线判定更可靠。关键经验:协议非“选优”,而应“各司其职”;UDP需配补发与TCP兜底;写操作必做回读;验收须模拟三通道故障。

520

Agent 安全实战:间接提示注入的四个攻击面与防御体系

当 Agent 从 "生成内容" 走向 "执行动作",安全边界就从内容合规变成了权限越界。本文拆解间接提示注入在网页抓取、工具返回值、MCP 连接器、长期记忆四个位置的真实攻击路径,对照 Claude、GPT、Gemini 在工具调用权限模型上的设计差异,给出可直接落地的五层防御体系。

阡陌数智,专注大模型网关与 LLM 工程落地 292

聊天室项目入口网关子服务的实现

上,客户端连接建立后发送首帧身份识别信息,网关反序列化出登录会话 ID 并到 Redis 中查证,查不到则直接关闭连接,查到则把该连接登记进长连接管理(维护用户 ID 与连接的映射),此后由网关按子服务返回的目标用户 ID 找到对应连接并推送通知——好友申请、申请处理结果、好友删除、会话建立与新消息五类通知皆由此发出。服务启动时先构造 Redis 客户端(承载登录会话与在线状态),再以服务根目录为监控范围创建服务发现客户端,把文件存储、语音识别、消息存储、好友管理、用户管理、消息转发。

2501_92042392的博客 127
上一篇: BAN 501 Marketing Campaign Budget Allocator
下一篇: UNIT BUSA3015 Business Forecasting
vx_codinghelp
博客等级 码龄2年 543粉丝 68原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值