January 9, 2001 Router Plugins (Crossbow) 1 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercises.

Slides:



Advertisements
Similar presentations
Router Implementation Project-2
Advertisements

Remote Procedure Call (RPC)
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
SYSTEM ADMINISTRATION Chapter 19
Common Gateway Interface (CGI). CGI is a protocol: CGI is not a programming language CGI is a protocol for the exchange of information between between.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
1 Java Networking – Part I CS , Spring 2008/9.
Introduction to Management Information Systems Chapter 5 Data Communications and Internet Technology HTM 304 Fall 07.
Design and Implementation of a Server Director Project for the LCCN Lab at the Technion.
TCP/IP Tools Lesson 5. Objectives Skills/ConceptsObjective Domain Description Objective Domain Number Using basic TCP/IP commands Understanding TCP/IP3.6.
Understanding Networks Charles Zangla. Network Models Before I can explain how connections are made from across the country, I would like to provide you.
WebReport/400 TCP/IP Configuration Presented by Kisco Information Systems.
Ch. 31 Q and A IS 333 Spring 2015 Victor Norman. SNMP, MIBs, and ASN.1 SNMP defines the protocol used to send requests and get responses. MIBs are like.
Ch. 31 Q and A CS332 Spring Network management more than just Ethernet Q: Comer mentions that network managers need to be able to account for different.
1 Network File System. 2 Network Services A Linux system starts some services at boot time and allow other services to be started up when necessary. These.
What’s going on here? Leo Koppel Jan The OSI Model LayersData unitFunctionExamples Host layers 7. ApplicationApplication Data High-level APIs,
Document Number ETH West Diamond Avenue - Third Floor, Gaithersburg, MD Phone: (301) Fax: (301)
Eucalyptus Virtual Machines Running Maven, Tomcat, and Mysql.
Partner Logo German Cancio – WP4-install LCFG HOW-TO - n° 1 WP4 hands-on workshop: EDG LCFGng exercises
University of Calgary – CPSC 441.  UDP stands for User Datagram Protocol.  A protocol for the Transport Layer in the protocol Stack.  Alternative to.
Network Technologies essentials Week 4: Internetworking Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of.
Lecture 2 TCP/IP Protocol Suite Reference: TCP/IP Protocol Suite, 4 th Edition (chapter 2) 1.
Washington WASHINGTON UNIVERSITY IN ST LOUIS January 7, MSR Tutorial John DeHart Washington University, Applied Research Lab
January 9, 2001 Router Plugins (Crossbow) 1 Washington WASHINGTON UNIVERSITY IN ST LOUIS NetBSD Kernel Topics: IP Processing mbuf structure Loadable Kernel.
SNORT Tutorial Sreekanth Malladi (modifying original by N. Youngworth)
Washington WASHINGTON UNIVERSITY IN ST LOUIS MSR Tutorial Group Exercises.
TCP/IP Essentials A Lab-Based Approach Shivendra Panwar, Shiwen Mao Jeong-dong Ryoo, and Yihan Li Chapter 5 UDP and Its Applications.
Module 12: Routing Fundamentals. Routing Overview Configuring Routing and Remote Access as a Router Quality of Service.
Server Sockets: A server socket listens on a given port Many different clients may be connecting to that port Ideally, you would like a separate file descriptor.
FTP Client Application CSC 8560 Brian Jorgage 4/27/2004.
Implementing a Port Knocking System in C Honors Thesis Defense by Matt Doyle.
Day 14 Introduction to Networking. Unix Networking Unix is very frequently used as a server. –Server is a machine which “serves” some function Web Server.
Transport Layer: TCP and UDP. Overview of TCP/IP protocols Comparing TCP and UDP TCP connection: establishment, data transfer, and termination Allocation.
January 9, 2001 Router Plugins (Crossbow) 1 Washington WASHINGTON UNIVERSITY IN ST LOUIS Router Plugins (Formerly Crossbow) A Software Architecture for.
1 - Charlie Wiseman - 05/11/07 Design Review: XScale Charlie Wiseman ONL NP Router.
Agilent Technologies Copyright 1999 H7211A+221 v Capture Filters, Logging, and Subnets: Module Objectives Create capture filters that control whether.
Washington WASHINGTON UNIVERSITY IN ST LOUIS CP and Full MSR Test Status.
Washington WASHINGTON UNIVERSITY IN ST LOUIS MSR Tutorial Exercises Group 3.
Sniffer, tcpdump, Ethereal, ntop
Monitoring Troubleshooting TCP/IP Chapter 3. Objectives for this Chapter Troubleshoot TCP/IP addressing Diagnose and resolve issues related to incorrect.
IP addresses IPv4 and IPv6. IP addresses (IP=Internet Protocol) Each computer connected to the Internet must have a unique IP address.
Networking Material taken mainly from HowStuffWorks.com.
Gold – Crystal Reports Introductory Course Cortex User Group Meeting New Orleans – 2011.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
When you run a scenario, the Vusers on each host machine use the host’s IP address. You can define multiple IP addresses on a host machine to emulate a.
Computer Communication: An example What happens when I click on
Firewalls A brief introduction to firewalls. What does a Firewall do? Firewalls are essential tools in managing and controlling network traffic Firewalls.
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
Review of IPv4 Routing Veena S, MCA Dept, PESIT Mar 09-10, 2013.
4343 X2 – The Transport Layer Tanenbaum Ch.6.
Introduction to TouchDevelop Lesson 3 – Comments & Lists Created by S. Johnson
INTERNET APPLICATIONS CPIT405 Install a web server and analyze packets.
Ch. 31 Q and A IS 333 Spring 2016 Victor Norman. SNMP, MIBs, and ASN.1 SNMP defines the protocol used to send requests and get responses. MIBs are like.
LAN Switching Virtual LANs. Virtual LAN Concepts A LAN includes all devices in the same broadcast domain. A broadcast domain includes the set of all LAN-connected.
The Distributed Application Debugger (DAD)
Networks Problem Set 3 Due Nov 10 Bonus Date Nov 9
Networks Problem Set 3 Due Oct 29 Bonus Date Oct 26
Part 3 – Remote Connection, File Transfer, Remote Environments
Chapter 6 Delivery & Forwarding of IP Packets
The Linux Operating System
ADDRESSING Before you can send a message, you must know the destination address. It is extremely important to understand that each computer has several.
Lab 1 introduction, debrief
CS 457 – Lecture 10 Internetworking and IP
Topic 5: Communication and the Internet
I. Basic Network Concepts
Configuring Internet-related services
Starting TCP Connection – A High Level View
The Router Plugins system architecture
46 to 1500 bytes TYPE CODE CHECKSUM IDENTIFIER SEQUENCE NUMBER OPTIONAL DATA ICMP Echo message.
Lecture 4a Mobile IP 1.
Presentation transcript:

