detail the applicati<strong>on</strong>’s functi<strong>on</strong>s, at this point it becomes necessary to make a brieflyexplanati<strong>on</strong> about MPEG files.3.1 <str<strong>on</strong>g>Applicati<strong>on</strong></str<strong>on</strong>g> general structureThe user software is composed by four executable files, each <strong>on</strong>e running a distinctsystem process, two in the sending terminal and the other two in the receiving <strong>on</strong>e:Parser and Sender are the former, and Receiver and Mpeg_play are the other two.Being yet <strong>on</strong>ly a prototype, the software management is not intuitive for theinexperienced user. We will now explain how they interact:First, in the receiver terminal, the Mpeg_play must be called, this means that wewill have a process running and wainting. Then the Receiver is started, thereby anotherwaiting process will be in standby in the terminal. Now, the sending terminal must bestarted. The first process to be called is the Sender, after that the Receiver process mustanswer because of the <strong>MMTP</strong> handshake process. After that, the Parser process isstarted with the movie file name filled in the command line; then streaming processbegins. The Parser program sends the mpeg frames, through a local UDP pipe, to theSender. The Sender will encapsulate those mpeg frames in a <strong>MMTP</strong> packet and willsend them through the Internet to the Receiver process, running in the other terminal.The Receiver retrieves the frames in the correct order and delivers them to theMpeg_play process, through another UDP local pipe. The frames are exhibited by thetime they arrive in the receiver terminal due to the minimal processing time expended inthe local pipe. The process is illustrated in the figure above:Parser (local UDP pipe) Sender (<strong>MMTP</strong>) Receiver (local UDP pipe) Mpeg_playMpeg videoframes<strong>MMTP</strong> c<strong>on</strong>trol packets anddataMpeg videoframs<strong>MMTP</strong> c<strong>on</strong>trol packetsSec<strong>on</strong>d c<strong>on</strong>figurati<strong>on</strong>: mpegvideo frames transmissi<strong>on</strong> throughUDP, without <strong>MMTP</strong>.Inter-process communicati<strong>on</strong>One of the reas<strong>on</strong>s for the entire applicati<strong>on</strong> be c<strong>on</strong>structed in that way was tokeep the edge processes (Parser and Mpeg_play) independents. In that way, we couldhave the same applicati<strong>on</strong> transmitting mpeg frames <strong>on</strong>ly over UDP (without the<strong>MMTP</strong> protocol encapsulati<strong>on</strong>). Therefore we were able to compare the <strong>MMTP</strong>protocol performance face n<strong>on</strong>e applicati<strong>on</strong>-level-transport protocol.
The actual state of the applicati<strong>on</strong> demands attenti<strong>on</strong> from the user. They mustbe started in the way it was presented: First, receiving terminal: Mpeg_play andReceiver. Then, the sending terminal: Sender and Parser.Another important issue remains over the implementati<strong>on</strong> of the <strong>MMTP</strong>protocol. Three distinct main programs compose the original <strong>MMTP</strong> protocol package:source, sender and receiver [2]. Our applicati<strong>on</strong> did not require the source program,which was formerly built for testing purposes. The present state of the <strong>MMTP</strong> protocolrequires a c<strong>on</strong>figurati<strong>on</strong> file for each running program, the “params.txt”. It is a text filewhere the user must correctly fill in some informati<strong>on</strong>. Some of them, like initial<strong>MMTP</strong> rate and network latency, may be acquired over the network through probingprocesses (this is currently under work, in the present state they must be filled in by theuser) other may not (like machine addresses and ports).We choose to keep this characteristic of the protocol and we applied the sameidea in our two extra programs. Therefore all the four applicati<strong>on</strong> programs have, each<strong>on</strong>e, a c<strong>on</strong>figurati<strong>on</strong> file. Using the “params.txt” file for the Parser program, we areable to choose the frame rate and the transmissi<strong>on</strong> protocol (this means the presence ornot of the <strong>MMTP</strong> protocol).3.2 The playback program Mpeg_playThe basic structure is <str<strong>on</strong>g>based</str<strong>on</strong>g> <strong>on</strong> the client-server paradigm. One terminal waits requestscoming from the network and another terminal must send the request to start thestreaming. In that way, we will have a database of mpeg movies in the server and aclient receiving them and performing the playback.Our user level client is an adjustment of the original software created by [10] formpeg files playback <strong>on</strong>ly. Instead of reading a file from the hard disk, ourimplementati<strong>on</strong> reads blocks from a local UDP pipe between the player and the receivertransport applicati<strong>on</strong>. Those blocks must be well-defined frames from the original file;otherwise the player will not recognize them and will stop the executi<strong>on</strong>. Thoseadjustments in the original program were made in a functi<strong>on</strong> called “get_more_data”,which uses another functi<strong>on</strong> called “pure_get_more_data”. They are located in thearchive “readfile.c”.The “get_more_data” functi<strong>on</strong> does the reading of the mpeg file from the diskand loads the memory buffer with it. Besides, it analyses the presence of system calls inthe bitstream to return the presence or not of multiplexed audio with the video. If audiois detected, it calls the “read_sys” functi<strong>on</strong> to separate it from the video stream. Thisproceeding does <strong>on</strong>ly the disjointing of the audio stream, without processing it. In fact,the present state of the Berkley mpeg player is not processing audio. Therefore, thestudy of the “read_sys” functi<strong>on</strong> is now unnecessary. C<strong>on</strong>tinuing, if no audio isdetected, the “get_more_data” functi<strong>on</strong> calls the “pure_get_more_data” functi<strong>on</strong> toread <strong>on</strong>ly video stream.The exhibiti<strong>on</strong> of the frames is d<strong>on</strong>e by a functi<strong>on</strong> called “correct_underflow”(located in the “utils.c” archive of the original program). This functi<strong>on</strong> is called severaltimes during the video decoding and, therefore, it uses the two functi<strong>on</strong>s describedabove. Every time the memory buffer needs to be loaded, the program calls“correct_underflow”. The next proceeding made in the original program was thereplacement of the C functi<strong>on</strong> fread to a <strong>MMTP</strong> functi<strong>on</strong> called “UdpRecv” in the