[Xorp-cvs] XORP cvs commit: xorp/fea
Pavlin Radoslavov
pavlin at icir.org
Fri Oct 6 13:55:21 PDT 2006
CVSROOT: /usr/local/share/doc/apache/cvs
Module name: xorp
Changes by: pavlin at xorpc.icir.org 2006-10-06 20:55:21 UTC
XORP CVS repository
Modified files:
fea mfea_proto_comm.cc mfea_proto_comm.hh rawsock.cc
rawsock.hh
Log message:
* Fix the mechanism for transmitting IPv4 packets, so now we can
transmit packets on Linux even if the source address doesn't belong
to the router. The problem with Linux is the following.
In case of Linux IP_HDRINCL IP packets are not fragmented and
are limited to the interface MTU. The raw(7) Linux manual is wrong
by saying it is a limitation only in Linux 2.2. It is a limitation
in 2.4 and 2.6 and there is no indication this is going to be fixed
in the future.
Hence, in case of Linux we do the following:
- If the IP packet fits in the MTU, then send the packet using
IP_HDRINCL option.
- Otherwise, if the IP source address belongs to the outgoing
interface, then use various socket options to specify some of
the IP header options.
- Otherwise, use IP_HDRINCL and fragment the IP packet in user
space before transmitting it. Note that in this case we need
to manage the ip_id field in the IP header.
The reasoning behind the above logic is: (1) If the IP source
address doesn't belong to one of the router's IP addresses, then
we must use IP_HDRINCL; (2) We want to avoid as much as possible
user-level IP packet fragmentation, because managing the ip_id
field in user space does not guarantee the same ip_id is reused
by the kernel as well (for the same tuple of <src, dest, protocol>).
Note that in case of all other OS-es we always use the IP_HDRINCL
option to transmit the packets.
* Remove extra buffers for sending and receiving raw packets.
This reduces the run-time memory usage by 128KB.
* Declare the IPv4 router alert option as static, and compute its
value on startup.
* Minor cleanup.
Revision Changes Path
1.65 +197 -110; commitid: 100a04526c1527ea6; xorp/fea/mfea_proto_comm.cc
1.22 +7 -10; commitid: 100a04526c1527ea6; xorp/fea/mfea_proto_comm.hh
1.34 +211 -115; commitid: 100a04526c1527ea6; xorp/fea/rawsock.cc
1.10 +6 -9; commitid: 100a04526c1527ea6; xorp/fea/rawsock.hh
More information about the Xorp-cvs
mailing list