Click Router: Hands on Alex Newman Arvind Venkatesan Shivkumar Kalyanaraman.

Slides:



Advertisements
Similar presentations
Linux device-driver issues
Advertisements

Click Router: Hands on Arvind Venkatesan. Acknowledgements Thanks Hema for beautifying the slides!
Static Routing Exercise. What will the exercise involve?  Unix network interface configuration  Cisco network interface configuration  Static routes.
Operating-System Structures
Mobile Agents in Click Tushar Mohan. Click Elements Graphs made of simple elements Separate flows have separate ports Common case fast Reduce function.
1 Linux Networking and Security Chapter 2. 2 Configuring Basic Networking Describe how networking devices differ from other Linux devices Configure Linux.
Traffic Management - OpenFlow Switch on the NetFPGA platform Chun-Jen Chung( ) SriramGopinath( )
Traffic Management - OpenFlow Switch on the NetFPGA platform Chun-Jen Chung( ) Sriram Gopinath( )
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 Understanding Linux Kernel to Build Software Routers (Qualitative Discussion) Shiv Kalyanaraman,
Introduction to Management Information Systems Chapter 5 Data Communications and Internet Technology HTM 304 Fall 07.
(NHA) The Laboratory of Computer Communication and Networking Network Host Analyzer.
Common network diagnostic and configuration utilities A ‘toolkit’ for network users and managers when ‘troubleshooting’ is needed on your network.
TCP/IP Protocol Suite 1 Chapter 6 Upon completion you will be able to: Delivery, Forwarding, and Routing of IP Packets Understand the different types of.
C++ fundamentals.
(part 3).  Switches, also known as switching hubs, have become an increasingly important part of our networking today, because when working with hubs,
Understanding Networks Charles Zangla. Network Models Before I can explain how connections are made from across the country, I would like to provide you.
Networking Components Chad Benedict – LTEC
Describe the elements of a VoIP Dial Plan Design.
FIREWALL TECHNOLOGIES Tahani al jehani. Firewall benefits  A firewall functions as a choke point – all traffic in and out must pass through this single.
Emanuele Pasqualucci Extending AppManager Monitoring with the SNMP Toolkit.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Chapter 12: Configuring Networks The Complete Guide to Linux System Administration.
TCP/IP Protocol Suite 1 Chapter 6 Upon completion you will be able to: Delivery, Forwarding, and Routing of IP Packets Understand the different types of.
Jennifer Rexford Princeton University MW 11:00am-12:20pm Programmable Data Planes COS 597E: Software Defined Networking.
Operating System Program 5 I/O System DMA Device Driver.
Q and A for Ch. 17 CS 332, Spring Fiber Modems Q: Why use fiber modem extensions? Is it to save money on not having to use as much fiber (otherwise.
1 Version 3.1 Module 4 Learning About Other Devices.
Unit 4, Lesson 11 How Data Travels the Internet
Wave Relay System and General Project Details. Wave Relay System Provides seamless multi-hop connectivity Operates at layer 2 of networking stack Seamless.
Lecturer: Ghadah Aldehim
TCP/IP Guide. OSI Reference Model Real-World Analogy Phase OSI Layer CEO LetterWeb Site Connection (Simplified) Transmission 7 The CEO of a company in.
PA3: Router Junxian (Jim) Huang EECS 489 W11 /
LWIP TCP/IP Stack 김백규.
Traffic Management - OpenFlow Switch on the NetFPGA platform Chun-Jen Chung( ) Sriram Gopinath( )
IP Forwarding.
Copyright © Lopamudra Roychoudhuri
CMPT 471 Networking II Address Resolution IPv4 ARP RARP 1© Janice Regan, 2012.
Cisco S2 C4 Router Components. Configure a Router You can configure a router from –from the console terminal (a computer connected to the router –through.
Click Router: Hands on Arvind Venkatesan Shivkumar Kalyanaraman.
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
2010 paro, bhutan IP Basics IP/ISP Services Workshop July, 2010 Paro, Bhutan.
Static Routing Exercise
The Design and Implementation of Firewall, NAT, Traffic Shaper on FreeBSD.
CE Operating Systems Lecture 13 Linux/Unix interprocess communication.
DoS Suite and Raw Socket Programming Group 16 Thomas Losier Paul Obame Group 16 Thomas Losier Paul Obame.
1 UNIT 13 The World Wide Web Lecturer: Kholood Baselm.
Networking Material taken mainly from HowStuffWorks.com.
Lab 12 Department of Computer Science and Information Engineering National Taiwan University Lab12 – Driver 2014/12/16 1 /21.
Linux Operations and Administration
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
Networking Components Assignment 3 Corbin Watkins.
January 9, 2001 Router Plugins (Crossbow) 1 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercises.
4000 Imaje 4020 – Software Imaje 4020 – Content ■ Content of Chapter Software: 1. Flash Up 2. Netcenter 3. FTP 4. Active X 5. XCL commands 6. Exercise.
Chapter 4: server services. The Complete Guide to Linux System Administration2 Objectives Configure network interfaces using command- line and graphical.
CHAPTER 3 Router CLI Command Line Interface. Router User Interface User and privileged modes User mode --Typical tasks include those that check the router.
1 UNIT 13 The World Wide Web. Introduction 2 Agenda The World Wide Web Search Engines Video Streaming 3.
1 UNIT 13 The World Wide Web. Introduction 2 The World Wide Web: ▫ Commonly referred to as WWW or the Web. ▫ Is a service on the Internet. It consists.
Ifconfig Kevin O'Brien Washtenaw Linux Users Group
Introduction to Operating Systems Concepts
Introduction to Operating Systems
LINUX ADMINISTRATION
Computer Networks 9/17/2018 Computer Networks.
Lec 5 Layers Computer Networks Al-Mustansiryah University
Introduction to Operating Systems
Introduction to Ansible
Delivery, Forwarding, and Routing of IP Packets
Implementing an OpenFlow Switch on the NetFPGA platform
Computer System Laboratory
Example 9 (Continued) 1. The first mask (/26) is applied to the destination address. The result is , which does not match the corresponding network.
Virtual Private Network
Presentation transcript:

Click Router: Hands on Alex Newman Arvind Venkatesan Shivkumar Kalyanaraman

Knowing about your network Helpful Unix commands –ifconfig: Find about IP address and MAC address for all the network interfaces on this machine –ifup: Bring up a network interface –ifdown: Bring down a network interface –lspci: Lists all PCI devices in the system

Modular software router –Click exists in User land or a Kernel Module for: Linux FreeBSD –Click is modular ! I.e. we can remove/add components of Click (eg: queues etc) Interconnected collection of modules called elements Elements are written in C++ !! It is also extensible – we can prototype our own designs! Provides high level coding interface: –Eg: vectors, string buffers, ip address, queues etc

Features of Click Provides a high level programming interface to the developer Provides a number of router building blocks that can be used/modified to build custom router configurations Click is darn fast, in fact it often reaches the theoretical limits of the hardware.

Click Scripts Before we have much understanding lets setup our environment and work with a basic Click Script. This should demonstrate how fast and human readable click is. How about a program to pass packets from one Ethernet card to another? FromDevice(eth0) -> Queue() -> ToDevice(eth1); But this doesn’t do anything right, as what will happen to the packet once it gets sent out of ETH1?

Exercise 1 Problem: Use Encapsulation elements that do header manipulation like strip, prepend etc. provided in the Click Toolkit to fix the router config. You should probably consult the element reference on the Click webpage Hint it is linked off of

THINKING ALOUD (Exercise 1) 1.Receive! 2.Every incoming packet has an ethernet and an IP Header 3.Remove existing ethernet header 4.Put next hop’s Ethernet Header 5.Send!

Exercise 2 Problem: Write a small configuration file to implement a packet source and a packet destination. The packet source sends a “ ” in an IP packet. The destination simply drops the “ ” packet 

Figure: Exercise 2 SourceRouter Destination

THINKING ALOUD (Exercise 2) 1.SOURCE Machine –Make a packet with the contents –Prepend IPHeader –Prepend EthernetHeader –Send 2.DESTINATION Machine –Receive a packet –Discard

Elements FromDevice, ToDevice and Queue are all click elements. Each Elements is an object which inherits some basic attributes. Types of elements –Push: Pushes packet to the next element. E.g. FromDevice(); –Pull: Pulls packet from the previous element E.g. ToDevice(); –Agnostic: May act as push or pull. E.g. Paint(); Method Interfaces –Methods exported to other elements. For example, methods for transferring packets like push(), pull() etc. Handlers –Methods exported to the user rather than to other elements in the router configuration –Support simple, text based read/write semantics

The Click Configuration File Describes connectivity between elements Acyclic directed graph Allows configuration arguments to be specified for the elements Configuration Language –Declaration: name :: class (config); E.g. Buffer::Queue(500); This is actually closer to typedefing. –Connections: name1 [port1] -> [port2] name2; E.g. IPClassifer[0] -> Discard; //Firewalled! IPClassifer[1] -> Buffer -> ToDevice(eth0); //Forward Notice each pipeline is its own atomic event driven system.

Element Classes Click elements are atomic objects which can inherit from each other. C++ supports Multiple Inheritance, therefore so does click. An elements ability to support push and pull depends on whether or not that function was written mainly.

Element Classes: A look at the C++ code class NullElement: public Element { public: NullElement(); const char *class_name() const; NullElement *clone() const; const char *processing() const; void push(int port, Packet *p); Packet *pull(int port); };

Element Classes: A look at the C++ code NullElement() { add_input(); add_output(); } const char *class_name() const { return "Null"; } NullElement *clone() const { return new NullElement; } const char *processing() const { return AGNOSTIC; } void push(int port, Packet *p) { output(0).push(p); } Packet *pull (int port) { return input(0).pull(); }

Making own elements STEPS: 1.Descend into the Click main directory 2.# make elemlist 3.# make install

Running router configuration Kernel Space –# rmmod click (within CLICKDIR) –# insmod linuxmodule/click.o (within CLICKDIR) –To start : # cat “filename.click” > /proc/click/config (whereever config file is) –To stop: # cat “null.click” > /proc/click/config (whereever null.click is) User Space –$ click “filename.click”

Debugging Aids Print messages with click_chatter() Use dmesg at the prompt Read /var/log/messages Use ksymoops (oops! What’s that? )

Exercise 3 Problem: Instead of dropping the packet at the destination, just echo “ ” on the screen and drop the packet. –Modify the Null element shown previously to echo the packet contents. – Use this “modified” NullElement” in your configuration file

Figure: Exercise 3 SourceRouter Destination hello

THINKING ALOUD (Exercise 3) DESTINATION Machine (MODIFIED) –Receive a packet –Strip its Ethernet address –Strip its IP Address –Print the packet contents using your element (use click_chatter() function) –Kill the packet

Exercise 4 Problem: Man in the middle attack!!!!!!! Let router R forward “boring” instead of “ ” Write a new element that: –Creates a new packet with the new contents –Kills the incoming packet (use the kill() function) –Forwards the new packet Include this element in your config file

Figure: Exercise 4 SourceRouter Destination boring

THINKING ALOUD (Exercise 4) ROUTER –Receive a packet –Strip its ethernet address –Strip its IP address –Within your element make a new packet with the new contents (use make() function on a WritablePacket) –Kill the received packet –Send the new packet out

Exercise 5 Problem: Mission TimeBomb You are secret agent 0049! With all the networking powers, you get access to the Router code that corrupts the packet. Now put a timer in that router code that times out every 1000ms and sends a packet to the destination saying “Don’t trust Routers!”

Figure: Exercise 5 Source Router Destination Don’t trust Routers! Don’t trust Routers

Hints: Exercise 5 Use a Timer object (include click/timer.hh) Initialize the timer Implement the function run_scheduled() that is called every time there is a time out. In this function –Make a packet with the new contents –Push the packet out Reset the timer every 1000ms using the reschedule method on a Timer object.

What did we do today? Learnt innards of click router Make new elements and of course router! Make your own source, destination nodes Processed packet within a router Blew the router up!!!