Documentation for EDIF Demo (Version 1)

Part 1: CP (Content Provider)

Introduction: Get an file from CP's hard disk, and search for keywords. If match, then mark them with EDIP and IPv6 header. If not match, then only encapsulate them with IPv6. No matter which case, the final IPv6 packages will be wrapped with IPv4 header, and sent throught IPv4 network. See the illustration below.

 

Fig-1: CP Architecture   

 

Related files: common.h, cpbuffedif.c, cpsenderedif.c, cpip6edif.c, filenames.edif

common.h: contains all static parameters, definitions, and common functions that may shared by both CP or AR (Adaptation Router).

cpbuffedif.c: Make a share memory buffer accessible by both the IPv6 encapsulation and the CP sender.

cpsenderedif.c: A program in charge of sending packages to AR over IPv4 network.

cpip6edif.c: A program simulating TCP/UDP encapsulation, EDIP marking and IPv6 encapsulation.

filenames.edif: Contains the file names that the CP is going to send to end user via AR.

 

Part 2: AR (Adaptation Router)

Introduction: Get an file from CP's hard disk, and search for keywords. If match, then mark them with EDIP and IPv6 header. If not match, then only encapsulate them with IPv6. No matter which case, the final IPv6 packages will be wrapped with IPv4 header, and sent throught IPv4 network. See the illustration below.

 

Fig-2: AR Architecture

 

related files: common.h, arbuffedif.c, arinedif.c, aroutedif.c, apiedif.c

common.h: contains all static parameters, definitions, and common functions that may shared by both CP or AR (Adaptation Router).

arbuffedif.c: defines two share memory blocks: one is shmbuffedit, which is an API editing buffer that connects arinedif.c and apiedif.c; the other one is shmbuffarout, which is sender's buffer that connects apiedif.c , arinedif.c and aroutedif.c

arinedif.c: controls data intake for AR. It includes the parts of EDIF Stream Controller and Decapsulation of IPv6/EDIP/TCP/UDP shown in fig-2.

aroutedif.c: controls data output for AR. It includes the parts of AR OUT and Encapsulation of IPv6/EDIP/TCP/UDP shown in fig-2.

apiedif.c: contains EDIF adaptation API and one user application running on top of that.

 

Part 3:  EU (End User Agent)

EU is simulating the end user agent, who will store the incoming data to hard disk.

related files: common.h, eu.c

eu.c: stores the incoming data packages to a buffer. When the stream is completed, then write it to hard disk.

 

Part 4: Bugs known and suggestions:

There is only one bug known. But there are several potential ones. The code is not fullly "boundary-checked". Boundary checks are done at the most error-prone places, such as share memory buffer. But there are some left.

Bug: If you want to transfer a large volume of data in a short time, say 10M in 1 second, the AR/CP will quit. This is because the current version use TCP as the ground to transfer IPv4 data. It will setup a TCP connection to transfer one IPv6 package over IPv4 network. After the tranfer is completed, it will close the connection. However, there is an unavoidable "TIME_Wait" for 1 mins (normally, 2 times of TTL) hold by the system. Before the TCP port is released, system will assign new ports to the following connections. When data volume is big, port numbers will be run out. That caused the AR/CP quits.

Solution: The solution is to change TCP connection to UDP connection as the ground to transfer IPv4 data. The file need to be modified includes cpsenderedif.c, arinedif.c, aroutedif.c, eu.c