# Network Slicing for mMTC and URLLC Using Software-Defined Networking with P4 Switches
## 3 The Proposed SDNPS
### Data Packet Format  
INT is a new monitoring technology based on P4. The main concept is collecting and reporting the network status in the data plane without the intervention of the control plane. In INT, network status information (for example, the switch queue occupancy, packet output rate, and processing delay) is encapsulated into a data packet or a predefined control packet by each P4 switch along a data transmission path. The packet carrying the collected network status information is extracted and sent to the application plane for further analysis prior to being forwarded to its destination. Thus, the load of bidirectional information exchange between the control plane and the data plane is considerably reduced, and up-to-date, accurate network status information in the data plane can be obtained and acted upon as quickly as possible. Figure 6 illustrates the procedure for INT. The INT source, INT transit hop, and INT sink are all P4 switching devices that support INT and represent the start, middle, and end point of a flow path, respectively. As shown in Figure 6, the INT procedure is divided into three steps:  
1. When a data packet from the source host enters the data plane, the INT source can add an INT header to tell the subsequent P4 switches which information (called 'INT data') they should write. 2. The INT transit hop can write its own INT data into the specified field in accordance with the content indicated by the INT header. 3. When a data packet carrying INT data arrives at the INT sink, all of the recorded INT data along a flow path are extracted and reported to the collector module. The original data packet is then forwarded to the destination host. Figure 5: SDNPS framework. Up to now, the P4 language and related specifications provide the following eight INT Metadata [46]. 1. Switch ID: the unique ID of a switch. 2. Ingress port ID: the port ID of a received INT packet. 3. Ingress timestamp: the time that an INT packet is received. 4. Egress port ID: the port ID of a forwarded INT packet. 5. Hop latency: the processing time of an INT packet in the switch. 6. Egress port transmission (TX) link utilization: the link bandwidth utilization when an INT packet is forwarded. 7. Queue occupancy: queue occupancy observed at the switch when an INT packet is forwarded. 8. Queue congestion status: congestion status of the current queue. Among the above Metadata, hop latency, egress port TX link utilization, and queue occupancy are used by the proposed SDNPS to manage the flow paths in the mMTC and URLLC slices. INT does not specify the packet encapsulation format. The format of the INT header and which INT data each P4 switch should write can be defined by the administrator. SDNPS writes 0 \(\times\) 0801 in the EtherType field of the Ethernet header to identify if it is a P4 switch (Figure 7). If it is a P4 switch, the field 'Flow_h' follows the EtherType field. Flow_h (i.e., Flow Header) is mainly used to inform P4 switches as to whether the forwarded packet contains INT data because the INT data for each P4 switch are sent only periodically--not with every data packet. Figure 8 presents the format of the 4-byte flow header (denoted as Flow_h), comprising Protocol (1 byte), Counter (1 byte), and RouteID (2 bytes). The Protocol field is set to 0 \(\times\) 00 and 0 \(\times\) 01 in our framework to identify whether the data after the Flow Header are an IP header or INT data, respectively. The Counter field records the number of P4 switches a packet passes through; each P4 switch adds one. The RouteID is configured in accordance with the source IP and destination IP. Each RouteID is unique and indicates a flow path; packets containing INT data include these data from each P4 switch along the flow path indicated by the RouteID. Figure 9 presents the format of the 5-byte INT data (denoted as INT_h) for a P4 switch, comprising SwitchID (1 byte), Qoccupancy (1 byte), Qlatency (2 bytes), and Link_utilization (1 byte).