This application relates to the communication field, and in particular, to a communication method, a related apparatus, and a storage medium.
Various types of services exist in a network, and some of the services have a requirement for transparent transmission of a clock frequency. In other words, only when a clock frequency of a service data stream sent by a communication device a1 is basically consistent with a clock frequency of the service data stream received by a communication device a2, the communication device a2 can correctly parse the received service data stream. For example, the services with the requirement for transparent transmission of a clock frequency are constant bit rate (CBR) services such as a common public radio interface (CPRI) service and a synchronous digital hierarchy (SDH) service.
Currently, a clock frequency of a service can be transmitted based on a circuit emulation service (CES). Specifically, a communication apparatus processes an original service data stream on a user network interface (UNI); extracts a data frame of an original service; adds a corresponding Ethernet frame header, a pseudo wire overhead, a real-time transport protocol (RTP) header, an Ethernet header, and a frame check sequence (FCS), to form an Ethernet packet; and then sends the Ethernet packet through an interface (NNI), for example, an interface between networks or an interface between devices in a network. Clock frequency information of the service data stream may be placed in the RTP header. It can be learned that the data frame needs to be encapsulated into the Ethernet packet in the foregoing solution. In this way, after receiving the Ethernet packet, another communication apparatus needs to perform layer 2 (L2) processing (which need to be performed on the Ethernet frame header, the RTP header, and the pseudo wire header), and needs to perform an operation, for example, packet assembly, which is complex.
On the other hand, the flexible Ethernet (FlexE) combines some technical features of the Ethernet and a transport network (for example, an optical transport network (OTN) and an SDH), and is an important milestone in evolution of the Ethernet technology. As flexible Ethernet technologies emerge, an Ethernet physical interface has a feature of virtualization. A plurality of Ethernet physical interfaces may be cascaded, to support several virtual logical ports. For example, a 400-gigabit (400 G) flexible Ethernet physical interface group obtained by cascading four 100-gigabit Ethernet (100 GE) physical interfaces can support several logical ports. The International Telecommunication Union Telecommunication Standardization Sector (ITU-T) defines a next-generation transport network technology system (MTN) based on reuse of FlexE logic to meet a requirement of a new service, for example, the 5th generation (5G) mobile network. The MTN is a new transport network layer network including an MTN section layer and an MTN path layer. A physical layer is compatible with existing standard 50GBASE R, 100GBASE R, 200GBASE R and 400GBASE R interfaces and the like.
In a bearer network based on the FlexE, the MTN, or the like, how to implement transparent transmission of clock frequency information of a service data stream becomes a problem that needs to be urgently resolved.
Embodiments of this application provide a communication method, a related apparatus, and a storage medium, to resolve transparent transmission of clock frequency information of a service.
According to a first aspect, an embodiment of this application provides a communication method, and the method may be performed by a first communication apparatus. The first communication apparatus receives a first service data stream, generates a first code block stream based on the first service data stream, and sends the first code block stream. The first code block stream includes first clock frequency information.
In a possible implementation, the first clock frequency information may indicate a moment at which the first communication apparatus receives k first data frames of the first service data stream. In another possible implementation, the first clock frequency information may indicate transmission duration of k first data frames of the first service data stream. In still another possible implementation, the first clock frequency information indicates a moment at which the first communication apparatus receives k first data frames of the first service data stream, and may further indicate transmission duration of the k first data frames of the first service data stream.
The first code block stream sent by the first communication apparatus includes the first clock frequency information, and the first clock frequency information indicates the transmission duration of the k first data frames and/or the transmission moment at which the first communication apparatus receives the k first data frames. Therefore, a second communication apparatus may send the k first data frames based on the first clock frequency information, so that a clock frequency of the k first data frames sent by the second communication apparatus are basically consistent with a clock frequency of the k first data frames received by the first communication apparatus. This can resolve transparent transmission of clock frequency information of a service.
In a possible implementation, the first clock frequency information may indicate the transmission duration of the k first data frames of the first service data stream. For example, the first clock frequency information includes a first count value, and the first count value is a quantity of periods of a clock frequency of a local clock signal of the first communication apparatus in duration in which the first communication apparatus receives the k first data frames. In this way, the second communication apparatus may send, based on a local clock signal of the second communication apparatus, the k first data frames in duration of periods whose quantity is the first count value and that are of the local clock signal of the second communication apparatus. In this way, the clock frequency of the k first data frames sent by the second communication apparatus can be basically consistent with the clock frequency of the k first data frames received by the first communication apparatus, to resolve transparent transmission of clock frequency information of a service. In addition, transparent transmission of the clock frequency information is implemented by transmitting the first count value, to reduce bits of information that needs to be transmitted.
In a possible implementation, the first clock frequency information may indicate the transmission duration of the k first data frames of the first service data stream. For example, the first clock frequency information includes a second count value, and the second count value is a difference between a first count value and a preset count value. In this way, the second communication apparatus may calculate the first count value based on the second count value and the preset count value, so that the second communication apparatus may resolve transparent transmission of clock frequency information of a service based on the local clock signal of the second communication apparatus and the first count value. In addition, because the second count value is the difference between the first count value and the preset count value, a quantity of bits occupied by the second count value may be less than a quantity of bits occupied by the first count value. Therefore, transparent transmission of the clock frequency information is implemented by transmitting the second count value, to further reduce bits of information that needs to be transmitted.
To improve flexibility of the solution, in a possible implementation, the first clock frequency information includes a second count value and a preset count value. In this way, the second communication apparatus may calculate a first count value based on the second count value and the preset count value, so that the second communication apparatus may resolve transparent transmission of clock frequency information of a service based on the local clock signal of the second communication apparatus and the first count value. In addition, in still another possible implementation, sending periods of the second count value and the preset count value may be separately set. For example, the sending period of the preset count value may be larger than the sending period of the second count value. This can reduce a quantity of times of sending the preset count value, and save resources. Further, because the first communication apparatus further sends the preset count value to the second communication apparatus, the first communication apparatus may more flexibly change a value of the preset count value, and the second communication apparatus may directly determine the preset count value from received data. It can be learned that the specific value of the preset count value may be more flexible and variable in this solution.
In a possible implementation, the preset count value may be a preset value. For example, the preset count value may be manually configured in the first communication apparatus. For another example, a rule and an initial value may be manually configured in the first communication apparatus, and then the first communication apparatus may obtain the preset count value through calculation according to the configuration rule and the initial value.
In a possible implementation, the preset count value is a quantity of periods of a clock frequency of a reference clock signal in preset duration. A difference between the preset duration and the transmission duration of the k first data frames is less than a preset difference threshold. It may also be understood as that a deviation exists between transmission duration of any two groups of data frames (each group has k data frames) of the first service data stream. That the difference between the preset duration and the transmission duration of the k first data frames is less than the preset difference threshold may also be understood as that the preset duration is close to average transmission duration of the k data frames of the first service data stream, so that a difference between transmission duration of each group of data frames and the preset count value may be small.
In a possible implementation, the first clock frequency information may indicate the transmission moment at which the first communication apparatus receives the k first data frames. In a possible implementation, the first clock frequency information includes a moment at which a frame header of a 1st data frame in the k first data frames is received, and a moment at which a frame trailer of a kth first data frame in the k first data frames is received. In this way, the second communication apparatus may send the k first data frames based on the received first clock frequency information, to resolve transparent transmission of clock frequency information of a service. In another possible implementation, the second communication apparatus may calculate the transmission duration of the k first data frames based on the two receiving moments. This manner is simple, and another reference value is not required for calculation. In this implementation, it may also be understood as that the first clock frequency information may indicate the transmission duration of the k first data frames of the first service data stream.
In this embodiment of this application, when the first clock frequency information includes the moment at which the frame header of the 1st data frame in the k first data frames is received, the moment, included in the first clock frequency information, at which the frame header of the 1st data frame in the k first data frames is received may be a moment at which the first communication apparatus receives the frame header of the 1st data frame in the k first data frames. When the first clock frequency information includes the moment at which the frame trailer of the kth first data frame in the k first data frames is received, the moment, included in the first clock frequency information, at which the frame trailer of the kth first data frame in the k first data frames is received may be a moment at which the first communication apparatus receives the frame trailer of the kth first data frame in the k first data frames.
In a possible implementation, the first clock frequency information may indicate the transmission duration of the k first data frames of the first service data stream, the first clock frequency information includes first duration, and the first duration is the transmission duration of the k first data frames. In this way, the second communication apparatus may send the k first data frames based on the received first duration, to resolve transparent transmission of clock frequency information of a service. This manner is simple, and the first communication apparatus and the second communication apparatus do not need to have a same frequency point.
In a possible implementation, the first clock frequency information may indicate the moment at which the first communication apparatus receives the k first data frames of the first service data stream. The first clock frequency information includes the moment at which the frame header of the 1st data frame in the k first data frames is received. If data frames corresponding to one piece of clock frequency information are referred to as a group of data frames, for example, because the first clock frequency information indicates the transmission duration of the k first data frames, the k first data frames may be referred to as a group of data frames, the second communication apparatus may send the k first data frames based on the received first clock frequency information, to resolve transparent transmission of clock frequency information of a service. This manner is simple, and the first communication apparatus and the second communication apparatus do not need to have a same frequency point.
In a possible implementation, the first clock frequency information includes the moment at which the frame trailer of the kth data frame in the k first data frames is received. In this way, the second communication apparatus may send the k first data frames based on the received first clock frequency information, to resolve transparent transmission of clock frequency information of a service. This manner is simple, and the first communication apparatus and the second communication apparatus do not need to have a same frequency point.
In a possible implementation, the first clock frequency information includes a third count value. The third count value is a quantity of periods of a clock frequency of a local clock signal of the first communication apparatus in second duration, and the second duration is duration from a preset moment to a moment at which a frame header of a 1st first data frame in the k first data frames is received. In this way, the second communication apparatus may send the k first data frames based on the received first clock frequency information, to resolve transparent transmission of clock frequency information of a service.
In a possible implementation, the first clock frequency information includes second duration. In this way, the second communication apparatus may send the k first data frames based on the received first clock frequency information, to resolve transparent transmission of clock frequency information of a service. This manner is simple, and the first communication apparatus and the second communication apparatus do not need to have a same frequency point.
In a possible implementation, the first clock frequency information includes a fourth count value. The fourth count value is a quantity of periods of a clock frequency of a local clock signal of the first communication apparatus in third duration, and the third duration is duration from a preset moment to a moment at which a frame trailer of a kth first data frame in the k first data frames is received. In this way, the second communication apparatus may send the k first data frames based on the received first clock frequency information, to resolve transparent transmission of clock frequency information of a service.
In a possible implementation, the first clock frequency information includes third duration. In this way, the second communication apparatus may send the k first data frames based on the received first clock frequency information, to resolve transparent transmission of clock frequency information of a service. This manner is simple, and the first communication apparatus and the second communication apparatus do not need to have a same frequency point.
In a possible implementation, the first code block stream further includes second clock frequency information, and the second clock frequency information indicates transmission duration of k second data frames of the first service data stream, and/or a moment at which the first communication apparatus receives the k second data frames of the first service data stream. Because the first code block stream includes a plurality of pieces clock frequency information, the second communication apparatus may send the restored first service data stream based on the plurality of pieces clock frequency information, and a clock frequency of the first service data stream sent by the second communication apparatus can be basically consistent with a clock frequency of the first service data stream received by the first communication apparatus, to resolve transparent transmission of clock frequency information of a service.
In a possible implementation, the first code block stream includes a first data unit group, the first data unit group includes W1 first data units, W1 is a positive integer, and the first clock frequency information is carried in at least one of the W1 first data units.
W1 may be equal to 1. In this case, it may be understood that the k first data frames are encapsulated in one first data unit. The first clock frequency information is also carried in the first data unit.
W1 may alternatively be greater than 1. In this case, it may be understood that the k first data frames are encapsulated in W1 (a plurality of) first data units. Some first data units in the W1 first data units may carry the first clock frequency information. For example, the first clock frequency information may be carried in one first data unit in the W1 first data units, or may be carried in two first data units in the W1 first data units. One of the two first data units may carry a portion of the first clock frequency information.
For the first data unit carrying the first clock frequency information, to improve flexibility of the solution, the first clock frequency information may be carried in at least one of the following content of the first data unit: a header code block, at least one data code block, a tail code block, or an operations, administration, and maintenance code block.
For the first data unit carrying the first clock frequency information, to improve flexibility of the solution, the first clock frequency information may be carried in at least one of the following content of the first data unit: an overhead area or a payload area.
In a possible implementation, bits corresponding to the k first data frames are carried in a payload area of a data code block in the at least one data code block of a first data unit in the W1 first data units. In a possible implementation, bits corresponding to the k first data frames are carried in the tail code block and a payload area of a data code block in the at least one data code block of a first data unit in the W1 first data units. For example, the tail code block is a T7 code block.
In a possible implementation, the at least one first data unit in the W1 first data units carries first indication information, and the first indication information indicates that the first data unit carrying the first indication information carries the first clock frequency information.
In this way, when receiving the first indication information, the second communication apparatus may determine, based on the first indication information, that the first data unit carrying the first indication information carries the first clock frequency information, to obtain the first clock frequency information from the first data unit. In this embodiment of this application, the first communication apparatus side and the second communication apparatus side may agree, in advance, on whether one piece of clock frequency information is carried in one data unit or a plurality of data units. If it is agreed that one piece of clock frequency information is carried in one data unit, the first indication information indicates that the first data unit that carries the first indication information carries all of the first clock frequency information. If it is agreed that one piece of clock frequency information is carried in a plurality of data units, the first indication information indicates that the first data unit carrying the first indication information carries a portion of the first clock frequency information.
In a possible implementation, the at least one first data unit in the W1 first data units carries second indication information, and the second indication information indicates that the first data unit carrying the second indication information does not carry the first clock frequency information.
In this way, when receiving the second indication information, the second communication apparatus may determine, based on the second indication information, that the first data unit carrying the second indication information does not carry the first clock frequency information, and therefore, does not need to obtain the first clock frequency information from the first data unit.
In a possible implementation, the first clock frequency information is carried in a payload area of a first data code block of the at least one first data unit in the W1 first data units. In this case, the tail code block of the first data unit carrying the first clock frequency information may be a Ty code block. Because the Ty code block has a large quantity of bits that can be used to carry data, when a payload area occupying the data code block carries the first clock frequency information, some fields of the tail code block T7 may be used to carry bits of the k first data frames, to reduce a quantity of data code blocks of the first data unit.
In a possible implementation, two first data units in the W1 first data units include a same quantity of data code blocks. The first service data stream may be a data stream with a constant rate. When the first communication apparatus receives the first service data stream and encapsulates the first service data stream, quantities of data code blocks of the two data units of the first code block stream corresponding to the first service data stream are the same, to simplify an encapsulation process.
In a possible implementation, the first code block stream further includes a second data unit group, the second data unit group includes W2 second data units, W2 is a positive integer, and a second data unit in the W2 second data units carries the k second data frames of the first service data stream. A quantity of data code blocks included in one second data unit in the W2 second data units is the same as a quantity of data code blocks included in one first data unit in the W1 first data units. The first service data stream may be a data stream with a constant rate. When the first communication apparatus receives the first service data stream and encapsulates the first service data stream, quantities of data code blocks of the two data units of the first code block stream corresponding to the first service data stream are the same, to simplify an encapsulation process.
In a possible implementation, W1 is equal to W2. In this way, a quantity of data units carrying the k first data frames is equal to a quantity of data units carrying the k second data frames, to further simplify an encapsulation process of the code block stream.
In a possible implementation, before generating the first code block stream based on the first service data stream, the first communication apparatus may further receive Q0 second service data streams, where Q0 is a positive integer. The first communication apparatus may generate the first code block stream based on the first service data stream and the Q0 second service data streams. The first clock frequency information further indicates transmission duration of k third data frames of each of the Q0 second service data streams, and/or a moment at which the first communication apparatus receives the k third data frames. In this way, the first communication apparatus may receive a plurality of service data streams, and encapsulate the plurality of service data streams, to obtain the first code block stream. This can improve service processing efficiency.
In a possible implementation, the Q0 second service data streams and the first service data stream have a same source communication apparatus, and the Q0 second service data streams and the first service data stream have a same sink communication apparatus. In this way, in a process in which the first communication apparatus encapsulates the plurality of service data streams into the first code block stream and sends the first code block stream to the second communication apparatus, a communication apparatus of another intermediate node other than the second communication apparatus does not need to decapsulate the first code block stream, to improve a data transmission rate.
In a possible implementation, the first communication apparatus may multiplex, based on a preset order of the first service data stream and the Q0 second service data streams and on a basis of a bit block including no consecutive bits, bit blocks of the first service data stream and the Q0 second service data streams, to obtain a third service data stream, where no is a positive integer. The first communication apparatus generates the first code block stream based on the third service data stream. In this way, the first communication apparatus may perform parallel processing on a plurality of received service data streams. Compared with serial processing, parallel processing can reduce a data amount that needs to be buffered, and further reduce pressure of a buffer.
In a possible implementation, no is 8 bits or 256 bits. In this way, an arrangement manner of data that is from each service data stream and that is included in the first data unit may be adjusted by adjusting a value of no. In addition, with reference to a specific example, one pulse code modulation (pulse code modulation, PCM) frame of the first service data stream is 256 bits (32*8=256), and one PCM frame is truncated on a basis of 64 bits, to obtain four segments through truncation. Therefore, each data unit may carry one PCM frame by using payload areas of four D code blocks. If there are four service data streams, each data unit may include 16 D code blocks, the 16 D code blocks may carry four PCM frames from the four service data streams, and an arrangement manner of bits of the four PCM frames on the 16 D code blocks may vary with the value of no. In addition, the value of no is adjusted on a basis of bytes (8 bits), so that distribution of service data streams in the data unit can be more regular.
In a possible implementation, the first code block stream includes the first data unit group, and the first data unit group includes the W1 first data units.
When W1 is 1, one first data unit in the W1 first data units includes the bits corresponding to the k first data frames of the first service data stream, and bits corresponding to the k third data frames of each of the Q0 second service data streams. When W1 is 1, k data frames from the first service data stream and each of the Q0 second service data streams are encapsulated into one first data unit.
When W1 is an integer greater than 1, one first data unit in the W1 first data units includes some of the bits corresponding to the k first data frames of the first service data stream, and some of bits corresponding to the k third data frames of each of the Q0 second service data streams.
In a possible implementation, if W1 is an integer greater than 1, and k/W1 is an integer, one first data unit in the W1 first data units includes bits corresponding to (k/W1) first data frames of the first service data stream, and bits corresponding to (k/W1) third data frames of each of the Q0 second service data streams. When W1 is greater than 1, (k/W1) data frames from the first service data stream and each of the Q0 second service data streams are encapsulated into one first data unit. In this way, the plurality of service data streams may be evenly distributed in W1 data units in parallel.
In a possible implementation, the first communication apparatus may process the Q0 second service data streams, to generate Q0 third code block streams. The first service data stream is processed, to generate a second code block stream. The second code block stream includes the first clock frequency information, and the second code block stream includes the first clock frequency information and the k first data frames. The first communication apparatus may multiplex data in the Q0 third code block streams and the second code block stream, to obtain the first code block stream. This can improve solution flexibility.
In a possible implementation, the first communication apparatus may multiplex, based on a preset order of the Q0 third code block streams and the second code block stream and on a basis of N1 data units, data units of the Q0 third code block streams and the second code block stream, to obtain the first code block stream, where N1 is a positive integer. In this way, the obtained first code block stream is still a code block stream on a basis of a data unit, to lay a foundation for multiplexing the first code block stream and another code block stream again.
In a possible implementation, before sending the first code block stream, the first communication apparatus may further obtain Q1 fourth code block streams, where Q1 is a positive integer. The first communication apparatus performs time division multiplexing on code blocks of the Q1 fourth code block streams and the first code block stream according to a correspondence between the Q1 fourth code block streams and S1 first slots and a correspondence between the first code block stream and the S1 first slots, to obtain a fifth code block stream. The Q1 fourth code block streams and one code block stream in the first code block stream correspond to at least one first slot in the S1 first slots, where S1 is an integer not less than (Q1+1). The fifth code block stream is sent. In this scenario, the first code block stream may be a code block stream corresponding to a large-granularity slot, and may further be multiplexed with another code block stream of the large-granularity slot before being sent. This can expand the application scope of this application.
In a possible implementation, before sending the fifth code block stream, the first communication apparatus may further obtain Q2 sixth code block streams, where Q2 is a positive integer. The first communication apparatus may perform time division multiplexing on code blocks of the Q2 sixth code block streams and the fifth code block stream according to a correspondence between the Q2 sixth code block streams and S2 second slots and a correspondence between the fifth code block stream and the S2 second slots, to obtain a seventh code block stream. The Q2 sixth code block streams and one code block stream in the fifth code block stream correspond to at least one second slot in the S2 second slots, where S2 is an integer not less than (Q2+1). Second slots corresponding to the fifth code block stream are divided into the S1 first slots. The seventh code block stream is sent. In this scenario, the first code block stream may be a code block stream corresponding to a fine-granularity slot, and may further be multiplexed with another code block stream of the fine-granularity slot and then multiplexed with another code block stream of the large-granularity slot before being sent. This can expand the application scope of this application.
In a possible implementation, the first code block stream includes the first data unit group, the first data unit group includes the W1 first data units, and the first data unit in the W1 first data units includes one of the following content: a header code block and at least one data code block; a header code block, at least one data code block, and a tail code block; at least one data code block and a tail code block; a header code block, at least one data code block, and an operations, administration, and maintenance code block; a header code block, at least one data code block, a tail code block, and an operations, administration, and maintenance code block; or at least one data code block, a tail code block, and an operations, administration, and maintenance code block. This can improve solution flexibility.
In a possible implementation, the header code block is an S code block, the tail code block is a T code block, the data code block is a D code block, or the operations, administration, and maintenance code block is an O code block. Therefore, the solution may be more compatible with the existing standard.
According to a second aspect, an embodiment of this application provides a communication method, and the method may be performed by a second communication apparatus. The second communication apparatus obtains a first code block stream. The first code block stream includes first clock frequency information, and the first clock frequency information indicates transmission duration of k first data frames of a first service data stream, and/or a moment at which the k first data frames of the first service data stream are received, where k is a positive integer. The k first data frames and the first clock frequency information are obtained from the first code block stream. The second communication apparatus sends the k first data frames based on the first clock frequency information.
The first code block stream includes first clock frequency information, and the first clock frequency information indicates transmission duration of k first data frames of a first service data stream, and/or a moment at which the k first data frames of the first service data stream are received. Therefore, the second communication apparatus may send the k first data frames based on the first clock frequency information, so that a clock frequency of the k first data frames sent by the second communication apparatus are basically consistent with a clock frequency of the k first data frames received by a first communication apparatus. This can resolve transparent transmission of clock frequency information of a service.
In a possible implementation, for a specific implementation form and beneficial effect of the first clock frequency information, refer to related descriptions of the first aspect. Details are not described herein again.
In a possible implementation, the preset count value is a quantity of periods of a clock frequency of a reference clock signal in preset duration. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, a difference between preset duration and the transmission duration of the k first data frames is less than a preset difference threshold. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, the first code block stream further includes second clock frequency information. The second clock frequency information indicates transmission duration of k second data frames of the first service data stream, and/or a moment at which the first communication apparatus receives the k second data frames of the first service data stream. The second communication apparatus may further obtain the second clock frequency information and the k second data frames from the first code block stream, and send the k second data frames based on the second clock frequency information.
Because the first code block stream includes a plurality of pieces clock frequency information, the second communication apparatus may send the restored first service data stream based on the plurality of pieces clock frequency information, and a clock frequency of the first service data stream sent by the second communication apparatus can be basically consistent with a clock frequency of the first service data stream received by the first communication apparatus, to resolve transparent transmission of clock frequency information of a service.
In a possible implementation, the first code block stream includes a first data unit group, the first data unit group includes W1 first data units, W1 is a positive integer, and the first clock frequency information is carried in at least one of the following content of at least one first data unit in the W1 first data units: a header code block, at least one data code block, a tail code block, or an operations, administration, and maintenance code block. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, bits corresponding to the k first data frames are carried in one of the following content of a first data unit in the W1 first data units: a payload area of a data code block in the at least one data code block; or the tail code block and a payload area of a data code block in the at least one data code block. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, the at least one first data unit in the W1 first data units carries first indication information, and the first indication information indicates that the first data unit carrying the first indication information carries the first clock frequency information. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, the at least one first data unit in the W1 first data units carries second indication information, and the second indication information indicates that the first data unit carrying the second indication information does not carry the first clock frequency information. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, the first clock frequency information is carried in a payload area of a first data code block of the at least one first data unit in the W1 first data units. The tail code block of the first data unit carrying the first clock frequency information is a T7 code block. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, two first data units in the W1 first data units include a same quantity of data code blocks. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, the first code block stream further includes a second data unit group, the second data unit group includes W2 second data units, W2 is a positive integer, and a second data unit in the W2 second data units carries the k second data frames of the first service data stream. A quantity of data code blocks included in one second data unit in the W2 second data units is the same as a quantity of data code blocks included in one first data unit in the W1 first data units. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, W1 is equal to W2. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, the second communication apparatus may obtain the first clock frequency information from the first code block stream; and demultiplex the first code block stream, to obtain the first service data stream and Q0 second service data streams, where Q0 is a positive integer. The first clock frequency information further indicates transmission duration of k third data frames of each of the Q0 second service data streams, and/or a moment at which the first communication apparatus receives the k third data frames. In this way, a plurality of service data streams may be transmitted between the first communication apparatus and the second communication apparatus by using the first code block stream, to improve service processing efficiency.
In a possible implementation, the Q0 second service data streams and the first service data stream have a same source communication apparatus, and the Q0 second service data streams and the first service data stream have a same sink communication apparatus. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, the second communication apparatus may demultiplex the first code block stream on a basis of a bit block including no consecutive bits, to obtain the first service data stream and the Q0 second service data streams. In this way, the first communication apparatus may perform parallel processing on a plurality of received service data streams. Compared with serial processing, parallel processing can reduce a data amount that needs to be buffered, and further reduce pressure of a buffer.
In a possible implementation, no is 8 bits or 256 bits. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, the first code block stream includes the first data unit group, and the first data unit group includes the W1 first data units. When W1 is 1, one first data unit in the W1 first data units includes the bits corresponding to the k first data frames of the first service data stream, and bits corresponding to the k third data frames of each of the Q0 second service data streams.
When W1 is an integer greater than 1, one first data unit in the W1 first data units includes some of the bits corresponding to the k first data frames of the first service data stream, and some of bits corresponding to the k third data frames of each of the Q0 second service data streams.
In a possible implementation, W1 is an integer greater than 1. If k/W1 is an integer, one first data unit in the W1 first data units includes bits corresponding to (k/W1) first data frames of the first service data stream, and bits corresponding to (k/W1) third data frames of each of the Q0 second service data streams. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, the second communication apparatus may demultiplex the first code block stream, to obtain Q0 third code block streams and a second code block stream. The second code block stream includes first clock frequency information and the k first data frames. The second communication apparatus may obtain the first service data stream and the first clock frequency information from the second code block stream; and obtain the Q0 second service data streams from the Q0 third code block streams. This can improve solution flexibility.
In a possible implementation, the second communication apparatus may demultiplex the first code block stream on a basis of N1 data units, to obtain Q0 third code block streams and a second code block stream, where N1 is a positive integer. In this way, a processing process is simple, so that a data processing process can be simplified.
In a possible implementation, the second communication apparatus may obtain a fifth code block stream; and demultiplex the fifth code block stream according to a correspondence between Q1 fourth code block streams and S1 first slots and a correspondence between the first code block stream and the S1 first slots, to obtain the Q1 fourth code block streams and the first code block stream. The Q1 fourth code block streams and one code block stream in the first code block stream correspond to at least one first slot in the S1 first slots, where S1 is an integer not less than (Q1+1). In this scenario, the first code block stream may be a code block stream corresponding to a large-granularity slot. This can expand the application scope of this application.
In a possible implementation, before sending the fifth code block stream, the second communication apparatus may further obtain a seventh code block stream. The second communication apparatus may demultiplex the seventh code block stream according to a correspondence between Q2 sixth code block streams and S2 second slots and a correspondence between the fifth code block stream and the S2 second slots, to obtain the Q2 sixth code block streams and the fifth code block stream. The Q2 sixth code block streams and one code block stream in the fifth code block stream correspond to at least one second slot in the S2 second slots, and second slots corresponding to the fifth code block stream are divided into the S1 first slots, where S2 is an integer not less than (Q2+1). In this scenario, the first code block stream may be a code block stream corresponding to a fine-granularity slot. This can expand the application scope of this application.
In a possible implementation, the first code block stream includes the first data unit group, the first data unit group includes the W1 first data units, and the first data unit in the W1 first data units includes one of the following content: a header code block and at least one data code block; a header code block, at least one data code block, and a tail code block; at least one data code block and a tail code block; a header code block, at least one data code block, and an operations, administration, and maintenance code block; a header code block, at least one data code block, a tail code block, and an operations, administration, and maintenance code block; or at least one data code block, a tail code block, and an operations, administration, and maintenance code block. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
In a possible implementation, the header code block is an S code block, the tail code block is a T code block, the data code block is a D code block, or the operations, administration, and maintenance code block is an O code block. For related beneficial effect and descriptions, refer to related descriptions in the first aspect. Details are not described herein again.
According to a third aspect, a communication apparatus is provided, and includes a communication unit and a processing unit. The communication apparatus may be the foregoing first communication apparatus or the foregoing second communication apparatus. The communication apparatus may perform any one of the first aspect and the second aspect and any implementation of either the first aspect or the second aspect. The communication unit is configured to perform functions related to sending and receiving. Optionally, the communication unit includes a receiving unit and a sending unit. In a design, the communication apparatus is a communication chip, the processing unit may be one or more processors or processor cores, and the communication unit may be an input/output circuit or a port of the communication chip.
In another design, the communication unit may be a transmitter and a receiver, or the communication unit may be a transmitter machine and a receiver machine.
Optionally, the communication apparatus further includes modules that may be configured to perform any one of the first aspect and the second aspect and any implementation of either the first aspect or the second aspect.
According to a fourth aspect, a communication apparatus is provided, and includes a processor and a memory. The communication apparatus may be the foregoing first communication apparatus or the foregoing second communication apparatus. Optionally, a transceiver is further included. The memory is configured to store a computer program or instructions. The processor is configured to invoke the computer program or the instructions from the memory and run the computer program or the instructions. When the processor executes the computer program or the instructions in the memory, the communication apparatus is enabled to perform any one of the first aspect and the second aspect and any implementation of either the first aspect or the second aspect.
Optionally, there are one or more processors, and there are one or more memories.
Optionally, the memory may be integrated with the processor, or the memory and the processor are disposed separately.
Optionally, the transceiver may include a transmitter and a receiver.
According to a fifth aspect, a communication apparatus is provided, and includes a processor. The communication apparatus may be the foregoing first communication apparatus or the foregoing second communication apparatus. The processor is coupled to a memory, and may be configured to perform any one of the first aspect and the second aspect and any implementation of either the first aspect or the second aspect. The communication apparatus may be the foregoing first communication apparatus or the foregoing second communication apparatus. Optionally, the communication apparatus further includes the memory. Optionally, the communication apparatus further includes a communication interface, and the processor is coupled to the communication interface.
In an implementation, when the communication apparatus is the first communication apparatus or the second communication apparatus, the communication interface may be a transceiver or an input/output interface. Optionally, the transceiver may be a transceiver circuit. Optionally, the input/output interface may be an input/output circuit.
In another implementation, when the communication apparatus is a chip or a chip system of the first communication apparatus or a chip or a chip system of the second communication apparatus, the communication interface may be an input/output interface, an interface circuit, an output circuit, an input circuit, a pin, a related circuit, or the like in the chip or the chip system. The processor may alternatively be embodied as a processing circuit or a logic circuit.
According to a sixth aspect, a system is provided, and the system includes the foregoing first communication apparatus and second communication apparatus.
According to a seventh aspect, a computer program product is provided. The computer program product includes a computer program (which may also be referred to as code or instructions), and when the computer program is run, a computer is enabled to perform any one of the first aspect and the second aspect and any implementation of either the first aspect or the second aspect.
According to an eighth aspect, a computer-readable storage medium is provided. The computer-readable medium stores a computer program (which may also be referred to as code or instructions). When the computer program is run on a computer, the computer is enabled to perform any one of the first aspect and the second aspect and any implementation of either the first aspect or the second aspect.
According to a ninth aspect, a chip system is provided. The chip system may include a processor. The processor is coupled to a memory, and may be configured to perform any one of the first aspect and the second aspect and any implementation of either the first aspect or the second aspect. Optionally, the chip system further includes a memory. The memory is configured to store a computer program (which may also be referred to as code or instructions). The processor is configured to invoke the computer program from the memory and run the computer program, to enable an apparatus in which the chip system is installed to perform any one of the first aspect and the second aspect and any implementation of either the first aspect or the second aspect.
According to a tenth aspect, a processing apparatus is provided, and includes an interface circuit and a processing circuit. The interface circuit may include an input circuit and an output circuit. The processing circuit is configured to receive a signal by using the input circuit, and transmit a signal by using the output circuit, to implement any one of the first aspect and the second aspect and any implementation of either the first aspect or the second aspect.
In a specific implementation process, the foregoing processing apparatus may be a chip, the input circuit may be an input pin, the output circuit may be an output pin, and the processing circuit may be a transistor, a gate circuit, a trigger, any logic circuit, or the like. An input signal received by the input circuit may be received and input by, for example, but not limited to, a receiver, a signal output by the output circuit may be output to, for example, but not limited to, a transmitter and transmitted by the transmitter, and the input circuit and the output circuit may be a same circuit, where the circuit is used as the input circuit and the output circuit at different moments. Specific implementations of the processor and various circuits are not limited in this application.
In another implementation, the communication apparatus may be a part of the first communication apparatus or the second communication apparatus, for example, an integrated circuit product, for example, a system chip or a communication chip. The interface circuit may be an input/output interface, an interface circuit, an output circuit, an input circuit, a pin, a related circuit, or the like in the chip or a chip system. The processing circuit may be a logic circuit in the chip.
Technical solutions provided in embodiments of this application may be applied to a metro transport network (MTN), or may be applied to another type of network, for example, the flexible Ethernet FlexE, the Ethernet, an OTN, and an SDH network. For ease of description, embodiments of this application are mainly described by using the FlexE as an example.
In embodiments of this application, the first communication apparatus may receive a first service data stream, generate a first code block stream based on the first service data stream, and send the first code block stream. The first code block stream includes first clock frequency information. The first clock frequency information indicates transmission duration of k first data frames of the first service data stream, and/or a moment at which the k first data frames of the first service data stream are received, where k is a positive integer. The second communication apparatus obtains the k first data frames and the first clock frequency information from the first code block stream, and may further send the k first data frames based on the first clock frequency information.
Because the first communication apparatus sends the first clock frequency information of the k first data frames of the first service data stream to the second communication apparatus, the second communication apparatus may send the k first data frames based on the first clock frequency information, so that a clock frequency of the k first data frames sent by the second communication apparatus are basically consistent with a clock frequency of the k first data frames received by a first communication apparatus. This can resolve transparent transmission of clock frequency information of a service.
As shown in
As shown in
The first communication apparatus in
In
In
The Ethernet is located at the data link layer and physical layer of an open systems interconnection (OSI) reference model. As shown in
As shown in
The Ethernet frame may be transmitted to the physical layer through an interface. At the physical layer, the Ethernet frame is processed at the MAC sublayer, the RS, the PCS, the FEC sublayer, the PMA sublayer, and the PMD sublayer from top to bottom. A processed data stream is represented as a signal sent to a link medium. A receiving direction is related to an inverse process of the foregoing processing. A signal is received by the link medium, and is finally sequentially processed at the PMD sublayer, the PMA sublayer, the FEC sublayer, and the PCS, to restore a MAC data stream.
In the system architecture shown in
The Optical Internet Forum (OIF) releases the FlexE. The FlexE is a general technology that supports a plurality of Ethernet MAC layer rates. A plurality of 100 GE physical (PHYs) interfaces are bound, and each 100 GE port is divided into 20 slots by using 5 Gbps as a granularity in time domain, so that the FlexE may support the following functions: binding, where a plurality of Ethernet interfaces are bound into one link group to support a MAC service whose rate is greater than that of a single Ethernet interface; a sub-rate that supports, by allocating a slot to a service, a MAC service whose rate is less than a link group bandwidth or is less than a signal Ethernet interface bandwidth; and channelization that supports, by allocating a slot to a service, simultaneous transmission of a plurality of MAC services in a link group, for example, supports simultaneous transmission of one 150 Gbps MAC service and two 25 Gbps MAC services in a 2*100 GE link group.
The ITU-T research group 15 uses some design concepts of the FlexE to define a new transport technology, namely, the MTN. The MTN may include complete transport network functions such as an interface, cross-connection, operations, administration, and maintenance (OAM), management and control, and protection. The OIF-FlexE is an interface technology that can be used for a data center interconnection (DCI) scenario. The MTN is an integrated transport network technology that can be used for a 5G transport network. The MTN is not equivalent to the FlexE.
The PCS in
As shown in
As shown in
It can be learned from
It should be noted that, in the system architecture shown in
The following describes some nouns and terms in embodiments of this application.
Based on the foregoing descriptions,
The fine-granularity service in embodiments of this application may be relative to the large-granularity service. The fine-granularity service may be a service whose bandwidth is less than a bandwidth of a large-granularity pipe. For example, a service whose bandwidth requirement is 10 Mbps or 100 Mbps may be referred to as a fine-granularity service. In embodiments of this application, a node that needs to multiplex or demultiplex a fine-granularity service is referred to as a fine-granularity node, and a node that needs to multiplex and demultiplex a large-granularity service is referred to as a large-granularity node. A node on a transmission path may be or may not be a fine-granularity node.
As shown in
One code block mentioned in embodiments of this application is one bit or a plurality of consecutive bits, and information carried in one code block may be information carried in a bit included in the code block.
The code block in embodiments of this application may also have another replaceable name, for example, may alternatively be a data unit, a bit block, or a flit. In embodiments of this application, some embodiments described by using a code block as an example are also applicable to a flit scenario.
The code block in embodiments of this application may include two types: a data-type code block and a control-type code block. A bit of the data-type code block may be used to carry an actual data payload, and a bit of the control-type code block may be used to carry control information.
The data-type code block may be a data-type code block in the FlexE technology/MTN, or may be one bit or a plurality of consecutive bits in a field, in a data frame of an OSU service, that carries a payload.
The control-type code block may include at least one of a header code block, a tail code block, an idle code block, an operations, administration, and maintenance code block, an error code block, or a low-power code block in the FlexE technology/MTN. The control-type data unit may further include one bit or a plurality of consecutive bits in an overhead area (an area carrying overhead information) in the data frame of the OSU service.
(2.1) An example of a concept, defined in embodiments of this application, of a “code block” in a 64B/66B coding format
The control code block may include a header code block, a tail code block, an ordered set (Ordered set) code block (which may also be denoted as an O code block), an idle code block (which may also be denoted as an IDLE code block), an error code block (which may also be denoted as an error code block), a low-power code block, and the like. In embodiments of this application, the header code block is a code block whose synchronization header is 10 and whose type field is ox78 in
(2.2) An Example of a Concept, Defined in Embodiments of this Application, of a “Code Block” in a Data Frame of an OSU Service
One code block mentioned in embodiments of this application is one bit or a plurality of consecutive bits, and information carried in one code block may be information carried in a bit included in the code block. For ease of understanding, in the OSU service, a code block is referred to as a bit block. One bit block is one bit or a plurality of consecutive bits. A data-type code block is referred to as a data-type bit block, and a control-type code block is referred to as a control-type bit block.
The general overhead may include other general overheads such as a version (VER), a tributary port number (TPN), and a frame type (FT).
The version (VER) may be used to identify a version of the frame structure. The TPN may be used to identify a correspondence between a tributary port and a frame. The FT may be used to identify a frame type. The other general overheads may include functions such as connectivity verification (CV), a bandwidth (BW) indication, tandem connection monitoring (TCM), and path monitoring (PM).
Information carried by the mapping overhead is related to a type of a mapped service, and different overhead functions may be set based on different requirements of a carried service. The mapping overhead is mainly classified into a constant bit rate (CBR) mapping overhead, an Ethernet mapping overhead, and the like. The CBR mapping overhead mainly includes a timestamp (TS), a payload length (PLn), and the like.
The data-type bit block (which may also be referred to as a data-type code block) in embodiments of this application may include one bit or a plurality of consecutive bits in the payload area of the data frame shown in
The control-type bit block (which may also be referred to as a control-type code block) in embodiments of this application may include one bit or a plurality of consecutive bits in the overhead area of the data frame shown in
In embodiments of this application, a data stream on a code block basis is referred to as a code block stream, for example, a first code block stream and a fourth code block stream in embodiments of this application. The code block stream in embodiments of this application may also have another name, for example, a code block sequence. The name is not specifically limited in embodiments of this application.
In embodiments of this application, there may be a plurality of forms of a segment of consecutive code blocks in one of the “first code block stream”, the “fourth code block stream”, a “fifth code block stream”, a “sixth code block stream”, a “seventh code block stream”, a “third code block stream”, and a “second code block stream”. For example, the following is an example:
In the foregoing example, S indicates a header code block, D indicates a data code block, T indicates a tail code block, I indicates an idle code block, and O indicates an O code block.
It can be learned from the foregoing example that the code block sequence in embodiments of this application may include a plurality of code block types, for example, the S code block, the D code block, and the T code block. For another example, the code block sequence further includes the I code block and the O code block. A specific quantity of code blocks in the code block stream is not limited, and only a possible existence form of a segment of consecutive code blocks in one code block sequence in embodiments of this application is listed.
It should be noted that, in embodiments of this application, one of the “first code block stream”, the “fourth code block stream”, the “fifth code block stream”, the “sixth code block stream”, the “seventh code block stream”, the “third code block stream”, and the “second code block stream” may alternatively be a data stream of the OSU service. The data stream of the OSU service may include one or more data frames shown in
Based on the foregoing descriptions,
S301: A first communication apparatus receives a first service data stream.
In a possible implementation, the first communication apparatus receives the first service data stream sent by a source.
S302: The first communication apparatus generates a first code block stream based on the first service data stream. The first code block stream includes first clock frequency information.
In a possible implementation, the first clock frequency information may indicate a moment at which the first communication apparatus receives k first data frames of the first service data stream.
In another possible implementation, the first clock frequency information may indicate transmission duration of k first data frames of the first service data stream.
In still another possible implementation, the first clock frequency information may indicate a moment at which the first communication apparatus receives k first data frames of the first service data stream, and may further indicate transmission duration of the k first data frames of the first service data stream.
In S302, the first code block stream may include at least one piece of clock frequency information, and the first clock frequency information is one of the at least one piece of clock frequency information. The clock frequency information in embodiments of this application may alternatively be another name, for example, a service frame frequency, a service bit rate, a count value at an arrival moment of a service frame header, a count difference between a service frame header and a frame header, a clock frequency, or client clock frequency information. For ease of description, the name “clock frequency information” is used as an example for description in embodiments of this application.
The first service data stream may include a plurality of data frames. For differentiation, in embodiments of this application, a data frame (one data frame or a plurality of consecutive data frames) corresponding to the first clock frequency information is referred to as a first data frame, and a total quantity of data frames corresponding to the first clock frequency information is identified as k. One piece of clock frequency information in the at least one piece of clock frequency information of the first code block stream may correspond to one or more data frames, and one piece of clock frequency information may be clock frequency information indicating a corresponding data frame received by the first communication apparatus. One piece of clock frequency information may indicate transmission duration of the data frame corresponding to the clock frequency information, or may be understood as duration of the data frame, corresponding to the clock frequency information, received by the first communication apparatus. For example, the first clock frequency information may indicate the duration in which the first communication apparatus receives the k first data frames.
S303: The first communication apparatus sends the first code block stream.
S304: A second communication apparatus obtains the first code block stream. The first code block stream includes first clock frequency information.
S305: The second communication apparatus obtains the k first data frames and the first clock frequency information from the first code block stream.
S306: The second communication apparatus sends the k first data frames based on the first clock frequency information.
In a possible implementation, the second communication apparatus sends the k first data frames to a sink. Correspondingly, the sink receives the k first data frames.
The first code block stream sent by the first communication apparatus includes the first clock frequency information. Therefore, the second communication apparatus may send the k first data frames based on the first clock frequency information, so that a clock frequency of the k first data frames sent by the second communication apparatus are basically consistent with a clock frequency of the k first data frames received by the first communication apparatus. This can resolve transparent transmission of clock frequency information of a service.
The following describes the service data stream in embodiments of this application. In embodiments of this application, the data stream received by the first communication apparatus is referred to as a service data stream. Embodiments of this application relate to a plurality of service data streams, for example, a first service data stream, a second service data stream 1, a second service data stream 2, and a second service data stream 3. In this embodiment of this application, the first service data stream is used as an example to describe the service data stream in embodiments of this application. For related descriptions of another service data stream, refer to related descriptions of the first service data stream. Details are not described again.
The first service data stream in this embodiment of this application may be a CBR service data stream, for example, may include but is not limited to a European transmission level 1 (E1), synchronous (STM-1), a CPRI, and serial digital information (SDI).
The first service data stream in this embodiment of this application may alternatively be a data stream that does not have an Ethernet frame format but has a constant rate and a time division multiplexing (TDM) frame structure. This type of data stream may also be referred to as a CBR service.
Table 1 and Table 2 are used as examples below to show related information of several service data streams. The service data streams (for example, the first service data stream, the second service data stream 1, the second service data stream 2, and the second service data stream 3) in this embodiment of this application may be data streams of services shown in Table 1 and Table 2.
For clearer display, for some English abbreviations in Table 1 and Table 2, refer to descriptions at other locations in this application. For other English abbreviations, refer to the following descriptions:
a megabyte (MB) (MB may also be referred to as G), bit per second (bit/s), a gigabyte (GB) (GB may also be referred to as G), a synchronous optical network (SONET), an optical carrier (OC), a generic requirement (GR), a core, the American National Standards Institute (ANSI), plesiochronous digital hierarchy (PDH), a transmission level 1 (T1), fast Ethernet (FE), the American Institute of Electrical and Electronics Engineers (IEEE), Gigabit Ethernet (GE), 10 Gigabit Ethernet (10 GE), a local area network (LAN), a wide area network (WAN), a storage area network (SAN), a fiber channel (FC), fiber connection (FICON), an enterprise systems connection architecture (ESCON), a fiber distributed data interface (FDDI), idle speed control (ISC), the International Organization for Standardization (ISO), the International Business Machines Corporation (IBM), the geographically distributed parallel sysplex (GDPS), an optical transform unit (OTU), an enhanced common public radio interface (eCPRI), the Open Base Station Architecture Initiative (OBSAI), a reference point (RP), the European Standard (EN), a digital video broadcasting asynchronous serial interface (DVB-ASI), a standard definition-serial digital interface (SD-SDI), a high definition-serial digital interface (HD-SDI), a 3G-serial digital interface (3G-SDI), the Society of Motion Picture and Television Engineers (SMPTE), the recommended standard (RS), the American Electronic Industries Association (EIA), and a registered jack (R.J).
In S302, the at least one piece of clock frequency information of the first code block stream may further include second clock frequency information. For differentiation, in embodiments of this application, a data frame (one data frame or a plurality of consecutive data frames) corresponding to the second clock frequency information is referred to as a second data frame, and there may be one or more second data frames. The second clock frequency information may indicate transmission duration of the second data frame of the first service data stream.
In a possible implementation, each of the at least one piece of clock frequency information corresponds to k data frames. In this case, the second clock frequency information indicates transmission duration of k second data frames of the first service data stream, and/or a transmission moment at which the first communication apparatus receives the k second data frames. It may also be understood that, for the first service data stream, the first communication apparatus determines the clock frequency information of the k data frames once every k data frames. After S304, the second communication apparatus may further obtain the second clock frequency information and the k second data frames from the first code block stream, and send the k second data frames based on the second clock frequency information. For related descriptions of the second clock frequency information, refer to related descriptions of the first clock frequency information. Details are not described again.
In still another possible implementation, a quantity of second data frames may be different from the quantity of first data frames. When the quantity of first data frames is different from the quantity of second data frames, the first communication apparatus may send the quantity of data frames corresponding to the first clock frequency information and the quantity of data frames corresponding to the second clock frequency information to the second communication apparatus, so that the second communication apparatus determines data frames separately corresponding to the first clock frequency information and the second clock frequency information.
In S302, the first clock frequency information may have the following plurality of implementations. The following uses examples for description by using an implementation a1, an implementation a2, an implementation a3, an implementation a4, an implementation a5, an implementation a6, an implementation a7, an implementation a8, an implementation a9, an implementation a10, and an implementation a11.
In the implementation a1, the first clock frequency information includes a first count value, and the first count value is a quantity of periods of a clock frequency of a local clock signal of the first communication apparatus in duration in which the first communication apparatus receives the k first data frames. The first clock frequency information may indicate the transmission duration of the k first data frames of the first service data stream.
The period of the clock frequency in embodiments of this application may also be referred to as a clock period, an oscillation period, or the like. Duration of one period of the clock frequency is a reciprocal of the clock frequency. The quantity of periods of the clock frequency of the local clock signal of the first communication apparatus may also be referred to as a quantity of clock periods, a quantity of oscillation periods, a quantity of oscillation times, and the like of the local clock signal of the first communication apparatus.
Further, the first communication apparatus may collect statistics on the first clock frequency information of the k first data frames of the first service data stream by using a statistics collection module. Specifically, a frame header of a 1st first data frame in the k first data frames may be identified, and a counter is started (for example, the first communication apparatus starts the counter at a moment at which a first bit of the frame header of the 1st first data frame is received). The counter counts the quantity of periods of the clock frequency of the local clock signal of the first communication apparatus (the clock frequency of the local clock signal of the first communication apparatus may be denoted as fsource). The counter continuously performs counting until a frame trailer of a kth first data frame is identified, and the counter is stopped (for example, the first communication apparatus stops the counter at a moment at which a last bit of the frame trailer of the kth first data frame is received). In this case, a value of the counter is the first count value. In this embodiment of this application, the first count value may be represented as Nsource. Further, the first communication apparatus may encapsulate the first service data stream, to obtain the first code block stream; place the first count value in the first code block stream; and send the first code block stream to the second communication apparatus.
It should be noted that, in this embodiment of this application, the frame header of the data frame of the first service data stream includes a frame header identifier, and the first communication apparatus and the second communication apparatus may identify the frame header of the data frame based on the frame header identifier. Similarly, the frame trailer of the data frame includes a frame trailer identifier, and the first communication apparatus and the second communication apparatus may identify the frame trailer of the data frame based on the frame trailer identifier. The data frame may be a PCM frame. During specific implementation, a length of one PCM frame may be 256 (32*8=256) bits.
Similarly, the counter is started at a moment at which a frame header of a 1st second data frame is received, to count the quantity of periods of the clock frequency of the local clock signal of the first communication apparatus, and the counter is stopped at a moment at which a frame trailer of a kth second data frame is received. A current value of the counter is the second clock frequency information. In
In another aspect, the second communication apparatus may decapsulate the first code block stream, to obtain the k first data frames of the first service data stream. Further, the second communication apparatus may send the k first data frames based on the clock frequency indicated by the first clock frequency information.
It can be learned from the implementation a1 that, on a basis of the frequency of the second communication apparatus synchronizing with the frequency of the first communication apparatus, the first communication apparatus and the second communication apparatus may resolve transparent transmission of clock frequency information of a service by transmitting the first count value. The solution is simple, and a quantity of bits occupied by the transmitted first count value may be small.
In still another possible implementation, the local clock signal of the first communication apparatus and the local clock signal of the second communication apparatus have a same frequency, and a frequency of the local clock signal of the first communication apparatus synchronizes with a frequency of the local clock signal of the second communication apparatus. For example, both the local clock signal of the first communication apparatus and the local clock signal of the second communication apparatus are 100 MHz signals. In this way, the second communication apparatus may send the k second data frames based on the clock frequency information, indicated by the first count value, of the k first data frames, to resolve transparent transmission of clock frequency information of a service.
In the implementation a2, the first clock frequency information includes a second count value, and the second count value is a difference between a first count value and a preset count value. The first clock frequency information may indicate the transmission duration of the k first data frames of the first service data stream.
A difference between the implementation a2 and the implementation a1 is that the first clock frequency information is the second count value instead of the first count value. For other descriptions, refer to the implementation a1. Details are not described again. It should be noted that the second count value may be a positive number or a negative number. In a possible implementation, the first clock frequency information may include two parts: a sign (a positive sign or a negative sign) of the second count value, and an absolute value of the second count value.
In the implementation a2, a reference clock signal may be set, and a clock frequency of the reference clock signal is fref. The clock frequency fref of the reference clock signal may also be referred to as a reference clock frequency. For given preset duration, a quantity of periods of the clock frequency of the reference clock signal in the preset duration is the preset count value, and the preset count value may be denoted as Nref. For example, a reference clock signal without a frequency offset is preset in the first communication apparatus, where fref=155.52 MHZ, and transmission duration of one data frame is, for example, 125 microseconds. In this case, a quantity of clock periods included in the reference clock signal within 125 microseconds may be used as the preset count value.
In a possible implementation, the preset count value may be defined as that Nref is a quantity of clock periods of fref in the preset duration, and is an integer. In a possible implementation, to make the first clock frequency information transmitted by the first communication apparatus to the second communication apparatus occupy fewer bits, the difference between the first count value and the preset count value may be transmitted to resolve transparent transmission of clock frequency information of a service. To make the difference occupy fewer bits, the preset count value may be close to the first count value. In a possible implementation, the preset duration may be set based on an average value of the transmission duration of the k data frames of the first service data stream. For example, the preset duration is equal to an average value of transmission duration of at least one group of data frames (a group of data frames includes k data frames) of the first service data stream, or the preset duration is close to an average value of transmission duration of at least one group of data frames of the first service data stream. In still another possible implementation, a difference between preset duration and the transmission duration of the k first data frames is less than a preset difference threshold.
In still another possible implementation, k values may be configured in the first communication apparatus. Then, the first communication apparatus determines a quantity r of bits of the k data frames, and then multiplies r by transmission duration of each bit. An obtained value may be used as the preset duration. The transmission duration of each bit may be determined based on a transmission rate of a service data stream corresponding to the k data frames. In this implementation, it may also be understood that when it is assumed that when an actual frequency of the local clock is equal to a clock frequency of the service data stream corresponding to the k data frames, recorded transmission duration of the k data frames is used as the preset duration. It can be learned from this implementation that the first communication apparatus may determine the preset duration provided that a value of k is configured. This solution provides a possible implementation solution for determining the preset duration, and only the value of k needs to be configured in this solution. This solution is simple and easy to be promoted.
A solution performed by the second communication apparatus is similar to that in the implementation a1, and a difference lies in that the second count value is obtained when the first clock frequency information is obtained. The second communication apparatus may obtain the preset count value in advance, and may calculate the first count value with reference to the preset count value. In still another possible implementation, the local clock signal of the first communication apparatus and the local clock signal of the second communication apparatus have a same frequency, and a frequency of the local clock signal of the first communication apparatus synchronizes with a frequency of the local clock signal of the second communication apparatus. For example, both the local clock signal of the first communication apparatus and the local clock signal of the second communication apparatus are 100 MHz signals. In this way, the second communication apparatus may send the k second data frames based on clock frequency information, indicated by the second count value, of the k first data frames, to resolve transparent transmission of clock frequency information of a service. Further, the k first data frames are sent based on the first count value. For this step, refer to the foregoing implementation a1. Details are not described again.
In the implementation a3, the first clock frequency information includes a second count value and a preset count value. The first clock frequency information may indicate the transmission duration of the k first data frames of the first service data stream.
A difference between the implementation a3 and the implementation a2 is that the first communication apparatus transmits both the second count value and the preset count value to the second communication apparatus. For other descriptions, refer to the implementation a2. Details are not described again.
In a possible implementation, sending periods of the second count value and the preset count value may be separately set. For example, the sending period of the preset count value may be larger than the sending period of the second count value. This can reduce a quantity of sending times of the preset count value, and save resources.
In this embodiment of this application, a preset count value may be set for the first service data stream, and the first communication apparatus may transfer the preset count value to the second communication apparatus based on clock frequency information (for example, the first clock frequency information) corresponding to the first service data stream. In still another possible implementation, the first communication apparatus may alternatively transfer the preset count value to the second communication apparatus for a plurality of times based on a plurality of pieces of clock frequency information of the first service data stream. For example, the preset count value may be carried in each piece of clock frequency information of the first service data stream. In still another possible implementation, a plurality of preset count values may be set for the first service data stream, and each preset count value may correspond to one or more groups of data frames (each group of data frames may include k data frames).
In the implementation a4, the first clock frequency information includes a moment at which a frame header of a 1st data frame in the k first data frame is received, and a moment at which a frame trailer of a kth first data frame in the k first data frame is received. The first clock frequency information may indicate a moment at which the first communication apparatus receives the k first data frames of the first service data stream.
In the implementation a4, in a possible implementation, the second communication apparatus may calculate the transmission duration of the k first data frames based on two moments of the first clock frequency information. Therefore, it may be understood that the first clock frequency information indicates the transmission duration of the k first data frames of the first service data stream.
In the implementation a4, it may also be understood that the first clock frequency information includes two timestamps: a timestamp 1 and a timestamp 2. The timestamp 1 is the moment at which the frame header (for example, a first bit of the frame header) of the 1st data frame is received, and the timestamp 2 is the moment at which the frame trailer (for example, a last bit of the frame trailer) of the kth first data frame is received.
The second communication apparatus may determine the transmission duration of the k first data frames of the first service data stream based on the first clock frequency information (calculate a difference between the two timestamps in the first clock frequency information), and may further send the k first data frames in the transmission duration based on the calculated transmission duration of the k first data frames, so that the transmission duration in which the second communication apparatus sends the k first data frames is equal to or close to transmission duration in which the first communication apparatus receives the k first data frames. This can resolve transparent transmission of clock frequency information of a service.
In a possible implementation, the first clock frequency information may occupy 32 bits on a basis of nanosecond. For example, the timestamp 1 is 0000 0000 0000 0000 0000 0000 0000 0001. The timestamp 2 is 0000 0000 0000 0000 0000 0000 1000 0000. A time difference between the timestamp 2 and the timestamp 1 is 127 nanoseconds, that is, the transmission duration of the k first data frames is 127 nanoseconds.
Further, the second communication apparatus may generate, based on the difference between the two timestamps in the first clock frequency information and the local clock signal of the second communication apparatus, a working clock signal that meets a clock frequency of the k first data frames, received by the first communication apparatus, of the first service data stream, and send the k first data frames based on the working clock signal. For example, a clock frequency of the working clock signal may be calculated according to a formula (Δt1/(1/f_local)), where Δt1 is the difference between the two timestamps in the first clock frequency information, f_local is a clock frequency of the local clock signal of the second communication apparatus, and units of a numerator and a denominator in the formula may be unified to nanosecond.
In still another possible implementation, the second communication apparatus may not calculate the transmission duration of the k first data frames, but directly send the k second data frames based on the clock frequency information, indicated by the two timestamps, of the k first data frames. For example, the second communication apparatus records, as a “timestamp 3”, a moment at which the second communication apparatus receives the frame header (for example, a first bit of the frame header) of the 1st data frame in the k first data frames. A time difference Δt2 between the timestamp 3 and the timestamp 1 is calculated. Further, the second communication apparatus records, as a “timestamp 4”, a moment at which the second communication apparatus receives the frame trailer of the kth data frame in the k first data frames, then calculates a time difference Δt3 between the timestamp 4 and the timestamp 2, and compares Δt3 with Δt2. During actual application, it may be assumed that a minimum delay of a network is fixed within specific time, and there is a probability that the minimum delay may also be obtained within a period of time. When a difference between Δt3 and Δt2 is less than a set threshold, if Δt3 is less than Δt2, it indicates that a data sending frequency of the second communication apparatus is slow, and the second communication apparatus may appropriately increase the data sending frequency. If Δt3 is greater than Δt2, it indicates that the data sending frequency of the second communication apparatus is fast, and the second communication apparatus may appropriately decrease the data sending frequency.
In still another possible implementation, a frequency of the local clock signal of the first communication apparatus synchronizes with a frequency of the local clock signal of the second communication apparatus. In this case, the local clock signal of the first communication apparatus and the local clock signal of the second communication apparatus may have a same frequency or different frequencies. The second communication apparatus may send the k second data frames based on the clock frequency information, indicated by the two timestamps, of the k first data frames, to resolve transparent transmission of clock frequency information of a service.
In the implementation a5, the first clock frequency information includes first duration, and the first duration is the transmission duration of the k first data frames.
In a possible implementation, the first communication apparatus may collect statistics on a first count value in the transmission duration of the k first data frames. Then, the first duration corresponding to the first count value is calculated. For example, calculation may be performed according to a formula Δt2=Nsource*(1/fsource). In the formula, Nsource is the first count value, fsource is a clock frequency of a local clock signal of the first communication apparatus, * indicates multiplication, / indicates division, and Δt2 indicates the first duration. A unit of Δt2 may be nanosecond or second.
In still another possible implementation, the first communication apparatus may start a timer at a moment at which a frame header of a 1st first data frame in the k first data frames is received, and stops timing of the timer at a moment at which the frame header of the 1st first data frame in the k first data frames is received. A current value of the timer is the first duration.
In another aspect, the second communication apparatus may decapsulate the first code block stream, to obtain the k first data frames of the first service data stream. Further, the second communication apparatus may send the k first data frames in the first duration indicated by the first clock frequency information, for example, sending duration in which the second communication apparatus sends the k first data frames may also be controlled to be the first duration. Therefore, this can resolve transparent transmission of clock frequency information of a service.
It can be learned from the implementation a5 that the first communication apparatus and the second communication apparatus may resolve transparent transmission of clock frequency information of a service by transmitting the first duration. The solution is simple. In addition, the second communication apparatus does not need to perform calculation with reference to a preset count value, a clock frequency of a reference clock signal, and the like.
In still another possible implementation, the frequency of the local clock signal of the first communication apparatus synchronizes with a frequency of a local clock signal of the second communication apparatus. In this case, the local clock signal of the first communication apparatus and the local clock signal of the second communication apparatus may have a same frequency or different frequencies. The second communication apparatus may send the k second data frames based on the clock frequency information, indicated by the first duration, of the k first data frames, to resolve transparent transmission of clock frequency information of a service.
In the implementation a6, the first clock frequency information may indicate a moment at which the first communication apparatus receives the k first data frames of the first service data stream. The first clock frequency information includes a moment at which a frame header of a 1st data frame in the k first data frames is received. Specifically, the moment, included in the first clock frequency information, at which the frame header of the 1st data frame in the k first data frames is received is a moment at which the first communication apparatus receives the frame header of the 1st data frame in the k first data frames.
If data frames corresponding to one piece of clock frequency information are referred to as a group of data frames, for example, because the first clock frequency information indicates the transmission duration of the k first data frames, the k first data frames may be referred to as a group of data frames. For another example, because the second clock frequency information indicates the transmission duration of the k second data frames, the k second data frames may also be referred to as a group of data frames. In this way, in a possible implementation, the second communication apparatus may calculate transmission duration of one group of data frames based on a difference between first clock frequency information included in two groups of received adjacent data frames.
For example, the k first data frames are referred to as a first group of data frames, and the k second data frames are referred to as a second group of data frames. If the k second data frames are received after the k first data frames, that is, the first group of data frames and the second group of data frames are two consecutive groups of data frames, after the second communication apparatus obtains the first clock frequency information corresponding to the first group of data frames (k first data frames) and obtains the second clock frequency information corresponding to the second group of data frames (k second data frames), the second communication apparatus may subtract a moment indicated by the first clock frequency information from a moment indicated by the second clock frequency information, to obtain transmission duration of the first group of data frames (k first data frames). It should be noted that, in this embodiment of this application, quantities of data frames included in any two groups of data frames may be equal or may not be equal. In this implementation, an example in which one group of data frames includes k data frames is used for presentation.
With reference to
It can be learned from the implementation a6 that the first communication apparatus and the second communication apparatus may resolve transparent transmission of clock frequency information of a service by transmitting a moment at which a frame header of a 1st data frame in a group of data frames is received. The solution is simple, and a quantity of bits occupied by the transmitted information is small. In addition, the second communication apparatus does not need to perform calculation with reference to a preset count value, a clock frequency of a reference clock signal, and the like.
In still another possible implementation, the second communication apparatus may not calculate the transmission duration of the k first data frames, but directly send the data frames based on two timestamps corresponding to two groups of data frames. For example, the second communication apparatus records a receiving moment (timestamp 3) at which the second communication apparatus receives a frame header (for example, a first bit of the frame header) of a 1st data frame in the k first data frames and a receiving moment (timestamp 5) at which the second communication apparatus receives a frame header (for example, a first bit of the frame header) of a 1st data frame in the k second data frames. Further, the second communication apparatus calculates a time difference Δt2 between the timestamp 3 and the receiving moment (timestamp 1) at which the first communication apparatus receives the frame header of the 1st data frame in the k first data frames, calculates a time difference Δt4 between the timestamp 5 and the receiving moment (timestamp 6) at which the first communication apparatus receives the frame header of the 1st data frame in the k second data frames, and compares Δt4 with Δt2. During actual application, it may be assumed that a minimum delay of a network is fixed within specific time, and there is a probability that the minimum delay may also be obtained within a period of time. When a difference between Δt4 and Δt2 is less than a set threshold, if Δt4 is less than Δt2, it indicates that a data sending frequency of the second communication apparatus is slow, and the second communication apparatus may appropriately increase the data sending frequency. If Δt4 is greater than Δt2, it indicates that the data sending frequency of the second communication apparatus is fast, and the second communication apparatus may appropriately decrease the data sending frequency. For related descriptions of the solution, refer to related descriptions in the foregoing implementation a4. Details are not described herein again.
In still another possible implementation, the frequency of the local clock signal of the first communication apparatus synchronizes with a frequency of a local clock signal of the second communication apparatus. In this case, the local clock signal of the first communication apparatus and the local clock signal of the second communication apparatus may have a same frequency or different frequencies. The second communication apparatus may send the k second data frames based on the first clock frequency information, to resolve transparent transmission of clock frequency information of a service.
In the implementation a7, the first clock frequency information may indicate a moment at which the first communication apparatus receives the k first data frames of the first service data stream. The first clock frequency information includes a moment at which a frame trailer of a kth first data frame in the k first data frames is received. Specifically, the moment, included in the first clock frequency information, at which the frame trailer of the kth first data frame in the k first data frames is received is a moment at which the first communication apparatus receives the frame trailer of the kth first data frame in the k first data frames.
For example, the k first data frames are referred to as a first group of data frames, where k fourth data frames of the first service data stream are referred to as a third group of data frames. Fourth clock frequency information indicates transmission duration of the k fourth data frames. If the k fourth data frames are received before the k first data frames, that is, the third group of data frames and the first group of data frames are two consecutive groups of data frames, after the second communication apparatus obtains the first clock frequency information corresponding to the first group of data frames (k first data frames) and obtains the fourth clock frequency information corresponding to the third group of data frames (k fourth data frames), the second communication apparatus may subtract a moment indicated by the fourth clock frequency information from a moment indicated by the first clock frequency information, to obtain transmission duration of the first group of data frames (k first data frames). It should be noted that, in this embodiment of this application, quantities of data frames included in any two groups of data frames may be equal or may not be equal. In this implementation, an example in which one group of data frames includes k data frames is used for presentation.
For another example, the k first data frames are referred to as a first group of data frames, and the k second data frames are referred to as a second group of data frames. If the k second data frames are received after the k first data frames, that is, the first group of data frames and the second group of data frames are two consecutive groups of data frames, after the second communication apparatus obtains the first clock frequency information corresponding to the first group of data frames (k first data frames) and obtains the second clock frequency information corresponding to the second group of data frames (k second data frames), the second communication apparatus may subtract a moment indicated by the first clock frequency information from a moment indicated by the second clock frequency information, to obtain transmission duration of the second group of data frames (k second data frames).
With reference to
It can be learned from the implementation a7 that the first communication apparatus and the second communication apparatus may resolve transparent transmission of clock frequency information of a service by transmitting a moment at which a frame trailer of a 1st data frame in a group of data frames is received. The solution is simple, and a quantity of bits occupied by the transmitted information is small. In addition, the second communication apparatus does not need to perform calculation with reference to a preset count value, a clock frequency of a reference clock signal, and the like.
In still another possible implementation, the second communication apparatus may not calculate the transmission duration of the k first data frames, but directly send the data frames based on two timestamps corresponding to two groups of data frames. For the solution, refer to related descriptions in the foregoing implementation a6. Details are not described herein again.
In still another possible implementation, a frequency of a local clock signal of the first communication apparatus synchronizes with a frequency of a local clock signal of the second communication apparatus. In this case, the local clock signal of the first communication apparatus and the local clock signal of the second communication apparatus may have a same frequency or different frequencies. The second communication apparatus may send the k second data frames based on the first clock frequency information, to resolve transparent transmission of clock frequency information of a service.
In the implementation a8, the first clock frequency information may indicate the transmission duration of the k first data frames of the first service data stream. The first clock frequency information includes a third count value, and the third count value is a quantity of periods of a clock frequency of a local clock signal of the first communication apparatus in second duration. The second duration is duration from a preset moment to a moment at which a frame header of a 1st first data frame in the k first data frames is received.
In this embodiment of this application, the preset moment may be implemented in a plurality of manners. In a possible implementation, the first communication apparatus may use, as the preset moment, the moment at which the frame header of the 1st data frame of the received first service data stream is received.
In this embodiment of this application, the first communication apparatus and the second communication apparatus may agree that the receiving moment at which the first communication apparatus receives the frame header of the 1st data frame of the first service data stream is the preset moment. Alternatively, the first communication apparatus may determine a location of the preset moment, and the first communication apparatus may not send the location of the preset moment to the second communication apparatus. In still another possible implementation, the first communication apparatus sends indication information indicating “the receiving moment at which the first communication apparatus receives the frame header of the 1st data frame of the first service data stream is the preset moment” to the second communication apparatus.
In still another possible implementation, one preset moment may be specified at a long interval, and duration between two adjacent preset moments may be greater than transmission duration of at least two groups of data frames. For example, the first communication apparatus may specify a preset moment every 3k data frames. In this implementation, the first communication apparatus may send, to the second communication apparatus, indication information indicating which moment is the preset moment, or may not indicate a location of the preset moment to the second communication apparatus.
It can be learned from
Further, in a possible implementation, the first communication apparatus may continue to use the counter to count until a next preset moment is reached, and reset and restart the counter. In still another possible implementation, the first communication apparatus may continue to use the counter to count until the data frames of the first service data stream are received. In still another possible implementation, the first communication apparatus may continue to use the counter to count until a maximum value that can be counted by the counter is reached. In this case, the counter is reset and restarted to recount. The first communication apparatus may record a moment at which the counter is restarted as a new preset moment. Because the maximum value that can be counted by the counter is large, the second communication apparatus may infer, based on a count value included in the received clock frequency information, whether the counter is reset and restarted to recount. Therefore, even if the first communication apparatus does not indicate the new preset moment to the second communication apparatus, the second communication apparatus may also send data based on the clock frequency information, and resolve transparent transmission of clock frequency information of a service. In still another possible implementation, the first communication apparatus may alternatively indicate the new preset moment to the second communication apparatus.
Further, the first communication apparatus may encapsulate the first service data stream, to obtain the first code block stream; place the third count value in the first code block stream; and send the first code block stream to the second communication apparatus.
In another aspect, the second communication apparatus may decapsulate the first code block stream, to obtain the k first data frames of the first service data stream, the first clock frequency information (third count value), and the second clock frequency information (fifth count value). Further, the second communication apparatus may subtract the third count value from the fifth count value, to obtain the first count value. The second communication apparatus sends the k first data frames based on the clock frequency corresponding to the first count value obtained through calculation.
It can be learned from the implementation a8 that the first communication apparatus and the second communication apparatus may resolve transparent transmission of clock frequency information of a service by transmitting the third count value. The solution is simple, and a quantity of bits occupied by the transmitted information is small.
In still another possible implementation, the local clock signal of the first communication apparatus and the local clock signal of the second communication apparatus have a same frequency, and a frequency of the local clock signal of the first communication apparatus synchronizes with a frequency of the local clock signal of the second communication apparatus. For example, both the local clock signal of the first communication apparatus and the local clock signal of the second communication apparatus are 100 MHz signals. In this way, the second communication apparatus may send the k second data frames based on the clock frequency information, indicated by the third count value, of the k first data frames, to resolve transparent transmission of clock frequency information of a service.
In the implementation a9, the first clock frequency information includes second duration. The second duration is duration from a preset moment to a moment at which a frame header of a 1st first data frame in the k first data frames is received.
In a possible implementation, the first communication apparatus may collect statistics on a third count value, and then calculate the second duration corresponding to the third count value. For example, calculation may be performed according to a formula Δtk2=NKsource*(1/fsource). In the formula, Nksource is the third count value, fsource is a clock frequency of a local clock signal of the first communication apparatus, * indicates multiplication, / indicates division, and Δtk2 indicates the second duration. A unit of Δtk2 may be nanosecond or second.
In still another possible implementation, the first communication apparatus may start a timer at the preset moment, and records duration collected by the timer at the moment at which the frame header of the 1st first data frame in the k first data frames is received. A current value of the timer is the second duration.
With reference to
It can be learned from the implementation ag that the first communication apparatus and the second communication apparatus may resolve transparent transmission of clock frequency information of a service by transmitting the second duration. The solution is simple. In addition, the second communication apparatus does not need to perform calculation with reference to a preset count value, a clock frequency of a reference clock signal, and the like.
In still another possible implementation, a frequency of a local clock signal of the first communication apparatus synchronizes with a frequency of a local clock signal of the second communication apparatus. In this case, the local clock signal of the first communication apparatus and the local clock signal of the second communication apparatus may have a same frequency or different frequencies. The second communication apparatus may send the k second data frames based on the clock frequency information, indicated by the second duration, of the k first data frames, to resolve transparent transmission of clock frequency information of a service.
In the implementation a10, the first clock frequency information may indicate the transmission duration of the k first data frames of the first service data stream. The first clock frequency information includes a fourth count value, and the fourth count value is a quantity of periods of a clock frequency of a local clock signal of the first communication apparatus in third duration. The third duration is duration from a preset moment to a moment at which a frame trailer of a kth first data frame in the k first data frames is received. For the preset moment in this embodiment of this application, refer to the foregoing content. Details are not described herein again.
It can be learned from
In another aspect, the second communication apparatus receives the k first data frames of the first service data stream, the first clock frequency information (fourth count value), and the fourth clock frequency information (seventh count value). Further, the second communication apparatus may subtract the seventh count value from the fourth count value, to obtain a first count value. The second communication apparatus sends the k first data frames based on the clock frequency corresponding to the first count value obtained through calculation. Similarly, the second communication apparatus may subtract the fourth count value from the sixth count value, to obtain a count value corresponding to the transmission duration of the k second data frames. The second communication apparatus sends the k first data frames based on a clock frequency indicated by the count value, obtained through calculation, corresponding to the transmission duration of the k second data frames.
It can be learned from the implementation a10 that the first communication apparatus and the second communication apparatus may resolve transparent transmission of clock frequency information of a service by transmitting the fourth count value. The solution is simple, and a quantity of bits occupied by the transmitted information is small.
In still another possible implementation, the second communication apparatus may not calculate the transmission duration of the k first data frames, but directly send the data frames based on two timestamps corresponding to two groups of data frames. For the solution, refer to related descriptions in the foregoing implementation a6. Details are not described herein again.
In still another possible implementation, the local clock signal of the first communication apparatus and a local clock signal of the second communication apparatus have a same frequency, and a frequency of the local clock signal of the first communication apparatus synchronizes with a frequency of the local clock signal of the second communication apparatus. For example, both the local clock signal of the first communication apparatus and the local clock signal of the second communication apparatus are 100 MHz signals. In this way, the second communication apparatus may send the k second data frames based on the clock frequency information, indicated by the fourth count value, of the k first data frames, to resolve transparent transmission of clock frequency information of a service.
In the implementation a11, the first clock frequency information includes third duration, the third duration is duration from a preset moment to a moment at which a frame trailer of a kth first data frame in the k first data frames is received.
In a possible implementation, the first communication apparatus may collect statistics on a fourth count value, and then calculate the third duration corresponding to the fourth count value. For a calculation manner, refer to the foregoing implementation a9. Details are not described again.
In still another possible implementation, the first communication apparatus may start a timer at the preset moment, and records duration collected by the timer at the moment at which the frame trailer of the kth first data frame in the k first data frames is received. A current value of the timer is the third duration.
With reference to
It can be learned from the implementation a11 that the first communication apparatus and the second communication apparatus may resolve transparent transmission of clock frequency information of a service by transmitting the third duration. The solution is simple. In addition, the second communication apparatus does not need to perform calculation with reference to a preset count value, a clock frequency of a reference clock signal, and the like.
In still another possible implementation, a frequency of a local clock signal of the first communication apparatus synchronizes with a frequency of a local clock signal of the second communication apparatus. In this case, the local clock signal of the first communication apparatus and the local clock signal of the second communication apparatus may have a same frequency or different frequencies. The second communication apparatus may send the k second data frames based on the clock frequency information, indicated by the third duration, of the k first data frames, to resolve transparent transmission of clock frequency information of a service.
Based on the foregoing descriptions,
As shown in
Then, the first communication apparatus may add an S code block and a T code block to two ends of a group of D code blocks. One group of D code blocks may include one or more D code blocks. Quantities of any two groups of D code blocks may be equal or unequal. In a possible implementation, quantities of any two groups of D code blocks in the code block stream 1 are equal. In
Further, the first communication apparatus may fill a code block between two adjacent data units (which are also referred to as containers), for example, fill an idle code block, so that a rate of the code block stream 1 matches a pipe rate. Then, the code block stream 1 is mapped to a pipe (the pipe in this embodiment of this application may also be referred to as a hard pipe).
Based on the foregoing descriptions,
As shown in
In
It should be noted that the code blocks of the code block stream 1 in this embodiment of this application may be divided into one or more data units. In
For differentiation, in this embodiment of this application, a data unit that carries bits corresponding to the k second data frames is referred to as a second data unit. The bits corresponding to the k second data frames may carry one or more second data units. In this embodiment of this application, all second data units that carry the bits corresponding to the k second data frames are referred to as a second data unit group. It may also be understood that the first data unit group includes W2 second data units, where W2 is a positive integer. Quantities of data code blocks included in any two second data units may be equal or unequal. The first code block stream further includes the second clock frequency information, and the second clock frequency information indicates the transmission duration of the k second data frames of the first service data stream, and/or the moment at which the first communication apparatus receives the k second data frames of the first service data stream.
In
In this embodiment of this application, the first data unit is used as an example to describe data units of the first code block stream. For content of another data unit, refer to related descriptions of the first data unit. Details are not described again.
For flexibility of the provided solution, the first data unit may have a plurality of structure forms. For example, the first data unit may include one of the following content:
In a possible implementation, the header code block may be an S code block. The tail code block may be a T code block. The data code block may be a D code block. The operations, administration, and maintenance code block may be an O code block. For a specific structure form, refer to related descriptions in
In this embodiment of this application, bits corresponding to the k first data frames may be carried in a payload area of a data code block in the at least one data code block of the first data unit in the W1 first data units. The bits corresponding to the k first data frames may be carried in the payload area of the data code block in the at least one data code block of the first data unit in the W1 first data units, and may further be carried in a tail code block of the first data unit in the W1 first data units, to improve a quantity of bits, carried in the data units, from the service data stream.
The first clock frequency information may be carried in some or all first data units in the W1 first data units. In a possible implementation, W1 is 1, and the first data unit carries all of the first clock frequency information and the k first data frames. In still another possible implementation, W1 is an integer greater than 1. In this case, the first clock frequency information may be carried in one or more first data units in the W1 first data units. In this case, one piece of clock frequency information may indicate a clock frequency of bits carried in the plurality of data units, to reduce a frequency of sending the clock frequency information, and save resources.
Further, the first communication apparatus may further add first indication information to each first data unit that is in the W1 first data units and that carries the first clock frequency information. The first indication information indicates that the first data unit carrying the first indication information carries a portion or all of the first clock frequency information. The first communication apparatus may further add second indication information to each first data unit that is in the W1 first data units and that does not carry the first clock frequency information. The second indication information indicates that the first data unit carrying the second indication information does not carry the first clock frequency information. In this way, the second communication apparatus may determine, based on whether a data unit carries the first indication information, whether the data unit carries the clock frequency information. When the data unit does not carry the first indication information, for example, carries the second indication information, the second communication apparatus does not need to search for the clock frequency information. This can improve a data processing speed of the second communication apparatus.
The following describes, by using a first case, a case in which the first communication apparatus adds the first clock frequency information to one first data unit in the W1 first data units, and describes, by using a second case, a case in which the first communication apparatus adds the first clock frequency information to a plurality of first data units in the W1 first data units.
First case: The first communication apparatus may transmit the first clock frequency information in one first data unit in the W1 first data units, and does not transmit the first clock frequency information in another first data unit in the W1 first data units.
In the first case, in this embodiment of this application, a field may further be set in each first data unit. For example, a SEQ field may be newly set. The SEQ field may occupy 3 bits, to indicate 0 to 7 (eight values in total). A value of the SEQ field increases with a quantity of data units. For example, if a value of a SEQ field of a current data unit is o, a value of a SEQ field of a next data unit is increased by 1, and is 1; a value of a SEQ field of a data unit after the next data unit is increased by 1, and is 2; and the rest may be deduced by analogy. When the value of the SEQ field reaches 7, the value restarts from 0.
For example, a value of W1 is 4, and the k first data frames are carried in four first data units. In still another possible implementation, every k data frames of the first service data stream are carried in every four data units of the first code block stream. Clock frequency information may be carried in data units in which a value of the SEQ field is 0 and a value of the SEQ field is 4. The clock frequency information (for example, the first clock frequency information) carried in the data unit in which the value of the SEQ field is 0 may indicate the transmission duration that is carried in the current data unit and consecutive data units (four first data units), after the data unit, in which values of SEQ fields are sequentially 1, 2, and 3 and that is of all data frames (k first data frames) from the first service data stream. Similarly, the clock frequency information (for example, the second clock frequency information) carried in the data unit in which the value of the SEQ field is 4 may indicate the transmission duration that is carried in the current data unit and consecutive data units (four second data units), after the data unit, in which values of SEQ fields are sequentially 5, 6, and 7 and that is of all data frames (k second data frames) from the first service data stream.
It can be learned from the foregoing example that the values 0 and 4 of the SEQ field are separately equivalent to the first indication information in this embodiment of this application, and the first indication information indicates that the data unit carrying the first indication information carries the clock frequency information. In still another possible implementation, it may be understood that the first indication information indicates that the data unit carrying the first indication information carries all of the clock frequency information. The values 1, 2, 3, 5, 6, and 7 of the SEQ fields are equivalent to the second indication information in this embodiment of this application, and the second indication information indicates that the data unit carrying the second indication information does not carry the clock frequency information.
For another example, a value of W1 is 2, and the k first data frames are carried in two first data units. In still another possible implementation, every k data frames of the first service data stream are carried in every two data units of the first code block stream. Clock frequency information may be carried in data units in which values of SEQ fields are 0, 2, 4, and 6. The clock frequency information (for example, the first clock frequency information) carried in the data unit in which the value of the SEQ field is 0 may indicate the transmission duration that is carried in the current data unit and a data unit (two first data units), after the data unit, in which a value of the SEQ field is 1 and that is of all data frames (k first data frames) from the first service data stream. Similarly, the clock frequency information (for example, the second clock frequency information) carried in the data unit in which the value of the SEQ field is 2 may indicate the transmission duration that is carried in the current data unit and a data unit (two second data units), after the data unit, in which a value of the SEQ field is 3 and that is of all data frames (k second data frames) from the first service data stream.
It can be learned from the foregoing example that the values 0, 2, 4, and 6 of the SEQ field are separately equivalent to the first indication information in this embodiment of this application, and the first indication information indicates that the data unit carrying the first indication information carries the clock frequency information. The values 1, 3, 5, and 7 of the SEQ fields are equivalent to the second indication information in this embodiment of this application, and the second indication information indicates that the data unit carrying the second indication information does not carry the clock frequency information.
Second case: The first communication apparatus may transmit the first clock frequency information in a plurality of first data units in the W1 first data units.
For example, W1 is 4, and the first clock frequency information occupies 32 bits in total. The first communication apparatus may transmit first 16 bits of the first clock frequency information in a 1st first data unit in the W1 first data units, and transmit last 16 bits of the first clock frequency information in a 2nd first data unit in the W1 first data units. The first communication apparatus does not transmit the first clock frequency information in a 3rd first data unit and a 4th first data unit in the W1 first data units. In other words, the plurality of first data units in the W1 first data units carry all of the first clock frequency information, and one first data unit in the plurality of first data units may only carry a portion of the first clock frequency information.
In the second case, a SEQ field may alternatively be set in each first data unit, and the SEQ field may occupy 3 bits, to indicate 0 to 7 (eight values in total).
For example, a value of W1 is 4, and the k first data frames are carried in four first data units. In still another possible implementation, every k data frames of the first service data stream are carried in every four data units of the first code block stream. In this implementation, 32 bits of one piece of clock frequency information may be carried in data units in which a value of the SEQ field is 0 and a value of the SEQ field is 1. For example, first 16 bits of the clock frequency information are carried in the data unit in which the value of the SEQ field is o, and last 16 bits of the clock frequency information are carried in the data unit in which the value of the SEQ field is 1. The 32 bits of the clock frequency information (for example, the first clock frequency information) carried in the data units in which the value of the SEQ field is 0 and the value of the SEQ field is 1 may indicate the transmission duration that is carried in the current two data units and consecutive data units (four first data units), after the data units, in which values of SEQ fields are sequentially 2 and 3 and that is of all data frames (k first data frames) from the first service data stream. Similarly, 32 bits of the clock frequency information (for example, the second clock frequency information) carried in data units in which a value of the SEQ field is 4 and a value of the SEQ field is 5 may indicate the transmission duration that is carried in the current two data units and consecutive data units (four second data units), after the data units, in which values of SEQ fields are sequentially 6 and 7 and that is of all data frames (k second data frames) from the first service data stream.
It can be learned from the foregoing example that the values 0, 1, 4, and 5 of the SEQ field are separately equivalent to the first indication information in this embodiment of this application, and the first indication information indicates that the data unit carrying the first indication information carries the clock frequency information. In still another possible implementation, the first indication information indicates that the data unit carrying the first indication information carries a portion of the clock frequency information. In this way, the plurality of data units may jointly carry one piece of clock frequency information, to increase a quantity of bits used to carry the clock frequency information. The values 2, 3, 6, and 7 of the SEQ fields are equivalent to the second indication information in this embodiment of this application, and the second indication information indicates that the data unit carrying the second indication information does not carry the clock frequency information.
In embodiments of this application, there may also be a plurality of implementations for carrying the clock frequency information of the first service data stream. The following uses one first data unit carrying the first clock frequency information as an example for description. The first data unit may carry a portion or all of the first clock frequency information. The first clock frequency information (which may be a portion or all of the first clock frequency information) may be carried in at least one of the following content of the first data unit: a header code block, at least one data code block, a tail code block, or an operations, administration, and maintenance code block, to improve flexibility of the solution. The following describes an implementation b1, an implementation b2, an implementation b3, and an implementation b4.
In the implementation b1, the first clock frequency information may be carried in the header code block of the first data unit.
The header code block may be an S code block, and may be used to identify a start of a data unit.
The first service data stream may be a constant rate service. One PCM frame of the first service data stream is 256 bits (32*8=256), and one PCM frame is truncated on a basis of 64 bits, to obtain four segments through truncation. Therefore, each data unit may carry one PCM frame by using payload areas of four D code blocks.
Implementation b2:
In the implementation b2, the first clock frequency information may be carried in the at least one data code block of the first data unit.
In a possible implementation, because the first clock frequency information occupies an area of a PCM frame that is originally used to carry the service data stream, a Ty code block may be used as a T code block, so that an area other than a code block type area “0xFF” in a payload area of the T7 code block is used to carry the PCM frame. For example, in
In the implementation b3, the first clock frequency information may be carried in the tail code block of the first data unit.
In the implementation b4, the first clock frequency information may be carried in the operations, administration, and maintenance code block of the first data unit.
The operations, administration, and maintenance code block may be an O code block. The operations, administration, and maintenance code block may be located between two data units. With reference to
A possible form of the code block stream into which the O code block is inserted may be: . . . OISDDDDTIOISDDDDTIOI . . . , where O is an O code block, I is an idle code block, S is a header code block, D is a data code block, and Tis a tail code block.
For a structure form of the O code block, refer to related descriptions in
In still another possible implementation, the first data unit may further include the data frame shown in
The foregoing content is described by using sending one first service data stream as an example. During actual application, a source communication apparatus may also send a plurality of service data streams. For example, in addition to the first service data stream, the source communication apparatus may further send Q0 second service data streams to the first communication apparatus, where Q0 is a positive integer.
In a possible implementation, the Q0 second service data streams and the first service data stream have a same source communication apparatus, and the Q0 second service data streams and the first service data stream have a same sink communication apparatus. In this case, the Q0 second service data streams and the first service data stream have a same source and sink.
In a possible implementation, the first communication apparatus may obtain third indication information of each of the Q0 second service data streams and the first service data stream. The third indication information indicates whether the Q0 second service data streams and the first service data stream have a same source and sink.
For two service data streams in the Q0 second service data streams and the first service data stream, the first communication apparatus may determine, based on two pieces of third indication information corresponding to the two service data streams, whether the two service data streams are from a same source communication apparatus (which may be a same logical communication apparatus or a same physical communication apparatus) and whether the two service data streams are to a same sink communication apparatus (which may be a same logical communication apparatus or a same physical communication apparatus).
For the service data streams in the Q0 second service data streams and the first service data stream, the third indication information of the service data streams may be one piece of information, and whether the Q0 second service data streams and the first service data stream have a same source and sink may be determined based on the information. In still another possible implementation, the third indication information may include two portions of information. For example, the third indication information includes source indication information and sink indication information. The first communication apparatus may determine, based on source indication information of two service data streams, whether the two service data streams are from a same source communication apparatus. The first communication apparatus may further determine, based on sink indication information of the two service data streams, whether the two service data streams are to a same sink communication apparatus.
For example, for two service data streams in the Q0 second service data streams and the first service data stream, two pieces of source indication information of the two service data streams may be two port numbers, and the two port numbers may be the same or may be different. When the two port numbers are the same, the first communication apparatus may determine, based on the source indication information corresponding to the two service data streams, that the two service data streams are from a same source communication apparatus. When the two port numbers are different, if the first communication apparatus determines that the two port numbers (which may be logical port numbers or physical port numbers) correspond to a same communication apparatus (for example, the first communication apparatus is connected to a same communication apparatus by using the two port numbers), the first communication apparatus may also determine, based on the source indication information corresponding to the two service data streams, that the two service data streams are from a same source communication apparatus. When the two port numbers are different, if the first communication apparatus determines that the two port numbers (which may be logical port numbers or physical port numbers) do not correspond to a same communication apparatus (for example, the first communication apparatus is connected to a same communication apparatus by using the two port numbers), the first communication apparatus determines that the two service data streams are not from a same source communication apparatus.
For another example, for two service data streams in the Q0 second service data streams and the first service data stream, two pieces of third indication information of the two service data streams may be two service numbers or two pieces of service type information. When determining that two services have a same service number or same service type information, the first communication apparatus may determine that the two service data streams have a same source and sink.
It can be learned from the foregoing example that the third indication information may be some configured indication information. In addition, the third indication information may alternatively be address information, for example, medium access control (MAC) address information or an Internet protocol (IP) address. For example, the source indication information in the third indication information may be a source address, and the sink indication information may be a destination address. The Q0 second service data streams and the first service data stream have a same source address, and the Q0 second service data streams and the first service data stream have a same target address. In this case, the Q0 second service data streams and the first service data stream have a same source and sink.
In a possible implementation, in S302, the first communication apparatus may multiplex the first service data stream and the Q0 second service data streams, to obtain the first code block stream. Parallel processing may be implemented on a plurality of service data streams through multiplexing, to improve a processing speed of each service data stream. There may be a plurality of multiplexing manners. The following describes, by using an implementation c1 and an implementation c2, a specific implementation in which the first communication apparatus multiplexes the first service data stream and the Q0 second service data streams, and an implementation on a second communication apparatus side.
In the implementation c1, the first communication apparatus multiplexes bit blocks of the first service data stream and the Q0 second service data streams on a basis of a bit block including no consecutive bits, to obtain the first code block stream, where no is a positive integer.
In the implementation c1, the first communication apparatus receives the first service data stream and the Q0 second service data streams. The first communication apparatus may multiplex, based on a preset order of the first service data stream and the Q0 second service data streams and on a basis of a bit block including no consecutive bits, bit blocks of the first service data stream and the Q0 second service data streams, to obtain a third service data stream. Further, the first communication apparatus may generate the first code block stream based on the third service data stream.
In this embodiment of this application, for the process in which the first communication apparatus generates the first code block stream based on the third service data stream, refer to the process shown in
For the k first data frames and the k third data frames of each of the Q0 second service data streams, the first communication apparatus may carry the data frames by using one data unit, or may carry the data frames by using a plurality of data units. For example, the first code block stream includes a first data unit group. The first data unit group includes W1 first data units.
When W1 is 1, one first data unit in the W1 first data units includes the bits corresponding to the k first data frames of the first service data stream, and bits corresponding to the k third data frames of each of the Q0 second service data streams.
When W1 is an integer greater than 1, one first data unit in the W1 first data units includes some of the bits corresponding to the k first data frames of the first service data stream, and some of bits corresponding to the k third data frames of each of the Q0 second service data streams.
In a possible implementation, if W1 is an integer greater than 1, and k/W1 is an integer, one first data unit in the W1 first data units includes bits corresponding to (k/W1) first data frames of the first service data stream, and bits corresponding to (k/W1) third data frames of each of the Q0 second service data streams.
Example 1: In an example in which no is 8, the first communication apparatus multiplexes the first service data stream and the Q0 second service data streams on a basis of 8 bits (or referred to as 1 byte).
Example 2: In an example in which no is 256, the first communication apparatus multiplexes the first service data stream and the Q0 second service data streams on a basis of 256 bits (or referred to as 32 bytes).
When one data unit of the first code block stream carries a plurality of signals, one piece of clock frequency information may be carried. The first data unit is used as an example. The first data unit may include bits corresponding to the k first data frames of the first service data stream, bits corresponding to the k third data frames of each of the Q0 second service data streams, and the first clock frequency information. The first data unit may include only the first clock frequency information. In this case, in addition to the transmission duration of the k first data frames of the first service data stream, the first clock frequency information may further indicate transmission duration of k third data frames of a second service data stream corresponding to third clock frequency information. The transmission duration of the k first data frames is equal to the transmission duration of the k third data frames of the second service data stream.
In still another possible implementation, the first data unit may further include a plurality of pieces of clock frequency information. For example, in addition to the first clock frequency information, the first data unit may further include Q0 pieces of third clock frequency information corresponding to the Q0 second service data streams. The third clock frequency information in the Q0 pieces of third clock frequency information indicates the transmission duration of the k third data frames of the second service data stream.
Correspondingly, after obtaining the first code block stream, the second communication apparatus side may decapsulate the first code block stream, to obtain the third service data stream. Further, the second communication apparatus may demultiplex the first code block stream on a basis of a bit block including no consecutive bits, to obtain the first service data stream and the Q0 second service data streams.
In the implementation c2, the first communication apparatus multiplexes data units of a code block stream corresponding to the first service data stream and the Q0 second service data streams on a basis of N1 (N1 is a positive integer) data units, to obtain the first code block stream.
In the implementation c2, the first communication apparatus may process the first service data stream, to generate the second code block stream. For this process, refer to the process shown in
In another aspect, the first communication apparatus may process the Q0 second service data streams, to generate Q0 third code block streams. For this process, refer to the process shown in
Further, the first communication apparatus multiplexes data in the Q0 third code block streams and the second code block stream, to obtain the first code block stream. For example, the second communication apparatus may multiplex, based on a preset order of the Q0 third code block streams and the second code block stream and on a basis of N1 data units, data units of the Q0 third code block streams and the second code block stream, to obtain the first code block stream.
In a possible implementation, one piece of clock frequency information may be carried in each data unit. For example, the first clock frequency information may be carried in the first data unit. The second code block stream includes the first data unit, and the first data unit includes the first clock frequency information and the k first data frames. For the third code block stream, one data unit of the third code block stream may carry the k third data frames of the second service data stream corresponding to the third code block stream and the third clock frequency information. The third clock frequency information indicates the transmission duration of the k third data frames of the second service data stream.
In still another possible implementation, a plurality of consecutive data units of the first code block stream may share one piece of clock frequency information. In other words, the clock frequency information may be carried only in the data unit of the second code block stream, and the clock frequency information is not carried in the Q0 third code block streams. As shown in
Further, with reference to the foregoing implementation, the first communication apparatus may set a SEQ field in each data unit of the first code block stream, and the SEQ field may occupy 3 bits, to indicate 0 to 7 (eight values in total). A value of the SEQ field increases with a quantity of data units. For example, if a value of a SEQ field of a current data unit is o, a value of a SEQ field of a next data unit is increased by 1, and is 1; a value of a SEQ field of a data unit after the next data unit is increased by 1, and is 2; and the rest may be deduced by analogy. When the value of the SEQ field reaches 7, the value restarts from 0.
For example, a value of N1 is 1, a value of W1 is 1, and the k first data frames of the first service data stream are carried in one first data unit. A data unit, of the first code block stream, in which the value of the SEQ field is 0 is a data unit (a data unit from the second code block stream) of k data frames (for example, the k first data frames) that carry the first service data stream, a data unit, of the first code block stream, in which the value of the SEQ field is 1 is a data unit of k data frames that carry the second service data stream 1, a data unit, of the first code block stream, in which the value of the SEQ field is 2 is a data unit of k data frames that carry the second service data stream 2, and a data unit, of the first code block stream, in which the value of the SEQ field is 3 is a data unit of k data frames that carry the second service data stream 3. If the data unit in which the value of the SEQ field is 0 carries clock frequency information (for example, the first clock frequency information), the clock frequency information carried in the data unit in which the value of the SEQ field is 0 may indicate that the current data unit carries transmission duration of all data frames from the first service data stream, may further indicate that the data unit, after the current data unit, in which the value of the SEQ field is 1 carries transmission duration of all data frames from the second service data stream 1, may further indicate that the data unit, after the current data unit, in which the value of the SEQ field is 2 carries transmission duration of all data frames from the second service data stream 2, and may further indicate that the data unit, after the current data unit, in which the value of the SEQ field is 3 carries transmission duration of all data frames from the second service data stream 3. The data units in which values of SEQ fields are 1, 2, and 3 do not carry the clock frequency information.
Similarly, a data unit (a data unit from the second code block stream), of the first code block stream, in which the value of the SEQ field is 4 is a data unit of k data frames that carry the first service data stream, a data unit, of the first code block stream, in which the value of the SEQ field is 5 is a data unit of k data frames that carry the second service data stream 1, a data unit, of the first code block stream, in which the value of the SEQ field is 6 is a data unit of k data frames that carry the second service data stream 2, and a data unit, of the first code block stream, in which the value of the SEQ field is 7 is a data unit of k data frames that carry the second service data stream 3. The data unit in which the value of the SEQ field is 4 may carry the clock frequency information. The clock frequency information carried in the data unit in which the value of the SEQ field is 4 may indicate that the current data unit carries transmission duration of all data frames from the first service data stream, may further indicate that the data unit, after the current data unit, in which the value of the SEQ field is 5 carries transmission duration of all data frames from the second service data stream 1, may further indicate that the data unit, after the current data unit, in which the value of the SEQ field is 6 carries transmission duration of all data frames from the second service data stream 2, and may further indicate that the data unit, after the current data unit, in which the value of the SEQ field is 7 carries transmission duration of all data frames from the second service data stream 3. The data units in which values of SEQ fields are 5, 6, and 7 do not carry the clock frequency information.
Correspondingly, the second communication apparatus may remove padding information (for example, an idle code block) from the first code block stream, to obtain the code block stream 3. Further, the second communication apparatus may demultiplex the code block stream 3, for example, demultiplexing the first code block stream on a basis of N1 data units, to obtain the Q0 third code block streams and the second code block stream. The second communication apparatus may obtain the k first data frames of the first service data stream and the first clock frequency information from the second code block stream. For the third code block stream in the Q0 third code block streams, the second communication apparatus may further process the third code block stream, to obtain the k third data frames of the second service data stream corresponding to the third code block stream.
The solution provided in embodiments of this application is applicable to a large-granularity pipe. In this case, before S303, the first communication apparatus may further obtain Q1 fourth code block streams, where Q1 is a positive integer. In S303, the first code block stream may perform time division multiplexing on the Q1 fourth code block streams and the first code block stream according to a correspondence between the Q1 fourth code block streams and S1 first slots and a correspondence between the first code block stream and the S1 first slots, to obtain a fifth code block stream; and send the fifth code block stream. The Q1 fourth code block streams and one code block stream in the first code block stream correspond to at least one first slot in the S1 first slots. S1 is an integer not less than (Q1+1).
Correspondingly, the second communication apparatus obtains the fifth code block stream, and demultiplexes the fifth code block stream according to the correspondence between the Q1 fourth code block streams and S1 first slots and a correspondence between the first code block stream and the S1 first slots, to obtain the Q1 fourth code block streams and the first code block stream.
With reference to
The following uses a path at a slot granularity of 5 Gbps in FlexE as a large-granularity pipe for description. It should be noted that a bandwidth of one large-granularity pipe in embodiments of this application is not limited to 5 Gbps, for example, may be 6 Gbps or 7 Gbps.
A code block stream corresponding to a large-granularity pipe is multiplexed based on 20 slots, to construct a time division multiplexing frame.
As shown in
As shown in
In a possible implementation, in the FlexE OH, two management channels may be defined, and the management channel may be used to run a management communication link and an OAM communication link of a 1.2 Mbit/s Ethernet protocol and a 1.8 Mbit/s Ethernet protocol that are coded based on a 64B/66B code block stream. Further, in this embodiment of this application, 64B/66B coding may be used in a scenario of a 100 GE physical layer. An ITU-T MTN reuses the FlexE frame structure. Therefore, the frame structure of the ITU-T MTN is the same as that of the FlexE frame structure. Details are not described again.
In still another possible implementation, the solution provided in embodiments of this application is applicable to a fine-granularity pipe. In this case, before S303, the first communication apparatus may further obtain Q1 fourth code block streams, where Q1 is a positive integer. In S303, the first code block stream may perform time division multiplexing on the Q1 fourth code block streams and the first code block stream according to a correspondence between the Q1 fourth code block streams and S1 first slots and a correspondence between the first code block stream and the S1 first slots, to obtain a fifth code block stream. The Q1 fourth code block streams and one code block stream in the first code block stream correspond to at least one first slot in the S1 first slots. S1 is an integer not less than (Q1+1).
Further, the first communication apparatus obtains Q2 sixth code block streams, where Q2 is a positive integer. The first communication apparatus performs time division multiplexing on code blocks of the Q2 sixth code block streams and the fifth code block stream according to a correspondence between the Q2 sixth code block streams and S2 second slots and a correspondence between the fifth code block stream and the S2 second slots, to obtain a seventh code block stream; and sends the seventh code block stream. The Q2 sixth code block streams and one code block stream in the fifth code block stream correspond to at least one second slot in the S2 second slots. S2 is an integer not less than (Q2+1). Second slots corresponding to the fifth code block stream are divided into the S1 first slots.
Correspondingly, the second communication apparatus obtains the seventh code block stream, and demultiplexes the seventh code block stream according to the correspondence between the Q2 sixth code block streams and the S2 second slots and a correspondence between the fifth code block stream and the S2 second slots, to obtain the Q2 sixth code block streams and the fifth code block stream. Further, the second communication apparatus obtains the fifth code block stream, and demultiplexes the fifth code block stream according to the correspondence between the Q1 fourth code block streams and the S1 first slots and a correspondence between the first code block stream and the S1 first slots, to obtain the Q1 fourth code block streams and the first code block stream.
With reference to
The following describes a flexible fine-granularity basic unit (fine-granularity basic unit, fgBU) frame format in a fine-granularity slot with reference to
In this embodiment of this application, at least two fine-granularity pipes may be obtained by dividing a large-granularity pipe. A bandwidth of one fine-granularity pipe is less than a bandwidth of a large-granularity pipe to which the fine-granularity pipe belongs. In this embodiment of this application, an example in which a bandwidth of a large-granularity pipe is 5 Gbps and a bandwidth of a fine-granularity pipe is 10 Mbps is used for description. Bandwidths corresponding to two large-granularity pipes may be equal or unequal. Bandwidths of any two fine-granularity pipes obtained by dividing one large-granularity pipe may also be equal or unequal. To more clearly describe this embodiment of this application, the following content is described by using an example in which a bandwidth of each large-granularity pipe is 5 Gbps and a bandwidth of each fine-granularity pipe is 10 Mbps. One slot corresponding to one large-granularity pipe may be divided into 480 sub-slots, and a correspondence between the 480 sub-slots and fine-granularity services may further be established, to multiplex data of each fine-granularity service according to the correspondence.
The code block stream obtained by multiplexing the fine-granularity service includes at least one multiframe. One multiframe includes 20 basic frames (for example, a basic frame 0 to a basic frame 19 in
As shown in
The first communication apparatus may encapsulate data corresponding to the fine-granularity service 1, to obtain a code block stream corresponding to the fine-granularity service 1, and encapsulate data corresponding to the fine-granularity service 2, to obtain a code block stream corresponding to the fine-granularity service 2. The first communication apparatus may multiplex, according to a correspondence between the fine-granularity service 1 and a sub-slot and a correspondence between the fine-granularity service 2 and a sub-slot, the code block stream corresponding to the fine-granularity service 1 and the code block stream corresponding to the fine-granularity service 2, to obtain a code block stream 4.
In
Still refer to
an fgBU encapsulation header (preamble): used for fgBU boundary positioning and Ethernet rate adaptation, and compatible with an Ethernet preamble, and X-Ethernet/MTN large-granularity pipes;
an fgBU overhead (OH): used to carry overhead information;
an fgBU payload (Payload): used to carry service data, and including a bit other than 56-bit OH information in a D code block after a first S code block of the fgBU frame, a payload area in another D code block, and a bit (for example, a bit other than a synchronization header area in a Ty code block), of the T code block, that may be used to carry service data; and an fgBU encapsulation tail (T7): compatible with an Ethernet standard Ty code block (a code block type is oxFF), where it is recommended that an idle code block be added after the encapsulation tail.
A fine-granularity fgBU of an Ethernet hard private line has a fixed length: 197 64B/66B code blocks (1567 bytes before coding), and includes a 7-byte fgBU overhead, a 1560-byte payload, an 8-byte preamble, a 1-byte EFD, and an 8-byte IPG (under a typical rate, each coded fgBU is followed by an idle code block).
There is another manner of generating the code block stream 411. For example, indication information may be carried in an area of the code block stream 411. The indication information indicates information carried in a synchronization header area that is of a code block of the code block stream 5 and that is carried in the multiframe. A compressed 1-bit synchronization header area of each code block is extracted and processed, and then placed in a preset area, for example, after OH information, to obtain the indication information. Then, only 64 bits of each code block in the code block stream 5 other than the synchronization header area are sequentially placed in the payload area of the code block stream 411. The second communication apparatus may restore the synchronization header area of the code block of the code block stream 5 based on the indication information.
It can be understood that, to implement functions in the foregoing embodiments, the communication apparatus includes corresponding hardware structures and/or software modules for performing the functions. A person skilled in the art should be easily aware that, with reference with units and method steps in the examples described in embodiments disclosed in this application, this application can be implemented by hardware or a combination of hardware and computer software. Whether a function is performed through hardware or hardware driven by computer software depends on particular application scenarios and design constraint conditions of the technical solutions.
As shown in
When the communication apparatus 1300 is configured to implement the functions of the first communication apparatus in the method embodiment shown in
When the communication apparatus 1300 is configured to implement the functions of the first communication apparatus in the method embodiment shown in
When the communication apparatus 1300 is configured to implement the functions of the first communication apparatus in the method embodiment shown in
When the communication apparatus 1300 is configured to implement the functions of the first communication apparatus in the method embodiment shown in
When the communication apparatus 1300 is configured to implement the functions of the first communication apparatus in the method embodiment shown in
When the communication apparatus 1300 is configured to implement the functions of the first communication apparatus in the method embodiment shown in
When the communication apparatus 1300 is configured to implement the functions of the first communication apparatus in the method embodiment shown in
As shown in
When the communication apparatus 1300 is configured to implement the functions of the second communication apparatus in the method embodiment shown in
When the communication apparatus 1300 is configured to implement the functions of the second communication apparatus in the method embodiment shown in
When the communication apparatus 1300 is configured to implement the functions of the second communication apparatus in the method embodiment shown in
When the communication apparatus 1300 is configured to implement the functions of the second communication apparatus in the method embodiment shown in
When the communication apparatus 1300 is configured to implement the functions of the second communication apparatus in the method embodiment shown in
When the communication apparatus 1300 is configured to implement the functions of the second communication apparatus in the method embodiment shown in
When the communication apparatus 1300 is configured to implement the functions of the second communication apparatus in the method embodiment shown in
When the communication apparatus 1300 is configured to implement the functions of the second communication apparatus in the method embodiment shown in
For related descriptions of the foregoing solution and more detailed descriptions of the processing unit 1310 and the transceiver unit 1320, directly refer to related descriptions in the method embodiment shown in
As shown in
When the communication apparatus 1400 is configured to implement the method shown in
As shown in
When the communication apparatus 1500 is configured to implement the method shown in
When the communication apparatus 1500 is configured to implement the functions of the first communication apparatus in the method embodiment shown in
When the communication apparatus 1500 is configured to implement the functions of the second communication apparatus in the method embodiment shown in
When the communication apparatus is a chip used in the communication apparatus, the chip in the communication apparatus implements the functions of the communication apparatus in the foregoing method embodiments. The chip in the communication apparatus receives information from another module (for example, a radio frequency module or an antenna) in the communication apparatus, where the information is sent by a network device to the communication apparatus. Alternatively, the chip in the communication apparatus sends information to another module (for example, a radio frequency module or an antenna) in the communication apparatus, where the information is sent by the communication apparatus to a network device.
It should be noted that the processor in embodiments of this application may be a central processing unit (Central Processing Unit, CPU), a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA), or another programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The general-purpose processor may be a microprocessor or any regular processor.
According to the method provided in embodiments of this application, this application further provides a computer program product. The computer program product includes a computer program or instructions. When the computer program or the instructions is/are run on a computer, the computer is enabled to perform the method in any embodiment shown in
According to the method in embodiments of this application, this application further provides a computer-readable storage medium. The computer-readable medium stores a program or instructions. When the program or the instructions is/are run on a computer, the computer is enabled to perform the method in any embodiment shown in
According to the method provided in embodiments of this application, this application further provides a chip system. The chip system may include a processor. The processor is coupled to the memory, and may be configured to perform the method in any embodiment shown in
According to the method in embodiments of this application, this application further provides a system, including the first communication apparatus and the second communication apparatus.
The method steps in embodiments of this application may be implemented in a hardware manner, or may be implemented in a manner of executing software instructions by the processor. The software instructions may include a corresponding software module. The software module may be stored in a random access memory (Random Access Memory, RAM), a flash memory (flash), a read-only memory (Read-Only Memory, ROM), a programmable read-only memory, an erasable programmable read-only memory (Erasable Programmable ROM, EPROM), an electrically erasable programmable read-only memory, a register, a hard disk, a solid-state drive (solid-state drive, SSD), a removable hard disk, a compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), or any other form of storage medium well-known in the art. For example, a storage medium is coupled to the processor, to enable the processor to read information from the storage medium and write information into the storage medium. Certainly, the storage medium may be a component of the processor. The processor and the storage medium may be disposed in an ASIC. In addition, the ASIC may be located in a communication apparatus. Certainly, the processor and the storage medium may exist in the communication apparatus as discrete components.
All or some of embodiments may be implemented by using software, hardware, firmware, or any combination thereof. When software is used to implement embodiments, all or a part of embodiments may be implemented in a form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer programs or the instructions are loaded and executed on a computer, the procedures or functions in embodiments of this application are all or partially performed. The computer may be a general-purpose computer, a dedicated computer, a computer network, a network device, user equipment, or another programmable apparatus. The computer programs or the instructions may be stored in a computer-readable storage medium or may be transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer programs or the instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired or wireless manner. The computer-readable storage medium may be any usable medium accessible by a computer, or a data storage device, for example, a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium, for example, a floppy disk, a hard disk, or a magnetic tape; or may be an optical medium, for example, a digital video disc; or may be a semiconductor medium, for example, a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include two types of storage media: a volatile storage medium and a non-volatile storage medium.
In embodiments of this application, unless otherwise stated or there is a logic conflict, terms and/or descriptions between different embodiments are/is consistent and may be mutually referenced, and technical features in different embodiments may be combined based on an internal logical relationship thereof, to form a new embodiment.
“A plurality of” in this application means two or more than two. The term “and/or” describes an association relationship between associated objects, and represents that three relationships may exist. For example, A and/or B may represent the following cases: Only A exists, both A and B exist, and only B exists, where A and B may be singular or plural. In text descriptions of this application, a character “/” usually indicates that associated objects are in an “or” relationship. In the formula of this application, a character “/” indicates that associated objects are in a “division” relationship. “Including at least one of A, B, or C” may indicate: including A; including B; including C; including A and B; including A and C; including B and C; and including A, B, and C.
It may be understood that various numbers in embodiments of this application are merely for distinguishing for ease of description, and are not intended to limit the scope of embodiments of this application. Sequence numbers of the foregoing processes do not mean execution sequences. The execution sequences of the processes should be determined according to functions and internal logic of the processes.
Number | Date | Country | Kind |
---|---|---|---|
202111067726.3 | Sep 2021 | CN | national |
202111142893.X | Sep 2021 | CN | national |
This application is a continuation of International Application No. PCT/CN2022/106293 filed on Jul. 18, 2022, which claims priority to Chinese Patent Application No. 202111142893.X filed on Sep. 28, 2021 and Chinese Patent Application No. 202111067726.3 filed on Sep. 13, 2021. All of the aforementioned patent applications are hereby incorporated by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2022/106293 | Jul 2022 | WO |
Child | 18602795 | US |