Examining network packets Information about the RTL8139 needed for understanding our ‘watch235.c’ pseudo driver.

Slides:



Advertisements
Similar presentations
Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
Advertisements

TOP Server: Understanding Modbus for Device Connectivity
ATM Asynchronous Transfer Mode. ATM Networks Use optical fibre similar to that used for FDDI networks ATM runs on network hardware called SONET ATM cells.
Using VMX within Linux We explore the feasibility of executing ROM-BIOS code within the Linux x86_64 kernel.
The ATA/IDE Interface Can we write a character-mode device driver for the hard disk?
Another device-driver? Getting ready to program the network interface.
Receiver ‘packet-splitting’
ECE 4110 – Internetwork Programming TCP/IP Protocol (cont’d)
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
1 Fall 2005 Hardware Addressing and Frame Identification Qutaibah Malluhi CSE Department Qatar University.
1 Version 3.0 Module 6 Ethernet Fundamentals. 2 Version 3.0 Why is Ethernet so Successful? In 1973, it could carry data at 3 Mbps Now, it can carry data.
The RealTek interface Introduction to the RTL-8139 network controller registers.
Timeout for some demos An instructive look at how the Linux Operating System sets up system data-structures.
RTL-8139 experimentation Setting up an environment for studying the Network Controller.
Computer Network 實踐資管 Wang-Jiunn Cheng 2004 PART IV-2 Local Area Networks (LANs) Frame.
Embedded Systems Programming Networking on the puppeteer.
The hardware ringbuffer Understanding the RTL-8139 mechanism for packet reception.
Handling a UART interrupt A look at some recent changes in the Linux kernel’s programming interface for device-interrupts.
Our ‘nic.c’ module We create a ‘character-mode’ device-driver for the 82573L NIC to use in futrure experiments.
Managing physical memory
Adjusting out device-driver Here we complete the job of modifying our ‘nicf.c’ Linux driver to support ‘raw’ packet-transfers.
Students:Gilad Goldman Lior Kamran Supervisor:Mony Orbach Mid-Semester Presentation Spring 2005 Network Sniffer.
ARP Request/Reply Can we modify our previous device-driver so it will allow us to send and receive ‘raw’ packets?
What’s needed to transmit? A look at the minimum steps required for programming our anchor nic’s to send packets.
CS335 Networking & Network Administration Tuesday, April 13, 2010.
Module 6 Chapter 5. Ethernet Ethernet is now the dominant LAN technology in the world. Ethernet is not one technology but a family of LAN technologies.
Hardware-address filtering How can we send packets to just one node on our ‘anchor’ cluster?
Building TCP/IP packets A look at the computation-steps which need to be performed for utilizing the TCP/IP protocol.
Senior Design Project 2004/2005 Web-Enabled Caller Identification 12/09/2004 Barron Shurn Daniel St. Clair Professor Soules.
Shell and Flashing Images Commands and upgrades. RS-232 Driver chip – ST3232C Driver chip is ST3232C Provides electrical interface between UART port and.
Embedded Systems Principle of Debugger. Reference Materials kl.de/avr_projects/arm_projects/#winarmhttp://
Module 10. Internet Protocol (IP) is the routed protocol of the Internet. IP addressing enables packets to be routed from source to destination using.
Internet Protocol (IP)
Ethernet, MAC podvrstva
Packet Transmission (Part III) Local Area Networks (LANs)
1-1 Embedded Network Interface (ENI) API Concepts Shared RAM vs. FIFO modes ENI API’s.
Sniffer University 4-1 Analyzing Network Issues. Sniffer University 4-2 Troubleshooting Flowchart Monitor Apps Dashboard Host Table Matrix ART History.
1-1 NET+OS Software Group Flash API Multiple flash memory bank support New Flash API introduction Detailed Flash API Function presentation Supporting.
11 NETWORK CONNECTION HARDWARE Chapter 3. Chapter 3: NETWORK CONNECTION HARDWARE2 NETWORK INTERFACE ADAPTER  Provides the link between a computer and.
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.
CCNA 3 Week 4 Switching Concepts. Copyright © 2005 University of Bolton Introduction Lan design has moved away from using shared media, hubs and repeaters.
Data Link Layer Moving Frames. Link Layer Protocols: ethernet, wireless, Token Ring and PPP Has node-to-node job of moving network layer.
NS Training Hardware.
Layer 3: Internet Protocol.  Content IP Address within the IP Header. IP Address Classes. Subnetting and Creating a Subnet. Network Layer and Path Determination.
Lecture 14 Today’s topics MARIE Architecture Registers Buses
Chapter 9 Hardware Address & Frame Type Identification Hardware address of frame Addressing schemes Ethernet Frame header format.
Chapter 9 Hardware Addressing and Frame Type Identification 1.Delivering and sending packets 2.Hardware addressing: specifying a destination 3. Broadcasting.
1 Ch 9 Hardware Addressing and Frame Type Identification.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Connecting Devices CORPORATE INSTITUTE OF SCIENCE & TECHNOLOGY, BHOPAL Department of Electronics and.
Copyright Kenneth M. Chipps Ph.D. Ethernet Frame Format Last Update
1 Microsoft Windows 2000 Network Infrastructure Administration Chapter 4 Monitoring Network Activity.
1 Hardware Addressing and Frame Type Identification.
COP 4930 Computer Network Projects Summer C 2004 Prof. Roy B. Levow Lecture 9.
Device Driver Concepts Digital UNIX Internals II Device Driver Concepts Chapter 13.
CCNA3 Module 4 Brierley Module 4. CCNA3 Module 4 Brierley Topics LAN congestion and its effect on network performance Advantages of LAN segmentation in.
Lecture Focus: Data Communications and Networking  Data Link Layer  MAC Frame Format Lecture 25 CSCS 311.
UDP : User Datagram Protocol 백 일 우
1 15-Mar-16 VLAN Trunking protocol CCNA Exploration Semester 3 Chapter 4.
+ Lecture#2: Ethernet Asma ALOsaimi. + Objectives In this chapter, you will learn to: Describe the operation of the Ethernet sublayers. Identify the major.
1 COMP 431 Internet Services & Protocols The IP Internet Protocol Jasleen Kaur April 21, 2016.
Data Communication Networks Lec 18. Wired LAN:Ethernet Datalink layer – Logical link control(LLC) – MAC Physical layer.
Internet Protocol (IP)
COMPUTER NETWORKS CS610 Lecture-10 Hammad Khalid Khan.
Processor Organization and Architecture
CS Chapter 4 Dr. Clincy Professor of CS TODAY’S AGENDA
Chaithra Ashwin Sanjana
COMP755 Advanced Operating Systems
Who’s listening? Some experiments with an ‘echo’ service on our anchor-cluster’s local network of 82573L nic’s.
Chapter 13 Wired LANs: Ethernet
Using RealTek interrupts
Presentation transcript:

