* Network implementation
@ 2003-10-20 9:23 an7
0 siblings, 0 replies; only message in thread
From: an7 @ 2003-10-20 9:23 UTC (permalink / raw)
To: linux-kernel
Hi, i am a french engineer who has some work to do on
TCP/IP implementation in the linux kernel.
I have three questions on it :
1) What are the advantages of using a ring buffer for
receiving and queuing packets ?
2) in tcp_minisocks.c in linux i get, in the function
which handles segment arrival in FIN_WAIT_2 state :
if (th->syn && !before(TCP_SKB_CB(skb)->seq,
tw->rcv_nxt))
goto kill_with_rst;
Just to confirm : in the state FIN_WAIT_2 a SYN
segment is automatically killed by a RST, unless its
sequence number is superior to the waited sequence
number. But in this case , what happens ? I think the
RFC tells to send a ACK. Am i right ?
3) the function tcp_recv_skb() (tcp.c)
struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq,
u32 *off)
1383 {
1384 struct sk_buff *skb;
1385 u32 offset;
1386
1387 skb_queue_walk(&sk->receive_queue, skb) {
1388 offset = seq -
TCP_SKB_CB(skb)->seq;
1389 if (skb->h.th->syn)
1390 offset--;
1391 if (offset < skb->len ||
skb->h.th->fin) {
1392 *off = offset;
1393 return skb;
1394 }
1395 }
1396 return NULL;
1397 }
I just can't understand the role of offset (and thus,
i can't undersand why it is decremented with a syn
segment, and why we can return the skb structure when
we have an offset inferior to the skb len, or a FIN
segment)
Could you help please ?
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-10-20 9:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-20 9:23 Network implementation an7
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®