The contents of the PAT (Program Association Table) is a list of all services listed in the transport stream.The services will be identified by a unique 16-bit program number also called service ID.
Numbers between 1 to 65,534 (1 - 0xFFFE) can be used as a service id.
Service ID 0xFFFF is reserved to indicate that you are using encrypted EIT data. The PMT will then describe the EIT as private stream and contain one or more CA_descriptors.
The program numbers must be unique within the transport stream. Per service is a reference to the PMT of the service. If there is a service with service id 0x0000 then it displays the PID for the NIT. When this service is missing then default PID 0x0010 (16) is used for the NIT.
The PAT is found in TS packets with PID 0x0000. The PAT is up to 1024 bytes long
The PAT is closed with a 32 bit CRC.
Descriptors are not allowed in the PAT
|Table ID||8||Indicates to which table this section belongs, in this case PAT (0x00)|
|section_syntax_indicator||1||Indicates whether a sub-table structure including CRC check is used.|
|0||1||always binary value '0'|
|Reserved||2||always binary value '11'|
|Section length||12||The length of the section in bytes. This length starts immediately after this field and includes the CRC.|
|Transport stream ID||16||Transport stream ID of the transport stream|
|reserved||2||always binary value '11'|
|version_number||5||value between 0 to 31.
A higher value indicates that the information has changed.
|current_next_indicator||1||This is to indicate whether a section is 'valid now' or 'valid in future'|
|section_number||8||Value between 0x00 - 0xFF. Used to indicate the sections of a table. Up to 256 sections|
|last_section_number||8||The number of the last section, so the receiver know when the table is completely received.|
|program_number||16||Program number = Service ID|
|reserved||3||always binary value '111'|
|PMT pid||13||Value of the PMT for this service. As a service ID = 0x00 it gives value to Network Pid.|
|CRC_32||32||Cyclic redundancy check|