GB ethernet UDP interface in FPGA



Similar documents
Exam 1 Review Questions

CMA5000 SPECIFICATIONS Gigabit Ethernet Module

10/100/1000 Ethernet MAC with Protocol Acceleration MAC-NET Core

The new frontier of the DATA acquisition using 1 and 10 Gb/s Ethernet links. Filippo Costa on behalf of the ALICE DAQ group

Getting the most TCP/IP from your Embedded Processor

Network layer: Overview. Network layer functions IP Routing and forwarding

Application Note. Introduction AN2471/D 3/2003. PC Master Software Communication Protocol Specification

Internet Architecture and Philosophy

Gigabit Ethernet MAC. (1000 Mbps Ethernet MAC core with FIFO interface) PRODUCT BRIEF

10/100 Mbps Ethernet MAC

10/100/1000Mbps Ethernet MAC with Protocol Acceleration MAC-NET Core with Avalon Interface

C-GEP 100 Monitoring application user manual

Guide to TCP/IP, Third Edition. Chapter 3: Data Link and Network Layer TCP/IP Protocols

Ethernet. Ethernet. Network Devices

Keywords: VoIP calls, packet extraction, packet analysis

Internet Protocol Version 6 (IPv6)

Network Security TCP/IP Refresher

Supporting ZDOs with the XBee API

Introduction to Analyzer and the ARP protocol

Mobile IP Network Layer Lesson 02 TCP/IP Suite and IP Protocol

Objectives of Lecture. Network Architecture. Protocols. Contents

Network Security on safety-critical systems: a case study. Fully arbitrary packet injection: maximizing the Ethernet attack surface

Internet Protocols Fall Lectures 7-8 Andreas Terzis

Subnetting,Supernetting, VLSM & CIDR

Firewall Implementation

Network Layer IPv4. Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS. School of Computing, UNF

The internetworking solution of the Internet. Single networks. The Internet approach to internetworking. Protocol stacks in the Internet

AFDX networks. Computers and Real-Time Group, University of Cantabria

Network layer" 1DT066! Distributed Information Systems!! Chapter 4" Network Layer!! goals: "

Internet Protocol: IP packet headers. vendredi 18 octobre 13

CS 457 Lecture 19 Global Internet - BGP. Fall 2011

IP - The Internet Protocol

TCP Performance Management for Dummies

Internet Packets. Forwarding Datagrams

How do I get to

Transport Layer Protocols

ACHILLES CERTIFICATION. SIS Module SLS 1508

AN 588: 10-Gbps Ethernet Hardware Demonstration Reference Designs

IP Network Layer. Datagram ID FLAG Fragment Offset. IP Datagrams. IP Addresses. IP Addresses. CSCE 515: Computer Network Programming TCP/IP

Introduction to Ethernet and IP in automotive vehicles

Network Layer: Network Layer and IP Protocol

VLAN for DekTec Network Adapters

Introduction to IP v6

Voice Over IP Per Call Bandwidth Consumption

Mobile Routing. When a host moves, its point of attachment in the network changes. This is called a handoff.

Chapter 4 Network Layer

Data Link Protocols. 5.4 Framing

Supporting VoIP in IEEE Distributed WLANs

A low-cost, connection aware, load-balancing solution for distributing Gigabit Ethernet traffic between two intrusion detection systems

Datacommunication. Internet Infrastructure IPv4 & IPv6

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

No. Time Source Destination Protocol Info DNS Standard query A weather.noaa.gov

NetFlow/IPFIX Various Thoughts

AGIPD Interface Electronic Prototyping

IP address format: Dotted decimal notation:

Network Layer: and Multicasting Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Firewalls. Firewalls. Idea: separate local network from the Internet 2/24/15. Intranet DMZ. Trusted hosts and networks. Firewall.

PMC-XM-DIFF & EADIN/MODBUS Virtex Design

WIZnet S2E (Serial-to-Ethernet) Device s Configuration Tool Programming Guide

8-ch RAID0 Design by using SATA Host IP Manual Rev1.0 9-Jun-15

Lecture 8. IP Fundamentals

AXI Performance Monitor v5.0

