Lab 2 Solution. Jon Turner. CSE 473 Introduction to Computer Networks. (20 points) Place a copy of your source code for TcpMapServer here.

Size: px
Start display at page:

Download "Lab 2 Solution. Jon Turner. CSE 473 Introduction to Computer Networks. (20 points) Place a copy of your source code for TcpMapServer here."

Transcription

1 CSE 473 Introduction to Computer Networks Lab 2 Solution Jon Turner (20 points) Place a copy of your source code for TcpMapServer here. This program implements a TCP MapServer that stores (key,value) strings. usage: MapServer [ ipaddress [ portnumber ] ] There are two optional arguments. The first is the ip address of the server's listen socket and the second is a port number for the listen socket. If the ip address is omitted, it defaults to the default address for the server. If the port number is omitted, it defaults to The server expects to receive TCP connections and then commands that store and retrieve (key,value) pairs, where both the key and the value are strings. There are three commands, get, put and get all. Get takes a single argument (the key) and put can take either one or two arguments (key,value). If only the key is provided, the mapping for that key is removed. If both key and value are provided, a new mapping is created, possibly replacing an existing pair. Each command is on a line by itself, with key and value strings enclosed in quotes. The get all command returns all (key,value) pairs on a single line, separated by double-colons (::). For example, to perform the operation put(foo,bar), the remote client would send the line put:foo:bar To perform the operation get(who hah) the client would send a packet containing get:who hah The reply to a successful put is the line ok The reply to a succesful get is ok:string where "ok:string" is the stored value. If the key to a get does not match any stored value, the server returns no match - 1 -

2 The response to a get all command is a set of pairs separated by a pair of colon characters. For example, foo:bar::who hah:whoop di doo::tish:tosh tosh On an error, the server returns unrecongizable input: copy of the offending input import sys from socket import * process command line arguments localip = '' localport = 6789 if len(sys.argv) > 1: localip = sys.argv[1] if len(sys.argv) > 2: localport = int(sys.argv[2]) open socket and bind to port (localip,localport) serversocket = socket(af_inet, SOCK_STREAM); serversocket.bind((localip, localport)) map = {} create an empty dictionary listen for incoming connections serversocket.listen(10) while 1: wait for, then accept incoming connection connsock, clientaddress = serversocket.accept() buffer = "" while 1 : add text to the buffer until we have a complete line exit loop if client closes connection newbuf = connsock.recv(1000); if len(newbuf) == 0 : break buffer = buffer + newbuf if buffer.find('\n') < 0 : continue get the next line of input, saving the rest in buffer chunks = buffer.partition('\n') command = chunks[0] buffer = chunks[2] if command == "get all" : reply = '' for key, val in map.iteritems(): reply += key + ":" + val + "::" reply = reply[:-2] else : chunks = command.partition(':') if chunks[1]!= ':': reply = "error :unrecognizable input:" + command - 2 -

3 else: if chunks[0] == "get": if chunks[2] in map: reply = "ok:" + map[chunks[2]] else: reply = "no match" elif chunks[0] == "put": subchunks = chunks[2].partition(':') if subchunks[1] == ':': map[subchunks[0]] = subchunks[2] else: del map[subchunks[0]] reply = "ok" else: reply = "error:unrecognizable input:" \ + command reply += '\n' send reply connsock.sendall(reply) close socket and do it again connsock.close() - 3 -

4 (10 points) Place a copy of your source code for TcpMapClient here. Simple client for use with a MapServer that stores (key,value) strings. usage: MapClient servername [ serverport ] The first argument is the name or IP address of a remote host, the second is a port number used by a MapServer on that remote host. Open a stream connection to the remote MapServer, then read commands from standard input (one per line) and send them to the server. Print the output returned by the server. A blank input line causes the client to close the connection and terminate. The client does no checking for malformed input. import sys from socket import * process arguments server = sys.argv[1] port = 6789 if len(sys.argv) > 2 : port = int(sys.argv[2]) open socket and connect to remote server clientsocket = socket(af_inet, SOCK_STREAM); clientsocket.connect((server, port)) buffer = '' while 1: get command from input and send it; stop if user types blank line command = raw_input("map server: ") if len(command) == 0 : break command += '\n' clientsocket.sendall(command) read until we get a newline, then print line while buffer.find('\n') < 0 : newbuf = clientsocket.recv(1000) if len(newbuf) == 0 : print "server closed connection prematurely" sys.exit(1) buffer += newbuf chunks = buffer.partition('\n') print chunks[0] buffer = chunks[2] print '' clientsocket.close() - 4 -

5 (10 points) Use the provided localscript to test your client and server. You may do this testing on any Unix (including MacOS) or Linux computer (shell.cec.wustl.edu or onl.wustl.edu). Paste a copy of the output below. :bar :hah :world map server: error :unrecognizable input:get map server: error:unrecognizable input:foo:who map server: no match :toast is tasty map server: foo:toast is tasty::goodbye:world::who:hah map server: - 5 -

