1 / 10

Introduction to Data Link Layer

Introduction to Data Link Layer. Reading: Chapter 6. Network Layer. Network layer Protocol instances. Network devices. 2b. 802.1 Overview Architecture Management. 802.1 Locigal Link Control. 802.3 CSMA/CD. 802.5 Token Ring. 802.11 WirelessLAN. Drivers. 2a. Network adaptersr.

matthewh
Download Presentation

Introduction to Data Link Layer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Data Link Layer Reading: Chapter 6 FSU CIS 5930 Internet Protocols

  2. Network Layer Network layer Protocol instances Network devices 2b 802.1 Overview Architecture Management 802.1 Locigal Link Control 802.3 CSMA/CD 802.5 Token Ring 802.11 WirelessLAN Drivers 2a Network adaptersr ... ... 1 IEEE 802 standard Linux network architecture Structure of Data Link Layer FSU CIS 5930 Internet Protocols

  3. Application processes Layer 5 NET_RX_SOFTIRQ- Software-Interrupt System Calls * * Kernel activities(Interrupts, Tasklets, Timer-Handler etc.) Layer 1-4 eth1 eth0 CPU1 CPU2 Hardware-Interrupt System-calls NET_RX- Soft-IRQ NET_TX- Soft-IRQ Processes on Data Link Layer FSU CIS 5930 Internet Protocols

  4. Path of a packet in data-link layer .. ... p8022_rcv arp_rcv ip_rcv arp_send ip_queue_xmit Layer 3 ETH_P_802_2 dev.c br_input.c dev.c ... net_rx_action handle_bridge dev_queue_xmit CONFIG_BRIDGE dev->qdisc->enqueue do_softirq Scheduler eth1 eth0 CPU1 CPU2 dev.c net_tx_action qdisc_run softnet_data[cpun].input_pkt_queue Data-link layer (OSI-Layer 1+2) dev.c netif_rx qdisc_restart Scheduler eth_type_trans() driver.c dev->qdisc->dequeue dev_alloc_skb() driver.c net_interrupt dev->hard_start_xmit FSU CIS 5930 Internet Protocols

  5. Receiving a packet • Adapter triggers interrupt, which is handled by the driver (e.g., net_interrupt) • net_rx if receiving a packet • dev_alloc_skb() into socket buffer • Identifying data type in payload (e.g., eth_type_trans()) • netif_rx completes interrupt handling • Enqueueing the buffer (softnet_data[cpu].input_pkt_queue) • Registering soft interrupt • __cpu_raise_softirq(cpu, NET_RX_SOFTIRQ) • CPU resumes the previous activity FSU CIS 5930 Internet Protocols

  6. Receiving packet (Cont’d) • CPU finishes the current activity • Schedule a new activity (schedule) • Check soft interrupt queue first using do_softirq • NET_RX_SOFTIRQ >net_rx_action() • net_rx_action() • Dequeue packet • Handled by different protocol instance based on protocol’s func() • Here for IP, it is ip_rcv() FSU CIS 5930 Internet Protocols

  7. dev.c, net/sched/* dev_queue_xmit softirq.c, netdevice.h dev->qdisc->enqueue timer_handler netif_schedule Timer cpu_raise_softirq Scheduler NET_TX_SOFTIRQ qdisc_run do_softirq net_tx_action qdisc_restart dev->qdisc->dequeue driver.c dev->hard_start_xmit Transmitting a packet FSU CIS 5930 Internet Protocols

  8. Transmitting packets (Cont’s) • dev_queue_xmit() (net/core/dev.c) • qdisc_run() (include/net/pkt_sched.h) • qdisc_restart() (net/sched/sch_generic.c) FSU CIS 5930 Internet Protocols

  9. packet_type 0 ptype_base[16] type: ETH_P_ARP dev: NULL arp_rcv() func data: 1 packet_type next packet_type 1 type: ETH_P_IP dev: NULL func ip_rcv() data: 1 next . . . 16 packet_type packet_type packet_type type: ETH_P_ALL ptype_all type: ETH_P_ALL dev dev func func data data next next Managing Layer-3 protocols FSU CIS 5930 Internet Protocols

  10. Managing Layer-3 Protocols (Cont’d) • dev_add_pack() (net/core/dev.c) • dev_remove_pack() (net/core/dev.c) FSU CIS 5930 Internet Protocols

More Related