RFID MODULE Mifare Reader / Writer SL025B User Manual Version 1.4 Nov 2012 StrongLink

Quick Note 15. Quality of Service (QoS) on a TransPort router

BRMO 80 / ETH-IP. User Manual. Réf : MU-BRMO 80-ETH-IP-1.4-EN

Network Programming TDC 561

Chapter 9. IP Secure

ROM Monitor. Entering the ROM Monitor APPENDIX

Dynamic Routing Protocols II OSPF. Distance Vector vs. Link State Routing

How will the Migration from IPv4 to IPv6 Impact Voice and Visual Communication?

IP addressing and forwarding Network layer

CCNA R&S: Introduction to Networks. Chapter 5: Ethernet

Qcast : IP Multicast Traffic Monitoring System with IPFIX/PSAMP

Introduction to TCP/IP

AFDX / ARINC 664. Tutorial

8B/10B Coding 64B/66B Coding

Chapter 3. TCP/IP Networks. 3.1 Internet Protocol version 4 (IPv4)

Using FPGAs to Design Gigabit Serial Backplanes. April 17, 2002

CS 43: Computer Networks IP. Kevin Webb Swarthmore College November 5, 2013

Network Configuration Example

The Looming Ethernet MAC Address Crisis

Computer Networks UDP and TCP

Lecture Computer Networks

EE984 Laboratory Experiment 2: Protocol Analysis

Networking Tools. Windows. Gilbert Held. Troubleshooting, and Security. The Complete Guide to Management, CRC Press INFORMATIONSBIBLIOTHEK

Lecture 2-ter. 2. A communication example Managing a HTTP v1.0 connection. G.Bianchi, G.Neglia, V.Mancuso

8.2 The Internet Protocol

What is a DoS attack?

Wireshark in a Multi-Core Environment Using Hardware Acceleration Presenter: Pete Sanders, Napatech Inc. Sharkfest 2009 Stanford University

CSE 127: Computer Security. Network Security. Kirill Levchenko

Asynchronous Transfer Mode: ATM. ATM architecture. ATM: network or link layer? ATM Adaptation Layer (AAL)

Solution of Exercise Sheet 5

ISTANBUL. 1.1 MPLS overview. Alcatel Certified Business Network Specialist Part 2

Appendix C: Keyboard Scan Codes

Outline. CSc 466/566. Computer Security. 18 : Network Security Introduction. Network Topology. Network Topology. Christian Collberg

Networking Test 4 Study Guide

MBP_MSTR: Modbus Plus Master 12

PE210G6SPi9 Six Port Fiber 10 Gigabit Ethernet PCI Express Server Adapter Intel based. Description. Key Features

Field Software Updates Using TPMS LF An example using the Low Frequency radio (LFR) for wireless software updating

Transcription:

GB ethernet UDP interface in FPGA NIKHEF, PeterJ 05 August 2013 1

LED0 RxFifos 0 1 n Rx Stream Select Rx_buf2data pkt_buffers Rx Packet Buffer 64 KB Flags Rx_mac2buf Overview Good/Bad Frame Rx FPGA ML605 Xilinx Evaluation Board LED4 N W C E CPU TxFifos 0 1 n Tx Stream Select Tx_data2buf Pause Request Tx Packet Buffer 32 KB Flags Tx_pkt2mac Valid Ack Tx PHY (GTX) 1000 BASE X SGMII SFP Marvell PHY 1000 BASE X 1000 BASE T CPU CPU Addr Req/Gnt MDIO Host S Reset Constant NUM_UDP_PRTS: natural := 4; Init State Machine Yes (Marvell) / No (Simulation) Auto Negotiation 2

