A “real” network driver? We want to construct a Linux network device-driver that is able to send and receive packets.

Slides:



Advertisements
Similar presentations
DEVICE DRIVER VINOD KAMATH CS691X PROJECT WORK. Introduction How to write/install device drivers Systems, Kernel Programming Character, Block and Network.
Advertisements

Internet Control Protocols Savera Tanwir. Internet Control Protocols ICMP ARP RARP DHCP.
Using VMX within Linux We explore the feasibility of executing ROM-BIOS code within the Linux x86_64 kernel.
1 Linux Networking and Security Chapter 2. 2 Configuring Basic Networking Describe how networking devices differ from other Linux devices Configure Linux.
Introduction Characteristics of USB System Model What needs to be done Platform Issues Conceptual Issues Timeline USB Monitoring Final Presentation 10.
04/14/2008CSCI 315 Operating Systems Design1 I/O Systems Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Network Devices COMS W6998 Spring 2010 Erich Nahum.
MIGSOCK Migratable TCP Socket in Linux Demonstration of Functionality Karthik Rajan Bryan Kuntz.
SiS 315 Graphics Engine Introduction to some capabilities of graphics accelerator hardware.
Our ‘nic.c’ module We create a ‘character-mode’ device-driver for the 82573L NIC to use in futrure experiments.
The ‘net_device’ structure A look at the main kernel-object concerned with a Linux system’s network interface controller.
Observing TCP behavior On using our classroom’s network hardware capabilities to perform experiments with TCP sockets.
Our ‘nic.c’ module We create a ‘character-mode’ device-driver for the 82573L NIC to use in future experiments.
The ‘ioctl’ driver-function On implementing a way to query and modify our UART’s baudrate via the ‘device-file’ abstraction.
Adjusting out device-driver Here we complete the job of modifying our ‘nicf.c’ Linux driver to support ‘raw’ packet-transfers.
Looking at kernel objects How a character-mode Linux device driver can be useful in viewing a ‘net_device’ structure.
What’s needed to transmit? A look at the minimum steps required for programming our anchor nic’s to send packets.
A network driver ‘framework’ We construct a ‘skeleton’ module showing just the essential pieces of a Linux network device driver.
Common network diagnostic and configuration utilities A ‘toolkit’ for network users and managers when ‘troubleshooting’ is needed on your network.
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
Socket options A way for network applications to ‘tweak’ the processing done at lower-levels of the TCP/IP stack.
User Datagram Protocol An initial look at using the UDP transport protocol for sending and receiving network packets.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 7 Connect the SUSE Linux Enterprise Server to the Network.
Hacking the Bluetooth Pairing Authentication Process Graduate Operating System Mini Project Siyuan Jiang and Haipeng Cai.
Sockets CIS 370 Fall 2009, UMassD. Introduction  Sockets provide a simple programming interface which is consistent for processes on the same machine.
1 The SpaceWire Internet Tunnel and the Advantages It Provides For Spacecraft Integration Stuart Mills, Steve Parkes Space Technology Centre University.
Agenda  Terminal Handling in Unix File Descriptors Opening/Assigning & Closing Sockets Types of Sockets – Internal(Local) vs. Network(Internet) Programming.
Internet Addressing. When your computer is on the Internet, anything you do requires data to be transmitted and received. For example, when you visit.
Wave Relay System and General Project Details. Wave Relay System Provides seamless multi-hop connectivity Operates at layer 2 of networking stack Seamless.
CIS 191 – Lesson 2 System Administration. CIS 191 – Lesson 2 System Architecture Component Architecture –The OS provides the simple components from which.
Remote Access Chapter 4. Learning Objectives Understand implications of IEEE 802.1x and how it is used Understand VPN technology and its uses for securing.
Socket Swapping for efficient distributed communication between migrating processes MS Final Defense Praveen Ramanan 12 th Dec 2002.
Windows XP. History Windows XP is based on the NT kernel developed in 1988 Windows XP is based on the NT kernel developed in 1988 XP was originally sold.
Chapter 1 : The Linux System Part 1 Lecture 1 10/21/
Linux Capability Zutao Zhu 10/23/2009. Outline Question 2 Question 5 Question 6.
Ethernet Driver Changes for NET+OS V5.1. Design Changes Resides in bsp\devices\ethernet directory. Source code broken into more C files. Native driver.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Issues Autonomic operation (fault tolerance) Minimize interference to applications Hardware support for new operating systems Resource management (global.
Spam Mail FilterJeff Rupp & Frank Watson1 Implement Spam Mail Filtration inside Linux kernel Jeff Rupp and Frank Watson.
CS492b Project #3-2 KIP router KAIST Dept. of CS NC Lab.
Networks Am I hooked up?. Networks definition sizes of networks types advantages and disadvantages how data is sent transmission media business uses.
Mininet and Openflow Labs. Install Mininet (do not do this in class) Download VirtualBox Download Xming for windows (X11) Download Mininet VM for linux-ubuntu.
Click Router: Hands on Alex Newman Arvind Venkatesan Shivkumar Kalyanaraman.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
SCSC 455 Computer Security Chapter 3 User Security.
1 CSCD 330 Network Programming Fall 2013 Some Material in these slides from J.F Kurose and K.W. Ross All material copyright Lecture 8a Application.
Kernel Modules – Introduction CSC/ECE 573, Sections 001 Fall, 2012.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Chapter 4: server services. The Complete Guide to Linux System Administration2 Objectives Configure network interfaces using command- line and graphical.
Reverse Engineered Architecture of the Linux Kernel Kristof De Vos.
LINUX Network Concepts M.S.Dibay Moghaddam Second Linux Festival Amir Kabir University of Technology Computer & IT Department.
LISA Linux Switching Appliance Radu Rendec Ioan Nicu Octavian Purdila Universitatea Politehnica Bucuresti 5 th RoEduNet International Conference.
Computer System Structures
Operating System Kernel Compilation
Zero-copy Receive Path in Virtio
Linux Details: Device Drivers
Programming Assignment
Containers: The new network endpoint
Linux Kernel Module Programming
sudo ./snull_load Two interfaces created: sn0, sn1
Design Your Own Android App
Chapter 3: Windows7 Part 4.
Operating System Kernel Compilation
TCP/IP Networking An Example
IS3440 Linux Security Unit 7 Securing the Linux Kernel
Linux Details: Device Drivers
LINUX System : Lecture 7 Lecture notes acknowledgement : The design of UNIX Operating System.
Module 12 Network Configuration
Operating System Kernel Compilation
Virtual Private Network
Presentation transcript:

A “real” network driver? We want to construct a Linux network device-driver that is able to send and receive packets

Our ‘framework.c’ demo Earlier in our course we wrote a ‘skeleton’ network device-driver that showed us the minimum elements necessary to interact successfully with the Linux kernel, though it did not program any actual hardware Since then we have learned how to write code that does control network hardware, by building ‘character-mode’ Linux drivers

Role of device-drivers hardware devices network device driver Linux operating system kernel networking subsystem application program standard runtime libraries user space kernel space file subsystem character device driver

Pedagogy Using character-mode device-drivers has advantages for studying how the network controller hardware works -- because we don’t have to worry about interfacing with the Linux kernel’s networking subsystem But we don’t end up with a ‘real’ network device-driver until we do create code that can work with that networking subsystem

Source-code layout #include … typedef struct { /* driver’s private data */ } MY_DRIVERDATA; char modname[ ] = “netframe”; struct net_device *netdev; netframe.c my_initmy_exit The mandatory module- administration functions my_open() my_stop() my_hard_start_xmit() my_isr() my_get_info() The network driver’s “payload” functions Optional pseudo-file (for debugging assistance)

‘minimal’ functionality Use the mimimum number of descriptors Use simple ‘legacy’ descriptor-formats Maintain a minimal set of driver statistics Omit flow-control and VLAN tagging Omit nonessential interrupt-processing Omit use of packet-filtering options Omit use of device’s ‘offload’ options

Interactions with the kernel module_init() calls ‘register_netdev()’ module_exit() calls ‘unregister_netdev()’ open() calls ‘netif_start_queue()’ stop() calls ‘netif_stop_queue()’ hard_start_xmit() calls ‘dev_kfree_skb()’ rx_handler() calls ‘dev_alloc_skb()’ and netif_rx()’

‘mynetdvr.c’ We can demonstrate the basic transmit and receive functionality of our network driver using a pair of ‘anchor’ machines But we have to work around some slight amount of interference with the already- installed ‘e1000’ network-driver which is supporting our ability to do remote login via the ‘eth0’ device interface

The ‘anchor’ installation-steps 1. Bring down the ‘eth1’ interface $ sudo /sbin/ifconfig eth1 down 2. Install our network device-driver $ /sbin/insmod mynetdvr.ko 3. Bring down the ‘eth1’ interface again $ sudo /sbin/ifconfig eth1 down 4. Assign IP-address to the ‘eth2’ interface $ sudo /sbin/ifconfig eth x

Demo #1: ‘ping’ Suppose you assigned the following pair of IP- addresses to the ‘eth2’ interface on ‘anchor01’ and the ‘anchor02’ machines, respectively: anchor01$ sudo /sbin/ifconfig eth anchor02$ sudo /sbin/ifconfig eth Then try to ‘ping’ anchor02 from anchor01: anchor01$ ping

Demo #2: client-server You can try executing our ‘udpserver’ and ‘udpclient’ application-programs: –First execute ‘udpserver’ on anchor01 anchor01$ udpserver Socket has port #32774 –Then execute ‘udpclient’ on anchor02 anchor02$ udpclient

Demo #3: ‘nicwatch’ Remember, you can watch the incoming and outgoing packets on an interface by using our ‘nicwatch’ application: anchor01$ nicwatch eth2 anchor02$ nicwatch eth2