The channel then has to report the channel number assigned to it back to the user-level process. The frame does not include the 0xff address byte or the 0x03 control byte that are optionally used in async PPP. Nor is there any escaping of control characters, nor are there any FCS or framing characters included.
That is all the responsibility of the channel code, if it is needed for the particular medium. The channel is free to use the private field however it wishes. The mtu field represents the maximum size of the data part of the PPP frames, that is, it does not include the 2-byte protocol number.
If the channel needs some headroom in the skbuffs presented to it for transmission i. The generic PPP code does not require this but will be more efficient if this is done. The generic PPP layer has been designed to minimize the amount of data that it buffers in the transmit direction. It maintains a queue of transmit packets for the PPP unit network interface device plus a queue of transmit packets for each attached channel. After this point the packets can no longer be reordered, as the decompression algorithms rely on receiving compressed packets in the same order that they were generated.
If the channel refuses to take the packet, the generic layer saves it for later transmission. The generic layer contains no timeout and retransmission logic; it relies on the core networking code for that. If multilink is in use, the generic layer divides the packet into one or more fragments and puts a multilink header on each fragment. It decides how many fragments to use based on the length of the packet and the number of channels which are potentially able to accept a fragment at the moment.
The channel may still refuse a fragment; in this case the fragment is queued up for the channel to transmit later. The generic PPP layer will attempt to provide that much headroom but the channel should still check if there is sufficient headroom and copy the skbuff if there isn't.
The generic PPP code does not require this but will be more efficient if this is done. Buffering and flow control The generic PPP layer has been designed to minimize the amount of data that it buffers in the transmit direction. It maintains a queue of transmit packets for the PPP unit network interface device plus a queue of transmit packets for each attached channel.
After this point the packets can no longer be reordered, as the decompression algorithms rely on receiving compressed packets in the same order that they were generated. If the channel refuses to take the packet, the generic layer saves it for later transmission. The generic layer contains no timeout and retransmission logic; it relies on the core networking code for that. If multilink is in use, the generic layer divides the packet into one or more fragments and puts a multilink header on each fragment.
It decides how many fragments to use based on the length of the packet and the number of channels which are potentially able to accept a fragment at the moment. A channel is potentially able to accept a fragment if it doesn't have any fragments currently queued up for it to transmit. The channel may still refuse a fragment; in this case the fragment is queued up for the channel to transmit later.
This scheme has the effect that more fragments are given to higher- bandwidth channels. It also means that under light load, the generic layer will tend to fragment large packets across all the channels, thus reducing latency, while under heavy load, packets will tend to be transmitted as single fragments, thus reducing the overhead of fragmentation.
Locks are used around accesses to the internal data structures where necessary to ensure their integrity. In multilink terms, the unit represents the bundle, while the channels represent the individual physical links. Thus, a PPP frame sent by a write to the unit i. In contrast, a PPP frame sent by a write to the channel will be sent as-is on that channel, without any multilink header. A channel is not initially attached to any unit. In this state it can be used for PPP negotiation but not for the transfer of data packets.
It can then be connected to a PPP unit with an ioctl call, which makes it available to send and receive data packets for that unit. The ioctl calls which are available on an unattached instance are:. The argument should point to an int containing the unit number. This does not make this instance the owner of the PPP interface.
The argument should point to an int containing the channel number. The argument should point to an int containing the interface unit number. The argument should point to an int containing the channel number of the channel to bridge to.
The argument should point to an int containing the new MRU value. The argument should be a pointer to an int containing the new flags value. The bits in the flags value that can be set are:. The argument should point to an int where the ioctl will store the flags value. If this is 0, the ioctl will affect the receive path, otherwise the transmit path.
The channel may still refuse a fragment; in this case the fragment is queued up for the channel to transmit later. This scheme has the effect that more fragments are given to higher- bandwidth channels. It also means that under light load, the generic layer will tend to fragment large packets across all the channels, thus reducing latency, while under heavy load, packets will tend to be transmitted as single fragments, thus reducing the overhead of fragmentation.
Locks are used around accesses to the internal data structures where necessary to ensure their integrity. As part of this, the generic layer requires that the channels adhere to certain requirements and in turn provides certain guarantees to the channels. This is used by pppd to control PPP interface units and channels. Using an ioctl call, it can then be attached to an existing unit, attached to a newly-created unit, or attached to an existing channel. An instance attached to a unit can be used to send and receive PPP control frames, using the read and write system calls, along with poll if necessary.
Similarly, an instance attached to a channel can be used to send and receive PPP frames on that channel. In multilink terms, the unit represents the bundle, while the channels represent the individual physical links. Thus, a PPP frame sent by a write to the unit i. In contrast, a PPP frame sent by a write to the channel will be sent as-is on that channel, without any multilink header. A channel is not initially attached to any unit. In this state it can be used for PPP negotiation but not for the transfer of data packets.
0コメント