From owner-freebsd-questions@FreeBSD.ORG Tue Oct 30 14:02:19 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CF2B16A41A for ; Tue, 30 Oct 2007 14:02:19 +0000 (UTC) (envelope-from dbprasad@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.181]) by mx1.freebsd.org (Postfix) with ESMTP id D0B2013C4AA for ; Tue, 30 Oct 2007 14:02:18 +0000 (UTC) (envelope-from dbprasad@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so2573762waf for ; Tue, 30 Oct 2007 07:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=+MsGsFqb+UUi7ggXmturkJTeGwRVuwJjHBNou3z9WOg=; b=cMzNehXTdUDc/eQM9WkN2uG0aoJN7XMWRtzfybG9KcJvoaOYtVOWXS5hfVq5/Hjbbnkoy957FB0gH6elPgXb/elwTcH3PfhYbVLSLdxp4BiipY72THubBa9y23btKuJstbmi7CTko2LNyS6VMpKhYCA2SWoDOweK2ObJKUODK5g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=PWg+90lSVltPHa86g2XTbeUNX4gAWyg15k1fSIuUc4v2g+juvoJWoRn64WstwFe5sU0PM2rD/0E8h8uf8XZRQhc8kcV5SCVjL+gyzmpUUQpjx/3DpxD4S0q75tM/BdkKCMhak5WfsuVZPq46RS2BXcNQmxMvX4iUNpfWU9yW+sc= Received: by 10.115.46.9 with SMTP id y9mr8229456waj.1193751411175; Tue, 30 Oct 2007 06:36:51 -0700 (PDT) Received: by 10.115.48.2 with HTTP; Tue, 30 Oct 2007 06:36:50 -0700 (PDT) Message-ID: Date: Tue, 30 Oct 2007 19:06:51 +0530 From: "Prasad Dandra" To: freebsd-questions@freebsd.org In-Reply-To: <44hckplscw.fsf@be-well.ilk.org> MIME-Version: 1.0 References: <44hckplscw.fsf@be-well.ilk.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Regarding Flow of sendto (UDP) using IPv6. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2007 14:02:19 -0000 Hi All, Thank You for the reply. But I still haven't got the information I am expecting. I am using the *FreeBSD IPv6 stack*. I would be very grateful if you help me to know the following: 1) I wrote the UDP client server program, the client is continously sending packets to server till some condition is met and then recieving the packets from the server untill some other condition is met. The code is working fine. I want to know how the *sendto flow works in the client when I am continously calling it without bind??* Doesn't it require connection to be disconnected after each sendto? if no why? Ex: sendto calls sendit and sendit calls kern_sendit in it and then using prusend the control goes to sosend and udp6_output is called. In udp6_output what are the functions it enters when 1st time sendto is called and in the subsequent sendto calls? i,e *what is the diffrence in th code flow?* 2) I used the same code using other IPv6 stack which has *FreeBSD ported* in it but here the same code doesn't work. If bind is used it works properly. Without Bind it fails at the function if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr)) in udp6_output when tryin the send packet 2nd time. I am not able to find where *in6p->in6p_faddr is initialised to 0*(which i feel is necessary to send the packet next time or else it fails as mentioned above)* in FreeBSD IPv6 stack. is it required? *Kindly help me in this regard. 3) Similarly how is the code flow when the stack recieves the packet i.e the *code flow in udp6_input? * Like udp6_input calls in6_pcblookup_hash. In *in6_pcblookup_hash whether it enters 1st LIST_FOREACH function or the one in wildcard?* ** The implementation of IPv6 is bit different compared to IPv4 like the pcbconnect is avoided and pcbsetport is used in IPv6, the theory and explaination is not available in books as that of IPv4 hence it is diificult to analyse the code flow, so expecting help. Waiting for response. Thanks and Regards Prasad On 10/17/07, Lowell Gilbert wrote: > > "Prasad Dandra" writes: > > > I have some doubts regarding the BSD stack flow. > > I am very much interested to know the code flow from sendto (UDP case) > upto > > udp6_output function when used in IPv6 client (simple client) and also > how > > the local port and destination address are assigned without using bind > > when 1st time the sendto is called i.e where the pcbconnect and pcbbind > are > > called (particularly in case of ipv6)? > > > > Any information provided about the links, books to be refered for more > > details will also be helpful. > > Bear in mind that the IPv6 implementation in FreeBSD has recently been > exchanged for a different one, but I don't think the basic concepts > are much changed. For that matter, the IPv4 model (which has plenty > of book documentation covering it) isn't very different. > >