When the connection is set up, each end tells the other what shift count to use on its advertised window. In other words, suppose A & B are communicating on a TCP link, and B is the server. Then at connection establishment,
So, for the life of the connection, whenever B receives an advertised window from A, which happens whenever A acknowledges a segment it's received from B, it shifts the value left a bits. This means the window size is 16+a bit number. The high 16 bits are the value of the advertised window field, and the low a bits are all zero.
Whenever A receives an advertised window value from B, it shifts the value left b bits. Effectively, B's advertised window field is 16+b bits, a 16 bit value with b zeros appended.
From here one can go