Host Layers Media Layers OSI Model Unit Layer Standard 7. Application 6. Presentation 5. Session Segment 4. Transport RFC 768 UDP Packet 3. Network RFC 791 IPv4 Frame 2. Link IEEE 802.3 Bit 1. Physical PHY PTP over IEEE 802.3 Ethernet uses Ethertype 0x88F7 PTP over IEEE 802.3 Ethernet uses Ethertype 0x88F7 4. Transport 3. Network 2. Link Src Port 20 00 Ver Len* TOS 45 00 UDP Header Dest Length Port 10 00 ## ## UDP Length (Hdr+) ## ## Frag. ID 00 00 *) IPv4, Length 5 words (=20 bytes) Header Checksum ## ## Flags Frag. Off 0 000 IPv4 ## ## TTL Prot 80 11 IP Header Hdr Checksum IP number Source IP number Destination ## ## C0 A8 01 03 C0 A8 01 02 ## ## Preamble SFD DstAdr SrcAdr LenTyp /PAD FCS* 55 55 55 55 55 D5 AA BB CC DD EE FF 00 1B 21 B0 AA 75 08 00 ## ## ## ## ## ## *) 32 bit CRC 1. Physical /I/ /S/ K28.5 (BC) D16.2 (50) K27.7 (FB) 110000010101101101010010010111 /T/ /R/* /R/* /I/ K29.7 (FD) K23.7 (F7) K23.7 (F7) K28.5(BC) D16.2(FB) 10111010001110101000111010100000111110101001000101 *) 1 or 2 /R/ => Next K28.5 should be 16 bits aligned 3

LED0 RxFifos 0 1 n Rx Stream Select Rx_buf2data pkt_buffers Rx Packet Buffer 64 KB Flags Rx_mac2buf Overview Good/Bad Frame Rx FPGA ML605 Xilinx Evaluation Board LED4 N W C E CPU TxFifos 0 1 n Tx Stream Select Tx_data2buf Pause Request Tx Packet Buffer 32 KB Flags Tx_pkt2mac Valid Ack Tx PHY (GTX) 1000 BASE X SGMII SFP Marvell PHY 1000 BASE X 1000 BASE T CPU CPU Addr Req/Gnt MDIO Host S Reset Init State Machine 4. Transport 3. Network 2. Link 1. Physical 4

tx_data2buf (input from FIFO) 1. Initialize fixed header values If no CPU Access Request AND there is input data Then 2. Read input FIFO > Start Write from PAYLOAD (offset + 0x15) Calculate UDP checksum (Pseudo Header) 3. Packet End := Last written offset 4. Write UDP header (offset + 0x11) Source/Dest port pointed by stream Length(bytes) = 8 (UDP Header) + number of data words(16) * 2 Calculated UDP Checksum 5. Write IP header (offset + 0x07) Length(bytes) = 20 (IP Header) + number of data words(16) * 2 Calculate IP Checksum Fragment ID, Fragment Offset, More Fragments 6. Write header (offset + 0x00) Type = EtherType x0800 7. Next Packet Pointer := Packet End + 1 Offset (@ 16 bits) Dec Hex PKT_STR _HDR 0 0x0 Destination Address (47:40) Destination Address (39:32) 1 0x1 Destination Address (31:24) Destination Address (23:16) 2 0x2 Destination Address (15:8) Destination Address (7:0) 3 0x3 Source Address (47:40) Source Address (39:32) 4 0x4 Source Address (31:24) IP_HDR 7 0x7 Header IP Header UDP Hdr (Layer 2) Source Address (23:16) 5 0x5 Source Address (15:8) Source Address (7:0) 6 0x6 Length / Type (15:8) Length / Type (7:0) Version Header Length Type Of Service (TOS) 8 0x8 Length (7:0) Length (15:8) 9 0x9 ID(7:0) ID(15:8) 10 0xA Flags FragmentOffset (11:8) FragmentOffset (7:0) 11 0xB Time To Live (TTL) Protocol 12 0xC Header CheckSum (7:0) Header CheckSum (15:8) 13 0xD IP Source (7:0) IP Source (15:8) 14 0xE IP Source (23:16) IP Source (31:24) 15 0xF IP Destination (7:0) IP Destination (15:8) 16 0x10 IP Destination (23:16) IP Destination (31:24) IP Header UDP_HDR 17 0x11 Port Source (7:0) Port Source (15:8) 18 0x12 Port Destination (7:0) Port Destination (15:8) 19 0x13 UDP Length (7:0) UDP Length (15:8) 20 0x14 CheckSum (7:0) CheckSum (15:8) PAYLOAD 21 0x15 CC 33 22 0x16 0 0 23 0x17 11 11 24 0x18 22 22 PKT_END 25 0x19 EE 11 UDP Header (RFC 768) 5

