Fragmentation Avoidance Code
Respected Sir I am currently working in the fragmentation avoidance technique caused by the overhead introduced by MIP6. I am using FreeBSD 4.4 and Kame Snap. I have introduced some code in netinet6/ip6_output.c code and netinet6/in6_pcb.h and netinet/in_pcb.h so that length of the MIP6 extension header if present is taken into account, when calculation the ipoptlen() and hence frag is avoided. Below i am pasting the code to which i have made changes. The lines starting with @ symbol shows the code introduced by me. Please go thru the code and let me know whether this takes account of the Extension header length introduced by MIP6. Since, this is my first research project, i kindly request you to go thru the code and help me. I have explained my code under the heading Implementation in the last ie. after the codes Please let me know, whether this code will take into account the length occupied by MIP6 Ext header. If any changes is required pls let me know. Thanks and sorry for the disturbance Code - netinet6/in6_pcb.h and netinet/in_pcb.h --- @ #ifdef MIP6 @ #include sys/syslog.h @ #include net/if_hif.h @ #include netinet6/mip6_var.h @ #include netinet6/mip6.h @ #endif /* MIP6 */ . . . struct in6pcb ( . . . struct ip6_pktopts *in6p_outputopts; /* IP6 options for outgoing packets */ @ #ifdef MIP6 @ struct mip6_pktopts *mip6_outputopts /* MIP6 options for outgoing packets */ @ #endif . . . ); netinet6/ip6_output.c -- In the last part of netinet6/ip6_output.c I have changed the code and pasted it under Modified code Modified Code: - /* * Compute IPv6 and MIP6 extension header length. */ #ifdef HAVE_NRL_INPCB # define in6pcb inpcb # define in6p_outputoptsinp_outputopts6 #endif int ip6_optlen(in6p) struct in6pcb *in6p; { int len; @ if (!(in6p-in6p_outputopts || @ #ifdef MIP6 @ in6p-mip6_outputopts @ #endif @ )) @ return 0; len = 0; #define elen(x) \ (((struct ip6_ext *)(x)) ? (((struct ip6_ext *)(x))-ip6e_len + 1) 3 : 0) len += elen(in6p-in6p_outputopts-ip6po_hbh); if (in6p-in6p_outputopts-ip6po_rthdr) /* dest1 is valid with rthdr only */ len += elen(in6p-in6p_outputopts-ip6po_dest1); len += elen(in6p-in6p_outputopts-ip6po_rthdr); len += elen(in6p-in6p_outputopts-ip6po_dest2); @ #ifdef MIP6 @ len += elen(in6p-mip6_outputopts-mip6po_rthdr);/* MIP6 Routing Header */ @ len += elen(in6p-mip6_outputopts-mip6po_haddr);/* MIP6 Home Addr Option */ @ len += elen(in6p-mip6_outputopts-mip6_dest2); /* MIP6 Dest2 Option */ @ #endif return len; #undef elen } #ifdef HAVE_NRL_INPCB # undef in6pcb # undef in6p_outputopts #endif Original netinet6/ip6_output.c kame Code -- /* * Compute IPv6 extension header length. */ #ifdef HAVE_NRL_INPCB # define in6pcb inpcb # define in6p_outputoptsinp_outputopts6 #endif int ip6_optlen(in6p) struct in6pcb *in6p; { int len; if (!in6p-in6p_outputopts) return 0; len = 0; #define elen(x) \ (((struct ip6_ext *)(x)) ? (((struct ip6_ext *)(x))-ip6e_len + 1) 3 : 0) len += elen(in6p-in6p_outputopts-ip6po_hbh); if (in6p-in6p_outputopts-ip6po_rthdr) /* dest1 is valid with rthdr only */ len += elen(in6p-in6p_outputopts-ip6po_dest1); len += elen(in6p-in6p_outputopts-ip6po_rthdr); len += elen(in6p-in6p_outputopts-ip6po_dest2); return len; #undef elen } #ifdef HAVE_NRL_INPCB # undef in6pcb # undef in6p_outputopts #endif Implementation 1)netinet6/in6_pcb.h and netinet/in_pcb.h Create a pointer to struct mip6_pktopts, if MIP6 is defined and name the pointer as *mip6_outputopts @ #ifdef MIP6 @ struct mip6_pktopts *mip6_outputopts /* MIP6 options for outgoing packets */ @ #endif 2) netinet6/ip6_output.c Modify the code of macro elen(x) present in function ip6_optlen(in6p) in netinet6/ip6_output.c such that it takes into account, the length occupied by Mip6 Extension headers @ #ifdef MIP6 @ len += elen(in6p-mip6_outputopts-mip6po_rthdr);/* MIP6 Routing Header */ @ len += elen(in6p-mip6_outputopts-mip6po_haddr);/* MIP6 Home Addr Option */ @ len += elen(in6p-mip6_outputopts-mip6_dest2); /* MIP6 Dest2 Option */ @ #endif Regards Dev To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Fragmentation Avoidance Code
Respected Sir I am currently working in the fragmentation avoidance technique caused by the overhead introduced by MIP6. I am using FreeBSD 4.4 and Kame Snap. I have introduced some code in netinet6/ip6_output.c code and netinet6/in6_pcb.h and netinet/in_pcb.h so that length of the MIP6 extension header if present is taken into account, when calculation the ipoptlen() and hence frag is avoided. Below i am pasting the code to which i have made changes. The lines starting with @ symbol shows the code introduced by me. Please go thru the code and let me know whether this takes account of the Extension header length introduced by MIP6. Since, this is my first research project, i kindly request you to go thru the code and help me. I have explained my code under the heading Implementation in the last ie. after the codes Please let me know, whether this code will take into account the length occupied by MIP6 Ext header. If any changes is required pls let me know. Thanks and sorry for the disturbance Code - netinet6/in6_pcb.h and netinet/in_pcb.h --- @ #ifdef MIP6 @ #include sys/syslog.h @ #include net/if_hif.h @ #include netinet6/mip6_var.h @ #include netinet6/mip6.h @ #endif /* MIP6 */ . . . struct in6pcb ( . . . struct ip6_pktopts *in6p_outputopts; /* IP6 options for outgoing packets */ @ #ifdef MIP6 @ struct mip6_pktopts *mip6_outputopts /* MIP6 options for outgoing packets */ @ #endif . . . ); netinet6/ip6_output.c -- In the last part of netinet6/ip6_output.c I have changed the code and pasted it under Modified code Modified Code: - /* * Compute IPv6 and MIP6 extension header length. */ #ifdef HAVE_NRL_INPCB # define in6pcb inpcb # define in6p_outputoptsinp_outputopts6 #endif int ip6_optlen(in6p) struct in6pcb *in6p; { int len; @ if (!(in6p-in6p_outputopts || @ #ifdef MIP6 @ in6p-mip6_outputopts @ #endif @ )) @ return 0; len = 0; #define elen(x) \ (((struct ip6_ext *)(x)) ? (((struct ip6_ext *)(x))-ip6e_len + 1) 3 : 0) len += elen(in6p-in6p_outputopts-ip6po_hbh); if (in6p-in6p_outputopts-ip6po_rthdr) /* dest1 is valid with rthdr only */ len += elen(in6p-in6p_outputopts-ip6po_dest1); len += elen(in6p-in6p_outputopts-ip6po_rthdr); len += elen(in6p-in6p_outputopts-ip6po_dest2); @ #ifdef MIP6 @ len += elen(in6p-mip6_outputopts-mip6po_rthdr);/* MIP6 Routing Header */ @ len += elen(in6p-mip6_outputopts-mip6po_haddr);/* MIP6 Home Addr Option */ @ len += elen(in6p-mip6_outputopts-mip6_dest2); /* MIP6 Dest2 Option */ @ #endif return len; #undef elen } #ifdef HAVE_NRL_INPCB # undef in6pcb # undef in6p_outputopts #endif Original netinet6/ip6_output.c kame Code -- /* * Compute IPv6 extension header length. */ #ifdef HAVE_NRL_INPCB # define in6pcb inpcb # define in6p_outputoptsinp_outputopts6 #endif int ip6_optlen(in6p) struct in6pcb *in6p; { int len; if (!in6p-in6p_outputopts) return 0; len = 0; #define elen(x) \ (((struct ip6_ext *)(x)) ? (((struct ip6_ext *)(x))-ip6e_len + 1) 3 : 0) len += elen(in6p-in6p_outputopts-ip6po_hbh); if (in6p-in6p_outputopts-ip6po_rthdr) /* dest1 is valid with rthdr only */ len += elen(in6p-in6p_outputopts-ip6po_dest1); len += elen(in6p-in6p_outputopts-ip6po_rthdr); len += elen(in6p-in6p_outputopts-ip6po_dest2); return len; #undef elen } #ifdef HAVE_NRL_INPCB # undef in6pcb # undef in6p_outputopts #endif Implementation 1)netinet6/in6_pcb.h and netinet/in_pcb.h Create a pointer to struct mip6_pktopts, if MIP6 is defined and name the pointer as *mip6_outputopts @ #ifdef MIP6 @ struct mip6_pktopts *mip6_outputopts /* MIP6 options for outgoing packets */ @ #endif 2) netinet6/ip6_output.c Modify the code of macro elen(x) present in function ip6_optlen(in6p) in netinet6/ip6_output.c such that it takes into account, the length occupied by Mip6 Extension headers @ #ifdef MIP6 @ len += elen(in6p-mip6_outputopts-mip6po_rthdr);/* MIP6 Routing Header */ @ len += elen(in6p-mip6_outputopts-mip6po_haddr);/* MIP6 Home Addr Option */ @ len += elen(in6p-mip6_outputopts-mip6_dest2); /* MIP6 Dest2 Option */ @ #endif Regards Dev To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Fragmentation Avoidance Code
Respected Sir I am currently working in the fragmentation avoidance technique caused by the overhead introduced by MIP6. I am using FreeBSD 4.4 and Kame Snap. I have introduced some code in netinet6/ip6_output.c code and netinet6/in6_pcb.h and netinet/in_pcb.h so that length of the MIP6 extension header if present is taken into account, when calculation the ipoptlen() and hence frag is avoided. Below i am pasting the code to which i have made changes. The lines starting with @ symbol shows the code introduced by me. Please go thru the code and let me know whether this takes account of the Extension header length introduced by MIP6. Since, this is my first research project, i kindly request you to go thru the code and help me. I have explained my code under the heading Implementation in the last ie. after the codes Please let me know, whether this code will take into account the length occupied by MIP6 Ext header. If any changes is required pls let me know. Thanks and sorry for the disturbance Code - netinet6/in6_pcb.h and netinet/in_pcb.h --- @ #ifdef MIP6 @ #include sys/syslog.h @ #include net/if_hif.h @ #include netinet6/mip6_var.h @ #include netinet6/mip6.h @ #endif /* MIP6 */ . . . struct in6pcb ( . . . struct ip6_pktopts *in6p_outputopts; /* IP6 options for outgoing packets */ @ #ifdef MIP6 @ struct mip6_pktopts *mip6_outputopts /* MIP6 options for outgoing packets */ @ #endif . . . ); netinet6/ip6_output.c -- In the last part of netinet6/ip6_output.c I have changed the code and pasted it under Modified code Modified Code: - /* * Compute IPv6 and MIP6 extension header length. */ #ifdef HAVE_NRL_INPCB # define in6pcb inpcb # define in6p_outputoptsinp_outputopts6 #endif int ip6_optlen(in6p) struct in6pcb *in6p; { int len; @ if (!(in6p-in6p_outputopts || @ #ifdef MIP6 @ in6p-mip6_outputopts @ #endif @ )) @ return 0; len = 0; #define elen(x) \ (((struct ip6_ext *)(x)) ? (((struct ip6_ext *)(x))-ip6e_len + 1) 3 : 0) len += elen(in6p-in6p_outputopts-ip6po_hbh); if (in6p-in6p_outputopts-ip6po_rthdr) /* dest1 is valid with rthdr only */ len += elen(in6p-in6p_outputopts-ip6po_dest1); len += elen(in6p-in6p_outputopts-ip6po_rthdr); len += elen(in6p-in6p_outputopts-ip6po_dest2); @ #ifdef MIP6 @ len += elen(in6p-mip6_outputopts-mip6po_rthdr);/* MIP6 Routing Header */ @ len += elen(in6p-mip6_outputopts-mip6po_haddr);/* MIP6 Home Addr Option */ @ len += elen(in6p-mip6_outputopts-mip6_dest2); /* MIP6 Dest2 Option */ @ #endif return len; #undef elen } #ifdef HAVE_NRL_INPCB # undef in6pcb # undef in6p_outputopts #endif Original netinet6/ip6_output.c kame Code -- /* * Compute IPv6 extension header length. */ #ifdef HAVE_NRL_INPCB # define in6pcb inpcb # define in6p_outputoptsinp_outputopts6 #endif int ip6_optlen(in6p) struct in6pcb *in6p; { int len; if (!in6p-in6p_outputopts) return 0; len = 0; #define elen(x) \ (((struct ip6_ext *)(x)) ? (((struct ip6_ext *)(x))-ip6e_len + 1) 3 : 0) len += elen(in6p-in6p_outputopts-ip6po_hbh); if (in6p-in6p_outputopts-ip6po_rthdr) /* dest1 is valid with rthdr only */ len += elen(in6p-in6p_outputopts-ip6po_dest1); len += elen(in6p-in6p_outputopts-ip6po_rthdr); len += elen(in6p-in6p_outputopts-ip6po_dest2); return len; #undef elen } #ifdef HAVE_NRL_INPCB # undef in6pcb # undef in6p_outputopts #endif Implementation 1)netinet6/in6_pcb.h and netinet/in_pcb.h Create a pointer to struct mip6_pktopts, if MIP6 is defined and name the pointer as *mip6_outputopts @ #ifdef MIP6 @ struct mip6_pktopts *mip6_outputopts /* MIP6 options for outgoing packets */ @ #endif 2) netinet6/ip6_output.c Modify the code of macro elen(x) present in function ip6_optlen(in6p) in netinet6/ip6_output.c such that it takes into account, the length occupied by Mip6 Extension headers @ #ifdef MIP6 @ len += elen(in6p-mip6_outputopts-mip6po_rthdr);/* MIP6 Routing Header */ @ len += elen(in6p-mip6_outputopts-mip6po_haddr);/* MIP6 Home Addr Option */ @ len += elen(in6p-mip6_outputopts-mip6_dest2); /* MIP6 Dest2 Option */ @ #endif Regards Dev To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
changes in tcp6_input.c and tcp6_output.c
Respected Sir I have made some changes to the /usr/kame/kame/kame/sys/netinet6/tcp6_input.c and /usr/kame/kame/kame/netinet6/sys/tcp6_output.c in FreeBSD 4.4 and iam using Kame snap. I have some queries regarding making the changes active. Can anyone please tell me the procedure to recompile or reconfigure the kernel so that the changes come into effect I would be grateful to you, if you could let me know these questions Thanks for the help and sorry for the disturbance. Best Regards Dev To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Packet length 1284 instead of 1280
Sir / Madam I am doing my research on fragmentation avoidance technique for mip6. I am using FreeBSD4.4 with kame snap and ethereal to capture packets I have a query regarding the packet length If i am correct , packet length = IPHdr +extHdr+TCPHdr+TCPOpt+Data =IPHdr+Routing Header + Frag Header + TCP Header+ Tcpopt+ Data 40+24+8+20+12+1176=1280 (Which is the MTU of the gif0 interface) But my ethereal capture says the packet length to be 1284 btyes. Can anyone please let me know what that 4 bytes is accounted for? With this mail, i am pasting a capture packet of my experiment Frame 973 (1284 on wire 1284 captured) Arrival Time: Dec 6 2002 39:54.8 Time delta from previous packet: 0.52 seconds Time relative to first packet: 97.69262 seconds Frame Number: 973 Packet Length: 1284 bytes Capture Length: 1284 bytes Null/Loopback Family: IPv6 (0x001c) Internet Protocol Version 6 Version: 6 Traffic class: 0x00 Flowlabel: 0x6017f Payload length: 1240 Next header: IPv6 routing (0x2b) Hop limit: 64 Source address: 2001:618:400::8949:b94 (2001:618:400::8949:b94) Destination address: 3ffe:400b:6004:3:200:39ff:fe11:f32 (3ffe:400b:6004:3:200:39ff:fe11:f32) Routing Header Type 0 Next header: IPv6 fragment (0x2c) Length: 2 (24 bytes) Type: 0 Segments left: 1 address 0:00 3ffe:327e:2:1:200:39ff:fe11:f32 (3ffe:327e:2:1:200:39ff:fe11:f32) Fragmention Header Next header: TCP (0x06) Offset: 0 More fragments: Yes Identification: 0xef9a Transmission Control Protocol Src Port: 49165 -49165 Dst Port: iad2 -1031 Seq: 2.68E+09 Ack: 1.12E+09 Source port: 49165 -49165 Destination port: iad2 -1031 Sequence number: 2.68E+09 Next sequence number: 2.68E+09 Acknowledgement number: 1.12E+09 Header length: 32 bytes Flags: 0x0010 (ACK) 0... = Congestion Window Reduced (CWR): Not set .0.. = ECN-Echo: Not set ..0. = Urgent: Not set ...1 = Acknowledgment: Set 0... = Push: Not set .0.. = Reset: Not set ..0. = Syn: Not set ...0 = Fin: Not set Window size: 16912 Checksum: 0x7783 Options: (12 bytes) NOP NOP Time stamp: tsval 1931258 tsecr 159233 Data (1176 bytes) Here the packet length is 1284 instead of 1280. Can anyone please explain me the situation . Is it because of any header or something else. Best Regards Dev To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Changing the Maximum Segment Size (MSS) of Kame MIP6 Free BSD4.4
Respected Sir/ Madam I am Dev, doing my research in Centre for Telecommunications Research, King's college London. My research project involves evaluating the performance of MIP6 TCP in the presence of fragmentation and without fragmentation. I am using Kame MIP6 for Free BSD 4.4 and have configured gif0 interface for ipv6ip tunnel. I wish to change the Maximum segment size of the TCP. Can you please help me , where i should change the MSS of the TCP. Can you tell me where the default size of the MSS mentioned? Eagerly waiting for the reply Best Regards Dev A. Dev pramil Research Student Center for Telecommunications Research University of London, Kings College Strand WC2R 2LS To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message