An application-level reliable network protocol upon UDP, a final project of COMP4721
- Reliable data transfer(both sender side and receiver side): resistant to disordering, packet loss and corruption.
- Batch ACK
- Basic timeout and retransmit
- 0RTT Handshaking
int
4 bytes, big endian
data
4 + n bytes, first 4 byte is its pure data length
Packet
int seq_num
int ack_num
int chk_sum
data payload
- adaptors.py: interface
Socket
and its implementations likeDebugSocket
(prints received and sent data),DropoutSocket
(drops packets randomly),CorruptedSocket
(shuffles individual packets probabilistically),ArraySocket
(for manually construct packets),DisorderSocket
(shuffle packets probabilistically), andUdtAdaptor
(utilizes udt.py here) - tools.py: some tools, including
ByteBuf
andprint_info
(print with mutex for testing) - packet.py: packet format
- protocol.py: core code is implemented here. It should be rdt.py but I finished it before rdt.py template was released. I am too lazy to rename it.
- receiver.py
- sender.py
- udt.py