Adjusting out device-driver Here we complete the job of modifying our ‘nicf.c’ Linux driver to support ‘raw’ packet-transfers.

Slides:



Advertisements
Similar presentations
1 ICS 156: Lecture 2 (part 2) Data link layer protocols Address resolution protocol Notes on lab 2.
Advertisements

Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
1 Address Resolution Protocol (ARP) Relates to Lab 2. This module is about the address resolution protocol.
1 Address Resolution Protocol (ARP) Relates to Lab 2. This module is about the address resolution protocol.
Internet Control Protocols Savera Tanwir. Internet Control Protocols ICMP ARP RARP DHCP.
 As defined in RFC 826 ARP consists of the following messages ■ ARP Request ■ ARP Reply.
Review of Important Networking Concepts
Oct 21, 2004CS573: Network Protocols and Standards1 IP: Addressing, ARP, Routing Network Protocols and Standards Autumn
CSCI 4550/8556 Computer Networks Comer, Chapter 19: Binding Protocol Addresses (ARP)
CS335 Networking & Network Administration Tuesday, May 11, 2010.
Our ‘nic.c’ module We create a ‘character-mode’ device-driver for the 82573L NIC to use in futrure experiments.
ITIS 6167/8167: Network and Information Security Weichao Wang.
ARP Request/Reply Can we modify our previous device-driver so it will allow us to send and receive ‘raw’ packets?
Common network diagnostic and configuration utilities A ‘toolkit’ for network users and managers when ‘troubleshooting’ is needed on your network.
Chapter 19 Binding Protocol Addresses (ARP) Chapter 20 IP Datagrams and Datagram Forwarding.
Hardware-address filtering How can we send packets to just one node on our ‘anchor’ cluster?
Address Resolution Protocol (ARP). Mapping IP Address to Data-Link Address  How does a machine map an IP address to its Data- Link layer (hardware or.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Ethernet, ARP.
Chapter Overview TCP/IP Protocols IP Addressing.
Lecture 8 Modeling & Simulation of Communication Networks.
Protocol Headers Pre DA SA 0800h … version H L 6 TCP Header Data FCS
Mapping Internet Addresses to Physical Addresses (ARP)
Managing Network connections. Network Cabling Ethernet Topology Bus topology – Connects each node in a line – Has no central connection point Star topology.
CEN Network Fundamentals Chapter 19 Binding Protocol Addresses (ARP) To insert your company logo on this slide From the Insert Menu Select “Picture”
1 IP Forwarding Relates to Lab 3. Covers the principles of end-to-end datagram delivery in IP networks.
IP Forwarding.
CMPT 471 Networking II Address Resolution IPv4 ARP RARP 1© Janice Regan, 2012.
Hyung-Min Lee ©Networking Lab., 2001 Chapter 8 ARP and RARP.
Chapter 19 - Binding Protocol Addresses
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
1 CS 4396 Computer Networks Lab TCP/IP Networking An Example.
Internet Protocols. Address Resolution IP Addresses are not recognized by hardware. If we know the IP address of a host, how do we find out the hardware.
1 Network Administration Module 3 ARP/RARP. 2 Address Resolution The problem Physical networks use physical addresses, not IP addresses Need the physical.
Birgit Bonham: Prospect High School ARP….or What’s your MAC address?
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
Media Access Control (MAC) addresses in the network access layer ▫ Associated w/ network interface card (NIC) ▫ 48 bits or 64 bits IP addresses for the.
1 Chapter 8 – TCP/IP Fundamentals TCP/IP Protocols IP Addressing.
BAI513 - PROTOCOLS ARP BAIST – Network Management.
Lecture 4 Overview. Ethernet Data Link Layer protocol Ethernet (IEEE 802.3) is widely used Supported by a variety of physical layer implementations Multi-access.
1 Kyung Hee University Chapter 8 ARP(Address Resolution Protocol)
EC week Review. Rules of Engagement Teams selected by instructor Host will read the entire questions. Only after, a team may “buzz” by raise of.
Linux Operations and Administration Chapter Eight Network Communications.
Mapping IP Addresses to Hardware Addresses Chapter 5.
Address Resolution Protocol (ARP). Internet and Data Link Layer Addresses Each host and router on a subnet needs a data link layer address to specify.
© Jörg Liebeherr (modified by M. Veeraraghavan) 1 Point-to-Point Protocol Data Link Layer Loopback ARP and RARP.
Final Examination of Internet Communication Protocol.
1 4 ARP : Address Resolution Protocol. 2 4 Introduction - Problem Successful Mapping of an IP Address to a Hardware Address Ethernet uses MAC-address.
ADDRESS MAPPING ADDRESS MAPPING The delivery of a packet to a host or a router requires two levels of addressing: logical and physical. We need to be able.
Chapter 4: server services. The Complete Guide to Linux System Administration2 Objectives Configure network interfaces using command- line and graphical.
Packet Switch Network Server client IP Ether IPTCPData.
IP - Internet Protocol No. 1  Seattle Pacific University IP: The Internet Protocol Kevin Bolding Electrical Engineering Seattle Pacific University.
RARP : Reverse Address Resolution Protocol
1 Address Resolution Protocol (ARP). 2 Overview 3 Need for Address Translation Note: –The Internet is based on IP addresses –Local area networks use.
Chapter 9 Introduction To Data-Link Layer 9.# 1
Behrouz A. Forouzan TCP/IP Protocol Suite, 3rd Ed.
IP: Addressing, ARP, Routing
Chapter 21 Address Mapping
Address Resolution Protocol (ARP)
Chapter 8 ARP(Address Resolution Protocol)
Objective: ARP.
ARP and RARP Objectives Chapter 7 Upon completion you will be able to:
Address Resolution Protocol (ARP)
Computer Networks 9/17/2018 Computer Networks.
Net 323: NETWORK Protocols
Address Resolution Protocol (ARP)
Chapter 7 ARP and RARP Prof. Choong Seon HONG.
Address Resolution Protocol (ARP)
CS4470 Computer Networking Protocols
Ch 17 - Binding Protocol Addresses
Transport Layer 9/22/2019.
Presentation transcript:

Adjusting out device-driver Here we complete the job of modifying our ‘nicf.c’ Linux driver to support ‘raw’ packet-transfers

Our experiment We set for ourselves the goal of crafting a character-mode Linux device-driver which would allow an unprivileged application to transmit and receive ‘raw’ Ethernet frames For fast development, we proposed to just modify our earlier ‘nicf.c’ device-driver, but abandon its attempt to simulate a ‘stream’ and just support simple datagrams instead

Driver’s ‘write()’ method

Driver’s ‘read()’ method

Specific example We had proposed writing an application (named ‘arpdemo.cpp’) which would send an ARP REQUEST, then try to receive an ARP REPLY We had left it as an exercise for students to implement the necessary modifications in our ‘nicf.c’ device-driver, renaming the resulting device-driver ‘nicraw.c’

ARP packet (Type 0x0806) Ethernet Header ARP Protocol Header Data (optional) 14 bytes 28 bytes

Ethernet Header

Host’s hardware-address If an application is going to send a ‘raw’ Ethernet packet, it will need to supply a source Hardware MAC-Address, which normally an application would not know We can implement an ‘ioctl()’ service in our device-driver which will deliver that piece of information to our application

Driver’s ‘fops’

Driver’s ‘ioctl()’ method

ARP packet-header Hardware TypeProtocol Type Hardware Length Operation (1=request, 2=reply) Sender Hardware Address (upper 4 octets) Sender Protocol Address (LSW) Sender Hardware Address (lower 2 octets) Sender Protocol Address (MSW) Target Hardware Address (lower 4 octets) Protocol Length Target Hardware Address (upper 2 octets) 32 bits For Ethernet: Hardware Type = 0x0001, Hardware Length = 0x06 For Internet: Protocol Type = 0x0800, Protocol Length = 0x04 Target Protocol Address

ARP Header

Host’s IP-address If an application is going to send an ARP Request packet, it will need the sender’s IP-address (as well as its MAC-address) But that piece of information can be found using existing functions which are part of the standard C runtime libraries, so it’s not necessary for our device-driver to deliver (or even to know) its host’s IP-address

Target’s IP-address The IP-address for the target machine to which an ARP Request will be sent would need to be included in the ‘raw’ packet’s fields, but for this item of information we can let our application look for it among command-line arguments, delegating to our human user the job of providing it: $./arpdemo

Testing our results You will need two stations for this testing, both on the same local network segment (i.e., either two classroom stations, or else two anchor-cluster stations) One station will use our ‘nicraw.c’ driver and will execute our ‘arpdemo’ program The other station, using Intel’s driver and normal TCP/IP protocol stack, will reply

ARP protocol $./arpdemo $ Using Intel’s ‘e1000e.c’ driver no IP-address Using our ‘nicraw.c’ driver ARP REQUEST ARP REPLY Our application will ‘write()’ a raw Ethernet packet to the ‘/dev/nic’ device-file, which the Linux kernel will relay to our ‘nicraw.c’ device-driver’s ‘write’ method for the 82573L network interface controller to transmit as a ‘broadcast’ message; this message will be received by the ‘eth1’ interface and relayed to the kernel’s network subsystem on the target machine, which will respond by sending back an ARP Reply which our device driver’s ‘read’ method will receive and deliver to our application’s buffer when it tries to ‘read()’ from the ‘dev/nic’ device-file.

In-class exercise Download the ‘nicraw.c’ driver-module and the ‘arpdemo.cpp’ application and compile them in your local directory Then try performing the proposed test on a pair or classroom or anchor machines: –Install ‘nicraw.ko’ on the machine where you will be running our ‘arpdemo’ application –Use ‘ifconfig’ to assign an IP-address to the other machine’s ‘eth1’ interface