January 9, 2001 Router Plugins (Crossbow) 1 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercises

January 9, 2001 Router Plugins (Crossbow) 2 Washington WASHINGTON UNIVERSITY IN ST LOUIS Let’s talk about Distribution and your plans.

January 9, 2001 Router Plugins (Crossbow) 3 Washington WASHINGTON UNIVERSITY IN ST LOUIS Question? Is everyone experienced with make, vi or emacs (or ed) and writing C programs?

January 9, 2001 Router Plugins (Crossbow) 4 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercises: Build MonP: A Monitoring Protocol over UDP/IP Three Operations supported: –Report Packets –Report Bytes –Print Packet »message is supported »you will implement the operation End systems will generate MonP/UDP/IP messages Router Plugins will perform MonP operations End systems will display resulting MonP information We’ll build up to the final plugin through several steps 2 End systems to be shared across all users 15 Router systems

January 9, 2001 Router Plugins (Crossbow) 5 Washington WASHINGTON UNIVERSITY IN ST LOUIS Lab Configuration cb1: Server (recv/echo) cb17: Client (xmit) cb16: cb2: cb15: Total of 30 Routing Domains 15 ROUTERS Client has 15 IP aliases Server has 15 IP aliases

January 9, 2001 Router Plugins (Crossbow) 6 Washington WASHINGTON UNIVERSITY IN ST LOUIS Example Server : cb17 > serv Client : cb16 > sendpkts cb2: Router You will each sit at and work on One of the 15 router machines

