INFORMATIO
Solutions_OSI_Exercises.pdf

Answer 15 hours reception path in netdevinit the

Info icon This preview shows pages 5–8. Sign up to view the full content.

Answer (1.5 hours): Reception path In net_dev_init(), the queue->backlog_dev.poll is initialized as follows:queue->backlog_dev.poll = process_backlog. net_rx_action() is the interrupt handling routine for the interrupt
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Computer Networks: An Open Source Approach 6 NET_RX_SOFTIRQ. It will check the poll_list to see if a device if waiting for polling. If yes, the registered routine for the device is called; otherwise, the system will call the default routine process_backlog(). process_backlog() will call__skb_dequeue to retrieve SKB from the device, and then call netif_receive_skb(). netif_receive_skb() will decide when to send the packet. If forwarding is required, netif_receive_skb() will pass the packet to the bridge. Otherwise, the packet is passed to process routine for upper layer protocols. For example, it will call ip_rcv() to pass the packet to the IP protocol. ip_rcv() will call the NF_HOOK function. When it finishes, it will call the ok_fn() which is link to the ip_rc_finish() function. In ip_rcv_finish(), ip_route_input() is called to perform routing. If the result of routing is to forward the packet to next hop (router), then ip_forward() is called. Otherwise, the input pointer points the ip_local_deliver() function. In ip_local_deliver(), there is also a NF_HOOK function. It eventually calls the ip_local_deliver_finish() function (hooked to ok_fu()). The ip_local_deliver_finish() will the upper layer protocol function to further process the packet. The upper layer protocol can be found by skb -> nh.iph -> protocol() . Finally, it uses following statement to call the upper layer protocol handler: ret = ipprot->handler(skb). For example, for UDP, the handler is udp_rcv(). Therefore, it will call the udp_rcv() function. UDP: udp_sendmsg() calls dp_push_pending_frames() for simple encapsulation. udp_push_pending_frames() first calls ip_push_pending_frames(). After that , it calls ip_local_out()- > __ip_local_out- > dst_output. TCP: When sending data through a TCP socket, tcp_sendmsg() is called to send data in units of segment. tcp_sendmsg() first checks if the data needs to be sending immediately (even the size of data is less than MSS) using the forced_push() function. If yes, it calls tcp_sendmsg()->__tcp_push_pending_frames- >tcp_write_xmit()->tcp_transmit_skb(). Otherwise, it call tcp_push_one()->tcp_transmit_skb()-> icsk->icsk_af_ops->queue_xmit(skb, 0)->ip_queue_xmit. The ip_queue_xmit() function will also call ip_local_out(). Eventually, the dst_output() function is called which calls
Image of page 6
Computer Networks: An Open Source Approach 7 skb->dst->output(skb). For IP packets, it will cann ip_output(). The ok_fn of one of the NF_HONOK_COND hooks of ip_output() is ip_finish_output(). ip_finish_output() will then call ip_finish_output2()-> hh->hh_output(skb). After calling hh->hh_output(skb), dev_queue_xmit()->dev_hard_start_xmit().dev_hard_start_xmit() is called to check if GSO(Generic Segmentation Offload) is required. GSO denotes offload the segmentation operation to the network interface card (NIC). If not, or no segmentation is required, it will then call dev->hard_start_xmit(skb) which hands the segment to the NIC. Otherwise, the packet is divided into
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Image of page 8
This is the end of the preview. Sign up to access the rest of the document.
  • Winter '15
  • MAhmoudali
  • IP address, Transmission Control Protocol

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern