Below is the MAC PDU structure:
From the above image we can see that, one MAC PDU has 2 parts
1. MAC Header
2. MAC Payload.
Mac Header can consist of multiple sub headers.
Mac Payload consists of “one or more MAC CE” and “one or more MAC SDU”
MAC Sub Headers
There are 3 different types of MAC sub header depending upon the octate size. They are:
One Octate Sub Header
One octate sub header is of 8 bits as shown below
Here:
“R” means, Reserved bit
“E” means, Extension bit. If the “E” bit is 1, then there are additional sub headers. Hence you need to check the next octate. Rule of thumb is, you need to check for additional sub headers till you get “E = 0”.
“LCID” stands for Logical Channel ID. It is of 5 bits. It is used to send MAC CE along with other information.
If you add all the bits “1 + 1 + 1 + 5” = 8 bits = 1 octate.
Now we shall see a simple example on how to decode:
Example 1:
Suppose you are given the following MAC PDU “11 23 3C …” in uplink. How do we decode it?
11 => 0001 0001.
Now we check bit by bit.
First bit is 0 -> Reserved
Second bit is 0 -> Reserved
Third bit is 0 -> Extension. This means, there is no sub header followed.
We take the next 5 bits “10001” it is 17 in decimal. Now we check that value in the “UL-SCH LCID” table.
After referring to the table, “10001” is a reserved bit. Hence we are not transmitting any MAC CE in this octate.
So after decoding any octate, we can answer below questions:
1. How many sub headers are there
2. What is the size of each sub header
3. How many MAC CE are present.
So form the above decoding, we can say that, the PDU is having
One MAC sub header
No MAC CE
So according to the sub header, all the octates after “11” are user data or signalling information.
Two Octate Sub Header
Two octate sub header is of 16 bits as shown below
Here the meaning of “R”, “E”, “LCID” is same as the above.
There is two additional elements.
F stands for “Format” bit. If ‘F = 1’, then the subheader is of 3 octate else sub header is of 2 octate.
L stands for length. It shows the length of the MAC SDU.
Three Octate Sub Header
Three octate sub header is of 24 bits as shown below
Example 2:
Suppose you are given the following MAC PDU “21 23 3E 2F …” in uplink. How do we decode it?
Step 1:
Take the first octate
21 => 0010 0001
First bit is 0 -> Reserved
Second bit is 0 -> Reserved
Third bit is 1 -> Extension. This means, there are additional sub headers followed.
We take the next 5 bits “00001” it is 1 in decimal. Now we check that value in the “UL-SCH LCID” table.
After referring to the table, “00001” gives the identity of logical channel.
Step 2:
Now from the first sub header “E = 1”, it means, this PDU has additional sub headers.
To know if the sub header is of 2 octate or 3 octate it depends on “F” bit.
We take first 2 octates “21 23”
21 23 => 0010 0001 0010 0011
Here “F = 0”. So it means the first sub header is of 2 octate.
Now, we will go to the next octate “3E”, because we need to decode till we get “E” as “0”.
3E => 0011 1110
Here again E bit is 1. So it means, this sub header is 2 octate or 3 octate. To check that take the next octate.
3E 2F => 0011 1110 0010 1111
Here “F = 0”, so second header is 2 octate in size. Like this we have to decode the values.
So according to the MAC PDU,
First all the sub headers will be present, then all the MAC CE will be present, then all the MAC SDU will be present based on the sub header ordering.