January 9, 2001 Router Plugins (Crossbow) 7 Washington WASHINGTON UNIVERSITY IN ST LOUIS Setup Should be no more then 2 people per Router –some will have one person per Router –If you are a two person group avoid cb12-cb15 (limited space) Routers are machines cb1-cb15 (cb13 might be BAD) End systems are cb16 (client) and cb17 (server) All connected via Ethernet. User accounts: ‘cbuser#’, where # matches machine –e.g. if you are on cb4, use the account cbuser4 –passwords: CbTut# (e.g. CbTut4) Root access: –available to cbuser# on machine cb# –password: CbowTut –You will probably want to do this after you become root: > exec tcsh

January 9, 2001 Router Plugins (Crossbow) 8 Washington WASHINGTON UNIVERSITY IN ST LOUIS Note about Addresses The address structures in the Crossbow Kernel are IPv6 –IPv6 address structures are a superset of IPv4 –IPv6 address are 128 bits We will be using IPv4 addresses –e.g –IPv4 addresses are 32 bits Notation for using IPv4 address in IPv6: –Use double colon before address: :: –Double colon tells the utilities to set everything to the left to 0’s

January 9, 2001 Router Plugins (Crossbow) 9 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercises Load printPacket plugin and try it out Build your own plugin –Start with template and add printf(“I got a packet\n”); –Use this plugin to try out array of different filters. Modify your plugin to print out UDP/IP info –Using utility functions used in printPacket »print udp header for packets using UDP Port 5555 –Using filter »print udp header for packets using UDP Port 5555 Implement “Monitor” Protocol –Using utility functions used in printPacket »test with different command line options to sendpkts –Implement Protocol »using code module supplied by us

January 9, 2001 Router Plugins (Crossbow) 10 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercises Create two instances of your protocol plugin: –use one with a filter to capture packets from client –use second with filter to capture packets from server Modify protocol plugin by adding PrintPacket command –it already exists in sendpkts program –plugin code currently just says that command is not supported.

January 9, 2001 Router Plugins (Crossbow) 11 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 0

January 9, 2001 Router Plugins (Crossbow) 12 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 0: Running PrintPacket Plugin Log in as root and reboot your router machine When it comes back, log in as cbuser#, Start X: > startx On your machine have four windows: one as root on cb# one as user cbuser# on cb# one as user cbuser# on cb16 (use ssh to connect) one as user cbuser# on cb17 (use ssh to connect)

January 9, 2001 Router Plugins (Crossbow) 13 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 0: Running PrintPacket Plugin (continued) on cb#, cbuser# Window: cb#> tail -f /var/log/messages watch what is displayed here while you do the other steps on cb#, Root Window: Load Plugin cb#> cd /usr/CB/plugins/TUTORIAL/PrintPacket cb#> modstat [modstat shows you what plugins are loaded. Right now, there should be none] cb#> sh loadit 1 cb#> modstat [now you should see your plugin loaded]

January 9, 2001 Router Plugins (Crossbow) 14 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 0: Running PrintPacket Plugin (continued) cb17 window: Start server program cb17> cd /usr/CB/plugins/TUTORIAL/programs cb17>./serv -h This will list the command line arguments are cb17>./serv -v -e 1 -l cb16 window: Start client program cb16> cd /usr/CB/plugins/ TUTORIAL/programs cb16>./sendpkts -h This will list the command line arguments. cb16>./sendpkts -v -d c pkts -n 1 -l server

January 9, 2001 Router Plugins (Crossbow) 15 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 0: Running PrintPacket Plugin (continued) After you have successfully seen the result of the Plugin executing on a packet: Root Window: Unload plugin cb#> cd /usr/CB/plugins/TUTORIAL/PrintPacket cb#> sh unloadit 1 cb#> modstat cb#, cbuser# window: Kill your ‘tail -f’ with cb17# window: Kill your server program with

January 9, 2001 Router Plugins (Crossbow) 16 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 1

January 9, 2001 Router Plugins (Crossbow) 17 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 1A: Building your own plugin On your machine have four windows: one as root on cb# one as user cbuser# on cb# one as user cbuser# on cb16 one as user cbuser# on cb17