tx_data2buf (input from CPU) 1. Initialize fixed header values If there is a CPU Access Request Then 2. Start Write (offset + CPU_Addr) Until CPU releases Access Request Note: The last word of the packet must be accompanied with an End Of Packet (EOP ; Packet End := CPU_Addr) (note, since the CPU has random access to the packet buffer this doesn t necessarily mean that the last word of the packet is actually written last to the packet buffer). The CPU is responsible for generating the proper packet data format (i.e., IP etc. headers, checksums and data). 3. Next Packet Pointer := Packet End + 1 Offset (@ 16 bits) Dec Hex PKT_STR _HDR 0 0x0 Destination Address (47:40) Destination Address (39:32) 1 0x1 Destination Address (31:24) Destination Address (23:16) 2 0x2 Destination Address (15:8) Destination Address (7:0) 3 0x3 Source Address (47:40) Source Address (39:32) 4 0x4 Source Address (31:24) Source Address (23:16) 5 0x5 Source Address (15:8) Source Address (7:0) 6 0x6 Length / Type (15:8) Length / Type (7:0) IP_HDR 7 0x7 Version Header Length Type Of Service (TOS) 8 0x8 Length (7:0) Length (15:8) 9 0x9 ID(7:0) ID(15:8) (Layer 2) 10 0xA Flags FragmentOffset (11:8) 11 0xB FragmentOffset (7:0) Time To Live (TTL) Protocol 12 0xC Header CheckSum (7:0) Header CheckSum (15:8) 13 0xD IP Source (7:0) IP Source (15:8) 14 0xE IP Source (23:16) IP Source (31:24) 15 0xF IP Destination (7:0) IP Destination (15:8) 16 0x10 IP Destination (23:16) IP Destination (31:24) IP Header UDP_HDR 17 0x11 Port Source (7:0) Port Source (15:8) 18 0x12 Port Destination (7:0) Port Destination (15:8) 19 0x13 UDP Length (7:0) UDP Length (15:8) 20 0x14 CheckSum (7:0) CheckSum (15:8) PAYLOAD 21 0x15 CC 33 22 0x16 0 0 23 0x17 11 11 24 0x18 22 22 PKT_END 25 0x19 EE 11 UDP Header (RFC 768) 6

Tx buffer memory flags Address (@ 16 bits) Words Dec Hex 0 0x0 14 Oct 7 Frame 1 9014 Oct 4507 Words 6 0x6 7 0x7 IP/UDP HDR 20+8 Oct 14 9000 oct 4500 Words 20 0x14 21 0x15 Payload 8972 Oct 4486 4506 0x119A 4507 0x119B 14 Oct 7 Frame 2 9014 Oct 4507 Words 4513 0x11A1 4514 0x11A2 IP/UDP HDR 20+8 Oct 14 9000 oct 4500 Words 4527 0x11AF 4528 0x11B0 Payload 8972 Oct 4486 9013 0x2335 9014 0x2336 14 Oct 7 Frame 3 9014 Oct 4507 Words 9020 0x233C 9021 0x233D IP/UDP HDR 20+8 Oct 14 9000 oct 4500 Words 9034 0x234A 9035 0x234B Payload 8972 Oct 4486 13520 0x34D0 13521 0x34D1 14 Oct 7 Frame 4 9014 Oct 4507 Words 13527 0x34D7 13528 0x34D8 IP/UDP HDR 20+8 Oct 14 9000 oct 4500 Words Tx Buffer of 32 KB can hold 3 complete Jumbo Frames (9000 bytes + _Hdr{6 + 6 + 2} = 9014 bytes) Jumbo Number of Bytes % of ADRSIZE 14 (32678 Bytes) % of ADRSIZE 15 (65536 Bytes) 1 9014 27,51% 13,75% 2 18028 55,02% 27,51% 3 27042 82,53% 41,26% 4 36056 110,03% 55,02% 5 45070 68,77% 6 54084 82,53% 7 63098 96,28% 8 72112 110,03% 9 81126 Signal Full, as soon as there is no room left for a complete (Jumbo) packet 13541 0x34E5 13542 0x34E6 Payload 8972 Oct 4486 18027 0x466B 18028 0x466C Example: 32KB 7 Full

