DOC PREVIEW
U of I CS 498 - Network Devices

This preview shows page 1-2-16-17-18-33-34 out of 34 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS 498 Lecture 7 Network Devices Jennifer Hou Department of Computer Science University of Illinois at Urbana Champaign Reading Chapters 5 The Linux Networking Architecture Design and Implementation of Network Protocols in the Linux Kernel Network Devices An interface between software based protocols and network adapters hardware Two major functions Abstract from the technical properties of network adapters that implement different layer 1 and layer 2 protocols and are manufactured by different vendors Provide a uniform interface for access by protocol instances Network Device Interface Higher Protocol Instances dev c netif rx dev queue xmit dev open dev close Network devices adapter independent Network devices interface net device dev hard start xmit dev open dev stop Abstraction from Adapter specifics driver c net rx net start xmit net tx skb net interrupt skb skb Network driver net open net stop adapter specific net device structure net device structure Represents a general interface between higher protocol instances and the hardware used Contains a number of function pointers that points to hardware specific methods of the driver Are grouped into four categories General fields Hardware specific fields Network layer fields Device driver methods 1 General Fields in net device name name of the network device e g eth0eth4 lo loopback device next points to the next net device in the list of network devices that starts with dev base owner points to the module structure of the module that creates net device ifindex a second identifier to a network device When a new network device is created dev get index assigns a new unused index to the device 1 General Fields in net device state state of the device LINK STATE START the network adapter has been opened with dev open LINK STATE XOFF the network adaptor cannot accept packets or the transmit buffers of the network adapter are all busy netif running dev can test this flag netif queue stopped dev can test this flag netif stop queue dev sets the LINK STATE XOFF flag and no packet can be passed onto the adapter Usually called by the driver of an adaptor 1 General Fields in net device state state of the device netif start queue dev deletes the LINK STATE XOFF flag and resumes accepting packets from the kernel Usually used by the driver methods of an adaptor after it has sent a packet from the ring transmit buffer netif wake queue dev resumes passing packets and trigger the NET TX software interrupt trans start the time in jiffies when the transmission of a packet started If after some time the driver has not received an acknowledgement it can take appropriate actions 1 General Fields in net device last rx the time in jiffies when the last packet arrived priv a pointer to the private data of a network device qdisk a structure of the type Qdisk and governs the serving discipline of the network device refcnt the number of references to the network device xmit lock xmit lock owner are used for mutual exclusion on the transmit queue xmit lock owner specifies the processor which is currently in the transmit function hard start xmt 2 Hardware Specific Fields rmem end rmem start mem end mem start specify the common memory space that the network adapter and the kernel share mem start mem end designates the buffers for packets to be sent rmem start rmem end designates the location for received packets When ifconfig is used to initialize a network adaptor the addresses of memory locations can be specified base addr I O basic address set in the driver s probing routine during the search for a device I e when the kernel is started or the module is loaded Irq the of the interrupt of a network adapter set in the driver s probing routine dma the number of the DMA channel 2 Hardware Specific Fields The following fields are set by ethersetup for Ethernet cards hard header length specifies the length of the layer 2 packet header 14 for Ethernet adapters does not correspond to the length of the actual packet physical layer header but only to the part passed to the network adapter mtu maximum transfer unit in a layer 2 frame 1500 bytes for Ethernet tx queue len specifies the maximum length of the output queue of the network device 2 Hardware Specific Fields type specifies the hardware type of the network adapter e g ARPHRD ETHER ARPHRD IEEE802 ARPHRD LOOPBACK addr len dev addr MAX ADDR LEN broadcast MAX ADDR LEN the length of the layer 2 address the layer 2 address and the broadcast address dev mc list points to a linear list that contains multicast layer 2 addresses set multicast list is used to pass the list to the network adapter mc count the number of addresses in dev mc list 2 Hardware Specific Fields watchdog timer is initialized when a network device starts The handling routine dev watchdog is called after watchdog timeo time units and checks whether or not watchdog timeo time units have passed since the last transmission of a packet Yes tx timeout of the driver is called No the watchdog timer is restarted 3 Network Layer Fields ip ptr ip6 ptr point to the information of layer 3 protocols that use the network device e g ip ptr points to a structure of type in device that keeps track of a list of IP addresses of the network device a list of IP mluticast groups and the parameters for the ARP protocol family designates the address family of the network device e g AF INET pa alen the length of the addresses e g 4 bytes pa addr pa braddr pa mask the address the broadcast address and the network mask pa dstaddr specifies the address of the other partner in a point to point connection 3 Network Layer Fields flags properties of the network device IFF UP the device is on IFF ARP the device supports ARP IFF BROADCAST the device is broadcast enabled If this flag is set then pa braddr contains the broadcast address IFF LOOKBACK the device is a loopback network device IFF POINTTOPOINT this is a point to point connection If this flag is set then pa dstaddr contains the address on the other end IFF PROMISC this flag switches the promiscuous mode on IFF MULTICAST activates the receipt of multicast packets 4 Device Driver Methods Functions that are related to the network adapter init is used to initialize a network device A network device structure is created and filled with the device specific data of the network driver uninit is called when the network device is unregistered unregister netdevice destructor is called when dev refcnt 0 open opens a named network device


View Full Document

U of I CS 498 - Network Devices

Documents in this Course
Lecture 5

Lecture 5

13 pages

LECTURE

LECTURE

39 pages

Assurance

Assurance

44 pages

LECTURE

LECTURE

36 pages

Pthreads

Pthreads

29 pages

Load more
Download Network Devices
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Network Devices and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Network Devices 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?