January 9, 2001 Router Plugins (Crossbow) 18 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 1A: Building your own plugin cbuser# on cb# Window: cb#> cd /usr/CB/plugins/TUTORIAL/MonP cb#> ls [Nothing there] cb#> cp../TEMPLATE/*. cb#> ls [Now we want to rename the plugin to MonP] cb#> mv myplugin.c MonP.c cb#> mv myplugin.h MonP.h [Edit the files: Makefile cbpgi.c MonP.c MonP.h and change all occurrences of myplugin to MonP]

January 9, 2001 Router Plugins (Crossbow) 19 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 1A: Building your own plugin cbuser# on cb# Window: cb#> cd /usr/CB/plugins/TUTORIAL/MonP edit the file MonP.c and add this to the function my_handle_packet() printf(“I Got a packet!\n”); printf(“############\n”); also, find out what the plugin id code is for your plugin, you’ll need this number later. > grep PGICODE *.h build the plugin: cb#> make cb#> tail -f /var/log/messages [You should see the results of your packets being processed by your plugin in this window when you do the next couple of steps…]

January 9, 2001 Router Plugins (Crossbow) 20 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 1A: Building your own plugin Root on cb# Window: Load the Plugin ourselves this time!! cb#> cd /usr/CB/plugins/TUTORIAL/MonP cb#> make load cb#> modstat cb#> cm [ see what the possible cm commands are, and check the args for some: ] cb#> cm create_instance cb#> cm add_filter cb#> cm register_instance cb#> cm create_instance [note the instance number that this returns, negative value means error] cb#> cm add_filter :: /128 :: /128 [note the filter handle that this returns, negative value means error] cb#> cm register_instance

January 9, 2001 Router Plugins (Crossbow) 21 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 1A: Testing Your Plugin cb17 window: cb17> cd /usr/CB/plugins/TUTORIAL/programs/ cb17>./serv -v -e 1 -l cb16 window: cb16> cd /usr/CB/plugins/TUTORIAL/programs/ cb16>./sendpkts -v -d c pkts -n 1 -l server#

January 9, 2001 Router Plugins (Crossbow) 22 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 1A: Removing Your Plugin After you have successfully seen the result of the Plugin executing on a packet: Root Window: cb#> cd /usr/CB/plugins/TUTORIAL/MonP cb#> cm deregister_instance cb#> cm remove_filter 1 cb#> cm free_instance cb#> make unload cb#> modstat

January 9, 2001 Router Plugins (Crossbow) 23 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 1B: Various Filters Repeat Exercise 1A, but try these filters instead. Try combining different ones. Can you find the most specific filter for the packets you are sending? You may need to try different command line parameters for serv and sendpkts. Each of them has a “-h” command line argument to print their options Beware: Very general filters will pick up lots of pkts!! cb#> cm add_filter /0 :: /128 cb#> cm add_filter :: /128 0/0 cb#> cm add_filter /0 :: /128 cb#> cm add_filter :: /128 0/0 cb#> cm add_filter :: /112 0/0 cb#> cm add_filter 1 fxp /0 0/0 cb#> cm add_filter 1 0 udp 0 0 0/0 0/0 cb#> cm add_filter 1 0 tcp 0 0 0/0 0/0 cb#> cm add_filter /0 0/0 cb#> cm add_filter /0 0/0

January 9, 2001 Router Plugins (Crossbow) 24 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 2

January 9, 2001 Router Plugins (Crossbow) 25 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 2A: Modify your plugin to Print UDP Info Open another window on your cb# machine as user cbuser#. In this window: cb#> cd /usr/CB/plugins/TUTORIAL/PrintPacket [ take a look at the file PrintPacket.c. We will use some of the functions that this uses to perform this step in the exercises. Find where it uses the following functions: locateUdpHdrFct() printUdpHdrFct() cb#> cd../utils [ take a look at the file udpHdr.c. Find where it defines the following functions and where it prints the UDP dst port: printUdpHdrFct()