rx_mac2buf 1. When Rx buffer is not Full then there is at least space for one Jumbo Frame (If Rx buffer is Full but starts writing data then signal this with Overflow ) 2. Assemble 8 bit output bytes into 16 bit words and store them 3. As soon as the signals Good Frame then increment the Packet Pointer Bad Frame then leave the Packet Pointer thus overwriting the bad frame with the next frame 8

Rx buffer memory flags Rx Buffer of 64 KB can hold 7 complete Jumbo Frames (9000 bytes + _Hdr{6 + 6 + 2} = 9014 bytes) Jumbo Number of Bytes % of ADRSIZE 14 (32678 Bytes) % of ADRSIZE 15 (65536 Bytes) 1 9014 27,51% 13,75% 2 18028 55,02% 27,51% 3 27042 82,53% 41,26% 4 36056 110,03% 55,02% 5 45070 68,77% 6 54084 82,53% 7 63098 96,28% 8 72112 110,03% 9 81126 Low Water Mark (@ 30 %) High Water Mark (@ 50 %) When High Water Mark is reached (i.e. buffer fills up after reception of 4 Jumbo Frames; Note that the Packet Pointer is only updated after the complete reception of the Packet), then a Pause Request (0xFFFF) is issued. When Low Water Mark is reached (i.e. buffer empties and there is still 1 Jumbo Frame available), then a Pause Request (0x0000) is issued which means Cancel the Pause Request 9

Pause Request Defined in See IEEE802.3 2005 Annex 31B Operates on the Control level: Uses globally assigned 48 bit multicast address 01 80 C2 00 00 01 One bit time = 0,8 ns @ 1Gb ethernet One Pause Quanta = 512 bit times (= 512 * 0,8 ns = 409,6 ns) 0xFFFF Pause Quanta s = 26,8 ms. 10