6 (15 points) In the remaining parts of the lab, you will be testing your application in ONL. Use the RLI to reserve an experimental network using the provided configuration file, cse473-lab2.onl (remember to first open an ssh connection to ONL with the tunnel required by the RLI), and commit your network. Open two separate ssh windows, one connecting to the host h4x2 and the other to the host h7x1 (remember to load the topology file first). First, start the server using the window for host h7x1. When starting the server, you will need to specify the host name (h7x1) or IP address ( ) for the host in the experimental network. Use the default port number. Run the command in the background by putting an ampersand (&) at the end of the line. This will allow you to use the window for command input, even while the server is running (read the job control section of the bash manual to learn more about running jobs in the foreground and background). Note that once you start the server, it will run forever until you stop it. One simple way to do this is to type kill %1. Note that if you have multiple jobs running in the background, you will need to substitute the appropriate job number for %1. See the bash manual for details. Now that your server is running in the background, type the following command in the window for h7x1. netstat -an grep 6789 and paste a copy of the output below. tcp : :* LISTEN Now, start the client on h4x2 (supplying the appropriate arguments) and then re-run netstat on h7x1 and paste the output below. tcp : :* LISTEN tcp : :51120 ESTABLISHED Explain the netstat output in the two cases. You should read the man page on netstat before answering this part (type man netstat to get the man page). The netstat command shows information about active sockets and the grep command filters out all lines but those containing the string So, in the first case, the output shows that there is a socket bound to port 6789 that is in the listening state; that is, it is waiting for incoming connections. The second also shows a connected socket to host h4x2 (which has the IP address ) using the remote port number This all makes sense, since before we start the client, the server is listening on the socket, while after we start the client, there is also an active connection to the client

7 Now, run the provided remotescript on h4x2. Paste the output from your run below. :bar :hah :world map server: error :unrecognizable input:get map server: error:unrecognizable input:foo:who map server: no match :toast is tasty map server: foo:toast is tasty::goodbye:world::who:hah map server: - 7 -

8 (10 points) In this part, you are to re-run the remotescript and take a screen capture of the two monitoring windows showing the traffic that results from running the remotescript. You can pause a monitoring window by selecting Stop from its Options menu. This makes it easier to do the screen capture. The charts should show a burst of traffic for some of the curves and no traffic for others. Which curves show a burst of traffic? Is this consistent with what you expect? Note that there are two possible routes between the two end hosts. Which of the two routes are used in this case? The top chart shows traffic leaving output 1 of router 1 and output 0 of router 2. This is consistent with traffic taking the direct link between the two routers (in both directions). The bottom chart shows traffic leaving host h4x2 and arriving at host h7x1. None of the other curves show any traffic. This is consistent with what we expect. The value on the curve shows a data rate of nearly 60 packets per second. The script only has 12 commands, so we would expect to see a total of about 12 packets in each direction. Because the burst occurs within a fraction of a second, the rate shown on the chart is a little bit misleading in this case

9 (10 points) In this next part, you are to run remotescript once again, but this time, you will be using the utility tcpdump to capture packets as seen at both hosts. Unfortunately we cannot use Wireshark for this purpose, because you cannot run Wireshark directly on the ONL computers. What we can do is to capture the packets using tcpdump, saving the results in a pcap file. We can then use Wireshark to examine the pcap file, just as we did when doing live captures in lab 1. Before going any further, read the man page for tcpdump. Then run tcpdump, on the machine where the server is running, by typing the following command into a shell window on h7x2. sudo /usr/sbin/tcpdump -i data0 -w servertrace.pcap tcp port 6789 Make sure you understand the purpose of all the arguments. Next, run tcpdump on the client machine, by typing sudo /usr/sbin/tcpdump -i data0 -w clienttrace.pcap tcp port 6789 To terminate tcpdump, type ctrl-c in the window where tcpdump is running (if it is running in the background, type the command fg first, then ctrl-c). You should now have two pcap files, which you can transfer to any computer with Wireshark installed, then you can use Wireshark to examine the captured packets

10 Open the file for the server-side capture and highlight the packet containing the command put:who:hah. Paste a copy of the Wireshark window below. How many microseconds pass between the arrival of the packet and the transmission of the reply? =27 µs

11 Open the client-side capture file in Wireshark and highlight the same packet. Paste a copy of the Wireshark window for the client below. How many microseconds pass between the time the client sends the packet containing the command and the time it gets the reply? What does this tell you about the network delay? =100 µs. If we subtract this from the difference at the server, we get 73 µs, suggesting a one-way delay of about 36 µs

12 - 12 -

13 (10 points) In this part, you will measure the performance of your application in another way. Run the provided longscript on the client. This performs a large number of puts and gets. Make a screen capture of the two monitoring windows showing the packet traffic in the network. Paste those windows here. What does the traffic data tell you about the performance of the application? Compare this to what you learned above from the packet capture data. The charts above show a traffic rate of nearly 10,000 packets per second in each direction. That means there is about 100 µs between each successive pair of commands. This is consistent with the packet capture data at the client

Computer Communication Networks Socket Programming

Computer Communication Networks Socket Programming Computer Communication Networks Socket Programming ICEN/ICSI 416 Fall 2018 Prof. Aveek Dutta 1 Application Programming Interface Interface exported by the network Since most network protocols are implemented

More information

Application Programming Interfaces

Application Programming Interfaces Application Programming Interfaces The TCP/IP protocol suite provides only the protocols that can be used by processes to communicate across a network. Though standarized, how these protocols are implemented

More information

Open Network Laboratory

