z/OS Communications Server: IP Programmer's Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Processing SYSTCPDA and SYSTCPOT trace records in a buffer

z/OS Communications Server: IP Programmer's Guide and Reference
SC27-3659-02

The EZBTMIC1 call or the TMI_CopyBuffer() service is used to receive a buffer of trace records defined by starting with a CTE structure and ending with a 2-byte ctelene field, which has the same value as the ctelenp. The PTHDR_T structure follows the CTE and has many fields for use when processing the trace records. The pth_tlen field is the IP packet payload length, although this field can reflect the ABBREV parameter on the PKTTRACE command. In some cases, to obtain the entire IP packet, multiple trace records must be processed. These trace records can span multiple buffers and might not be contiguous. In this case, several fields must be examined. See the example of packet records in Example of split buffers for IP packet X. The ctelenp will be less than the pth_tlen. The pth_seqnum fields must be used to determine the ordered chain of records that make up the IP packet. The first record in the sequence will have pth_seqnum=0 and will contain the IP protocol headers. The pth_tlen and pth_time are the same for each record in the sequence.

TCP segmentation offload considerations

When TCP segmentation is being offloaded (indicated by flag pth_seg_offload), the pth_plen field represents the data length of all the segments being offloaded. When the pth_seg_offload flag is set, the pth_offseglen field indicates the length of each segment (the MSS). The total number of offloaded segments can be derived by dividing the data length in field pth_plen by the length of each segment from field pth_offseglen and rounding up one segment for a nonzero remainder. For example, you can use the following algorithm to derive the total number of offloaded segments:
totnumoffsegs = (pth_plen - ip_header_len - tcp_headerlen + pth_offseglen - 1) / pth_offseglen

In the algorithm, for IPv4, ip_header_len = ip_hl * 4; for IPv6, ip_header_len = sizeof(ip6) and tcp_header_len = tcph_hdr_len * 4.

Example of split buffers for IP packet X

First TMI_CopyBuffer() issued; a complete buffer received.
Second TMI_CopyBuffer issued; a complete buffer received.
Last TMI_CopyBuffer() issued; a partial buffer received.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014