Skip to contentSkip to conversation

sk_buff for frame fragmentation and reassembly

DISCUSSION Seong Moon 2 participants 2 messages Aug 28, 2002

lore
Share & tools
lore

Seong Moon

author
#0 lore raw

Hi,there.

I'm writing virtual network device driver.
I want to write the function of fragmentation and reassembly of a frame which is larger than physical MTU.

So, I've looked into the ip_fragment() and ip_defrag() and sk_buff.h . But I couldn't understand the process of fragmentation and reassembly of datagram.

My questions are as follows :

<fragmentation>
- ip_fragment() uses alloc_skb() and skb_copy_bit(), Is the original sk_buff shared ? or Is another sk_buff created? I want to know the meaning of alloc_skb() and skb_copy_bit().

<reassembly>
- ip_defrag() uses skb_shinfo(skb)->frag_list. When I pass a reassembled frame to network layer, can I use skb_shinfo(skb)->frag_list ?
If not, How can I pass the reassembled frame to upper layer?

<sk_buff>
what does the usage of pskb_pull() and pskb_trim()?

Thanks in advance.

#1 lore raw

From: "Seong Moon" <[email protected]>
Date: Wed, 28 Aug 2002 10:42:50 +0900

I want to know the meaning of alloc_skb() and skb_copy_bit().

alloc_skb allocates a new SKB.
skb_copy_bit copies data from a SKB to a kernel buffer.

net/core/skbuff.c has full documentation in the comments above alloc_skb, perhaps you should read it :-)