Open Network Laboratory Open Network Laboratory TA: CSE 473S (Fall 2010) Introduction to Computer Networks These slides are available on-line at: http://www.cse.wustl.edu/~jain/cse473-10/ 1 Outline 1. Open Network Laboratory

More information

IEMS 5780 / IERG 4080 Building and Deploying Scalable Machine Learning Services

IEMS 5780 / IERG 4080 Building and Deploying Scalable Machine Learning Services IEMS 5780 / IERG 4080 Building and Deploying Scalable Machine Learning Services Lecture 7 - Network Programming Albert Au Yeung 18th October, 2018 1 / 48 Computer Networking 2 / 48 Data Communication Exchange

More information

CSE 473 Introduction to Computer Networks. Exam 1. Your name here: 10/3/2012

CSE 473 Introduction to Computer Networks. Exam 1. Your name here: 10/3/2012 CSE 473 Introduction to Computer Networks Jon Turner Exam 1 Your name here: 10/3/2012 1. (10 points). A user in St. Louis, connected to the internet via a 20 Mb/s (b=bits) connection retrieves a 250 KB

More information

We will cover in this order: 2.1, 2.7, 2.5, 2.4, 2.2

We will cover in this order: 2.1, 2.7, 2.5, 2.4, 2.2 CSE 422 Notes, Set 2 These slides contain materials provided with the text: Computer Networking: A Top Down Approach,5 th edition, by Jim Kurose and Keith Ross, Addison-Wesley, April 2009. Additional figures

More information

Overview. Setup and Preparation. Exercise 0: Four-way handshake

Overview. Setup and Preparation. Exercise 0: Four-way handshake Overview In this Lab assignment you will develop a simple client program written in Python(use a socket library) to interact with a CSE 3300 Server running on a remote machine. The server, running on the

More information

Chapter II: Application Layer

Chapter II: Application Layer Chapter II: Application Layer UG3 Computer Communications & Networks (COMN) Myungjin Lee myungjin.lee@ed.ac.uk Slides copyright of Kurose and Ross Internet hourglass Here 2 Some network apps e-mail web

More information

Esempi di programmi client/server in Python 2

Esempi di programmi client/server in Python 2 Reti di Calcolatori I Prof. Roberto Canonico Dipartimento di Ingegneria Elettrica e delle Tecnologie dell Informazione Corso di Laurea in Ingegneria Informatica A.A. 2018-2019 Esempi di programmi client/server

More information

SOCKET. Valerio Di Valerio

SOCKET. Valerio Di Valerio SOCKET Valerio Di Valerio The Problem! Communication between computers connected to a network Network Network applications! A set of processes distributed over a network that communicate via messages!

More information

Computer Networks Spring 2017 Homework 2 Due by 3/2/2017, 10:30am

Computer Networks Spring 2017 Homework 2 Due by 3/2/2017, 10:30am 15-744 Computer Networks Spring 2017 Homework 2 Due by 3/2/2017, 10:30am (please submit through e-mail to zhuoc@cs.cmu.edu and srini@cs.cmu.edu) Name: A Congestion Control 1. At time t, a TCP connection

More information

Chapter 2: outline. 2.1 principles of network applications. 2.6 P2P applications 2.7 socket programming with UDP and TCP

Chapter 2: outline. 2.1 principles of network applications. 2.6 P2P applications 2.7 socket programming with UDP and TCP Chapter 2: outline 2.1 principles of network applications app architectures app requirements 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming

More information

A set of processes distributed over a network that communicate via messages. Processes communicate via services offered by the operating system

A set of processes distributed over a network that communicate via messages. Processes communicate via services offered by the operating system SOCKET Network applications A set of processes distributed over a network that communicate via messages Ex: Browser Web, BitTorrent, ecc Processes communicate via services offered by the operating system

More information

LAB THREE STATIC ROUTING

LAB THREE STATIC ROUTING LAB THREE STATIC ROUTING In this lab you will work with four different network topologies. The topology for Parts 1-4 is shown in Figure 3.1. These parts address router configuration on Linux PCs and a

More information

transmission media and network topologies client/server architecture layers, protocols, and sockets

transmission media and network topologies client/server architecture layers, protocols, and sockets Network Programming 1 Computer Networks transmission media and network topologies client/server architecture layers, protocols, and sockets 2 Network Programming a simple client/server interaction the

More information

Outline. What is TCP protocol? How the TCP Protocol Works SYN Flooding Attack TCP Reset Attack TCP Session Hijacking Attack

Outline. What is TCP protocol? How the TCP Protocol Works SYN Flooding Attack TCP Reset Attack TCP Session Hijacking Attack Attacks on TCP Outline What is TCP protocol? How the TCP Protocol Works SYN Flooding Attack TCP Reset Attack TCP Session Hijacking Attack TCP Protocol Transmission Control Protocol (TCP) is a core protocol

More information

Network Programming with Python. Sébastien Tixeuil

Network Programming with Python. Sébastien Tixeuil Network Programming with Python Sébastien Tixeuil sebastien.tixeuil@lip6.fr Python 101 Python Standard Types Numbers: 1, 122L, 2.0, 1e+2j Strings: Python, PROGRES Lists: [123, ABC ] Tuples: (123, ABC )

More information

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines Introduction to UNIX Logging in Basic system architecture Getting help Intro to shell (tcsh) Basic UNIX File Maintenance Intro to emacs I/O Redirection Shell scripts Logging in most systems have graphical

