MacOS uses Window Scaling by default, to allow for faster TCP transfers (which benefit from larger window sizes, as these allow more data in flight). This feature of TCP is described in RFC 1232, https://www.ietf.org/rfc/rfc1323.txt From 2.1: "This option is sent only in a SYN segment (a segment with the SYN bit on), hence the window scale is fixed in each direction when a connection is opened." From 2.2: "TCP Window Scale Option (WSopt): Kind: 3 Length: 3 bytes +---------+---------+---------+ | Kind=3 |Length=3 |shift.cnt| +---------+---------+---------+ This option is an offer, not a promise; both sides must send Window Scale options in their SYN segments to enable window scaling in either direction. If window scaling is enabled, then the TCP that sent this option will right-shift its true receive-window values by 'shift.cnt' bits for transmission in SEG.WND. The value 'shift.cnt' may be zero (offering to scale, while applying a scale factor of 1 to the receive window). This option may be sent in an initial segment (i.e., a segment with the SYN bit on and the ACK bit off). It may also be sent in a segment, but only if a Window Scale op- tion was received in the initial segment. A Window Scale option in a segment without a SYN bit should be ignored." So in Lab4 this option only needs to be parsed on the incoming SYN, and must be echoed back on the SYN+ACK for the host side to actually use it. Note that my original example code echoed back any TCP options that it received---hence you saw windows scaling used in my packet captures. Long story short: when Window scaling is in use, the actual windows size is about 128K, and larger than my test file. The test file thus fits within one window. This makes it hard to test sliding window implementation. To get back to smaller windows without scaling (the largest is 0xffff = 65535 bytes), you need to either: (1) disable window scaling on the host, or (2) not echo back the window scaling option The first is easy to do on MacOS Yosemite: # sysctl net.inet.tcp.rfc1323=0 net.inet.tcp.rfc1323: 1 -> 0 swithes it off. My understanding is that El Capitan and Sierra removed this useful configuration option (https://discussions.apple.com/thread/7408993?start=0&tstart=0). but included another, sudo sysctl net.inet.tcp.broken_peer_syn_rexmit_thres=0 I have not tested it. The second option is easy to implement, and will also preclude the host side from using SACKs (for a quick hands-on explanation, see http://packetlife.net/blog/2010/jun/17/tcp-selective-acknowledgments-sack/; for the specification, see https://tools.ietf.org/html/rfc2018 )