Pause Request test Hold Rx buffer readout while sending Jumbo Frames from PC to ML605 Evaluation kit Implemented a EmptyRxBuffer push button./ipsar udp_tx_jumbo recv.bin (Command sends 4 Jumbo frames) ML605 responds with Pause Request 65535 Push EmptyRxBuffer button (SW_North) ML605 sends Pause Request 0 Send 4 Jumbo frames ML605 responds with Pause Request 65535 Receive 14 jumbo frames from M605 (pushed button (SW_Centre) 11

rx_data2buf 1. If Rx buffer is not Empty then Offset (@ 16 bits) Dec Hex PKT_STR _HDR 0 0x0 2. Assumption is made that an IPv4 / UDP header is received 3. Check: EtherType = IPv4 (=0x0800)? IP header checksum? IP Version = 4 and IP Header Length = 5? Protocol = UDP (0x11)? 4. Check if the UDP destination port corresponds to one of the predefined (originating from either constants or registers) output streams 5. Fragment ID, Fragment Offset and More Fragments flag are updated. 6. Only the data is routed to the corresponding output Stream FIFO 7. After routing, UDP checksum error is asserted when applicable. All packets that fail the above checks are routed integral (i.e., IP, UDP header and ) to the CPU Stream FIFO IP_HDR 7 0x7 UDP_HDR 17 0x11 PAYLOAD 21 0x15 Destination Address (47:40) Destination Address (39:32) 1 0x1 Destination Address (31:24) Destination Address (23:16) 2 0x2 Destination Address (15:8) Destination Address (7:0) 3 0x3 Source Address (47:40) Source Address (39:32) 4 0x4 Source Address (31:24) Source Address (23:16) 5 0x5 Source Address (15:8) Source Address (7:0) 6 0x6 Length / Type (15:8) Length / Type (7:0) Version Header Length Type Of Service (TOS) 8 0x8 Length (7:0) Length (15:8) 9 0x9 ID(7:0) ID(15:8) 10 0xA Flags FragmentOffset (11:8) FragmentOffset (7:0) 11 0xB Time To Live (TTL) Protocol 12 0xC Header CheckSum (7:0) Header CheckSum (15:8) 13 0xD IP Source (7:0) IP Source (15:8) 14 0xE IP Source (23:16) IP Source (31:24) 15 0xF IP Destination (7:0) IP Destination (15:8) 16 0x10 IP Destination (23:16) IP Destination (31:24) (Layer 2) IP Header Port Source (7:0) Port Source (15:8) 18 0x12 Port Destination (7:0) Port Destination (15:8) 19 0x13 UDP Length (7:0) UDP Length (15:8) 20 0x14 CheckSum (7:0) CheckSum (15:8) CC 33 22 0x16 0 0 23 0x17 11 UDP Header (RFC 768) 11 24 0x18 22 22 PKT_END 25 0x19 EE 11 12

Checksum calculation IP and UDP Checksums Checksum is a sum, not a CRC! Add all and finally add the overflow (i.e. bits 31:16) to the lower 16 bits (15:0) Again this may lead to an overflow in bit 16 (thanks to Frans Schreuder for debugging). For example 0xffff + 0xffff = 0x1fffe. This overflow bit 16 also needs to be added to (15 downto 0). Take the ones complement of the lower 16 bits => this is the checksum IP Checksum Mandatory Calculated over the IP header (Not including IP header checksum field which is added as 0x0000) UDP Checksum Optional Calculated using a UDP Pseudo Header that contains: IP Source address IP Destination address x"00" & Protocol UDP Length Further calculation includes UDP Header: UDP Source Port UDP Destination Port UDP Length (Note that UDP Length is present twice (in the Pseudo header and in the UDP header) UDP Checksum is the sum over the Pseudo Header, UDP header and all data words. NIKHEF, PeterJ 05 August 2013 13

Resources Entity pkt_buffers implementing 4 Tx/Rx Streams: Dffs or Latches 644 Block RAMs 32 KB + 64 KB, Packet buffers = 24 * RAMB36E1 5 Rx FIFOs, 4 Tx FIFOs = 9 * RAMB18E1 Virtex 6 xc6vlx240t => 5% RAM, < 1% Slices 14

15

Frame and Packet Defenitions IEEE802.3 2008 Clause 30 (see also 46.2.5) /I/ /S/ Preamble SFD DstAdr FCS /T/ /R/* /R/* /I/ K28.5 (BC) D16.2 (50) K27.7 (FB) 55 55 55 55 55 D5 AA ## K29.7 (FD) K23.7 (F7) K23.7 (F7) K28.5(BC) D16.2(FB) 110000010101101101010010010111 10111010001110101000111010100000111110101001000101 Frame Packet NIKHEF, PeterJ 17 January 2012 16

Frame and Packet Defenitions Unit Layer Standard Host Layers Media Layers 7. Application 6. Presentation 5. Session Segment 4. Transport RFC 768 UDP Packet 3. Network RFC 791 IPv4 Frame 2. Link IEEE 802.3 Bit 1. Physical PHY 4. Transport Src Port C0 A8 UDP Header Dest Length Port C0 A8 ## ## Header Checksum ## ## ## ## 3. Network Ver Len TOS 45 00 Length (Hdr+) Frag. ID ## ## 00 00 Flags Frag. Off 0 000 TTL IP Header Hdr Checksum Prot 80 11 IP number Source IP number Destination ## ## C0 A8 01 03 C0 A8 01 02 ## ## 2. Link 1. Physical NIKHEF, PeterJ Preamble SFD DstAdr SrcAdr LenTyp /PAD FCS 55 55 55 55 55 D5 AA BB CC DD EE FF 00 1B 21 B0 AA 75 08 00 ## ## ## ## ## ## /I/ /S/ /T/ /R/* /R/ /I/ K28.5 (BC) D16.2 (50) K27.7 (FB) K29.7 (FD) K23.7 (F7) K23.7 (F7) K28.5(BC) D16.2(FB) 110000010101101101010010010111 10111010001110101000111010100000111110101001000101 17 January 2012 Frame 17