From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=c7mdx3WO; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 4D22E5A004E for ; Tue, 21 Jan 2025 00:56:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737417377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hd+FAtyW3qepPKqkUOL9/Od7MK2xAPA9vyFrAueIjFU=; b=c7mdx3WO4ZBojnStmiiTbVRj1FDmVcT2Iv1nice0kAx6eYYv4ZxB6blwvYUutA7NOTEwMJ RqncXVgD0ki+WLNENAhTCRNahhhOGS2l1Tts8xoVwpN+kAMe/KSDR7p4Owt2UchFO5t9S9 iGXfm17JykE5B0mnjkC8G9T7jYCky1Y= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-48-J4VdMkdCMOeTB2o2JimiCQ-1; Mon, 20 Jan 2025 18:56:15 -0500 X-MC-Unique: J4VdMkdCMOeTB2o2JimiCQ-1 X-Mimecast-MFC-AGG-ID: J4VdMkdCMOeTB2o2JimiCQ Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-385e3cbf308so2131105f8f.2 for ; Mon, 20 Jan 2025 15:56:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737417374; x=1738022174; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:to:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hd+FAtyW3qepPKqkUOL9/Od7MK2xAPA9vyFrAueIjFU=; b=H7RArsuVQqWipb5aCgFVKIcHG8KrwDEBedAyk8sir93vpZ9uySZN9aFDUOtiQoVT+r A2G3Wr6k4bvr+ez0Igc+hHSh3jy5+PocYYxHsScGTla6E+PdeB7Ks1RQio801dxBU5kL Dcdko2ULSjCT22V/wA4qxj1+A2Jo/4DeQ/dbGALk/gLZIDUe6WXQLRWr7QRcg3Egmr3M YpVZLdCACCuv6siO2gNOi1xwX9Cg4OU0LAN3I0b3dd0S5eZB5juZrOD3baLHIQg+uNXb TzEE0Zdu6D9WQJyQUXKez0FO7xM0YjDrvBc80wxWC3RSZNyng/vD6rDZoZaiNmY6njSv iO3g== X-Gm-Message-State: AOJu0YxYjbnDu2TSf7/xJcQCKHEboeRti65CqL2WS2RbCCgRkVyey3Dm yhYMk99vh2XncD+EhsbUv8PoTp0I7q10zCISB+X2KHOSK6kVg4d0A2ZbGAIAKc1Kiy42akxfhqU j2L52sbNywV8gOjqiRV6zkN4oHky3SNW059vzNx7g/HltmWOBze+UnsFjB9OWJtov0JItka0K3c bh9lQ8f3toYppXoWLJnu24zGqYseHdFFfNU/A= X-Gm-Gg: ASbGncuZS3cqyY0ekQ4Be5W6sEx25RS2/099H87TM0Rc/dDbozBsx5lGsqYJu2cDmfb yFsgh0Z3LzFK/Ku/PPTGtyGH8tMryYkVFDT82ZTW3cm0b+18TukWiEuLITAKjI05YBfbMm8kSSV O6vJcLj8YdxlfwPMK9+szXcQBKZqYEigO7fr+p/AD1lSjPNx6ceLld1FbY59IQwDstab45WSXRo yWtUXGGIlGRaIvWkNGSC30F+P7XcCgts0zKvTDuiyWdIKj1Q7Zx4MDgt7EDTdTWr0RDucUngBpE LVXSpplJXXrlO87YAJbi1cI= X-Received: by 2002:a05:6000:4008:b0:38a:624b:e37b with SMTP id ffacd0b85a97d-38bf57b642dmr13778543f8f.53.1737417373848; Mon, 20 Jan 2025 15:56:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDcHsWHZju/jA3k7fqfwUZsxmkeUzGBYm41qDfgJWUTTsOsBFfSi67Jze57hcqiSeB+Fv5gA== X-Received: by 2002:a05:6000:4008:b0:38a:624b:e37b with SMTP id ffacd0b85a97d-38bf57b642dmr13778534f8f.53.1737417373418; Mon, 20 Jan 2025 15:56:13 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf322ace8sm11834703f8f.53.2025.01.20.15.56.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 15:56:12 -0800 (PST) Date: Tue, 21 Jan 2025 00:56:11 +0100 From: Stefano Brivio To: passt-dev@passt.top Subject: Re: [PATCH] tcp: Set PSH flag for last incoming packets in a batch Message-ID: <20250121005611.06a21126@elisabeth> In-Reply-To: <20250120234958.3247370-1-sbrivio@redhat.com> References: <20250120234958.3247370-1-sbrivio@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 2IPjfK8HulwjM6OWRU6h_TTvcOdRpksR9Mhbs1zIcM4_1737417374 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: UJBLUDKMUPTUYRGY7CV5O5ECB2SB3PGL X-Message-ID-Hash: UJBLUDKMUPTUYRGY7CV5O5ECB2SB3PGL X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, 21 Jan 2025 00:49:58 +0100 Stefano Brivio wrote: > So far we omitted setting PSH flags for inbound traffic altogether: as > we ignore the nature of the data we're sending, we can't conclude that > some data is more or less urgent. This works fine with Linux guests, > as the Linux kernel doesn't do much with it, on input: it will > generally deliver data to the application layer without delay. >=20 > However, with Windows, things change: if we don't set the PSH flag on > interactive inbound traffic, we can expect long delays before the data > is delivered to the application. >=20 > This is very visible with RDP, where packets we send on behalf of the > RDP client are delivered with delays exceeding one second: >=20 > $ tshark -r rdp.pcap -td -Y 'frame.number in { 33170 .. 33173 }' --disa= ble-protocol tls > 33170 0.030296 93.235.154.248 =E2=86=92 88.198.0.164 54 TCP 49012 =E2= =86=92 3389 [ACK] Seq=3D13820 Ack=3D285229 Win=3D387968 Len=3D0 > 33171 0.985412 88.198.0.164 =E2=86=92 93.235.154.248 105 TCP 3389 =E2= =86=92 49012 [PSH, ACK] Seq=3D285229 Ack=3D13820 Win=3D63198 Len=3D51 > 33172 0.030373 93.235.154.248 =E2=86=92 88.198.0.164 54 TCP 49012 =E2= =86=92 3389 [ACK] Seq=3D13820 Ack=3D285280 Win=3D387968 Len=3D0 > 33173 1.383776 88.198.0.164 =E2=86=92 93.235.154.248 424 TCP 3389 =E2= =86=92 49012 [PSH, ACK] Seq=3D285280 Ack=3D13820 Win=3D63198 Len=3D370 >=20 > in this example (packet capture taken by passt), frame #33172 is a > mouse event sent by the RDP client, and frame #33173 is the first > event (display reacting to click) sent back by the server. This > appears as a 1.4 s delay before we get frame #33173. >=20 > If we set PSH, instead: >=20 > $ tshark -r rdp_psh.pcap -td -Y 'frame.number in { 314 .. 317 }' --disa= ble-protocol tls > 314 0.002503 93.235.154.248 =E2=86=92 88.198.0.164 170 TCP 51066 =E2= =86=92 3389 [PSH, ACK] Seq=3D7779 Ack=3D74047 Win=3D31872 Len=3D116 > 315 0.000557 88.198.0.164 =E2=86=92 93.235.154.248 54 TCP 3389 =E2=86= =92 51066 [ACK] Seq=3D79162 Ack=3D7895 Win=3D62872 Len=3D0 > 316 0.012752 93.235.154.248 =E2=86=92 88.198.0.164 170 TCP 51066 =E2= =86=92 3389 [PSH, ACK] Seq=3D7895 Ack=3D79162 Win=3D31872 Len=3D116 > 317 0.011927 88.198.0.164 =E2=86=92 93.235.154.248 107 TCP 3389 =E2= =86=92 51066 [PSH, ACK] Seq=3D79162 Ack=3D8011 Win=3D62756 Len=3D53 >=20 > here, in frame #116, our mouse event is delivered without a delay and ^^^ 316 --=20 Stefano