More information

9.2 Linux Essentials Exam Objectives

9.2 Linux Essentials Exam Objectives 9.2 Linux Essentials Exam Objectives This chapter will cover the topics for the following Linux Essentials exam objectives: Topic 3: The Power of the Command Line (weight: 10) 3.3: Turning Commands into

More information

Open Network Laboratory

Open Network Laboratory Open Network Laboratory Raj Jain Raj Jain Washington University in Saint Louis Saint Louis, MO 63130 Jain@wustl.edu Audio/Video recordings of this lecture are available on-line at: http://www.cse.wustl.edu/~jain/cse473-11/

More information

To see how ARP (Address Resolution Protocol) works. ARP is an essential glue protocol that is used to join Ethernet and IP.

To see how ARP (Address Resolution Protocol) works. ARP is an essential glue protocol that is used to join Ethernet and IP. Lab Exercise ARP Objective To see how ARP (Address Resolution Protocol) works. ARP is an essential glue protocol that is used to join Ethernet and IP. Requirements Wireshark: This lab uses the Wireshark

More information

Distributed Systems. Remote Procedure Calls

Distributed Systems. Remote Procedure Calls Distributed Systems Remote Procedure Calls Today s Agenda Last time: Computer networks, primarily from an application perspective Protocol layering Client-server architecture End-to-end principle Today:

More information

Bash Programming. Student Workbook

Bash Programming. Student Workbook Student Workbook Bash Programming Published by ITCourseware, LLC, 7245 South Havana Street, Suite 100, Englewood, CO 80112 Contributing Authors: Julie Johnson, Rob Roselius Editor: Jeff Howell Special

More information

Lab I: Using tcpdump and Wireshark

Lab I: Using tcpdump and Wireshark Objectives To get the student familiar with basic network protocol analyzer, tools and equipment used in later labs, including tcpdump and Wireshark. Lab Readings Go to http://www.tcpdump.org/tcpdump_man.html

More information

Using RDP with Azure Linux Virtual Machines

Using RDP with Azure Linux Virtual Machines Using RDP with Azure Linux Virtual Machines 1. Create a Linux Virtual Machine with Azure portal Create SSH key pair 1. Install Ubuntu Bash shell by downloading and running bash.exe file as administrator.

More information

Lab 8: Introduction to Pen Testing (HPING)

Lab 8: Introduction to Pen Testing (HPING) Lab 8: Introduction to Pen Testing (HPING) Aim: To provide a foundation in understanding of email with a focus on hping to provide security assessments and in understanding the trails of evidence produced.

More information

Linux Systems Administration Getting Started with Linux

Linux Systems Administration Getting Started with Linux Linux Systems Administration Getting Started with Linux Network Startup Resource Center www.nsrc.org These materials are licensed under the Creative Commons Attribution-NonCommercial 4.0 International

More information

Communication in Distributed Systems: Sockets Programming. Operating Systems

Communication in Distributed Systems: Sockets Programming. Operating Systems Communication in Distributed Systems: Sockets Programming Operating Systems TCP/IP layers Layers Message Application Transport Internet Network interface Messages (UDP) or Streams (TCP) UDP or TCP packets

More information

Cisco IOS Shell. Finding Feature Information. Prerequisites for Cisco IOS.sh. Last Updated: December 14, 2012

Cisco IOS Shell. Finding Feature Information. Prerequisites for Cisco IOS.sh. Last Updated: December 14, 2012 Cisco IOS Shell Last Updated: December 14, 2012 The Cisco IOS Shell (IOS.sh) feature provides shell scripting capability to the Cisco IOS command-lineinterface (CLI) environment. Cisco IOS.sh enhances

More information

Network Security Laboratory 23 rd May STATEFUL FIREWALL LAB

Network Security Laboratory 23 rd May STATEFUL FIREWALL LAB Network Security Laboratory 23 rd May 2016. STATEFUL FIREWALL LAB 1 CONTENTS INTRODUCTION I. What is Stateful Firewall II. Difference between Stateful and Stateless III. Example of Stateful firewall IV.

More information

Chapter 2: outline. 2.1 principles of network applications app architectures app requirements

Chapter 2: outline. 2.1 principles of network applications app architectures app requirements Chapter 2: outline 2.1 principles of network applications app architectures app requirements 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming

More information

UNIVERSITY OF TRENTO Dipartimento di Ingegneria e Scienza dell Informazione Laboratory of Nomadic Communications

UNIVERSITY OF TRENTO Dipartimento di Ingegneria e Scienza dell Informazione Laboratory of Nomadic Communications Experimental evaluation of the performance of a 802.11 wireless network 1. Tutorial goals After this tutorial students should have acquired enough skills to 1) configure a wireless network composed of

More information

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad -500 043 COMPUTER SCIENCE AND ENGINEERING TUTORIAL QUESTION BANK Course Name : LINUX PROGRAMMING Course Code : ACS010 Class : III

More information

COMPUTER NETWORKS. CPSC 441, Winter 2016 Prof. Mea Wang Department of Computer Science University of Calgary

