## 4 Cache-Supported ICN Router
### Architecture Design  
Software-defined networking (SDN) [35] is widely used in designing ICN routers because it is able to support new network protocols without upgrading the network equipment. Recent research has proposed some new SDN technologies, such as protocol oblivious forwarding (POF) [36] and programming protocol-independent packet processors (P4) [37]. OPF technology adopts the matching method of \(<\)offset, length\(>\), which can support almost any new protocol including those customized by developers themselves. Hence, we selected OPF to develop the forwarding function in our router.  
Figure 3 depicts the software architecture comprised by various function modules such as _packet routing_, _cache service_, _cache management_, and _ICN transport protocol stack_.  
The _cache service_ module consists of two submodules, chunk assemble and request service, which are the two aspects of read and write of chunk operation.  
_Chunk assemble submodule_: Due to the limitations of network MTUs, a chunk is segmented into packets of different sizes for transmission. The problem then is that incoming packets belonging to same chunk may be lost or out of order when routers collect ICN packets in a complex real network. Therefore, the _chunk assemble_ submodule assembles packets with same name into a complete chunk, and then it verifies the chunk's integrity and the validity of the name. The process of chunk assembling brings inevitable delays, which makes it impossible to complete the cache operation while guaranteeing wire-speed forwarding. We adopted a split structure [26] to decouple low-speed block device I/O operations from the forwarding path. Consequently, a cache-supported router is decomposed into two separate processes: a forwarding element (FE) and a cache element (CE), between which both messages and chunks pass via inter-process communication.  
_Request service_ submodule: When a router receives a data request packet, the _request service_ submodule fetches the requested chunk from the disk by sending a message to the CE. The chunk is put into an ICN transmission protocol stack for specific sending.  
Packet routing moduleThe _packet routing_ module in an FE includes two submodules: The _IP routing_ submodule and the _ICN routing_ submodule, which forward the ICN and IP flows according to the flow rules issued by the controller. In addition, the _ICN routing_ submodule makes caching decisions for passing packets based on certain caching strategy.  
ICN transport protocol stackThe _ICN transport protocol stack_ provides reliable and low latency transmission based on chunks. Appropriate transport protocols containing retransmission and congestion control guarantee the quality of service (QOS) of ICN. For example, the router shapes the interest rate when it detects occurring congestion via an active queue management algorithm [30]. We do not expand on the relevant design details since they are not the focus of this paper.  
Cache management moduleThe _cache management_ module mainly manages chunks cached in the CE, which includes three submodules. The _cache replacement_ submodule replaces the unpopular chunks following the LRU policies when the disk space is insufficient. The _cache index_ submodule is a hash table used to store the mapping of content name and store address. To speed up the lookup, we set the size of each bucket in hash table to the size of the Central Processing Unit (CPU) cache line. The _register/logout_ module is responsible for communicating with the NRS. When a chunk is successfully written into disk or deleted, this submodule needs to register/logout the mapping of the content EID and NA of router in the NRS.