Through the Internet, use socket programs to setup a simple link layer protocol between your computer anda server to fulfills the following tasks:
1)Read the small jpeg file [url removed, login to view] or other files in a binary format using the transmitter computer orphone.
2)Pack the bit stream of the file into many I-frames with sizes of 1024bit (or others) payload.
3)Each frame contains a header of 01111110.
4)Each frame has a frame counter (1Byte).
5)Each frame attach with a CRC check by using a divisorx4+x3+x2+ 1(11101) or standard CRC16.
6)The server will bounce back the packets at a packet error rate of20%randomlly. When receiving thepacket, perform CRC check.
7)Use stop and wait automatic repeat request (ARQ) for error control by resenting incorrect packet untilit is correctly received.
8)Write the receiver bit stream to a file in binary format and play/show it.
9)the server address is:[url removed, login to view]
2 -- Requirements and Suggestions
1)Test sample codes as the first step.
2)Use a build-in test frame to realize the function before actually transfer the file.
3)Addition to transfer the file, the option is to establish a live audio/video streaming, if time allows.
3 Socket Sample Codes in Matlab
clear all; close all;
u=udp(’[url removed, login to view]’,9990,’LocalPort’,3000);
fprintf(’%d,transmitted: %s, received: %s\n’,i,message,fscanf(u));
% This is for I/O interface
clear all;close all;
fid1=fopen(’[url removed, login to view]’,’rb’);
fid2=fopen(’[url removed, login to view]’,’wb’);
[Ys,Fs]=audioread(’[url removed, login to view]’);