COMPUTER NETWORKS. CPSC 441, Winter 2016 Prof. Mea Wang Department of Computer Science University of Calgary COMPUTER NETWORKS CPSC 441, Winter 2016 Prof. Mea Wang Department of Computer Science University of Calgary Introduction: Wireshark and tshark Running tshark Running Wireshark Exercise: Analyze HTTP traffic

More information

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP Chapter 2: outline 2.1 principles of network applications app architectures app requirements 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming

More information

TELE301 Lab16 - The Secure Shell

TELE301 Lab16 - The Secure Shell TELE301 Lab16 - The Secure Shell Department of Telecommunications May 7, 2002 Contents 1 Introduction 2 2 OpenSSH 2 3 Replacing Telnet 2 4 Logging in without a password 2 5 SSH Agent 3 5.1 SSH Add..............................

More information

Intro to OpenFlow Tutorial

Intro to OpenFlow Tutorial GENIExperimenter/Tutorials/OpenFlowOVS-Floodlight GENI: geni Intro to OpenFlow Tutorial Overview: This is a simple OpenFlow tutorial that will guide you how to use the Floodlight Controller in conjunction

More information

Using Sockets. client/server interaction telephone exchange. getting IP addresses of computers code for remote client and server

Using Sockets. client/server interaction telephone exchange. getting IP addresses of computers code for remote client and server Using Sockets 1 Communication between Programs client/server interaction telephone exchange 2 Remote Server and Client getting IP addresses of computers code for remote client and server 3 Two Clients

More information

TCP and Concurrency. The third assignment at DA

TCP and Concurrency. The third assignment at DA TCP and Concurrency The third assignment at DA2402 2009-03-05 Jonas Lundberg/Ola Flygt adapted to Java by Marcus Edvinsson maintained by Marcus Edvinsson Matematiska och systemtekniska institutionen, MSI

More information

SSH-REVERSE-TUNNEL(1) User Commands SSH-REVERSE-TUNNEL(1)

SSH-REVERSE-TUNNEL(1) User Commands SSH-REVERSE-TUNNEL(1) NAME ssh-reverse-tunnel - create robust reverse ssh tunnels or VPNs SYNOPSIS Usage: ssh-reverse-tunnel client [options] or: ssh-reverse-tunnel server [options] or: ssh-reverse-tunnel --help or --version

More information

Remote Procedure Call. Tom Anderson

Remote Procedure Call. Tom Anderson Remote Procedure Call Tom Anderson Why Are Distributed Systems Hard? Asynchrony Different nodes run at different speeds Messages can be unpredictably, arbitrarily delayed Failures (partial and ambiguous)

More information

5/8/2012. Exploring Utilities Chapter 5

5/8/2012. Exploring Utilities Chapter 5 Exploring Utilities Chapter 5 Examining the contents of files. Working with the cut and paste feature. Formatting output with the column utility. Searching for lines containing a target string with grep.

More information

Bash Check If Command Line Parameter Exists

Bash Check If Command Line Parameter Exists Bash Check If Command Line Parameter Exists How to enter the parameters on the command line for this shell script? exit 1 fi if $ERR, then echo $MSG exit 1 fi if ( -d "$NAME" ), then echo "Directory -

More information

Appendix A GLOSSARY. SYS-ED/ Computer Education Techniques, Inc.

Appendix A GLOSSARY. SYS-ED/ Computer Education Techniques, Inc. Appendix A GLOSSARY SYS-ED/ Computer Education Techniques, Inc. $# Number of arguments passed to a script. $@ Holds the arguments; unlike $* it has the capability for separating the arguments. $* Holds

More information

Department of Computer Science and Engineering. Final Examination. Instructor: N. Vlajic Date: April 15, 2011

Department of Computer Science and Engineering. Final Examination. Instructor: N. Vlajic Date: April 15, 2011 Department of Computer Science and Engineering CSE 3214: Computer Network Protocols and Applications Final Examination Instructor: N. Vlajic Date: April 15, 2011 Instructions: Examination time: 180 min.

More information

Distributed Systems. Networking Slides courtesy Kurose & Ross

Distributed Systems. Networking Slides courtesy Kurose & Ross Distributed Systems Networking Slides courtesy Kurose & Ross Agenda Computer networks, primarily from an application perspective Protocol layering Client-server architecture End-to-end principle TCP Socket

More information

Lab #9: Basic Linux Networking

Lab #9: Basic Linux Networking CTEC1767 Data Communications & Networking 2017 Lab #9: Basic Linux Networking Understanding Linux networks starts with understanding Linux network commands and the information they provide. We will use

More information

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 6

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 6 CMPE 150/L : Introduction to Computer Networks Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 6 1 Midterm room for overflow students The students who used my registration code to enroll

More information

Network softwarization Lab session 2: OS Virtualization Networking

Network softwarization Lab session 2: OS Virtualization Networking Network softwarization Lab session 2: OS Virtualization Networking Nicolas Herbaut David Bourasseau Daniel Negru December 16, 2015 1 Introduction 1.1 Discovering docker 1.1.1 Installation Please launch

More information

TCP/IP Attack Lab. 1 Lab Overview. 2 Lab Environment. 2.1 Environment Setup. SEED Labs TCP/IP Attack Lab 1

TCP/IP Attack Lab. 1 Lab Overview. 2 Lab Environment. 2.1 Environment Setup. SEED Labs TCP/IP Attack Lab 1 SEED Labs TCP/IP Attack Lab 1 TCP/IP Attack Lab Copyright c 2006-2016 Wenliang Du, Syracuse University. The development of this document was partially funded by the National Science Foundation under Award