January 9, 2001 Router Plugins (Crossbow) 26 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 2A: Modify your plugin to Print UDP Info Using the utility functions that are used in the PrintPacket plugin, modify your plugin to print the IP and UDP Headers for packets which are UDP and use UDP destination port of Add the body of the function filterUdpPacketsFct() to do this. [Your plugin template already has the include files necessary to use the utility functions. Also, your Makefile is already set up to link the utility functions with your plugin. You just need to add the function calls and any variables you might want.] Use a very general filter to make your plugin code do the packet selection. Test your plugin with UDP and TCP packets. Test your plugin with a variety of UDP port numbers. Don’t forget to perform the cleanup operations (deregister_instance, …)

January 9, 2001 Router Plugins (Crossbow) 27 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 2B: Modify your plugin to Print UDP Info Modify your plugin from Exercise 2A to print the IP and UDP Headers for all packets. Comment the call to the function filterUdpPacketsFct() out. We’ll use a filter this time to do the selection. Add the body of printIpUdpHdrsFct() to print those headers. For this we will assume that the packets are UDP. The filter should guarantee this!! Use a filter that does the packet selection of UDP packets with destination port Add ‘-p 5555’ to your server and client command lines Test your plugin with UDP and TCP packets. Test your plugin with a variety of UDP port numbers. Don’t forget to perform the cleanup operations (deregister_instance, …)

January 9, 2001 Router Plugins (Crossbow) 28 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 3

January 9, 2001 Router Plugins (Crossbow) 29 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 3A: Implement FRED Protocol Using the utility functions that are used in the PrintPacket plugin and code samples from utils/*.c, modify your plugin from Exercise 2B to print JUST the packet payload for all packets received. Choose a filter to use. Test your plugin with UDP and TCP packets. Test your plugin with a variety of UDP port numbers. Look at the packet payload data and see how it corresponds to what we have defined as the Monitor Protocol. Try different command line options to sendpkts to send different commands. Note the results at the client systems. We’ll want to compare this with the results in the next step... Don’t forget to perform the cleanup operations (deregister_instance, …)

January 9, 2001 Router Plugins (Crossbow) 30 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 3B: Implement Monitor Protocol Uncomment the call to the monitor protocol function (ProcesssMonP) and uncomment the function in your plugin code. Look at the body of the ProcessMonP() function. Most of the code is given to you. Look for comments of the form: // BEGIN: ADD CODE HERE to …. // END: ADD CODE HERE to …. These tell you where you need to add calls to utility functions and do certain tests in the code. You may look at the rest of the code, but don’t worry if you don’t understand it Work with the code until you get it to compile

January 9, 2001 Router Plugins (Crossbow) 31 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 3B: Implement Monitor Protocol (continued) Choose a filter to use. Test your plugin with UDP and TCP packets. Test your plugin with a variety of UDP port numbers. Try different command line options to sendpkts to send different commands. Note the results at the client systems. Compare these results to those in the previous step… Can you come up with filters to cause your plugin to operate on packets arriving from just the client? Just the server? How about both? Don’t forget to perform the cleanup operations (deregister_instance, …)

January 9, 2001 Router Plugins (Crossbow) 32 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 4

January 9, 2001 Router Plugins (Crossbow) 33 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 4: Multiple Instances Using your plugin from Exercise 3B: Create an instance and an appropriate filter to monitor packets arriving from the client. Create a second instance of the same plugin with an appropriate filter to monitor packets arriving from the server. Test them and check the results at the end systems. How do the different instances know whether they are instance 1 or 2? Don’t forget to perform the cleanup operations (deregister_instance, …)

January 9, 2001 Router Plugins (Crossbow) 34 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 5

January 9, 2001 Router Plugins (Crossbow) 35 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercise 5: Augment the Monitor Protocol Using the utility functions to modify the code for the Monitor Procotol to add the PrintPacket command. Look at the file /usr/CB/plugins/TUTORIAL/fred/fp_proto.c for the code for the actual protocol. You will have to modify it to add the PrintPacket command. When you get it to compile, go back to MonP. Rebuild your plugin and test this new feature.

January 9, 2001 Router Plugins (Crossbow) 36 Washington WASHINGTON UNIVERSITY IN ST LOUIS END of Exercises