From owner-freebsd-hackers Wed Nov 24 14:11:29 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id 468A5154D2 for ; Wed, 24 Nov 1999 14:11:26 -0800 (PST) (envelope-from partha@cs.duke.edu) Received: from mackerel.cs.duke.edu (mackerel.cs.duke.edu [152.3.140.156]) by duke.cs.duke.edu (8.9.1/8.9.1) with ESMTP id RAA15286; Wed, 24 Nov 1999 17:10:54 -0500 (EST) Received: from localhost (partha@localhost) by mackerel.cs.duke.edu (8.8.5/8.6.9) with ESMTP id RAA23758; Wed, 24 Nov 1999 17:10:51 -0500 (EST) X-Authentication-Warning: mackerel.cs.duke.edu: partha owned process doing -bs Date: Wed, 24 Nov 1999 17:10:51 -0500 (EST) From: "Parthasarathy M. Aji" To: freebsd-hackers@FreeBSD.ORG Cc: Kirill Komarov Subject: Redirection In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hey, We are doing packet redirection. The client sends packets through our node to a given server. The server contents are replicated in 2 other servers. We want to redirect new syn packets from the client to a specific server in a round robin fashion. Here 's typical scenarion, let the client's ip address be, C1 and let the three replicated servers have ip addresses S1,S2 and S3. and let us say that the client and the world knows only about the existence of S1. Our program will reside on an intermediate node between C1 and S1 such that every packet sent by C1 to S1 will pass through our program. Now what we want to do is, when ever a new connection requested from the client (it sends syn packet) to S1, we redirect the destination address of the packet to S2 and S3 in a round robin fashion. Similarly when we receive data back from server S2 we change the destination address of the S2 packet to our clien C1t.. Now here's the problem... We seem to have recomputd the check sum and changed the destination address correclty when the client sends the syn packet to the server, but the problem is when the server sends an ack back (in the 3 way handshake) the client is not able to accept it. here's the TCP dump output which was run on the server cricket.. cricket is the client hugo is the server to which we redirected the client syn packet. for some reason cricket is not able to accept the syn+ack from hugo.. 16:19:30.524349 cricket.cs.duke.edu.1048 > hugo.cs.duke.edu.telnet: S 1156355247:1156355247(0) win 65535 (DF) [tos 0x10] 16:19:30.524349 hugo.cs.duke.edu.telnet > cricket.cs.duke.edu.1048: S 872384000:872384000(0) ack 1156355248 win 33580 (DF) 16:19:31.231553 hugo.cs.duke.edu.telnet > cricket.cs.duke.edu.1048: S 872384000:872384000(0) ack 1156355248 win 33580 (DF) 16:19:33.261917 cricket.cs.duke.edu.1048 > hugo.cs.duke.edu.telnet: S 1156355247:1156355247(0) win 65535 (DF) [tos 0x10] 16:19:33.261917 hugo.cs.duke.edu.telnet > cricket.cs.duke.edu.1048: S 872384000:872384000(0) ack 1156355248 win 33580 (DF) 16:19:36.231575 hugo.cs.duke.edu.telnet > cricket.cs.duke.edu.1048: S 872384000:872384000(0) ack 1156355248 win 33580 (DF) 16:19:42.231668 hugo.cs.duke.edu.telnet > cricket.cs.duke.edu.1048: S 872384000:872384000(0) ack 1156355248 win 33580 (DF) 16:19:42.231668 cricket.cs.duke.edu.1048 > hugo.cs.duke.edu.telnet: R 1156355248:1156355248(0) win 0 Partha To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message