More information

Firewall Evasion Lab: Bypassing Firewalls using VPN

Firewall Evasion Lab: Bypassing Firewalls using VPN SEED Labs Firewall Evasion Lab 1 Firewall Evasion Lab: Bypassing Firewalls using Copyright 2018 Wenliang Du, Syracuse University. The development of this document was partially funded by the National Science

More information

07 - Processes and Jobs

07 - Processes and Jobs 07 - Processes and Jobs CS 2043: Unix Tools and Scripting, Spring 2016 [1] Stephen McDowell February 10th, 2016 Cornell University Table of contents 1. Processes Overview 2. Modifying Processes 3. Jobs

More information

Chapter 8: I/O functions & socket options

Chapter 8: I/O functions & socket options Chapter 8: I/O functions & socket options 8.1 Introduction I/O Models In general, there are normally two phases for an input operation: 1) Waiting for the data to arrive on the network. When the packet

More information

Reliable File Transfer

Reliable File Transfer Due date Wednesday, Mar 14, 11:59pm Reliable File Transfer CS 5565 Spring 2012, Project 2 This project is worth 100 points. You may form teams of up to two students for this project. You are not required

More information

Server algorithms and their design

Server algorithms and their design Server algorithms and their design slide 1 many ways that a client/server can be designed each different algorithm has various benefits and problems are able to classify these algorithms by looking at

More information

Lab - TCP Traffic Generator

Lab - TCP Traffic Generator ECE4110 Fall Semester, 2010 Lab - TCP Traffic Generator Assigned: Sep 10, 2010 Due: Sep 20, 2010 Group Number: Member Names: Lab Goals 1. Finish a TCP sockets programs to transmit and receive TCP data.

More information

Esempi di programmi client/server in Python 3

Esempi di programmi client/server in Python 3 Reti di Calcolatori I Prof. Roberto Canonico Dipartimento di Ingegneria Elettrica e delle Tecnologie dell Informazione Corso di Laurea in Ingegneria Informatica A.A. 2018-2019 Esempi di programmi client/server

More information

The Application Layer: Sockets Wrap-Up

The Application Layer: Sockets Wrap-Up The Application Layer: Sockets Wrap-Up CSC 249 February 8, 2018 slides mostly from J.F Kurose and K.W. Ross,copyright 1996-2012 1 Socket Overview q Examples with socket-api programming q Differences between

More information

Lab 9: Network Capture

Lab 9: Network Capture Lab 9: Network Capture Link: http://www.asecuritysite.com/csn09112/software01 Video demo: https://www.youtube.com/watch?v=raphjch2spe 1 Number formats Within cryptography we often have to present numbers

More information

6.824 Lab 2: A concurrent web proxy

6.824 Lab 2: A concurrent web proxy Page 1 of 6 6.824 - Fall 2002 6.824 Lab 2: A concurrent web proxy Introduction In this lab assignment you will write an event-driven web proxy to learn how to build servers that support concurrency. For

More information

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description:

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: This course provides Bioinformatics students with the

More information

CSE 374 Programming Concepts & Tools. Brandon Myers Winter 2015 Lecture 4 Shell Variables, More Shell Scripts (Thanks to Hal Perkins)

CSE 374 Programming Concepts & Tools. Brandon Myers Winter 2015 Lecture 4 Shell Variables, More Shell Scripts (Thanks to Hal Perkins) CSE 374 Programming Concepts & Tools Brandon Myers Winter 2015 Lecture 4 Shell Variables, More Shell Scripts (Thanks to Hal Perkins) test / if Recall from last lecture: test (not built-in) takes arguments

More information

SECURITY+ LAB SERIES. Lab 3: Protocols and Default Network Ports Connecting to a Remote System

SECURITY+ LAB SERIES. Lab 3: Protocols and Default Network Ports Connecting to a Remote System SECURITY+ LAB SERIES Lab 3: Protocols and Default Network Ports Connecting to a Remote System Document Version: 2015-09-24 otherwise noted, is licensed under the Creative Commons Attribution 3.0 Unported

More information

Post Ubuntu Install Exercises

Post Ubuntu Install Exercises Post Ubuntu Install Exercises PacNOG 3 June 18 Rarotonga, Cook Islands 1. Get used to using sudo 2. Create an ainst account 3. Learn how to install software 4. Install gcc and make 5. Learn how to control

More information

The basic server algorithm. Server algorithms and their design. Problems with the simple server? Servers. overview ofaserver

The basic server algorithm. Server algorithms and their design. Problems with the simple server? Servers. overview ofaserver Server algorithms and their design slide 1 The basic server algorithm slide 2 many ways that a client/server can be designed overview ofaserver each different algorithm has various benefits and problems

More information

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1 Review of Fundamentals Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 GPL the shell SSH (secure shell) the Course Linux Server RTFM vi general shell review 2 These notes are available on

More information

Objectives. Chapter 10. Upon completion you will be able to:

Objectives. Chapter 10. Upon completion you will be able to: Chapter 10 Figure 10.1 Position of IGMP in the network layer Objectives Upon completion you will be able to: Know the purpose of IGMP Know the types of IGMP messages Understand how a member joins a group