Examining network packets Information about the RTL8139 needed for understanding our ‘watch235.c’ pseudo driver

Harney-235 The Kudlick Classroom’s workstations are equipped with network interface adapters designed by RealTek (model 8139) The Linux network device-driver for these NICs is configured on our workstations to use 32KB of memory as a receive buffer Each device interrupt identification number is calculated by adding 0x20 to the IRQ

RTL8139 registers The RTL8139 has a number of hardware registers which control its operations and provide information about its current state The Linux driver programs these registers Our driver will need to read three of them: –Interrupt Status register –Receive Buffer Start Address register –Current Address of Packet Read register

The Receive Buffer 32KB RAM RBSTART 32-bits 16-bits CAPR packet data packet-header packet-checksum 16-bits ISR 16-bits CBR

Rx Buffer Operation When a new packet is received, the 8139 stores it into the Receive Buffer area, at the offset specified in the CBA register (Current Buffer Address), automatically advances the CBA value to the offset of the end of the packet, and generates an interrupt (with ISR equal to 0x0001)

Interrupt Service Routine The CAPR register points to an offset that is 16-bytes ahead of the newly received packet’s packet-header The packet-header is always aligned on a 32-bit address-boundary The packet-header consists of two fields: –The packet status (16-bits) –The packet length (16-bits)

Packet Length The packet-length field contains a count of the number of bytes of packet-data, plus 4 (for the length of the packet’s checksum) The maximum length of a network packet is set by an ethernet standard: 1514 bytes (not including the 4-byte CRC checksum) The minimum length of a network packet is normally required to be 60 bytes (+CRC)

Packet Status MARMAR PAMPAM BARBAR ISEISE RUNTRUNT LONGLONG CRCCRC FAEFAE ROKROK Legend: ROK = Receive OK FAE = Frame Alignment Error CRC = Checksum Error LONG = Long Packet ( > 4K bytes) RUNT = Data + CRC < 64 bytes ISE = Invalid Symbol Error BAR = Broadcast Address Received PAM = Physical Addfess Matched MAR = Multicast Address Received

Demo: ‘trywatch.cpp’ After you download and then compile our ‘watch235.c’ driver module, you can try running this demo-program to see a dump (in hex and ascii formats) of a packet that is received in our classroom (Harney-235)

In-Class exercise Modify the ‘trywatch.cpp’ program so that it continuously ‘dumps’ received packets, until the user terminates the endless loop by typing -C. For a graceful termination, you should use a signal-handler to break out of your loop, so that you can close the pseudo-file and remove the ‘watch235’ driver module