Download Using Time Division Multiplexing to support Real
Transcript
the packet. It then calls the udp getfrag() function mentioned above, to copy the data from the user space to the kernel. Once this is done it directly goes to the link layer without getting into the next step of fragmentation. These operations are done in the ip build xmit [net/ipv4/ip output.c] routine. Step 7 : In case of a TCP packet the ip queue xmit2 [net/ipv4/ip output.c] routine checks to see if fragmentation is required in case the packet size is greater than the permitted size. If fragmentation is needed, then the packets are fragmented and sent to the link layer. This routine is executed in process context and is not required by the UDP packets. Link Layer Step 8 : From the link layer there is no difference in the nature of processing between a TCP and a UDP packet. The link layer recieves the packet through the dev queue xmit [net/core/dev.c] routine. This completes the checksum calculation if it is not already done in the above layers or if the output device supports a different type of checksum calculation. It checks if the output device has a queue and enqueues the packet in the output device. It also initiates the scheduler associated with the queuing discipline to dequeue the packet and send it out. In this step the execution is carried out in the process context. Step 9 : The dev queue xmit routine invokes the qdisc run [include/net/pkt sched.h] routine which checks the device queue to see if there are any packets to be sent out. If present, it initiates the sending of a packet. This function runs in the process context the first time it comes through this flow of control, however if the device is not free or if the process is not able to send the packet out for some other reason, this function is executed again in a softirq context. Step 10 : The qdisc run routine invokes the qdisc restart [net/sched/sch - generic.c] function to check if the device is free to transmit. If so, the packet is sent 27