More information

CCNA Discovery 3 Chapter 8 Reading Organizer

CCNA Discovery 3 Chapter 8 Reading Organizer Name Date Chapter 8 Reading Organizer After completion of this chapter, you should be able to: Describe traffic filtering and explain how Access Control Lists (ACLs) can filter traffic at router interfaces.

More information

Lab 1 Solution. Jon Turner. CSE 542 Advanced Data Structures and Algorithms

Lab 1 Solution. Jon Turner. CSE 542 Advanced Data Structures and Algorithms CSE 542 Advanced Data Structures and Algorithms Lab 1 Solution Jon Turner Part A. Modifications to Dheap (10 points). Your svn repository includes a directory called grafalgo that contains various data

More information

Avi Networks Technical Reference (17.2)

Avi Networks Technical Reference (17.2) Page 1 of 5 Packet Capture view online Most troubleshooting of connection or traffic data may be done quickly via virtual service logs. However, some troubleshooting may require full visibility into the

More information

International Journal of Scientific Research and Modern Education (IJSRME) ISSN (Online): ( Volume I, Issue I,

International Journal of Scientific Research and Modern Education (IJSRME) ISSN (Online): (  Volume I, Issue I, EFFECTIVE LEARNING WITH USAGE OF SIMULATORS A CASE OF NCTUNS SIMULATOR IN COMPUTER NETWORKS Subrahmanya Bhat* & Dr. K. R. Kamath** * Department of Computer Application, Srinivas Institute of Management

More information

CS Unix Tools & Scripting

CS Unix Tools & Scripting Cornell University, Spring 2014 1 February 24, 2014 1 Slides evolved from previous versions by Hussam Abu-Libdeh and David Slater A note on awk for (item in array) The order in which items are returned

More information

CS 351 Design of Large Programs Java and Socket Communication

CS 351 Design of Large Programs Java and Socket Communication CS 351 Design of Large Programs Java and Socket Communication Instructor: Joel Castellanos e-mail: joel@unm.edu 4/6/2017 Transmission Control Protocol The Transmission Control Protocol (TCP) is one of

More information

ECE 4110 Internetwork Programming Lab 3: UDP Traffic Generator. Lab Goals. Section I: Coding udp_gen & udp_sink

ECE 4110 Internetwork Programming Lab 3: UDP Traffic Generator. Lab Goals. Section I: Coding udp_gen & udp_sink ECE 4110 Internetwork Programming Lab 3: UDP Traffic Generator Group Number: Member Names: Date Issued: Tuesday February 7, 2012 Date Due: Friday February 17, 2012 Last Edited: 2/6/2012 Lab Goals Finish

More information

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files ... and systems programming C basic syntax functions arrays structs

More information

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs.

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs. CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files... and systems programming C basic syntax functions arrays structs

More information

More Raspian. An editor Configuration files Shell scripts Shell variables System admin

More Raspian. An editor Configuration files Shell scripts Shell variables System admin More Raspian An editor Configuration files Shell scripts Shell variables System admin Nano, a simple editor Nano does not require the mouse. You must use your keyboard to move around the file and make

More information

CSE 390a Lecture 6. bash scripting continued; remote X windows; unix tidbits

CSE 390a Lecture 6. bash scripting continued; remote X windows; unix tidbits CSE 390a Lecture 6 bash scripting continued; remote X windows; unix tidbits slides created by Marty Stepp, modified by Jessica Miller and Ruth Anderson http://www.cs.washington.edu/390a/ 1 Lecture summary

More information

CSCI 211 UNIX Lab. Shell Programming. Dr. Jiang Li. Jiang Li, Ph.D. Department of Computer Science

CSCI 211 UNIX Lab. Shell Programming. Dr. Jiang Li. Jiang Li, Ph.D. Department of Computer Science CSCI 211 UNIX Lab Shell Programming Dr. Jiang Li Why Shell Scripting Saves a lot of typing A shell script can run many commands at once A shell script can repeatedly run commands Help avoid mistakes Once

More information

A Client-Server Exchange

A Client-Server Exchange Socket programming A Client-Server Exchange A server process and one or more client processes Server manages some resource. Server provides service by manipulating resource for clients. 1. Client sends

More information

Review of Fundamentals

Review of Fundamentals Review of Fundamentals 1 The shell vi General shell review 2 http://teaching.idallen.com/cst8207/14f/notes/120_shell_basics.html The shell is a program that is executed for us automatically when we log

More information

Advanced Web Programming

Advanced Web Programming Advanced Web Programming 1 Advanced Web Programming what we have covered so far 2 The SocketServer Module simplified development of network servers a server tells clients the time 3 A Forking Server instead

More information

A shell can be used in one of two ways:

A shell can be used in one of two ways: Shell Scripting 1 A shell can be used in one of two ways: A command interpreter, used interactively A programming language, to write shell scripts (your own custom commands) 2 If we have a set of commands

More information

Assignment 2 Group 5 Simon Gerber Systems Group Dept. Computer Science ETH Zurich - Switzerland

Assignment 2 Group 5 Simon Gerber Systems Group Dept. Computer Science ETH Zurich - Switzerland Assignment 2 Group 5 Simon Gerber Systems Group Dept. Computer Science ETH Zurich - Switzerland t Your task Write a simple file server Client has to be implemented in Java Server has to be implemented

More information

Multiplayer Game Programming 2/26

Multiplayer Game Programming 2/26 Multiplayer Game Programming 2/26 1. Turn off Windows Firewall 2. Download and install Python and Notepad++ a. Python.org downloads/python/install b. Notepad-plus-plus.org download/install 3. Download

More information

Understanding bash. Prof. Chris GauthierDickey COMP 2400, Fall 2008

Understanding bash. Prof. Chris GauthierDickey COMP 2400, Fall 2008 Understanding bash Prof. Chris GauthierDickey COMP 2400, Fall 2008 How does bash start? It begins by reading your configuration files: If it s an interactive login-shell, first /etc/profile is executed,

More information

UNIX Quick Reference

UNIX Quick Reference UNIX Quick Reference Charles Duan FAS Computer Services August 26, 2002 1 Command Reference Many of these commands have many more options than the ones displayed here. Most also take the option h or help,

More information

CS Unix Tools. Fall 2010 Lecture 10. Hussam Abu-Libdeh based on slides by David Slater. September 29th, 2010

CS Unix Tools. Fall 2010 Lecture 10. Hussam Abu-Libdeh based on slides by David Slater. September 29th, 2010 Fall 2010 Lecture 10 Hussam Abu-Libdeh based on slides by David Slater September 29th, 2010 Vim = Awesome! Vim is a powerful lightweight text editor. The name Vim is an acronym for Vi IMproved vi is an

More information

What is Bash Shell Scripting?

What is Bash Shell Scripting? What is Bash Shell Scripting? A shell script is a script written for the shell, or command line interpreter, of an operating system. The shell is often considered a simple domain-specic programming language.

More information

Fundamentals of Linux Platform Security

Fundamentals of Linux Platform Security Fundamentals of Linux Platform Security Security Training Course Dr. Charles J. Antonelli The University of Michigan 2012 Hands-On Network Security Module 1 Reconnaissance Tools Roadmap Review of generally

More information

Fundamentals of Linux Platform Security. Hands-On Network Security. Roadmap. Security Training Course. Module 1 Reconnaissance Tools

Fundamentals of Linux Platform Security. Hands-On Network Security. Roadmap. Security Training Course. Module 1 Reconnaissance Tools Fundamentals of Linux Platform Security Security Training Course Dr. Charles J. Antonelli The University of Michigan 2012 Hands-On Network Security Module 1 Reconnaissance Tools Roadmap Review of generally

More information

QUIZ: Longest Matching Prefix

QUIZ: Longest Matching Prefix QUIZ: Longest Matching Prefix A router has the following routing table: 10.50.42.0 /24 Send out on interface Z 10.50.20.0 /24 Send out on interface A 10.50.24.0 /22 Send out on interface B 10.50.20.0 /22

More information

Shell scripting and system variables. HORT Lecture 5 Instructor: Kranthi Varala

Shell scripting and system variables. HORT Lecture 5 Instructor: Kranthi Varala Shell scripting and system variables HORT 59000 Lecture 5 Instructor: Kranthi Varala Text editors Programs built to assist creation and manipulation of text files, typically scripts. nano : easy-to-learn,

More information

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen Introduction to Unix The Windows User perspective Wes Frisby Kyle Horne Todd Johansen What is Unix? Portable, multi-tasking, and multi-user operating system Software development environment Hardware independent

More information

Question Score 1 / 19 2 / 19 3 / 16 4 / 29 5 / 17 Total / 100

Question Score 1 / 19 2 / 19 3 / 16 4 / 29 5 / 17 Total / 100 NAME: Login name: Computer Science 461 Midterm Exam March 10, 2010 3:00-4:20pm This test has five (5) questions. Put your name on every page, and write out and sign the Honor Code pledge before turning

More information

Lab 4: Protocols and Default Network Ports - Connecting to a Remote System

Lab 4: Protocols and Default Network Ports - Connecting to a Remote System CompTIA Security+ Lab Series Lab 4: Protocols and Default Network Ports - Connecting to a Remote System CompTIA Security+ Domain 1 - Network Security Objective 1.4: Implement and use common protocols Objective

More information

Intro to OpenFlow Tutorial

Intro to OpenFlow Tutorial 5/24/2015 GENIExperimenter/Tutorials/OpenFlowOVS GENI: geni Intro to OpenFlow Tutorial Overview: This is a simple OpenFlow tutorial that will guide you through the writing of simple OpenFlow controllers

More information

Networking. Chapter How to identify machines on internet Ports

Networking. Chapter How to identify machines on internet Ports Chapter 1 Networking Computer networks allow communication between multiple computers, regardless of their physical location. Internet provides us with an infrastructure that allows computers to interact

More information

IT 341: Introduction to System

IT 341: Introduction to System IT 341: Introduction to System Administration Private IP Addresses and the Internet Using IP Addresses to Communicate Over the Internet Network Address Translation Private IP Addresses and the Internet

More information

BITS-Pilani Hyderabad Campus

BITS-Pilani Hyderabad Campus BITS-Pilani Hyderabad Campus CS C461/IS C461/CS F303/ IS F303 (Computer Networks) Laboratory 4 Aim: To give an introduction to Socket Programming in TCP and UDP. TCP Socket Programming: A socket is the

More information