## 4 RSCR
### Architecture
Through processing the collected information, extracting computing resources is performed to achieve computing resource awareness. (6) Network Resource Perception Unit: This unit is divided into two functions: Topology Discovery and Link Status Perception. The Topology Discovery module sends request messages to forwarding devices (switches) in the data plane, and the forwarding devices respond by sending feature information such as ID, port count, and port status. Based on the received messages, this module associates each port of each switch with neighboring switch ports and hosts connected to each switch port, thereby inferring the network topology. The Link Status Perception module is mainly responsible for perceiving fundamental data on link status in terms of computing delay (\(d_{link}\)), instantaneous throughput (\(bwu_{link}\)), and packet loss rate (\(l_{link}\)). (7) Computing-Network Resource Processing Unit: This unit mainly consists of two modules, namely Network Resource Processing and Computing Resource Processing. Network Resource Processing is responsible for processing the collected raw network data, calculating available bandwidth (\(bwa_{link}\)), delay (\(d_{link}\)), and packet loss (\(l_{link}\)). The controller periodically sends Port-Stats-Request messages to specified switches at each port. It retrieves the sent byte count (\(bt_{1}\)), received byte count (\(bt_{2}\)), and port lifetime (time difference between sending and receiving data) \(\delta t\) from the Port-Stats-Reply messages from the switches. With this information, it can calculate the instantaneous throughput \(bwu_{link}=\frac{b_{2}-b_{1}}{\Delta t}\). Therefore, the available bandwidth of the link (\(bwa_{link}\)) is represented as the difference between link capacity (\(cap_{link}\)) and instantaneous throughput can be represented as \(bwa_{link}=cap_{link}-bwu_{link}\). The link's instantaneous packet loss rate (\(l_{link}\)) can be represented as \(l_{link}=\frac{b_{1}-b_{2}}{b_{1}}\). The calculation of link latency follows the method described in reference [42], which adheres to the Link Layer Discovery Protocol (LLDP) [43] and the OpenFlow protocol [44]. The SDN controller \(c_{0}\) sends LLDP messages, and the messages traverse the path \(c_{0}-s_{i}-s_{j}-c_{0}\), where \(s_{i}\), \(s_{j}\) represent the switches connected by the link \((s_{i},s_{j})\). The time difference between the LLDP message transmission and reception, denoted as \(d_{lld_{P_{0}}}\), estimates the time it takes for the message from \(c_{0}\) to port \(s_{i}\). This estimation considers half of the time for the transmission and reception of OpenFlow echo_request and echo_reply messages sent from \(c_{0}\) to \(s_{i}\). A similar process is used to estimate the time the message takes from \(s_{j}\) to \(c_{0}\). Therefore, the instantaneous latency of the link \((s_{i},s_{j})\), denoted as \(d_{link}\), can be represented as \(d_{link}=d_{s_{i}-s_{j}}=d_{lld_{P_{0}}}-d_{c_{0}-s_{i}}-d_{s_{j}-c_{0}}\). Computing-Network Resource Processing involves segmenting compute nodes based on their computing capabilities according to the DCRMM algorithm, using the collected compute resource data. (8) Computing Routing Calculation Unit: Analyzing the current network link status and compute distribution based on computing-network resource data, coupled with the compute resource requirements of computing tasks, this unit calculates the optimal routing. The specific calculation method will be detailed in Section 5. (9) Computing Routing Deployment Unit: This unit proactively writes flow table entries into the switches in the network through SDN applications, guiding the processing and forwarding of traffic. This process is typically accomplished using the Southbound Interface (SBI). By installing flow table entries on switches, the SDN controller can precisely define how to handle specific types of traffic, including routing, filtering, forwarding, or modification. The installation of flow table entries affects the traffic forwarding in the data plane [45].